Pegmatite::DSL
The Pegmatite::DSL allows you to tersely define a deeply composed Pattern by providing convenience methods for creating new Pattern instances.
See spec/fixtures/json.cr for a detailed real-world example of using the DSL.
Class methods
clear_class_variables_state
Sourcedefine
Sourcelast_defined_whitespace_pattern
SourceInstance methods
any
Sourcechar(c)
Sourcedeclare
Sourcedynamic_match(label)
Sourcel(lit)
Sourcerange(min, max)
Sourcestr(text)
Sourcewhitespace_pattern(pattern : Pattern)
Define a DSL method for setting the pattern to use for whitespace in the ^ operator, which allows optional whitespace between concatenated patterns. Using class variables here is not ideal, but it's acceptable for a DSL.