X-Git-Url: https://jxself.org/git/?p=b43-tools.git;a=blobdiff_plain;f=assembler%2Fscanner.l;h=16f375ca2d0fa974268b70ab6770d47a6312a213;hp=1fa83d564b7e95183da999039edecb5b15ba954c;hb=e882e360ba16d2eed103adffdd1809076ee98017;hpb=be06ecf2322ad87005e2d3f18eb6dbb08da7e92c diff --git a/assembler/scanner.l b/assembler/scanner.l index 1fa83d5..16f375c 100644 --- a/assembler/scanner.l +++ b/assembler/scanner.l @@ -48,7 +48,6 @@ NEWLINE ((\r)|(\n)|(\r\n)) {WS}+ { update_lineinfo(); /* whitespace */ } {NEWLINE} { cur_lineinfo.lineno++; update_lineinfo(); } -;.*$ { update_lineinfo(); /* comment */ } ^{WS}*"%"{WS}*arch { update_lineinfo(); return ASM_ARCH; } ^{WS}*"%"{WS}*start { update_lineinfo(); return ASM_START; } @@ -62,6 +61,7 @@ off/[0-6] { update_lineinfo(); return OFFR; } lr/[0-3] { update_lineinfo(); return LR; } , { update_lineinfo(); return COMMA; } +; { update_lineinfo(); return SEMICOLON; } \[ { update_lineinfo(); return BRACK_OPEN; } \] { update_lineinfo(); return BRACK_CLOSE; } \( { update_lineinfo(); return PAREN_OPEN; } @@ -149,6 +149,7 @@ shm32 { update_lineinfo(); return IVAL_SHM32; } %% struct lineinfo cur_lineinfo; +//FIXME The linenumber sometimes is wrong. static void interpret_cppinfo(const char *str) { @@ -175,7 +176,7 @@ static void interpret_cppinfo(const char *str) memset(tmp, 0, sizeof(tmp)); memcpy(tmp, str, min(sizeof(tmp) - 1, (int)(found - str))); - cur_lineinfo.lineno = strtoul(tmp, NULL, 10); + cur_lineinfo.lineno = strtoul(tmp, NULL, 10) - 1; str = found; str++;