aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/lexer.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/asm/lexer.c b/asm/lexer.c
index 556ac86..51a8ec6 100644
--- a/asm/lexer.c
+++ b/asm/lexer.c
@@ -110,6 +110,22 @@ token_stream_t tokenise_buffer(buffer_t *buffer)
// Clean whitespace
for (; space_left(buffer) > 0 && (isspace(c) || c == '\0');
++buffer->used, c = buffer->data[buffer->used])
+ {
+ ++column;
+ if (c == '\n')
+ {
+ column = 0;
+ ++line;
+ }
+ }
+ ++column;
+ is_token = false;
+ }
+ else if (c == ';')
+ {
+ // Stop lexing till next line
+ for (; space_left(buffer) > 0 && c != '\n';
+ ++buffer->used, c = buffer->data[buffer->used])
continue;
column = 0;
++line;