class Pegmatite::DSL
- Pegmatite::DSL
- Reference
- Object
Overview
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.
Defined in:
pegmatite/dsl.crClass Method Summary
Instance Method Summary
- #any
- #char(c)
- #declare
- #dynamic_match(label)
- #l(lit)
- #range(min, max)
- #str(text)
-
#whitespace_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.
Class Method Detail
Instance Method Detail
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.