]> git.mdlowis.com Git - proto/sclpl-rb.git/commitdiff
added more scaffolding for declarations and assignments
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 27 Jan 2020 21:58:15 +0000 (16:58 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 27 Jan 2020 21:58:15 +0000 (16:58 -0500)
compile.rb

index f702ee1231fd9af6cf170a6b60fc79516159e564..5fb23e57a4343dd041c824d2945d345198ec1e56 100755 (executable)
@@ -303,9 +303,14 @@ class Parser
       Ast::Return.new(expr[:type], expr)
     elsif matches(:if)
     elseif matches(:ident)
-      # declaration
-      # assignment
-      # procedure call
+      name = expect(:ident)
+      if matches(":")
+#        declaration(name)
+      elsif matches("=")
+#        assignment
+      else
+#        binary_expr(name) # procedure call / expression
+      end
     else
       error("invalid statment")
     end