Sha256: e26024253c25c7d2da923d0e8ba086252b209304d0ac2a503f42d6964a55dbb6
Contents?: true
Size: 667 Bytes
Versions: 1
Compression:
Stored size: 667 Bytes
Contents
module Treetop class Predicate < NodePropagatingParsingExpression attr_reader :expression def initialize(expression) @expression = expression end def parse_at(input, start_index, parser) result = expression.parse_at(input, start_index, parser) if result.success? return child_expression_success(start_index, input, result) else return child_expression_failure(start_index, input, result) end end protected def success_at(index, input, nested_results) SyntaxNode.new(input, index...index, collect_nested_failures(nested_results)) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
treetop-0.1.0 | lib/treetop/grammar/parsing_expressions/predicate.rb |