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

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

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]