From a58e8316eca5aa12b1a13c22953fd44760d19ff7 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Fri, 29 Dec 2023 05:06:25 +0300 Subject: [PATCH] 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 --- scanner.flex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scanner.flex b/scanner.flex index a57ef6d..f373be5 100644 --- a/scanner.flex +++ b/scanner.flex @@ -18,6 +18,9 @@ if { return TOKEN_IF; } \) { return TOKEN_RPAREN; } \{ { return TOKEN_LBRACE; } \} { return TOKEN_RBRACE; } += { return TOKEN_ASSIGN; } +: { return TOKEN_COLON; } +; { return TOKEN_SEMI; } void { return TOKEN_VOID; } int { return TOKEN_INT; } while { return TOKEN_WHILE; }