feat: add managed types, source classes and scoped native calls

This commit is contained in:
2026-10-21 01:47:08 +08:00
parent 7c842789c0
commit a970fd7707
48 changed files with 2069 additions and 134 deletions
+3 -4
View File
@@ -4,7 +4,9 @@ use frontend::ast::{
use frontend::{DiagnosticKind, Span, TokenKind, lex, parse, parse_expression};
fn function(program: &Program, index: usize) -> &Function {
let DeclKind::Function(function) = &program.declarations[index].kind;
let DeclKind::Function(function) = &program.declarations[index].kind else {
panic!("expected function")
};
function
}
@@ -258,14 +260,11 @@ fn parser_requires_complete_input_and_rejects_unimplemented_or_malformed_syntax(
"// empty",
"let x = 1",
"use atelier:shop.data",
"class Product {}",
"agent Worker {}",
"function f() { return 1 }",
"function f(x): Number { return x }",
"function f(x: Number,): Number { return x }",
"function f(): Number {}",
"function f(): Number { return 1 let x = 2 }",
"function f(): Number { let x = 1 }",
"function f(): Number { return 1 } extra",
"function f(): Number { function g(): Number { return 1 } return 2 }",
] {