Sha256: c320979d4129ce9b45f48f510ef3a8c91ffe66ebffe2d4ad44d26d7e21b0a598

Contents?: true

Size: 579 Bytes

Versions: 357

Compression:

Stored size: 579 Bytes

Contents

module Treetop
  module Compiler
    module InlineModuleMixin
      attr_reader :module_name
      
      def compile(index, builder, rule)
        @module_name = "#{rule.name.treetop_camelize}#{index}"
      end
    end
    
    class InlineModule < Runtime::SyntaxNode

      include InlineModuleMixin
      
      def compile(index, builder, rule)
        super
        builder.module_declaration(module_name) do
          builder << ruby_code.gsub(/\A\n/, '').rstrip
        end
      end
      
      def ruby_code
        elements[1].text_value
      end
    end
  end
end

Version data entries

357 entries across 312 versions & 41 rubygems

Version Path
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
treetop-1.6.11 lib/treetop/compiler/node_classes/inline_module.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/treetop-1.4.15/lib/treetop/compiler/node_classes/inline_module.rb
treetop-1.6.10 lib/treetop/compiler/node_classes/inline_module.rb
treetop-1.6.9 lib/treetop/compiler/node_classes/inline_module.rb