class Pegmatite::Pattern::Sequence

Overview

Pattern::Sequence is used to specify a consecutive sequence of patterns.

Parsing will fail if any child pattern fails, returning that failure result. Otherwise, succeeds and consumes all bytes from all child patterns.

Defined in:

pegmatite/pattern/sequence.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(children : Array(Pegmatite::Pattern) = [] of Pattern) #

[View source]

Instance Method Detail

def >>(other) #

Override this DSL operator to accrue into the existing sequence.


[View source]
def _match(source, offset, state) : MatchResult #

[View source]
def description #

[View source]
def dsl_name #

[View source]
def inspect(io) #

[View source]