class Ven::Parselet::PDefineNud
Overview
Reads and defines a new nud. Properly handles redefinition of subsidiary nuds.
nud greet!(name) {
say("Hi, " ~ $name);
}
greet! "John Doe!"
Defined in:
ven/parselet/nud.crInstance Method Summary
-
#lead! : Tuple(String, Regex | String)
Parses the lead of this nud definition.
- #parse(tag, token)
Instance methods inherited from class Ven::Parselet::PFun
diamond!
diamond!,
given!
given!,
param!(utility = true)
param!,
params!(utility = true)
params!,
parse(tag, token)
parse
Instance methods inherited from class Ven::Parselet::Nud
parse(tag : QTag, token : Word)
parse,
parse!(parser : Reader, tag : QTag, token : Word)
parse!
Instance methods inherited from class Ven::Parselet::Share
block(opening = true, semicolon : Bool = false)
block,
die(message : String)
die,
led(precedence = @precedence)
led,
precedence : Precedence
precedence,
semicolon : Bool
semicolon,
symbol(tag, token = nil) : QSymbol
symbol
Constructor methods inherited from class Ven::Parselet::Share
new(precedence : Ven::Precedence = Precedence::ZERO)
new
Instance Method Detail
def lead! : Tuple(String, Regex | String)
#
Parses the lead of this nud definition.
The lead is either a regex pattern (word REGEX) or a keyword (through word SYMBOL).
Returns the type of the word that has to be defined and the trigger.