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:
Macro- Definition of a single macroMacroRegistry- Collection of macros with lookup by keyMacroExpander- The expansion function typeMacroContext- Context passed to expanders for node creation
§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.
- Macro
Context - Context provided to macro expanders for creating AST nodes.
- Macro
Registry - Registry of macros with efficient lookup.
Enums§
- ArgCount
- Specifies the expected argument count for a macro.
- Macro
Expansion - Result of macro expansion.
- Macro
Style - 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§
- Macro
Expander - Type alias for macro expander functions.