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

Side by Side Diff: pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart

Issue 2749643002: Create DeclaredSimpleIdentifier when parse a declaration 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.analyzer.ast_builder; 5 library fasta.analyzer.ast_builder;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory;
9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard;
10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; 10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 void handleIdentifier(Token token, IdentifierContext context) { 176 void handleIdentifier(Token token, IdentifierContext context) {
177 debugEvent("handleIdentifier"); 177 debugEvent("handleIdentifier");
178 analyzer.Token analyzerToken = toAnalyzerToken(token); 178 analyzer.Token analyzerToken = toAnalyzerToken(token);
179 179
180 if (context.inSymbol) { 180 if (context.inSymbol) {
181 push(analyzerToken); 181 push(analyzerToken);
182 return; 182 return;
183 } 183 }
184 184
185 SimpleIdentifier identifier = ast.simpleIdentifier(analyzerToken); 185 SimpleIdentifier identifier = ast.simpleIdentifier(analyzerToken,
186 isDeclaration: context.inDeclaration);
186 if (context.inLibraryOrPartOfDeclaration) { 187 if (context.inLibraryOrPartOfDeclaration) {
187 if (!context.isContinuation) { 188 if (!context.isContinuation) {
188 push([identifier]); 189 push([identifier]);
189 } else { 190 } else {
190 push(identifier); 191 push(identifier);
191 } 192 }
192 } else if (context == IdentifierContext.enumValueDeclaration) { 193 } else if (context == IdentifierContext.enumValueDeclaration) {
193 // TODO(paulberry): analyzer's ASTs allow for enumerated values to have 194 // TODO(paulberry): analyzer's ASTs allow for enumerated values to have
194 // metadata, but the spec doesn't permit it. 195 // metadata, but the spec doesn't permit it.
195 List<Annotation> metadata; 196 List<Annotation> metadata;
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 } else if (identical('static', s)) { 1599 } else if (identical('static', s)) {
1599 staticKeyword = token; 1600 staticKeyword = token;
1600 } else if (identical('var', s)) { 1601 } else if (identical('var', s)) {
1601 finalConstOrVarKeyword = token; 1602 finalConstOrVarKeyword = token;
1602 } else { 1603 } else {
1603 internalError('Unhandled modifier: $s'); 1604 internalError('Unhandled modifier: $s');
1604 } 1605 }
1605 } 1606 }
1606 } 1607 }
1607 } 1608 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698