Sha256: cc5e4f2fca3303b156f01482b4aab150d1df07161dd6c4cc030eb90a51b06a76

Contents?: true

Size: 703 Bytes

Versions: 20

Compression:

Stored size: 703 Bytes

Contents

module Treetop
  module Compiler    
    class CharacterClass < AtomicExpression
      def compile(address, builder, parent_expression = nil)
        super
        
        builder.if__ "has_terminal?(#{single_quote(text_value)}, true, index)" do
          if address == 0 || decorated?
            assign_result "instantiate_node(#{node_class_name},input, index...(index + 1))"
            extend_result_with_inline_module
          else
            assign_lazily_instantiated_node
          end
          builder << "@index += 1"
        end
        builder.else_ do
          "terminal_parse_failure(#{single_quote(characters)})"
          assign_result 'nil'
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
cloudhead-less-1.0.1 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
cloudhead-less-1.0.10 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
cloudhead-less-1.0.13 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
cloudhead-less-1.0.2 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
cloudhead-less-1.0.3 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
cloudhead-less-1.0.4 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
cloudhead-less-1.0.5 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
cloudhead-less-1.0.6 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
cloudhead-less-1.0.8 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
cloudhead-less-1.0.9 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.4 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.5 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.6 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.8 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.9 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.10 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.11 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.12 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.13 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb
less-1.0.14 lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb