class Pegmatite::Pattern::Forward

Overview

Pattern::Forward is used to create a forward declaration, such as when defining a pattern that will be used recursively with another.

There is no child pattern present at declaration, so one must be added later by calling define exactly once before the pattern is used to parse.

Returns the result of the child pattern's parsing.

Defined in:

pegmatite/pattern/forward.cr

Constructors

Instance Method Summary

Instance methods inherited from class Pegmatite::Pattern

_match(source, offset, state) : MatchResult _match, match(source, offset, state) : MatchResult match

Instance methods inherited from module Pegmatite::DSL::Methods

>>(other) >>, ^(other) ^, |(other) |, ~ ~, dynamic_pop(label) dynamic_pop, dynamic_push(label) dynamic_push, maybe maybe, named(label, tokenize = true) named, repeat(min = 0, max = nil) repeat, repeat_exactly(times) repeat_exactly, then_eof then_eof

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def _match(source, offset, state) : MatchResult #

[View source]
def define(child : Pegmatite::Pattern | Nil) #

[View source]
def description #

[View source]
def dsl_name #

[View source]
def inspect(io) #

[View source]