Sha256: c2fcd0993c74a12bf4041ec45c24967ac63ebe75cbd670d90f60cc34932fb912

Contents?: true

Size: 642 Bytes

Versions: 185

Compression:

Stored size: 642 Bytes

Contents

module Treetop
  module Compiler    
    class Terminal < AtomicExpression
      def compile(address, builder, parent_expression = nil)
        super
        string_length = eval(text_value).length
        
        builder.if__ "has_terminal?(#{text_value}, false, index)" do
          assign_result "instantiate_node(#{node_class_name},input, index...(index + #{string_length}))"
          extend_result_with_inline_module
          builder << "@index += #{string_length}"
        end
        builder.else_ do
          builder << "terminal_parse_failure(#{text_value})"
          assign_result 'nil'
        end
      end
    end
  end
end

Version data entries

185 entries across 170 versions & 29 rubygems

Version Path
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/terminal.rb