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

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

Issue 3001003002: update AstBuilder to support part of <uri> (Closed)
Patch Set: Created 3 years, 4 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' show Token, TokenType; 10 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType;
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 StringLiteral uri = pop(); 1414 StringLiteral uri = pop();
1415 List<Annotation> metadata = pop(); 1415 List<Annotation> metadata = pop();
1416 Comment comment = pop(); 1416 Comment comment = pop();
1417 directives 1417 directives
1418 .add(ast.partDirective(comment, metadata, partKeyword, uri, semicolon)); 1418 .add(ast.partDirective(comment, metadata, partKeyword, uri, semicolon));
1419 } 1419 }
1420 1420
1421 @override 1421 @override
1422 void endPartOf(Token partKeyword, Token semicolon, bool hasName) { 1422 void endPartOf(Token partKeyword, Token semicolon, bool hasName) {
1423 debugEvent("PartOf"); 1423 debugEvent("PartOf");
1424 List<SimpleIdentifier> libraryName = pop(); 1424 var libraryNameOrUri = pop();
1425 var name = ast.libraryIdentifier(libraryName); 1425 LibraryIdentifier name;
1426 StringLiteral uri = null; // TODO(paulberry) 1426 StringLiteral uri;
1427 if (libraryNameOrUri is StringLiteral) {
1428 uri = libraryNameOrUri;
1429 } else {
1430 name = ast.libraryIdentifier(libraryNameOrUri);
1431 }
1427 // TODO(paulberry,ahe): seems hacky. It would be nice if the parser passed 1432 // TODO(paulberry,ahe): seems hacky. It would be nice if the parser passed
1428 // in a reference to the "of" keyword. 1433 // in a reference to the "of" keyword.
1429 var ofKeyword = partKeyword.next; 1434 var ofKeyword = partKeyword.next;
1430 List<Annotation> metadata = pop(); 1435 List<Annotation> metadata = pop();
1431 Comment comment = pop(); 1436 Comment comment = pop();
1432 directives.add(ast.partOfDirective( 1437 directives.add(ast.partOfDirective(
1433 comment, metadata, partKeyword, ofKeyword, uri, name, semicolon)); 1438 comment, metadata, partKeyword, ofKeyword, uri, name, semicolon));
1434 } 1439 }
1435 1440
1436 @override 1441 @override
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 } else if (identical('var', s)) { 2011 } else if (identical('var', s)) {
2007 finalConstOrVarKeyword = token; 2012 finalConstOrVarKeyword = token;
2008 } else if (identical('covariant', s)) { 2013 } else if (identical('covariant', s)) {
2009 covariantKeyword = token; 2014 covariantKeyword = token;
2010 } else { 2015 } else {
2011 unhandled("$s", "modifier", token.charOffset, null); 2016 unhandled("$s", "modifier", token.charOffset, null);
2012 } 2017 }
2013 } 2018 }
2014 } 2019 }
2015 } 2020 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_fasta_test.dart » ('j') | pkg/analyzer/test/generated/parser_fasta_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698