From a88d3a5c9deb964ce4d7172e1579110f8ebeb747 Mon Sep 17 00:00:00 2001 From: mlokr Date: Fri, 19 Jul 2024 14:24:58 +0200 Subject: [PATCH] t --- hblang/src/parser.rs | 2 +- hblang/text-prj/main.hb | 6 ++++-- hblang/text-prj/pkg.hb | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hblang/src/parser.rs b/hblang/src/parser.rs index be3a7cc..0bb3371 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 4c7bc19..ae98778 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 6dd10a5..5c74adc 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 }