class Ven::Suite::Context::Reader

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.cr

Instance Method Summary

Instance Method Detail

def <<(*args, **options) #

Defines a new keyword.


[View source]
def <<(*args, **options, &) #

Defines a new keyword.


[View source]
def []=(type : String, pattern : Regex) #

Defines a trigger given type, word type, and regex pattern pattern.


[View source]
def []=(trigger : String, nud : Ven::Parselet::PNudMacro) #

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.


[View source]
def keyword?(lexeme : String) #

Returns whether lexeme is a keyword under this context.


[View source]
def keywords : Array(String) #

Returns the keyword lexemes of this context.


[View source]
def nuds : Hash(String, Ven::Parselet::PNudMacro) #

Returns a hash of word types mapped to nud macros they trigger.


[View source]
def triggers : Hash(String, Regex) #

Returns a hash of word types mapped to regex patterns used to match them.


[View source]