class Ven::Suite::Context::Reader
- Ven::Suite::Context::Reader
- Reference
- Object
Overview
The context for a Reader
The reader uses context to store and look up user-defined nuds, leds and words.
Defined in:
ven/suite/context.crInstance Method Summary
-
#<<(*args, **options)
Defines a new keyword.
-
#<<(*args, **options, &)
Defines a new keyword.
-
#[]=(type : String, pattern : Regex)
Defines a trigger given type, word type, and regex pattern pattern.
-
#[]=(trigger : String, nud : Ven::Parselet::PNudMacro)
Defines a reader macro that will be triggered by trigger, a word type (keyword or not).
-
#keyword?(lexeme : String)
Returns whether lexeme is a keyword under this context.
-
#keywords : Array(String)
Returns the keyword lexemes of this context.
-
#nuds : Hash(String, Ven::Parselet::PNudMacro)
Returns a hash of word types mapped to nud macros they trigger.
-
#triggers : Hash(String, Regex)
Returns a hash of word types mapped to regex patterns used to match them.
Instance Method Detail
Defines a trigger given type, word type, and regex pattern pattern.
Defines a reader macro that will be triggered by trigger, a word type (keyword or not).
Does not check whether trigger is a valid word type.
Returns a hash of word types mapped to nud macros they trigger.
Returns a hash of word types mapped to regex patterns used to match them.