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

Side by Side Diff: pkg/front_end/lib/src/fasta/source/stack_listener.dart

Issue 2727753002: Parse InstanceCreationExpression with Fasta. (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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.stack_listener; 5 library fasta.stack_listener;
6 6
7 import 'package:front_end/src/fasta/parser.dart' show ErrorKind, Listener; 7 import 'package:front_end/src/fasta/parser.dart' show ErrorKind, Listener;
8 8
9 import 'package:front_end/src/fasta/parser/identifier_context.dart' 9 import 'package:front_end/src/fasta/parser/identifier_context.dart'
10 show IdentifierContext; 10 show IdentifierContext;
11 11
12 import 'package:front_end/src/fasta/scanner.dart' show BeginGroupToken, Token; 12 import 'package:front_end/src/fasta/scanner.dart' show BeginGroupToken, Token;
13 13
14 import 'package:kernel/ast.dart' show AsyncMarker; 14 import 'package:kernel/ast.dart' show AsyncMarker;
15 15
16 import '../errors.dart' show inputError, internalError; 16 import '../errors.dart' show inputError, internalError;
17 17
18 import '../quote.dart' show unescapeString; 18 import '../quote.dart' show unescapeString;
19 19
20 import '../messages.dart' as messages; 20 import '../messages.dart' as messages;
21 21
22 enum NullValue { 22 enum NullValue {
23 Arguments, 23 Arguments,
24 Block, 24 Block,
25 BreakTarget, 25 BreakTarget,
26 CascadeReceiver, 26 CascadeReceiver,
27 Combinators, 27 Combinators,
28 ConditionalUris, 28 ConditionalUris,
29 ConstructorReferenceContinuationAfterTypeArguments,
29 ContinueTarget, 30 ContinueTarget,
30 Expression, 31 Expression,
31 FieldInitializer, 32 FieldInitializer,
32 FormalParameters, 33 FormalParameters,
33 FunctionBody, 34 FunctionBody,
34 IdentifierList, 35 IdentifierList,
35 Initializers, 36 Initializers,
36 Metadata, 37 Metadata,
37 Modifiers, 38 Modifiers,
38 ParameterDefaultValue, 39 ParameterDefaultValue,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 push(NullValue.TypeArguments); 148 push(NullValue.TypeArguments);
148 } 149 }
149 150
150 @override 151 @override
151 void handleNoTypeVariables(Token token) { 152 void handleNoTypeVariables(Token token) {
152 debugEvent("NoTypeVariables"); 153 debugEvent("NoTypeVariables");
153 push(NullValue.TypeVariables); 154 push(NullValue.TypeVariables);
154 } 155 }
155 156
156 @override 157 @override
158 void handleNoConstructorReferenceContinuationAfterTypeArguments(Token token) {
159 debugEvent("NoConstructorReferenceContinuationAfterTypeArguments");
160 }
161
162 @override
157 void handleNoType(Token token) { 163 void handleNoType(Token token) {
158 debugEvent("NoType"); 164 debugEvent("NoType");
159 push(NullValue.Type); 165 push(NullValue.Type);
160 } 166 }
161 167
162 @override 168 @override
163 void handleNoFormalParameters(Token token) { 169 void handleNoFormalParameters(Token token) {
164 debugEvent("NoFormalParameters"); 170 debugEvent("NoFormalParameters");
165 push(NullValue.FormalParameters); 171 push(NullValue.FormalParameters);
166 } 172 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 list.setRange(0, arrayLength, array); 291 list.setRange(0, arrayLength, array);
286 return list; 292 return list;
287 } 293 }
288 294
289 void _grow() { 295 void _grow() {
290 final List newTable = new List(array.length * 2); 296 final List newTable = new List(array.length * 2);
291 newTable.setRange(0, array.length, array, 0); 297 newTable.setRange(0, array.length, array, 0);
292 array = newTable; 298 array = newTable;
293 } 299 }
294 } 300 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698