scanner: handle "=", ":", and ";"

Now can scan and parse a basic expression like:
		x : int = 5;
	Still do not know how to handle the AST

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2023-12-29 05:06:25 +03:00
parent 212ac9119d
commit a58e8316ec

View File

@ -18,6 +18,9 @@ if { return TOKEN_IF; }
\) { return TOKEN_RPAREN; } \) { return TOKEN_RPAREN; }
\{ { return TOKEN_LBRACE; } \{ { return TOKEN_LBRACE; }
\} { return TOKEN_RBRACE; } \} { return TOKEN_RBRACE; }
= { return TOKEN_ASSIGN; }
: { return TOKEN_COLON; }
; { return TOKEN_SEMI; }
void { return TOKEN_VOID; } void { return TOKEN_VOID; }
int { return TOKEN_INT; } int { return TOKEN_INT; }
while { return TOKEN_WHILE; } while { return TOKEN_WHILE; }