diff --git a/schala-lang/language/src/ast.rs b/schala-lang/language/src/ast.rs index bc300ff..7b06876 100644 --- a/schala-lang/language/src/ast.rs +++ b/schala-lang/language/src/ast.rs @@ -151,7 +151,7 @@ pub enum ExpressionKind { BinExp(BinOp, Box>, Box>), PrefixExp(PrefixOp, Box>), TupleLiteral(Vec>), - Value(QualifiedName), + Value(Meta), NamedStruct { name: QualifiedName, fields: Vec<(Rc, Meta)>, diff --git a/schala-lang/language/src/parsing.rs b/schala-lang/language/src/parsing.rs index 71cdd8d..245a898 100644 --- a/schala-lang/language/src/parsing.rs +++ b/schala-lang/language/src/parsing.rs @@ -765,7 +765,7 @@ impl Parser { let fields = self.record_block()?; Expression::new(NamedStruct { name: qualified_identifier, fields }) }, - _ => Expression::new(Value(qualified_identifier)) + _ => Expression::new(Value(Meta::new(qualified_identifier))) }) } diff --git a/schala-lang/language/src/parsing/test.rs b/schala-lang/language/src/parsing/test.rs index 6bf3cde..60304c4 100644 --- a/schala-lang/language/src/parsing/test.rs +++ b/schala-lang/language/src/parsing/test.rs @@ -30,7 +30,7 @@ macro_rules! parse_error { ($string:expr) => { assert!(parse($string).is_err()) } } macro_rules! val { - ($var:expr) => { Value(QualifiedName(vec![Rc::new($var.to_string())])) }; + ($var:expr) => { Value(Meta::new(QualifiedName(vec![Rc::new($var.to_string())]))) }; } macro_rules! ty { ($name:expr) => { Singleton(tys!($name)) } @@ -171,13 +171,13 @@ fn qualified_identifiers() { parse_test_wrap_ast! { "let q_q = Yolo::Swaggins", Meta::new(Declaration(Binding { name: rc!(q_q), constant: true, type_anno: None, - expr: Meta::new(Expression::new(Value(QualifiedName(vec![rc!(Yolo), rc!(Swaggins)])))), + expr: Meta::new(Expression::new(Value(Meta::new(QualifiedName(vec![rc!(Yolo), rc!(Swaggins)]))))), })) } parse_test_wrap_ast! { "thing::item::call()", - exst!(Call { f: bx![ex!(m Value(QualifiedName(vec![rc!(thing), rc!(item), rc!(call)])))], arguments: vec![] }) + exst!(Call { f: bx![ex!(m Value(Meta::new(QualifiedName(vec![rc!(thing), rc!(item), rc!(call)]))))], arguments: vec![] }) } } diff --git a/schala-lang/language/src/scope_resolution.rs b/schala-lang/language/src/scope_resolution.rs index f963601..5098475 100644 --- a/schala-lang/language/src/scope_resolution.rs +++ b/schala-lang/language/src/scope_resolution.rs @@ -31,7 +31,7 @@ impl ScopeResolver { let inner_expr = expr.mut_node(); match &mut inner_expr.kind { ExpressionKind::Value(qualified_name) => { - let fqsn = lookup_name_in_scope(&qualified_name); + let fqsn = lookup_name_in_scope(&qualified_name.node()); expr.fqsn = Some(fqsn); }, NamedStruct { name, .. } => { diff --git a/schala-lang/language/src/typechecking.rs b/schala-lang/language/src/typechecking.rs index 940bf2d..3f69291 100644 --- a/schala-lang/language/src/typechecking.rs +++ b/schala-lang/language/src/typechecking.rs @@ -317,7 +317,7 @@ impl<'a> TypeContext<'a> { PrefixExp(op, expr) => self.prefix(op, expr.node())?, BinExp(op, lhs, rhs) => self.binexp(op, lhs.node(), rhs.node())?, IfExpression { discriminator, body } => self.if_expr(discriminator, body)?, - Value(val) => self.handle_value(val)?, + Value(val) => self.handle_value(val.node())?, Call { box ref f, arguments } => self.call(f, arguments)?, Lambda { params, type_anno, body } => self.lambda(params, type_anno, body)?, _ => ty!(Unit),