Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: pkg/front_end/lib/src/fasta/scanner/array_based_scanner.dart

Issue 2749623003: Revert "Add support for metadata on type variables to Fasta parser." (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.scanner.array_based_scanner; 5 library fasta.scanner.array_based_scanner;
6 6
7 import 'error_token.dart' show ErrorToken; 7 import 'error_token.dart' show ErrorToken;
8 8
9 import 'keyword.dart' show Keyword; 9 import 'keyword.dart' show Keyword;
10 10
11 import 'precedence.dart' show COMMENT_INFO, EOF_INFO, PrecedenceInfo; 11 import 'precedence.dart' show COMMENT_INFO, EOF_INFO, PrecedenceInfo;
12 12
13 import 'token.dart' 13 import 'token.dart'
14 show BeginGroupToken, KeywordToken, StringToken, SymbolToken, Token; 14 show BeginGroupToken, KeywordToken, StringToken, SymbolToken, Token;
15 15
16 import 'token_constants.dart' 16 import 'token_constants.dart'
17 show 17 show LT_TOKEN, OPEN_CURLY_BRACKET_TOKEN, STRING_INTERPOLATION_TOKEN;
18 LT_TOKEN,
19 OPEN_CURLY_BRACKET_TOKEN,
20 OPEN_PAREN_TOKEN,
21 STRING_INTERPOLATION_TOKEN;
22 18
23 import 'characters.dart' show $LF, $STX; 19 import 'characters.dart' show $LF, $STX;
24 20
25 import 'abstract_scanner.dart' show AbstractScanner; 21 import 'abstract_scanner.dart' show AbstractScanner;
26 22
27 import '../util/link.dart' show Link; 23 import '../util/link.dart' show Link;
28 24
29 abstract class ArrayBasedScanner extends AbstractScanner { 25 abstract class ArrayBasedScanner extends AbstractScanner {
30 bool hasErrors = false; 26 bool hasErrors = false;
31 27
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 125 }
130 126
131 /** 127 /**
132 * Appends a token that begins a new group, represented by [info]. 128 * Appends a token that begins a new group, represented by [info].
133 * Group begin tokens are '{', '(', '[' and '${'. 129 * Group begin tokens are '{', '(', '[' and '${'.
134 */ 130 */
135 void appendBeginGroup(PrecedenceInfo info) { 131 void appendBeginGroup(PrecedenceInfo info) {
136 Token token = new BeginGroupToken(info, tokenStart); 132 Token token = new BeginGroupToken(info, tokenStart);
137 appendToken(token); 133 appendToken(token);
138 134
139 // { [ ${ cannot appear inside a type parameters / arguments. 135 // { ( [ ${ cannot appear inside a type parameters / arguments.
140 if (!identical(info.kind, LT_TOKEN) && 136 if (!identical(info.kind, LT_TOKEN)) discardOpenLt();
141 !identical(info.kind, OPEN_PAREN_TOKEN)) {
142 discardOpenLt();
143 }
144 groupingStack = groupingStack.prepend(token); 137 groupingStack = groupingStack.prepend(token);
145 } 138 }
146 139
147 /** 140 /**
148 * Appends a token that begins an end group, represented by [info]. 141 * Appends a token that begins an end group, represented by [info].
149 * It handles the group end tokens '}', ')' and ']'. The tokens '>' and 142 * It handles the group end tokens '}', ')' and ']'. The tokens '>' and
150 * '>>' are handled separately bo [appendGt] and [appendGtGt]. 143 * '>>' are handled separately bo [appendGt] and [appendGtGt].
151 */ 144 */
152 int appendEndGroup(PrecedenceInfo info, int openKind) { 145 int appendEndGroup(PrecedenceInfo info, int openKind) {
153 assert(!identical(openKind, LT_TOKEN)); // openKind is < for > and >> 146 assert(!identical(openKind, LT_TOKEN)); // openKind is < for > and >>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 * something which cannot possibly be part of a type parameter/argument 265 * something which cannot possibly be part of a type parameter/argument
273 * list, like the '=' in the above example. 266 * list, like the '=' in the above example.
274 */ 267 */
275 void discardOpenLt() { 268 void discardOpenLt() {
276 while (!groupingStack.isEmpty && 269 while (!groupingStack.isEmpty &&
277 identical(groupingStack.head.kind, LT_TOKEN)) { 270 identical(groupingStack.head.kind, LT_TOKEN)) {
278 groupingStack = groupingStack.tail; 271 groupingStack = groupingStack.tail;
279 } 272 }
280 } 273 }
281 } 274 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698