diff --git a/schala-lang/language/src/parsing/test.rs b/schala-lang/language/src/parsing/test.rs index ab07aec..4f2b64c 100644 --- a/schala-lang/language/src/parsing/test.rs +++ b/schala-lang/language/src/parsing/test.rs @@ -165,6 +165,27 @@ fn parsing_identifiers() { }; } + +#[test] +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)])))), + })) + } + + parse_test_wrap_ast! { + "thing::item::call()", + exst!(Call { f: bx![ex!(m Value(QualifiedName(vec![rc!(thing), rc!(item), rc!(call)])))], arguments: vec![] }) + } +} + +#[test] +fn reserved_words() { + parse_error!("module::item::call()"); +} + #[test] fn parsing_complicated_operators() { parse_test!("a <- b", AST(vec![exst!(binexp!("<-", val!("a"), val!("b")))]));