This commit is contained in:
mlokr 2024-07-19 14:24:58 +02:00
parent 7c7a4e4edf
commit 999906cd73
3 changed files with 8 additions and 5 deletions

View file

@ -1001,7 +1001,7 @@ impl<'a> std::fmt::Display for Expr<'a> {
pub fn insert_needed_semicolon(source: &str) -> bool { pub fn insert_needed_semicolon(source: &str) -> bool {
let kind = lexer::Lexer::new(source).next().kind; let kind = lexer::Lexer::new(source).next().kind;
kind.precedence().is_some() || matches!(kind, TokenKind::Struct | TokenKind::Tupl) kind.precedence().is_some() || matches!(kind, TokenKind::Ctor | TokenKind::Tupl)
} }
#[repr(C)] #[repr(C)]

View file

@ -1,5 +1,7 @@
.{ global, fib } := @use("pkg.hb"); foo := 0;
.{global, fib} := @use("pkg.hb")
main := fn(a: int): int { main := fn(a: int): int {
return fib(global); return fib(global)
} }

View file

@ -1,5 +1,6 @@
global := 10; global := 10
fib := fn(n: int): int { fib := fn(n: int): int {
return n + 1; return n + 1
} }