From aad4b5c22e5e122941d32dbfff7b6e4eb6d24ef8 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 30 Dec 2024 21:40:47 -0500 Subject: [PATCH] Errors on unmatched brackets --- lib/src/parse/stylesheet.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/parse/stylesheet.dart b/lib/src/parse/stylesheet.dart index 19d2d6929..165b3bec6 100644 --- a/lib/src/parse/stylesheet.dart +++ b/lib/src/parse/stylesheet.dart @@ -2905,7 +2905,10 @@ abstract class StylesheetParser extends Parser { brackets.add(opposite(bracket)); case $rparen || $rbracket: - if (brackets.isEmpty) break loop; + if (brackets.isEmpty) { + scanner.error( + 'Unexpected "${String.fromCharCode(scanner.peekChar()!)}".'); + } var bracket = brackets.removeLast(); scanner.expectChar(bracket); buffer.writeCharCode(bracket);