Sha256: 8e600da987e5ab5908b190a5c13f95109b19394961f82c34875ba25ca7bb6837

Contents?: true

Size: 529 Bytes

Versions: 8

Compression:

Stored size: 529 Bytes

Contents

module Treetop
  module Compiler    
    class AnythingSymbol < AtomicExpression
      def compile(address, builder, parent_expression = nil)
        super
        builder.if__ "index < input_length" do
          assign_result "(#{node_class_name}).new(input, index...(index + 1))"
          extend_result_with_inline_module
          builder << "@index += 1"
        end
        builder.else_ do
          builder << 'terminal_parse_failure("any character")'
          assign_result 'nil'
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
cognita-treetop-1.2.4 lib/treetop/compiler/node_classes/anything_symbol.rb
mack-0.8.3.1 lib/gems/treetop-1.2.4/lib/treetop/compiler/node_classes/anything_symbol.rb
mack-0.8.3 lib/gems/treetop-1.2.4/lib/treetop/compiler/node_classes/anything_symbol.rb
treetop-1.2.0 lib/treetop/compiler/node_classes/anything_symbol.rb
treetop-1.2.3 lib/treetop/compiler/node_classes/anything_symbol.rb
treetop-1.2.1 lib/treetop/compiler/node_classes/anything_symbol.rb
treetop-1.2.2 lib/treetop/compiler/node_classes/anything_symbol.rb
treetop-1.2.4 lib/treetop/compiler/node_classes/anything_symbol.rb