Refactor Value enum for Quote node

Replaces `Value::Object(Rc<dyn Object>)` for SyntaxNodes with a
dedicated `Value::Quote(Rc<SyntaxNode>)`. This provides better type
safety and clarity when dealing with AST nodes as values.
Refactor Value enum for Quote node

This commit introduces a new `Value::Quote` variant to represent quoted
AST nodes directly, replacing the generic `Value::Object` for this
purpose.

This change simplifies the handling of quoted nodes by:
- Directly storing an `Rc<SyntaxNode>` instead of relying on dynamic
  downcasting from `Rc<dyn Object>`.
- Streamlining macro expansion logic by removing the need to check for
  `SyntaxNode` within `Value::Object`.
- Improving type safety and explicitness in the `Value` enum.
This commit is contained in:
2026-03-22 20:53:30 +01:00
parent ae1d94e507
commit 09ae98728f
5 changed files with 25 additions and 48 deletions
+1
View File
@@ -710,6 +710,7 @@ impl VM {
Value::FieldAccessor(_) => "FieldAccessor",
Value::Function(_) => "Function",
Value::Closure(_) => "Closure",
Value::Quote(_) => "Quote",
Value::Object(_) => "Object",
Value::Cell(_) => "Cell",
};