site/meta_parse.rb
tests/_examples/site/meta_parse.rb in the metorex repository.
tree = parse("1 + 2 * 3")
p tree.first["op"]
p tree.first["right"]
Output:
"+"
{"type" => "BinaryOp", "op" => "*", "left" => {"type" => "IntLiteral", "value" => 2}, "right" => {"type" => "IntLiteral", "value" => 3}}