Skip to content

Commit

Permalink
Errors on unmatched brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnw committed Dec 31, 2024
1 parent 233d774 commit aad4b5c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/parse/stylesheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit aad4b5c

Please sign in to comment.