author | Alan Dipert
<alan@dipert.org> 2024-01-05 04:34:27 UTC |
committer | Alan Dipert
<alan@dipert.org> 2024-01-05 04:34:27 UTC |
parent | 4b9acbd8dfeecbeeb3ea894761f73be88690d7e9 |
bbasic.l | +1 | -0 |
bbasic.y | +2 | -0 |
diff --git a/bbasic.l b/bbasic.l index 5a9b11b..8cfca66 100644 --- a/bbasic.l +++ b/bbasic.l @@ -15,6 +15,7 @@ "=" return EQUALS; [0-9]+ { yylval.num = atoi(yytext); return NUMBER; } [a-zA-Z][a-zA-Z0-9]* { yylval.str = strdup(yytext); return IDENTIFIER; } +\"([^\\\"]|\\.)*\" { yylval.str = strdup(yytext); return STRING; } . return *yytext; %% diff --git a/bbasic.y b/bbasic.y index f2350db..24d8a17 100644 --- a/bbasic.y +++ b/bbasic.y @@ -19,6 +19,8 @@ void yyerror(const char *s) { %token <str> IDENTIFIER %token EOL PRINT IF THEN GOTO EQUALS +%define parse.error verbose + %left '+' '-' %left '*' '/'