Skip to main content

Crate cel_rs_macros

Crate cel_rs_macros 

Source
Expand description

Procedural macros for the cel-rs crate.

This crate provides procedural macros for working with CEL (Common Expression Language) expressions in Rust. It includes macros for validating CEL expressions at compile time and debugging token parsing.

§Examples

§Validating CEL expressions

use cel_rs_macros::expression;

// This will compile only if the expression is valid CEL
expression! {
    54 + 25 * (11 + 6 * 6)
};

§Debugging token parsing

use cel_rs_macros::print_tokens;

// This will print the parsed tokens to stdout during compilation
print_tokens! {
    10 + 20
};

Macros§

expression
Validates that the input contains a valid CEL expression.
print_tokens
Prints the tokens for debugging purposes.