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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/fasta/ast_builder.dart
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index f61af91664debeb47f8a0346e893212c739d5f14..7580511ad0e7d1d44dadacb5129acc57205adbaa 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -1421,9 +1421,14 @@ class AstBuilder extends ScopeListener {
@override
void endPartOf(Token partKeyword, Token semicolon, bool hasName) {
debugEvent("PartOf");
- List<SimpleIdentifier> libraryName = pop();
- var name = ast.libraryIdentifier(libraryName);
- StringLiteral uri = null; // TODO(paulberry)
+ var libraryNameOrUri = pop();
+ LibraryIdentifier name;
+ StringLiteral uri;
+ if (libraryNameOrUri is StringLiteral) {
+ uri = libraryNameOrUri;
+ } else {
+ name = ast.libraryIdentifier(libraryNameOrUri);
+ }
// TODO(paulberry,ahe): seems hacky. It would be nice if the parser passed
// in a reference to the "of" keyword.
var ofKeyword = partKeyword.next;
« 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