class

Pegmatite::Pattern::Repeat

Inherits Pegmatite::Pattern < Pegmatite::DSL::Methods < Reference < Object

Pattern::Repeat is used to specify a pattern that can or must repeat for a specified minimum number of occurrences.

When the child pattern eventually fails to match, fail overall if the minimum number of occurrences has not yet been met. Otherwise, succeed overall, consuming all bytes from the occurrences that succeeded (not consuming any bytes from the final failing occurrence). Like Pattern::Optional, this pattern will never fail if @min is zero.

Constructors

new(child : Pattern, min : Int32 = 0, max = nil)
Source

Instance methods

_match(source, offset, state) : MatchResult
Source
description
Source
dsl_name
Source
inspect(io)
Source