function

Function-like macros.

class macro_polo.macros.function.FunctionMacroInvokerMacro

A macro that processes function-like macro invocations.

The syntax for invoking a function-style macro is:

macro_name!(input tokens)

or

macro_name![input tokens]

or

macro_name!{input tokens}

or

macro_name!:
    input
    tokens

Important

Due to the way Python’s tokenizer works, indentation and newlines are only preserved by the last (block) style.

When invoked, the registered macro is called with a single argument, the token sequence passed as input.

Macros are defined by macros (which can be updated after this class is instantiated).

__init__(macros=<factory>)
Parameters:

macros (Mapping[str, Macro])

Return type:

None

macros: Mapping[str, Macro]

A mapping of names to function macros.

When a function macro is invoked, its name is looked up here.

This mapping may be shared with other macros, such as a ImporterMacro.