Sha256: cb1891084a30ec4da90e128baad0f71f4c494df59a10e4e71b25797bf804b4a8

Contents?: true

Size: 693 Bytes

Versions: 3

Compression:

Stored size: 693 Bytes

Contents

module Treetop
  module Compiler    
    class AnythingSymbol < AtomicExpression
      def compile(address, builder, parent_expression = nil)
        super
        builder.if__ "index < input_length" 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
          builder << 'terminal_parse_failure("any character")'
          assign_result 'nil'
        end
      end

      def expected
	'"any character"'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
swift-pyrite-0.1.1 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/anything_symbol.rb
swift-pyrite-0.1.0 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/anything_symbol.rb
treetop-1.6.3 lib/treetop/compiler/node_classes/anything_symbol.rb