Skip to content

Commit

Permalink
Replace 100 :REM with 100 REM
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerb9 committed Mar 13, 2024
1 parent e7fd175 commit 672d83c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion m100-crunch.lex
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ LINENUM [0-9]+
/* Replace 100 ' with 100 REM as it tokenizes to 1 instead of 2 bytes */
^[ \t]*[0-9]+[ \t:]*['][^\r\n]* fprintf(yyout, "%d REM", atoi(yytext));

/* Replace 100 :REM with 100 REM */
^[ \t]*[0-9]+[ \t:]*REM[^\r\n]* fprintf(yyout, "%d REM", atoi(yytext));

/* Remove redundant colon in :'. */
[ \t:]:['] fprintf(yyout, "'");

Expand All @@ -54,7 +57,8 @@ LINENUM [0-9]+
/* MAYBE Delete leading colons. XXX this could remove a jump target! */
/*^[0-9]+[: \t]+ fprintf(yyout, "%d ", atoi(yytext));*/

/* Line numbers have a single space after them. */

/* Ensure line numbers have a single space after them. */
/* Doesn't matter for tokenization, but standardizes the output */
^[ \t]*[0-9]+[ \t:] fprintf(yyout, "%d ", atoi(yytext));

Expand Down

0 comments on commit 672d83c

Please sign in to comment.