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
Instance methods
_match(source, offset, state) : MatchResult
Sourcedescription
Sourcedsl_name
Sourceinspect(io)
Source