From d7a7433843cf408c825c7f9efaeb436e5fc31f87 Mon Sep 17 00:00:00 2001 From: bashir Date: Tue, 30 Dec 2025 22:34:31 +0200 Subject: [PATCH] [Lexer] Close comment on //*/ instead of opening a nested one --- Sources/SwiftParser/Lexer/Cursor.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/SwiftParser/Lexer/Cursor.swift b/Sources/SwiftParser/Lexer/Cursor.swift index d55f6024068..4f1651362df 100644 --- a/Sources/SwiftParser/Lexer/Cursor.swift +++ b/Sources/SwiftParser/Lexer/Cursor.swift @@ -765,6 +765,12 @@ extension Lexer.Cursor { case "/": // Check for a '/*' if self.advance(matching: "*") { + if self.advance(matching: "/") { + depth -= 1 + if depth == 0 { + break LOOP + } + } depth += 1 }