]> www.git.momoyon.org Git - lang.git/commitdiff
[main.c] Fix Column of EOF, and Update tests.
authormomoyon <ahmedsamyh10@gmail.com>
Thu, 24 Apr 2025 11:30:49 +0000 (16:30 +0500)
committermomoyon <ahmedsamyh10@gmail.com>
Thu, 24 Apr 2025 11:30:49 +0000 (16:30 +0500)
main.c
main.momo
tests/.bool.build.out.expected
tests/.identifiers.build.out.expected
tests/.keywords.build.out.expected
tests/.operators.build.out.expected
tests/.strings.build.out.expected

diff --git a/main.c b/main.c
index accc7eaf05542ac4714b38caad3a5ca08c10cf4f..75ff8c1f57a063c899c0a166917822b2de7abd42 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1463,7 +1463,7 @@ Tokens lex(Lexer *l) {
     t.lexeme = SV("EOF");
     t.loc.filename = l->filename;
     t.loc.line = l->line-1;
-    t.loc.col = last_line.count - last_line.offset;
+    t.loc.col = last_line.count;
     t.type = TK_EOF;
     da_append(tokens, t);
 
index 16a562a2e8d97cc8c2e69b0716a06ba710a42c86..9f9370e5bb8ff9a339013953bba4f04757e3c31d 100644 (file)
--- a/main.momo
+++ b/main.momo
@@ -1 +1 @@
-690 / (34 + 35) * 69;
+1 + (4 / );
index e541dc417a64b1537c2ad28bcb394e69aded2be9..09436a13adc58f2db80fc9f3e1519ad428c02356 100644 (file)
@@ -1,3 +1,3 @@
 bool.momo:1:0 [BOOL] 'true'
 bool.momo:2:0 [BOOL] 'false'
-bool.momo:3:0 [EOF] 'EOF'
+bool.momo:2:5 [EOF] 'EOF'
index 9de1b788d2b467b1220a72757ba83997561f6d9c..594eb439d48c589432d66da363bd0fc6d80b402a 100644 (file)
@@ -8,4 +8,4 @@ identifiers.momo:10:0 [IDENT] '_D'
 identifiers.momo:10:3 [IDENT] 'eE'
 identifiers.momo:10:6 [IDENT] '_F'
 identifiers.momo:10:9 [IDENT] '_G'
-identifiers.momo:11:0 [EOF] 'EOF'
+identifiers.momo:10:11 [EOF] 'EOF'
index 1a324526936605432a3995c789c7ca6462eea6c3..0d456a30d6976e1dcb727b428019d0228e8f3d12 100644 (file)
@@ -28,4 +28,4 @@ keywords.momo:35:0 [KEYWORD] 'switch'
 keywords.momo:36:0 [KEYWORD] 'break'
 keywords.momo:37:0 [KEYWORD] 'case'
 keywords.momo:38:0 [KEYWORD] 'default'
-keywords.momo:39:0 [EOF] 'EOF'
+keywords.momo:38:7 [EOF] 'EOF'
index f92e1e061fe3da1255ad950b60ea43fcd06b46c5..24cb3b8f03a805253012bfc4344e74e252eb8f07 100644 (file)
@@ -30,4 +30,4 @@ operators.momo:33:0 [<] '<'
 operators.momo:34:0 [>] '>'
 operators.momo:35:0 [<=] '<='
 operators.momo:36:0 [>=] '>='
-operators.momo:37:0 [EOF] 'EOF'
+operators.momo:36:2 [EOF] 'EOF'
index 2aadf07fff69ae36df5756034a60ae5d9536075c..08847d1816baddb2f30a9bfdb8c64aa7086285a7 100644 (file)
@@ -1,3 +1,3 @@
 strings.momo:1:1 [STRING] 'This is a string!'
 strings.momo:4:9 [STRING] 'This too is a string!'
-strings.momo:5:0 [EOF] 'EOF'
+strings.momo:4:31 [EOF] 'EOF'