macro_rules! expr_to_str_or_deopt {
($expr:expr, $state:expr, $traversal_state:expr, $fns:expr, $error_msg:expr) => { ... };
}Expand description
Macro to safely convert an expression to a string with proper error handling. Returns the string on success, or calls deopt and returns None on failure.
This macro is designed for use in evaluation contexts where we need to:
- Convert an expression to a string
- Call deopt() if conversion fails
- Return None to indicate failure
§Usage
ⓘ
let str_value = expr_to_str_or_deopt!(expr, state, traversal_state, fns, "Expression is not a string");§Arguments
$expr: The expression to convert$state: Mutable reference to EvaluationState$traversal_state: Mutable reference to StateManager$fns: Reference to FunctionMap$error_msg: Error message string literal