class Ven::Parselet::PNudMacro

Overview

Represents a nud macro and expands it on a parse.

When triggered, it interprets the nud parameters it was initialized with and passes the results to the expansion visitor (ReadExpansion).

It is one of the semantic nuds.

Defined in:

ven/parselet/nud.cr

Constructors

Instance Method Summary

Instance methods inherited from class Ven::Parselet::Nud

block(opening = true, semicolon : Bool = false) block, die(message : String) die, led(precedence : Precedence)
led(precedence = @precedence)
led
, parse(tag : QTag, token : Word) parse, parse!(parser : Ven::Reader, tag : QTag, token : Ven::Word) parse!, semicolon : Bool semicolon, symbol(tag, token = nil) : QSymbol symbol

Constructor methods inherited from class Ven::Parselet::Nud

new(precedence : UInt8 = 0_u8) new

Constructor Detail

def self.new(params : Array(String), body : Quotes) #

[View source]

Instance Method Detail

def args! #

Reads the arguments of this nud macro by interpreting the parameters it accepts.

Returns a hash of parameter names mapped to the corresponding arguments. Tail slurpie (*) is stored under $-tail.


[View source]
def parse(tag, token) #

[View source]
def tail! #

Reads the tail slurpie. Yields each expression to the block.


[View source]