Sha256: 068feff10e4bf4028d9e014e7ce7db60410404a9d185324d0d53f55c61807843

Contents?: true

Size: 498 Bytes

Versions: 371

Compression:

Stored size: 498 Bytes

Contents

module Treetop
  module Compiler
    class Optional < ParsingExpression
      def compile(address, builder, parent_expression)
        super
        use_vars :result
        obtain_new_subexpression_address
        parent_expression.atomic.compile(subexpression_address, builder)
        
        builder.if__ subexpression_success? do
          assign_result subexpression_result_var
        end
        builder.else_ do
          assign_result epsilon_node
        end
      end
    end
  end
end

Version data entries

371 entries across 326 versions & 43 rubygems

Version Path
treetop-1.6.12 lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb