Skip to content

Commit 09d06eb

Browse files
committed
Fixes PRINT COLOR() according to the documentation.
The color should be set up to the end of the PRINT statement. Adds a test case.
1 parent 97a89ff commit 09d06eb

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/syntax/basic.syn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ PRINT_SEP_EOL:
292292
# Right-TAB and COLOR are complicated because we need to apply it to the *next*
293293
# parameter, so we read that parameter and the next optional separator:
294294
"RTab" T_EXPR emit { TOK_BYTE_POKE, PRINT_RTAB_ARG } PRINT_ONE emit { TOK_PRINT_RTAB } PRINT_SEP_EOL
295-
"Color" T_EXPR emit { TOK_BYTE_POKE, PRINT_COLOR } PRINT_ONE_STR PRINT_SEP_EOL emit { TOK_0, TOK_BYTE_POKE, PRINT_COLOR }
295+
"Color" T_EXPR emit { TOK_BYTE_POKE, PRINT_COLOR } PRINT_MORE emit { TOK_0, TOK_BYTE_POKE, PRINT_COLOR }
296296
"," emit { TOK_BYTE, 10, TOK_PRINT_TAB }
297297
";"
298298
E_EOL emit { TOK_BYTE_PUT, ATEOL }

testsuite/tests/print-color.bas

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ GR.1
1313
? "NORMAL" TAB(4) COLOR(128) "INVERSE" COLOR(0) "."
1414

1515
? "NORMAL" COLOR(128) RTAB(20) "INVERSE" COLOR(0) "."
16+
17+
? 3, COLOR(32) "LOWERCASE" , "ALSO" ,
18+
? "NORMAL"

testsuite/tests/print-color.chk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ SCREEN: plot 0,0 color 225
4040
SCREEN: plot 0,0 color 155
4141
NORMAL �������.
4242
NORMAL �������.
43+
3 lowercase also NORMAL

0 commit comments

Comments
 (0)