Skip to content

Commit febb0d8

Browse files
committed
Throw after consuming the ! when scanning a global tag prefix
1 parent 36c9ea5 commit febb0d8

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
@@ -1111,8 +1111,7 @@ class Scanner {
11111111
final buffer = StringBuffer('!');
11121112

11131113
if (_scanner.peekChar() == EXCLAMATION) {
1114-
// TODO: Do we really need this highlighted?
1115-
final char = _scanner.readCodePoint();
1114+
buffer.writeCharCode(_scanner.readChar());
11161115

11171116
if (isGlobalTagPrefix) {
11181117
throw YamlException(
@@ -1121,8 +1120,6 @@ class Scanner {
11211120
_scanner.spanFrom(start),
11221121
);
11231122
}
1124-
1125-
buffer.writeCharCode(char);
11261123
} else {
11271124
// Both %TAG and tag shorthands can have named handles.
11281125
buffer.write(_scanTagUri(flowSeparators: false));

0 commit comments

Comments
 (0)