Skip to main content

Module macros

Module macros 

Source
Expand description

Macro system for CEL parser.

Macros in CEL are syntactic transformations that expand at parse time. They transform specific call patterns (like list.all(x, cond)) into expanded AST nodes (like Comprehension).

This module provides:

§Architecture

Macros are keyed by name:arg_count:is_receiver (e.g., "all:2:true"). This allows separate definitions for different argument counts. Lookup tries the exact key first, then falls back to a var-arg key.

Structs§

Macro
Definition of a single macro.
MacroContext
Context provided to macro expanders for creating AST nodes.
MacroRegistry
Registry of macros with efficient lookup.

Enums§

ArgCount
Specifies the expected argument count for a macro.
MacroExpansion
Result of macro expansion.
MacroStyle
Indicates whether a macro is called as a global function or as a method on a receiver.

Statics§

STANDARD_MACROS
Standard CEL macros.

Type Aliases§

MacroExpander
Type alias for macro expander functions.