]> www.git.momoyon.org Git - lang.git/commitdiff
Parse [] and remove debug "OK" logging.
authorahmedsamyh <ahmedsamyh10@gmail.com>
Mon, 3 Mar 2025 13:06:55 +0000 (18:06 +0500)
committerahmedsamyh <ahmedsamyh10@gmail.com>
Mon, 3 Mar 2025 13:07:09 +0000 (18:07 +0500)
main.c
main.momo
tests/.identifiers.build.out.expected
tests/.operators.build.out.expected
tests/.strings.build.out.expected

diff --git a/main.c b/main.c
index 274b76d7f4c7a3b60ba754955365403cb26be156..14e3e57061fa1faa8618932f10a7ea15c01511e8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -582,6 +582,12 @@ bool next_token(Lexer *l, Token *t_out) {
         case '}': {
             LEX_N_CHAR_TOKEN(TK_RIGHT_BRACE, 1);
         } break;
+        case '[': {
+            LEX_N_CHAR_TOKEN(TK_LEFT_SQUARE_BRACE, 1);
+        } break;
+        case ']': {
+            LEX_N_CHAR_TOKEN(TK_RIGHT_SQUARE_BRACE, 1);
+        } break;
         case '-': {
             // - could be --, -= or ->
             char next = next_char(l);
@@ -821,8 +827,6 @@ int main(int argc, char **argv) {
 
     Tokens tokens = lex(&l);
 
-    info("OK");
-
     free_lexer(&l);
 
     da_free(tokens);
index 1d999f9835459e49e2046e182933cac4bccbf456..0fd558c4b826b0c59a9ba72837f98ff2cce59eea 100644 (file)
--- a/main.momo
+++ b/main.momo
@@ -1,29 +1,6 @@
-       -
---
-->
-+
-++
-+=
-/
-/=
-*
-**
-*=
-%
-%=
+#include <stdio>
 
-&
-&=
-^
-^=
-~
-|
-|=
-
-!
-!=
-&&
-||
-
-=
-==
+fun main(args: [string]) -> int {
+    printf("Hello, World\n");
+    return 0;
+}
index d8a895beab9fad2d76504b091a1c39de7815f266..54292acdc4928e5e9021f6622ce04f5758fcb33e 100644 (file)
@@ -8,4 +8,3 @@ identifiers.momo:10:0 [IDENT] '_D'
 identifiers.momo:10:3 [IDENT] 'eE'
 identifiers.momo:10:6 [IDENT] '_F'
 identifiers.momo:10:9 [IDENT] '_G'
-[INFO] OK
index 7a0e1597d0de224ce6f5efe3e18a645fac820051..aae9bcf3c240fc683f1c09447f0aabcb907a13d0 100644 (file)
@@ -30,4 +30,3 @@ operators.momo:33:0 [LT] '<'
 operators.momo:34:0 [GT] '>'
 operators.momo:35:0 [LTE] '<='
 operators.momo:36:0 [GTE] '>='
-[INFO] OK
index 214376d10af49c7a3e11643793e5c748743708b5..ed0589bec263d462ee0ca67babec39de16c7fb10 100644 (file)
@@ -1,3 +1,2 @@
 strings.momo:1:1 [STRING] 'This is a string!'
 strings.momo:4:9 [STRING] 'This too is a string!'
-[INFO] OK