From cdd23bbcdeae18c4fe118f0879a1230c075b2999 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 27 Jan 2020 16:58:15 -0500 Subject: [PATCH] added more scaffolding for declarations and assignments --- compile.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/compile.rb b/compile.rb index f702ee1..5fb23e5 100755 --- a/compile.rb +++ b/compile.rb @@ -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 -- 2.54.0