Index: pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart |
diff --git a/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart b/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart |
index f98242cda29804f83b275aafc50dd5767b6e0a78..5e4f34518739517d5d057bd244bcaad369932c36 100644 |
--- a/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart |
+++ b/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart |
@@ -11,7 +11,7 @@ import 'dart:typed_data' show Uint16List, Uint32List; |
import '../scanner.dart' |
show ErrorToken, Scanner, buildUnexpectedCharacterToken; |
-import 'error_token.dart' show UnmatchedToken, UnterminatedToken; |
+import 'error_token.dart' show UnterminatedToken; |
import 'keyword.dart' show KeywordState, Keyword; |
@@ -1116,57 +1116,6 @@ abstract class AbstractScanner implements Scanner { |
return -1; |
} |
} |
- |
- void unmatchedBeginGroup(BeginGroupToken begin) { |
- // We want to ensure that unmatched BeginGroupTokens are reported as |
- // errors. However, the diet parser assumes that groups are well-balanced |
- // and will never look at the endGroup token. This is a nice property that |
- // allows us to skip quickly over correct code. By inserting an additional |
- // synthetic token in the stream, we can keep ignoring endGroup tokens. |
- // |
- // [begin] --next--> [tail] |
- // [begin] --endG--> [synthetic] --next--> [next] --next--> [tail] |
- // |
- // This allows the diet parser to skip from [begin] via endGroup to |
- // [synthetic] and ignore the [synthetic] token (assuming it's correct), |
- // then the error will be reported when parsing the [next] token. |
- // |
- // For example, tokenize("{[1};") produces: |
- // |
- // SymbolToken({) --endGroup-----+ |
- // | | |
- // next | |
- // v | |
- // SymbolToken([) --endGroup--+ | |
- // | | | |
- // next | | |
- // v | | |
- // StringToken(1) | | |
- // | v | |
- // next SymbolToken(]) | <- Synthetic token. |
- // | | | |
- // | next | |
- // v | | |
- // UnmatchedToken([)<---------+ | |
- // | | |
- // next | |
- // v | |
- // SymbolToken(})<---------------+ |
- // | |
- // next |
- // v |
- // SymbolToken(;) |
- // | |
- // next |
- // v |
- // EOF |
- Token synthetic = |
- new SymbolToken(closeBraceInfoFor(begin), begin.charOffset); |
- UnmatchedToken next = new UnmatchedToken(begin); |
- begin.endGroup = synthetic; |
- synthetic.next = next; |
- appendErrorToken(next); |
- } |
} |
PrecedenceInfo closeBraceInfoFor(BeginGroupToken begin) { |