]> git.mdlowis.com Git - proto/obnc.git/commitdiff
minor cleanup
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 12 May 2021 13:02:04 +0000 (09:02 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 12 May 2021 13:02:04 +0000 (09:02 -0400)
cerise/src/grammar.c
cerise/src/type_checks.c
cerise/tests/Module.m

index 2bbdf9b4bad5e6a06c6a1d78c95bd9c28ccc2b38..bb1b57f2939e819dba53e4dfca6e98001b73207f 100644 (file)
@@ -6,7 +6,6 @@
 
 /* TODO
     * Implement logical operators: and, or, not
-    * Implement arrays and array access
     * Implement module scoped identifiers
     * Implement strings types
     * Implement records and record access
@@ -357,28 +356,6 @@ RULE(statement_seq)
 {
     do
     {
-//        if (matches(p, IDENT))
-//        {
-//            Item right = { 0 };
-//            char* text = expect_text(p, IDENT);
-//            if (accept(p, '='))
-//            {
-//                Symbol* sym = symbol_get(p, SYM_VAR, text);
-//                init_item(item, sym);
-//                item->imm.s = sym->name;
-//
-//                expression(p, &right);
-//                check_types(p, item, &right);
-//                codegen_store(p, item, &right);
-//            }
-//            else
-//            {
-//                /* TODO: add function calls and other complex stuff */
-//                error(p, "expected assignment");
-//            }
-//            expect(p, ';');
-//        }
-//        else
         if (matches(p, IF))
         {
             expect(p, IF);
@@ -430,7 +407,6 @@ RULE(var_decl)
         int nsyms = 0;
         Symbol* first = NULL;
         Symbol* sym = NULL;
-//        Symbol* type = NULL;
         char* name = NULL;
         bool export = false;
 
@@ -449,9 +425,6 @@ RULE(var_decl)
         expect(p, ':');
         type(p, &base_type);
 
-//        name = expect_text(p, IDENT);
-//        type = symbol_get(p, SYM_TYPE, name);
-
         /* apply the type to the newly created symbols */
         for (int i = 0; i < nsyms; i++)
         {
index b7285d6807d41484d0a1bf749ab8a5fbc45f9633..0038a390b39bf94e3061a1591abe3206e63347b2 100644 (file)
@@ -86,6 +86,6 @@ void check_types(Parser* p, Item* a, Item* b)
 //    }
     else
     {
-        error(p, "type mismatch");
+        error(p, "unimplemented type check!");
     }
 }
index 7e69119cc31291030fcfc9c5b196de63ad7c9f49..035f2c271c21ad3de3df75acd30c10872525981a 100644 (file)
@@ -35,6 +35,7 @@ procedure Foo*(e : Int, z : Int) : Int
 #  end
 
 begin
+#  e = q;
   c = 1;
   z = 2;
   return z;