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

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

Issue 1878253002: Adds support for remaining generic method syntax constructs. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Review 2 response Created 4 years, 8 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
« no previous file with comments | « pkg/compiler/lib/src/parser/parser.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dart2js.scanner.array_based; 5 library dart2js.scanner.array_based;
6 6
7 import '../io/source_file.dart' show SourceFile; 7 import '../io/source_file.dart' show SourceFile;
8 import '../tokens/keyword.dart' show Keyword; 8 import '../tokens/keyword.dart' show Keyword;
9 import '../tokens/precedence.dart' show PrecedenceInfo; 9 import '../tokens/precedence.dart' show PrecedenceInfo;
10 import '../tokens/precedence_constants.dart' as Precedence 10 import '../tokens/precedence_constants.dart' as Precedence
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 appendPrecedenceToken(no); 56 appendPrecedenceToken(no);
57 return next; 57 return next;
58 } 58 }
59 } 59 }
60 60
61 /** 61 /**
62 * Appends a keyword token whose kind is determined by [keyword]. 62 * Appends a keyword token whose kind is determined by [keyword].
63 */ 63 */
64 void appendKeywordToken(Keyword keyword) { 64 void appendKeywordToken(Keyword keyword) {
65 String syntax = keyword.syntax; 65 String syntax = keyword.syntax;
66 // Type parameters and arguments cannot contain 'this' or 'super'. 66 // Type parameters and arguments cannot contain 'this'.
67 if (identical(syntax, 'this') || identical(syntax, 'super')) { 67 if (identical(syntax, 'this')) {
68 discardOpenLt(); 68 discardOpenLt();
69 } 69 }
70 tail.next = new KeywordToken(keyword, tokenStart); 70 tail.next = new KeywordToken(keyword, tokenStart);
71 tail = tail.next; 71 tail = tail.next;
72 } 72 }
73 73
74 void appendEofToken() { 74 void appendEofToken() {
75 beginToken(); 75 beginToken();
76 discardOpenLt(); 76 discardOpenLt();
77 while (!groupingStack.isEmpty) { 77 while (!groupingStack.isEmpty) {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 * something which cannot possibly be part of a type parameter/argument 225 * something which cannot possibly be part of a type parameter/argument
226 * list, like the '=' in the above example. 226 * list, like the '=' in the above example.
227 */ 227 */
228 void discardOpenLt() { 228 void discardOpenLt() {
229 while (!groupingStack.isEmpty && 229 while (!groupingStack.isEmpty &&
230 identical(groupingStack.head.kind, Tokens.LT_TOKEN)) { 230 identical(groupingStack.head.kind, Tokens.LT_TOKEN)) {
231 groupingStack = groupingStack.tail; 231 groupingStack = groupingStack.tail;
232 } 232 }
233 } 233 }
234 } 234 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/parser/parser.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698