From ad232f187a5f10b8cff62645cc520e17735836f9 Mon Sep 17 00:00:00 2001 From: Timerix Date: Thu, 21 Nov 2024 09:48:54 +0500 Subject: [PATCH] semicolon --- src/compiler/compiler.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/compiler/compiler.c b/src/compiler/compiler.c index 49efab5..f636241 100644 --- a/src/compiler/compiler.c +++ b/src/compiler/compiler.c @@ -187,7 +187,7 @@ static void readArguments(Compiler* cmp){ while(cmp->pos < cmp->code_len){ c = cmp->code[cmp->pos]; // end of line - if(c == '\r' || c == '\n'){ + if(c == '\r' || c == '\n' || c == ';'){ tok.length = cmp->pos - tok.begin; if(tok.length > 0) List_Token_push(&cmp->tokens, tok); @@ -222,7 +222,7 @@ static void readInstruction(Compiler* cmp){ while(cmp->pos < cmp->code_len){ char c = cmp->code[cmp->pos]; // end of line - if(c == '\r' || c == '\n'){ + if(c == '\r' || c == '\n' || c == ';'){ tok.length = cmp->pos - tok.begin; List_Token_push(&cmp->tokens, tok); // cmp->line will be increased in lex() @@ -358,9 +358,8 @@ bool Compiler_compileTasm(Compiler* cmp, cstr source_file_name, cstr out_file_na char* tokstr = malloc(4096); strncpy(tokstr, cmp->code + t.begin, t.length); tokstr[t.length] = 0; - printf("[l:%u, c:%u](pos:%u, size:%u) %s '%s'\n", + printf("[l:%2u, c:%2u] %s '%s'\n", pos.line, pos.column, - t.begin, t.length, TokenType_toString(t.type), tokstr); free(tokstr); }