Skip to content

Commit f055c28

Browse files
committed
Throw after consuming the ! when scanning a global tag prefix
1 parent 68665e2 commit f055c28

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkgs/yaml/lib/src/scanner.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,8 +1120,7 @@ class Scanner {
11201120
final buffer = StringBuffer('!');
11211121

11221122
if (_scanner.peekChar() == EXCLAMATION) {
1123-
// TODO: Do we really need this highlighted?
1124-
final char = _scanner.readCodePoint();
1123+
buffer.writeCharCode(_scanner.readChar());
11251124

11261125
if (isGlobalTagPrefix) {
11271126
throw YamlException(
@@ -1130,8 +1129,6 @@ class Scanner {
11301129
_scanner.spanFrom(start),
11311130
);
11321131
}
1133-
1134-
buffer.writeCharCode(char);
11351132
} else {
11361133
// Both %TAG and tag shorthands can have named handles.
11371134
buffer.write(_scanTagUri(flowSeparators: false));

0 commit comments

Comments
 (0)