macro_rules

Declarative macro_rules macros.

class macro_polo.macros.macro_rules.MacroRule

A macro matcher/macro transcriber pair.

__init__(matcher, transcriber)
Parameters:
Return type:

None

matcher: MacroMatcher

The rule’s matcher

transcriber: MacroTranscriber

The rule’s transcriber

class macro_polo.macros.macro_rules.MacroRules

A sequence of MacroRules.

__init__()
class macro_polo.macros.macro_rules.MacroRulesParserMacro

A macro that parses macro_rules macro definitions.

Parsed macros are added to macros.

__init__(macros=<factory>)
Parameters:

macros (dict[str, Macro])

Return type:

None

macros: dict[str, Macro]

Parsed macro_rules macros will be added to this dict.

It may be shared with other macros, such as a FunctionMacroInvokerMacro.