Sha256: acb0efa0da57ccf60582ce8a7d3bf47705dbfdd657fd9be6fa7a6fb126af3b59

Contents?: true

Size: 250 Bytes

Versions: 202

Compression:

Stored size: 250 Bytes

Contents

module Arithmetic
  class BinaryOperation < Treetop::Runtime::SyntaxNode
    def eval(env={})
      tail.elements.inject(head.eval(env)) do |value, element|
        element.operator.apply(value, element.operand.eval(env))
      end
    end
  end
end

Version data entries

202 entries across 187 versions & 30 rubygems

Version Path
treetop-1.6.14 examples/lambda_calculus/arithmetic_node_classes.rb
treetop-1.6.12 examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/examples/lambda_calculus/arithmetic_node_classes.rb