diff --git a/crates/fuse-ast/src/ast.rs b/crates/fuse-ast/src/ast.rs index 5b0ee05..01ac54d 100644 --- a/crates/fuse-ast/src/ast.rs +++ b/crates/fuse-ast/src/ast.rs @@ -1,6 +1,6 @@ use fuse_common::Span; use fuse_common_proc::serializable; -use std::rc::Rc; +use std::{cell::Cell, rc::Rc}; #[serializable] #[derive(Debug)] @@ -185,8 +185,13 @@ pub enum InterpolationFormat { pub struct Identifier { pub span: Span, pub name: Atom, + pub reference: Cell>, } +#[serializable] +#[derive(Debug, PartialEq, Clone, Copy)] +pub struct ReferenceId(u32); + #[serializable] #[derive(Debug, PartialEq)] pub struct Function { diff --git a/crates/fuse-parser/src/parsers/expressions.rs b/crates/fuse-parser/src/parsers/expressions.rs index 5345716..8538713 100644 --- a/crates/fuse-parser/src/parsers/expressions.rs +++ b/crates/fuse-parser/src/parsers/expressions.rs @@ -1,3 +1,5 @@ +use std::cell::Cell; + use crate::{lexer::TokenKind, Parser, ParserResult}; use fuse_ast::{ ArrayExpressionElement, BinaryOperator, BooleanLiteral, ConstructionExpression, @@ -71,6 +73,7 @@ impl<'a> Parser<'a> { Ok(Identifier { span: token.span(), name: self.ast.atom(view), + reference: Cell::default(), }) } diff --git a/crates/fuse-parser/tests/cases/fail/variable-declaration-01/ast.snap b/crates/fuse-parser/tests/cases/fail/variable-declaration-01/ast.snap index 42b04b4..a1dc37d 100644 --- a/crates/fuse-parser/tests/cases/fail/variable-declaration-01/ast.snap +++ b/crates/fuse-parser/tests/cases/fail/variable-declaration-01/ast.snap @@ -29,6 +29,7 @@ Some(Chunk( end: 10, ), name: Atom("name"), + reference: None, ), mutable: false, )), diff --git a/crates/fuse-parser/tests/cases/pass/binary-operator-01/ast.snap b/crates/fuse-parser/tests/cases/pass/binary-operator-01/ast.snap index 961f43e..a19345d 100644 --- a/crates/fuse-parser/tests/cases/pass/binary-operator-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/binary-operator-01/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 1, ), name: Atom("x"), + reference: None, )), rhs: BinaryOperator(BinaryOperator( kind: LogicalAnd(Span( @@ -34,6 +35,7 @@ Some(Chunk( end: 5, ), name: Atom("a"), + reference: None, )), rhs: Identifier(Identifier( span: Span( @@ -41,6 +43,7 @@ Some(Chunk( end: 11, ), name: Atom("b"), + reference: None, )), )), ))), diff --git a/crates/fuse-parser/tests/cases/pass/binary-operator-02/ast.snap b/crates/fuse-parser/tests/cases/pass/binary-operator-02/ast.snap index 70571b5..3942160 100644 --- a/crates/fuse-parser/tests/cases/pass/binary-operator-02/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/binary-operator-02/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 1, ), name: Atom("x"), + reference: None, )), rhs: BinaryOperator(BinaryOperator( kind: LogicalAnd(Span( @@ -39,6 +40,7 @@ Some(Chunk( end: 5, ), name: Atom("a"), + reference: None, )), rhs: Identifier(Identifier( span: Span( @@ -46,6 +48,7 @@ Some(Chunk( end: 11, ), name: Atom("b"), + reference: None, )), )), rhs: Identifier(Identifier( @@ -54,6 +57,7 @@ Some(Chunk( end: 17, ), name: Atom("c"), + reference: None, )), )), ))), diff --git a/crates/fuse-parser/tests/cases/pass/binary-operator-03/ast.snap b/crates/fuse-parser/tests/cases/pass/binary-operator-03/ast.snap index 7b9b849..085cb03 100644 --- a/crates/fuse-parser/tests/cases/pass/binary-operator-03/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/binary-operator-03/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 1, ), name: Atom("x"), + reference: None, )), rhs: BinaryOperator(BinaryOperator( kind: LogicalOr(Span( @@ -39,6 +40,7 @@ Some(Chunk( end: 5, ), name: Atom("a"), + reference: None, )), rhs: Identifier(Identifier( span: Span( @@ -46,6 +48,7 @@ Some(Chunk( end: 11, ), name: Atom("b"), + reference: None, )), )), rhs: Identifier(Identifier( @@ -54,6 +57,7 @@ Some(Chunk( end: 16, ), name: Atom("c"), + reference: None, )), )), ))), diff --git a/crates/fuse-parser/tests/cases/pass/binary-operator-04/ast.snap b/crates/fuse-parser/tests/cases/pass/binary-operator-04/ast.snap index a130e21..8d7f1b8 100644 --- a/crates/fuse-parser/tests/cases/pass/binary-operator-04/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/binary-operator-04/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 1, ), name: Atom("x"), + reference: None, )), rhs: BinaryOperator(BinaryOperator( kind: Minus(Span( diff --git a/crates/fuse-parser/tests/cases/pass/binary-operator-05/ast.snap b/crates/fuse-parser/tests/cases/pass/binary-operator-05/ast.snap index a763744..2ae5b47 100644 --- a/crates/fuse-parser/tests/cases/pass/binary-operator-05/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/binary-operator-05/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 1, ), name: Atom("x"), + reference: None, )), rhs: BinaryOperator(BinaryOperator( kind: LessThan(Span( diff --git a/crates/fuse-parser/tests/cases/pass/binary-operator-06/ast.snap b/crates/fuse-parser/tests/cases/pass/binary-operator-06/ast.snap index 6a8bacf..24571c9 100644 --- a/crates/fuse-parser/tests/cases/pass/binary-operator-06/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/binary-operator-06/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 1, ), name: Atom("x"), + reference: None, )), rhs: BinaryOperator(BinaryOperator( kind: LogicalAnd(Span( @@ -39,6 +40,7 @@ Some(Chunk( end: 5, ), name: Atom("x"), + reference: None, )), rhs: Identifier(Identifier( span: Span( @@ -46,6 +48,7 @@ Some(Chunk( end: 11, ), name: Atom("max"), + reference: None, )), )), rhs: BinaryOperator(BinaryOperator( @@ -59,6 +62,7 @@ Some(Chunk( end: 17, ), name: Atom("x"), + reference: None, )), rhs: Identifier(Identifier( span: Span( @@ -66,6 +70,7 @@ Some(Chunk( end: 24, ), name: Atom("min"), + reference: None, )), )), )), diff --git a/crates/fuse-parser/tests/cases/pass/binary-operator-07/ast.snap b/crates/fuse-parser/tests/cases/pass/binary-operator-07/ast.snap index b3db450..8b26f40 100644 --- a/crates/fuse-parser/tests/cases/pass/binary-operator-07/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/binary-operator-07/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 1, ), name: Atom("x"), + reference: None, )), rhs: BinaryOperator(BinaryOperator( kind: Multiply(Span( @@ -39,6 +40,7 @@ Some(Chunk( end: 6, ), name: Atom("x"), + reference: None, )), )), rhs: NumberLiteral(NumberLiteral( diff --git a/crates/fuse-parser/tests/cases/pass/call-expression-01/ast.snap b/crates/fuse-parser/tests/cases/pass/call-expression-01/ast.snap index 9609dda..52d42dd 100644 --- a/crates/fuse-parser/tests/cases/pass/call-expression-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/call-expression-01/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 4, ), name: Atom("test"), + reference: None, )), arguments: [], ))), diff --git a/crates/fuse-parser/tests/cases/pass/call-expression-02/ast.snap b/crates/fuse-parser/tests/cases/pass/call-expression-02/ast.snap index 5a28fff..6cf9e64 100644 --- a/crates/fuse-parser/tests/cases/pass/call-expression-02/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/call-expression-02/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 4, ), name: Atom("test"), + reference: None, )), arguments: [ Identifier(Identifier( @@ -30,6 +31,7 @@ Some(Chunk( end: 6, ), name: Atom("a"), + reference: None, )), Identifier(Identifier( span: Span( @@ -37,6 +39,7 @@ Some(Chunk( end: 9, ), name: Atom("b"), + reference: None, )), Identifier(Identifier( span: Span( @@ -44,6 +47,7 @@ Some(Chunk( end: 12, ), name: Atom("c"), + reference: None, )), ], ))), diff --git a/crates/fuse-parser/tests/cases/pass/call-expression-03/ast.snap b/crates/fuse-parser/tests/cases/pass/call-expression-03/ast.snap index 107b2fd..0392db2 100644 --- a/crates/fuse-parser/tests/cases/pass/call-expression-03/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/call-expression-03/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 3, ), name: Atom("foo"), + reference: None, )), rhs: BinaryOperator(BinaryOperator( kind: Member(Span( @@ -39,6 +40,7 @@ Some(Chunk( end: 7, ), name: Atom("bar"), + reference: None, )), arguments: [], )), @@ -53,6 +55,7 @@ Some(Chunk( end: 13, ), name: Atom("baz"), + reference: None, )), arguments: [], )), diff --git a/crates/fuse-parser/tests/cases/pass/enum-declaration-01/ast.snap b/crates/fuse-parser/tests/cases/pass/enum-declaration-01/ast.snap index 9d2219a..c75c02d 100644 --- a/crates/fuse-parser/tests/cases/pass/enum-declaration-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/enum-declaration-01/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 13, ), name: Atom("EnumName"), + reference: None, ), variants: [ EnumVariant( @@ -31,6 +32,7 @@ Some(Chunk( end: 23, ), name: Atom("VariantA"), + reference: None, ), value: None, ), @@ -41,6 +43,7 @@ Some(Chunk( end: 33, ), name: Atom("VariantB"), + reference: None, ), value: None, ), diff --git a/crates/fuse-parser/tests/cases/pass/enum-declaration-02/ast.snap b/crates/fuse-parser/tests/cases/pass/enum-declaration-02/ast.snap index e555339..909eb30 100644 --- a/crates/fuse-parser/tests/cases/pass/enum-declaration-02/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/enum-declaration-02/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 10, ), name: Atom("Ident"), + reference: None, ), variants: [ EnumVariant( @@ -31,6 +32,7 @@ Some(Chunk( end: 16, ), name: Atom("Var1"), + reference: None, ), value: Some(StringLiteral(StringLiteral( span: Span( @@ -52,6 +54,7 @@ Some(Chunk( end: 32, ), name: Atom("Var2"), + reference: None, ), value: Some(StringLiteral(StringLiteral( span: Span( diff --git a/crates/fuse-parser/tests/cases/pass/function-declaration-01/ast.snap b/crates/fuse-parser/tests/cases/pass/function-declaration-01/ast.snap index e2ca866..4e1ac50 100644 --- a/crates/fuse-parser/tests/cases/pass/function-declaration-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/function-declaration-01/ast.snap @@ -27,6 +27,7 @@ Some(Chunk( end: 13, ), name: Atom("test"), + reference: None, )), params: FunctionParameters( span: Span( diff --git a/crates/fuse-parser/tests/cases/pass/function-declaration-02/ast.snap b/crates/fuse-parser/tests/cases/pass/function-declaration-02/ast.snap index 4ed87ef..594ed56 100644 --- a/crates/fuse-parser/tests/cases/pass/function-declaration-02/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/function-declaration-02/ast.snap @@ -27,6 +27,7 @@ Some(Chunk( end: 13, ), name: Atom("test"), + reference: None, )), params: FunctionParameters( span: Span( @@ -51,6 +52,7 @@ Some(Chunk( end: 15, ), name: Atom("a"), + reference: None, ), mutable: false, )), @@ -75,6 +77,7 @@ Some(Chunk( end: 18, ), name: Atom("b"), + reference: None, ), mutable: false, )), @@ -99,6 +102,7 @@ Some(Chunk( end: 21, ), name: Atom("c"), + reference: None, ), mutable: false, )), @@ -119,6 +123,7 @@ Some(Chunk( end: 26, ), name: Atom("b"), + reference: None, ))), ], )), diff --git a/crates/fuse-parser/tests/cases/pass/function-declaration-03/ast.snap b/crates/fuse-parser/tests/cases/pass/function-declaration-03/ast.snap index b75d41a..fa3772a 100644 --- a/crates/fuse-parser/tests/cases/pass/function-declaration-03/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/function-declaration-03/ast.snap @@ -27,6 +27,7 @@ Some(Chunk( end: 7, ), name: Atom("test"), + reference: None, )), params: FunctionParameters( span: Span( @@ -51,6 +52,7 @@ Some(Chunk( end: 9, ), name: Atom("a"), + reference: None, ), mutable: false, )), @@ -69,6 +71,7 @@ Some(Chunk( end: 15, ), name: Atom("a"), + reference: None, ))), )), ], diff --git a/crates/fuse-parser/tests/cases/pass/function-expression-03/ast.snap b/crates/fuse-parser/tests/cases/pass/function-expression-03/ast.snap index b00455b..ea345f8 100644 --- a/crates/fuse-parser/tests/cases/pass/function-expression-03/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/function-expression-03/ast.snap @@ -45,6 +45,7 @@ Some(Chunk( end: 4, ), name: Atom("a"), + reference: None, ), mutable: false, )), @@ -69,6 +70,7 @@ Some(Chunk( end: 7, ), name: Atom("b"), + reference: None, ), mutable: false, )), @@ -89,6 +91,7 @@ Some(Chunk( end: 11, ), name: Atom("a"), + reference: None, ))), ], )), diff --git a/crates/fuse-parser/tests/cases/pass/function-expression-04/ast.snap b/crates/fuse-parser/tests/cases/pass/function-expression-04/ast.snap index 69df94b..c93489f 100644 --- a/crates/fuse-parser/tests/cases/pass/function-expression-04/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/function-expression-04/ast.snap @@ -38,6 +38,7 @@ Some(Chunk( end: 13, ), name: Atom("ident"), + reference: None, ))), ))), ], diff --git a/crates/fuse-parser/tests/cases/pass/function-expression-05/ast.snap b/crates/fuse-parser/tests/cases/pass/function-expression-05/ast.snap index 3a1b158..16dc855 100644 --- a/crates/fuse-parser/tests/cases/pass/function-expression-05/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/function-expression-05/ast.snap @@ -45,6 +45,7 @@ Some(Chunk( end: 8, ), name: Atom("value"), + reference: None, ), mutable: false, )), @@ -63,6 +64,7 @@ Some(Chunk( end: 19, ), name: Atom("value"), + reference: None, ))), ))), ], diff --git a/crates/fuse-parser/tests/cases/pass/identifier-01/ast.snap b/crates/fuse-parser/tests/cases/pass/identifier-01/ast.snap index ded6437..559eaf5 100644 --- a/crates/fuse-parser/tests/cases/pass/identifier-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/identifier-01/ast.snap @@ -17,6 +17,7 @@ Some(Chunk( end: 10, ), name: Atom("ident_name"), + reference: None, ))), ], ), diff --git a/crates/fuse-parser/tests/cases/pass/if-expression-01/ast.snap b/crates/fuse-parser/tests/cases/pass/if-expression-01/ast.snap index 817db7d..26dfd32 100644 --- a/crates/fuse-parser/tests/cases/pass/if-expression-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/if-expression-01/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 7, ), name: Atom("expr"), + reference: None, )), body: Block( statements: [ diff --git a/crates/fuse-parser/tests/cases/pass/if-expression-02/ast.snap b/crates/fuse-parser/tests/cases/pass/if-expression-02/ast.snap index c8f2e8d..40236ca 100644 --- a/crates/fuse-parser/tests/cases/pass/if-expression-02/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/if-expression-02/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 7, ), name: Atom("cond"), + reference: None, )), body: Block( statements: [ diff --git a/crates/fuse-parser/tests/cases/pass/if-expression-03/ast.snap b/crates/fuse-parser/tests/cases/pass/if-expression-03/ast.snap index d528cc9..b097d26 100644 --- a/crates/fuse-parser/tests/cases/pass/if-expression-03/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/if-expression-03/ast.snap @@ -21,6 +21,7 @@ Some(Chunk( end: 8, ), name: Atom("cond1"), + reference: None, )), body: Block( statements: [ @@ -49,6 +50,7 @@ Some(Chunk( end: 38, ), name: Atom("cond2"), + reference: None, )), body: Block( statements: [ diff --git a/crates/fuse-parser/tests/cases/pass/if-expression-04/ast.snap b/crates/fuse-parser/tests/cases/pass/if-expression-04/ast.snap index 82c7a23..ba7bc9d 100644 --- a/crates/fuse-parser/tests/cases/pass/if-expression-04/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/if-expression-04/ast.snap @@ -26,6 +26,7 @@ Some(Chunk( end: 4, ), name: Atom("x"), + reference: None, )), rhs: BinaryOperator(BinaryOperator( kind: LogicalAnd(Span( @@ -38,6 +39,7 @@ Some(Chunk( end: 9, ), name: Atom("y"), + reference: None, )), rhs: Identifier(Identifier( span: Span( @@ -45,6 +47,7 @@ Some(Chunk( end: 15, ), name: Atom("z"), + reference: None, )), )), )), @@ -82,6 +85,7 @@ Some(Chunk( end: 35, ), name: Atom("x"), + reference: None, )), rhs: Identifier(Identifier( span: Span( @@ -89,6 +93,7 @@ Some(Chunk( end: 41, ), name: Atom("y"), + reference: None, )), )), rhs: Identifier(Identifier( @@ -97,6 +102,7 @@ Some(Chunk( end: 46, ), name: Atom("z"), + reference: None, )), )), body: Block( diff --git a/crates/fuse-parser/tests/cases/pass/impl-statement-01/ast.snap b/crates/fuse-parser/tests/cases/pass/impl-statement-01/ast.snap index c3b0934..0e30dd7 100644 --- a/crates/fuse-parser/tests/cases/pass/impl-statement-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/impl-statement-01/ast.snap @@ -23,6 +23,7 @@ Some(Chunk( end: 19, ), name: Atom("Test"), + reference: None, ), ), trait: TypeAnnotation( @@ -32,6 +33,7 @@ Some(Chunk( end: 10, ), name: Atom("Trait"), + reference: None, ), ), methods: [], diff --git a/crates/fuse-parser/tests/cases/pass/impl-statement-02/ast.snap b/crates/fuse-parser/tests/cases/pass/impl-statement-02/ast.snap index 796272f..6e2378e 100644 --- a/crates/fuse-parser/tests/cases/pass/impl-statement-02/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/impl-statement-02/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 19, ), name: Atom("Test"), + reference: None, ), ), trait: TypeAnnotation( @@ -31,6 +32,7 @@ Some(Chunk( end: 10, ), name: Atom("Trait"), + reference: None, ), ), methods: [ @@ -52,6 +54,7 @@ Some(Chunk( end: 28, ), name: Atom("test"), + reference: None, )), params: FunctionParameters( span: Span( @@ -86,6 +89,7 @@ Some(Chunk( end: 46, ), name: Atom("test2"), + reference: None, )), params: FunctionParameters( span: Span( @@ -110,6 +114,7 @@ Some(Chunk( end: 50, ), name: Atom("foo"), + reference: None, ), mutable: false, )), @@ -120,6 +125,7 @@ Some(Chunk( end: 58, ), name: Atom("number"), + reference: None, ), )), optional: false, @@ -142,6 +148,7 @@ Some(Chunk( end: 63, ), name: Atom("bar"), + reference: None, ), mutable: false, )), @@ -152,6 +159,7 @@ Some(Chunk( end: 71, ), name: Atom("number"), + reference: None, ), )), optional: false, @@ -167,6 +175,7 @@ Some(Chunk( end: 80, ), name: Atom("Type"), + reference: None, ), )), ), diff --git a/crates/fuse-parser/tests/cases/pass/parenthesized-expression-02/ast.snap b/crates/fuse-parser/tests/cases/pass/parenthesized-expression-02/ast.snap index 795cbec..871f604 100644 --- a/crates/fuse-parser/tests/cases/pass/parenthesized-expression-02/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/parenthesized-expression-02/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 11, ), name: Atom("identifier"), + reference: None, )), ))), ], diff --git a/crates/fuse-parser/tests/cases/pass/parenthesized-expression-03/ast.snap b/crates/fuse-parser/tests/cases/pass/parenthesized-expression-03/ast.snap index 9020163..9f9ecfe 100644 --- a/crates/fuse-parser/tests/cases/pass/parenthesized-expression-03/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/parenthesized-expression-03/ast.snap @@ -65,6 +65,7 @@ Some(Chunk( end: 27, ), name: Atom("other"), + reference: None, )), )), )), diff --git a/crates/fuse-parser/tests/cases/pass/string-interpolation-03/ast.snap b/crates/fuse-parser/tests/cases/pass/string-interpolation-03/ast.snap index 7afbef5..2fa1394 100644 --- a/crates/fuse-parser/tests/cases/pass/string-interpolation-03/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/string-interpolation-03/ast.snap @@ -24,6 +24,7 @@ Some(Chunk( end: 15, ), name: Atom("world"), + reference: None, )), format: Display, )), diff --git a/crates/fuse-parser/tests/cases/pass/struct-construction-01/ast.snap b/crates/fuse-parser/tests/cases/pass/struct-construction-01/ast.snap index 5fa4634..54df914 100644 --- a/crates/fuse-parser/tests/cases/pass/struct-construction-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/struct-construction-01/ast.snap @@ -18,6 +18,7 @@ Some(Chunk( end: 8, ), name: Atom("MyStruct"), + reference: None, )), construction: ConstructionExpression( span: Span( @@ -36,6 +37,7 @@ Some(Chunk( end: 16, ), name: Atom("first"), + reference: None, ), value: NumberLiteral(NumberLiteral( span: Span( @@ -58,6 +60,7 @@ Some(Chunk( end: 29, ), name: Atom("second"), + reference: None, ), value: NumberLiteral(NumberLiteral( span: Span( diff --git a/crates/fuse-parser/tests/cases/pass/struct-construction-02/ast.snap b/crates/fuse-parser/tests/cases/pass/struct-construction-02/ast.snap index 69c0e8a..097f8b3 100644 --- a/crates/fuse-parser/tests/cases/pass/struct-construction-02/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/struct-construction-02/ast.snap @@ -18,6 +18,7 @@ Some(Chunk( end: 4, ), name: Atom("Test"), + reference: None, )), construction: ConstructionExpression( span: Span( @@ -36,6 +37,7 @@ Some(Chunk( end: 12, ), name: Atom("first"), + reference: None, ), value: StringLiteral(StringLiteral( span: Span( @@ -56,6 +58,7 @@ Some(Chunk( end: 29, ), name: Atom("second"), + reference: None, ))), Spread(SpreadArgument( span: Span( @@ -68,6 +71,7 @@ Some(Chunk( end: 39, ), name: Atom("third"), + reference: None, )), )), ], diff --git a/crates/fuse-parser/tests/cases/pass/struct-declaration-01/ast.snap b/crates/fuse-parser/tests/cases/pass/struct-declaration-01/ast.snap index 872af67..cb5160e 100644 --- a/crates/fuse-parser/tests/cases/pass/struct-declaration-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/struct-declaration-01/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 15, ), name: Atom("MyStruct"), + reference: None, ), fields: [ StructField( @@ -32,6 +33,7 @@ Some(Chunk( end: 23, ), name: Atom("field1"), + reference: None, ), type_annotation: TypeAnnotation( identifier: Identifier( @@ -40,6 +42,7 @@ Some(Chunk( end: 31, ), name: Atom("number"), + reference: None, ), ), ), @@ -51,6 +54,7 @@ Some(Chunk( end: 39, ), name: Atom("field2"), + reference: None, ), type_annotation: TypeAnnotation( identifier: Identifier( @@ -59,6 +63,7 @@ Some(Chunk( end: 47, ), name: Atom("string"), + reference: None, ), ), ), @@ -70,6 +75,7 @@ Some(Chunk( end: 55, ), name: Atom("field3"), + reference: None, ), type_annotation: TypeAnnotation( identifier: Identifier( @@ -78,6 +84,7 @@ Some(Chunk( end: 64, ), name: Atom("boolean"), + reference: None, ), ), ), diff --git a/crates/fuse-parser/tests/cases/pass/tuple-initializer-03/ast.snap b/crates/fuse-parser/tests/cases/pass/tuple-initializer-03/ast.snap index 24e7866..53051e4 100644 --- a/crates/fuse-parser/tests/cases/pass/tuple-initializer-03/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/tuple-initializer-03/ast.snap @@ -23,6 +23,7 @@ Some(Chunk( end: 6, ), name: Atom("first"), + reference: None, ))), ], ))), diff --git a/crates/fuse-parser/tests/cases/pass/variable-assignment-01/ast.snap b/crates/fuse-parser/tests/cases/pass/variable-assignment-01/ast.snap index 31a453f..baf81cc 100644 --- a/crates/fuse-parser/tests/cases/pass/variable-assignment-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/variable-assignment-01/ast.snap @@ -22,6 +22,7 @@ Some(Chunk( end: 1, ), name: Atom("x"), + reference: None, )), rhs: NumberLiteral(NumberLiteral( span: Span( diff --git a/crates/fuse-parser/tests/cases/pass/variable-declaration-01/ast.snap b/crates/fuse-parser/tests/cases/pass/variable-declaration-01/ast.snap index 0038f9c..82eef1b 100644 --- a/crates/fuse-parser/tests/cases/pass/variable-declaration-01/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/variable-declaration-01/ast.snap @@ -29,6 +29,7 @@ Some(Chunk( end: 6, ), name: Atom("id"), + reference: None, ), mutable: false, )), diff --git a/crates/fuse-parser/tests/cases/pass/variable-declaration-02/ast.snap b/crates/fuse-parser/tests/cases/pass/variable-declaration-02/ast.snap index 3a609c7..78c68af 100644 --- a/crates/fuse-parser/tests/cases/pass/variable-declaration-02/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/variable-declaration-02/ast.snap @@ -29,6 +29,7 @@ Some(Chunk( end: 6, ), name: Atom("id"), + reference: None, ), mutable: false, )), diff --git a/crates/fuse-parser/tests/cases/pass/variable-declaration-03/ast.snap b/crates/fuse-parser/tests/cases/pass/variable-declaration-03/ast.snap index b99d1c7..af1da23 100644 --- a/crates/fuse-parser/tests/cases/pass/variable-declaration-03/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/variable-declaration-03/ast.snap @@ -29,6 +29,7 @@ Some(Chunk( end: 11, ), name: Atom("num"), + reference: None, ), mutable: true, )), diff --git a/crates/fuse-parser/tests/cases/pass/variable-declaration-04/ast.snap b/crates/fuse-parser/tests/cases/pass/variable-declaration-04/ast.snap index b55cb9d..c7f3f5b 100644 --- a/crates/fuse-parser/tests/cases/pass/variable-declaration-04/ast.snap +++ b/crates/fuse-parser/tests/cases/pass/variable-declaration-04/ast.snap @@ -29,6 +29,7 @@ Some(Chunk( end: 8, ), name: Atom("PI"), + reference: None, ), mutable: false, )),