feat: add managed types, source classes and scoped native calls
This commit is contained in:
@@ -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 }",
|
||||
] {
|
||||
|
||||
Reference in New Issue
Block a user