]> git.mdlowis.com Git - proto/obnc.git/commitdiff
started modifying parser to generate ssa directly graph
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 19 Jul 2021 20:55:16 +0000 (16:55 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 19 Jul 2021 20:55:16 +0000 (16:55 -0400)
cerise/TODO.md
cerise/src/grammar.c
cerise/tests/Module.m

index d793b78116c3225c4befde1e2599de14fbd846ce..2011e9dd19f03e6415547a9fa3aa933a11572849 100644 (file)
@@ -29,5 +29,7 @@
 * Implement borrowed pointers
 * Implement biased refcounting for borrowed pointers
 
+# Improvements or Notes
 
+* Uninited local idents and constants will have version==0
 
index e7295b6f903bf57cb5e2793fdeb7f72a6a46f9c6..14300cb28c3a92a26a2fc8705b1a6cd2105c09af 100644 (file)
@@ -482,6 +482,10 @@ static void const_decl(Parser* p)
         export = accept(p, '*');
         sym = symbol_new(p, 0, name, SYM_CONST, export);
         expect(p, '=');
+//        AstNode* block = ast_block();
+//        expression(p, block);
+//        sym->value = ast_lastval(block);
+//        check_const(sym->value);
         sym->value = expression(p);
         sym->type = sym->value->hdr.type;
     }
@@ -619,9 +623,19 @@ static void module(Parser* p)
 
     if (accept(p, BEGIN))
     {
-        AstNode* block = statement_seq(p);
-        ast_print(p, block);
-        (void)block;
+//        p->curr_join = ast_block();
+//        if (!matches(p, END))
+//        {
+//            AstNode* block = ast_block();
+//            statement_seq(p, block);
+//            ast_print(p, block);
+//        }
+        if (!matches(p, END))
+        {
+            AstNode* block = statement_seq(p);
+            ast_print(p, block);
+            (void)block;
+        }
         expect(p, END);
     }
 
index 58698a518cfd85c572a2f7f817d11c71e9cfa33a..87490956181166c659dad0ca4507f57175e38bc0 100644 (file)
@@ -54,22 +54,22 @@ var
 #  return z1;
 #end
 
-procedure Bar*(a : Int) : Int
-begin
-    return a;
-end
-
-procedure Baz*(a : Int)
-begin
-    if (1 > 2) then
-        42;
-    else
-        24;
-    end
-end
+#procedure Bar*(a : Int) : Int
+#begin
+#    return a;
+#end
+#
+#procedure Baz*(a : Int)
+#begin
+#    if (1 > 2) then
+#        42;
+#    else
+#        24;
+#    end
+#end
 
 begin
-    h[1].i = 42;
+#    h[1].i = 42;
 #  a = true;
 #  a = A;
 #  b = 24;
@@ -80,7 +80,7 @@ begin
 #  b = -b;
 #
 #  # Arithmetic ops
-  c = b + 1;
+#  c = b + 1;
 #  c = b - 1;
 #  c = b * 1;
 #  c = b / 1;
@@ -152,7 +152,7 @@ begin
 #    c = 42;
 #    c = 24;
 
-    Bar(Foo.testint);
-    Bar(Bar2.testint);
-    Bar(Bar3.testint);
+#    Bar(Foo.testint);
+#    Bar(Bar2.testint);
+#    Bar(Bar3.testint);
 end