diff --git a/hblang/src/parser.rs b/hblang/src/parser.rs index be3a7cc3..0bb33711 100644 --- a/hblang/src/parser.rs +++ b/hblang/src/parser.rs @@ -1001,7 +1001,7 @@ impl<'a> std::fmt::Display for Expr<'a> { pub fn insert_needed_semicolon(source: &str) -> bool { 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)] diff --git a/hblang/text-prj/main.hb b/hblang/text-prj/main.hb index 4c7bc19c..ae987781 100644 --- a/hblang/text-prj/main.hb +++ b/hblang/text-prj/main.hb @@ -1,5 +1,7 @@ -.{ global, fib } := @use("pkg.hb"); +foo := 0; +.{global, fib} := @use("pkg.hb") + main := fn(a: int): int { - return fib(global); + return fib(global) } diff --git a/hblang/text-prj/pkg.hb b/hblang/text-prj/pkg.hb index 6dd10a5e..5c74adc7 100644 --- a/hblang/text-prj/pkg.hb +++ b/hblang/text-prj/pkg.hb @@ -1,5 +1,6 @@ -global := 10; +global := 10 + fib := fn(n: int): int { - return n + 1; + return n + 1 }