Commits
Click on a commit to change the comparison range♻️ refactor(macro): add AST runtime value and improve macro evaluation
This change refactors the macro system to properly support quote/unquote
and introduces a new MacroEvaluator trait for evaluating macro bodies
during expansion.
Key changes:
- Add RuntimeValue::Ast variant to represent quoted expressions
- Introduce MacroEvaluator trait to decouple macro expansion from evaluation
- Change quote expressions to evaluate to AST values instead of erroring
- Add InvalidMacroResultAst and InvalidMacroResult error types
- Refactor macro collection to evaluate macro bodies at definition time
- Update macro expansion to properly handle AST values
- Fix tests to use proper quote blocks in macro definitions ✅ test(macro): add comprehensive tests for macro expansion and substitution scenarios Merge pull request #1028 from harehare/copilot/sub-pr-1027
Refactor duplicated macro_expander take/restore pattern into helper method ♻️ Refactor(runtime): enhance RuntimeValue display and AST formatting ♻️ refactor(eval): update eval_macro to use macro environment for evaluation ♻️ test(macro): add tests for macro expansion with empty blocks ♻️ refactor(runtime): update AST node formatting to use Rust Debug-like syntax ♻️ refactor(tests): remove commented-out cases for quote functionality in integration tests