vendor/bundle/ruby/2.5.0/gems/parslet-1.5.0/example/calc.rb
# And this calls everything in the right order.
And this calls everything in the right order.
And this calls everything in the right order .
def calculate(str)
  intermediary_tree = CalcParser.new.parse(str)
  abstract_tree = CalcTransform.new.apply(intermediary_tree)
  result = abstract_tree.eval
  result.to_i
end
def calculate ( str ) intermediary_tree = CalcParser . new . parse ( str ) abstract_tree = CalcTransform . new . apply ( intermediary_tree ) result = abstract_tree . eval result . to_i end
And this calls everything in the right order.
And this calls everything in the right order .
str
<not_specific>