lib/kompiler/mc_builder.rb in kompiler-0.1.0 vs lib/kompiler/mc_builder.rb in kompiler-0.1.1
- old
+ new
@@ -27,9 +27,10 @@
{name: "get_current_address", n_args: 0, func: lambda {|args, state| state[:current_address] } },
{name: "get_label_address", n_args: 1, func: lambda {|args, state| state[:labels].include?(args[0]) ? state[:labels][args[0]] : raise("Label \"#{args[0]}\" not found: Program build not possible") } },
{name: "bits", n_args: "any", func: lambda {|args, state| args } },
{name: "if_eq_else", n_args: 4, eval_args: false, func: lambda {|args, state| (eval_mc_node_arg(args[0], state) == eval_mc_node_arg(args[1], state)) ? eval_mc_node_arg(args[2], state) : eval_mc_node_arg(args[3], state) }},
{name: "raise_error", n_args: 1, func: lambda {|args, state| raise args[0] } },
+ {name: "get_key", n_args: 2, func: lambda {|args, state| args[0][args[1]] }},
]
def self.is_ast_node(val)
val.is_a?(Array) && (val.size >= 1) && val[0].is_a?(String)
end
\ No newline at end of file