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
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
treetop-1.6.11 lib/treetop/compiler/node_classes/optional.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb
treetop-1.6.10 lib/treetop/compiler/node_classes/optional.rb
treetop-1.6.9 lib/treetop/compiler/node_classes/optional.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/optional.rb