Sha256: c320979d4129ce9b45f48f510ef3a8c91ffe66ebffe2d4ad44d26d7e21b0a598

Contents?: true

Size: 579 Bytes

Versions: 356

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

356 entries across 311 versions & 41 rubygems

Version Path
cloudhead-less-1.1.13 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.1.2 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.1.3 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.1.4 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.1.5 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.1.6 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.1.7 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.1.8 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.1.9 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.2.0 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.2.1 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.2.2 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
cloudhead-less-1.2.3 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
nirvdrum-less-1.1.4 lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb
depengine-0.0.31 etc/isolate/jruby-1.8/gems/treetop-1.4.8/lib/treetop/compiler/node_classes/inline_module.rb
depengine-0.0.31 etc/isolate/ruby-1.8/gems/treetop-1.4.8/lib/treetop/compiler/node_classes/inline_module.rb
depengine-0.0.30 etc/isolate/jruby-1.8/gems/treetop-1.4.8/lib/treetop/compiler/node_classes/inline_module.rb
depengine-0.0.30 etc/isolate/ruby-1.8/gems/treetop-1.4.8/lib/treetop/compiler/node_classes/inline_module.rb
depengine-0.0.29 etc/isolate/ruby-1.8/gems/treetop-1.4.8/lib/treetop/compiler/node_classes/inline_module.rb
depengine-0.0.29 etc/isolate/jruby-1.8/gems/treetop-1.4.8/lib/treetop/compiler/node_classes/inline_module.rb