add else if, else, and comments
This commit is contained in:
@@ -47,6 +47,7 @@ int yywrap(void *) {
|
||||
|
||||
|
||||
"if" { return TOKEN_IF; }
|
||||
"else if" { return TOKEN_ELSE_IF; }
|
||||
"else" { return TOKEN_ELSE; }
|
||||
"while" { return TOKEN_WHILE; }
|
||||
"forever" { return TOKEN_FOREVER; }
|
||||
@@ -102,6 +103,8 @@ int yywrap(void *) {
|
||||
COLUMN_NO += yyleng;
|
||||
}
|
||||
|
||||
#[^\n]* {}
|
||||
|
||||
. {
|
||||
GET_STATE
|
||||
fprintf(stderr, "%s:%u:%u error: unexpected character '%s'\n", state->path, yylineno, COLUMN_NO+1, yytext);
|
||||
|
||||
@@ -39,6 +39,7 @@ typedef enum {
|
||||
|
||||
// Keywords
|
||||
TOKEN_IF,
|
||||
TOKEN_ELSE_IF,
|
||||
TOKEN_ELSE,
|
||||
TOKEN_WHILE,
|
||||
TOKEN_FOREVER,
|
||||
|
||||
Reference in New Issue
Block a user