From bbe9fd255d6575d9f95ecf6166888f3e8db6f679 Mon Sep 17 00:00:00 2001 From: Jaime Humberto Macias Bustamante Date: Sun, 3 Aug 2025 21:46:04 -0700 Subject: [PATCH] fixed `package` parsing issue --- hscript/Parser.hx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hscript/Parser.hx b/hscript/Parser.hx index ade871c..ff75805 100644 --- a/hscript/Parser.hx +++ b/hscript/Parser.hx @@ -959,12 +959,13 @@ class Parser { mk(EFunction(inf.args, inf.body, name, inf.ret, nextIsPublic, nextIsStatic, nextIsOverride, nextIsPrivate, nextIsFinal, nextIsInline),p1,pmax(inf.body)); case "package": var tk = token(); - if(tk == TSemicolon) - mk(EPackage(null), p1); - push(tk); + if(tk == TSemicolon) + return mk(EPackage(null), p1); + var pkg:String = parsePath().join('.'); ensure(TSemicolon); + push(TSemicolon); mk(EPackage(pkg), p1); case "import" | "using": var isUsing = id == "using";