class

Pegmatite::Pattern::Optional

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

Pattern::Optional specifies that a pattern that can either match or not.

If the child pattern doesn't match, zero bytes are consumed. Otherwise, the result of the child pattern is returned directly. This pattern will never fail.

Constructors

new(child : Pattern)
Source

Instance methods

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