From 68b9f87bc3b6bd6ccb3773641578b0d914e61104 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Sat, 14 Mar 2026 20:45:12 -0400 Subject: refactor!: Switched from x86_64 to RISC-V Switched from x86_64 to RISC-V because RISC-V is a cleaner and simpler architecture and I'm more familiar with it since it's similar to MIPS. BREAKING CHANGE: Switched from x86_64 to RISC-V --- src/lexer.l | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lexer.l') diff --git a/src/lexer.l b/src/lexer.l index 46f6bc6..26be828 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -8,7 +8,7 @@ extern size_t line_number; %option noyywrap %% ^[a-zA-Z]+ { yylval.symbol = strdup(yytext); return T_INSTRUCTION; } -%*[a-zA-Z\_\-]+[a-zA-Z0-9\_\-]* { yylval.symbol = strdup(yytext); return T_LABEL; } +%*[a-zA-Z\_\-]+[a-zA-Z0-9\_\-]* { yylval.symbol = strdup(yytext); return T_SYMBOL; } 0x[0-9A-Fa-f]+ { yylval.i_val = atoi(yytext); return T_INTEGER; } [0-9]+ { yylval.i_val = atoi(yytext); return T_INTEGER; } -*[0-9]*\.*[0-9]* { yylval.i_val = atof(yytext); return T_FLOAT; } @@ -21,7 +21,9 @@ extern size_t line_number; return T_STRING; } , { return T_COMMA; } -\$ { return T_IMMEDIATE; } +\( { return T_OPENPAREN; } +\) { return T_CLOSEPAREN; } +#.* ; [ \t] ; \n { ++line_number; return T_ENDL; } . ; -- cgit v1.2.3