From b1deff7fd56cc119ecf3ee73819d048d174a9880 Mon Sep 17 00:00:00 2001 From: dimgigov Date: Mon, 8 Jun 2026 18:56:43 +0300 Subject: [PATCH] fix(selfhost/parser): skip newlines inside multi-import brace blocks parserParseImportDecl now skips tkNewLine tokens inside {..} blocks, matching the bootstrap parser behavior. This fixes parsing of imports with names on separate lines, e.g.: import Std::String::{ String_Eq, String_Len }; Previously the parser failed because it expected tkIdent immediately after { but encountered tkNewLine instead. --- src/parser.bux | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/parser.bux b/src/parser.bux index 7a0e7a8..0f99157 100644 --- a/src/parser.bux +++ b/src/parser.bux @@ -1925,6 +1925,12 @@ func parserParseImportDecl(p: *Parser, isPublic: bool) -> *Decl { discard parserAdvance(p); // { var names: String = ""; while !parserCheck(p, tkRBrace) && parserPeek(p, 0) != tkEndOfFile { + while parserCheck(p, tkNewLine) { + discard parserAdvance(p); + } + if parserCheck(p, tkRBrace) || parserPeek(p, 0) == tkEndOfFile { + break; + } let n: LexToken = parserExpect(p, tkIdent, "expected import name"); names = String_Concat(names, n.text); names = String_Concat(names, ",");