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

Unified Diff: dart/lib/compiler/implementation/scanner/listener.dart

Issue 11033003: Unparse new library syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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: dart/lib/compiler/implementation/scanner/listener.dart
diff --git a/dart/lib/compiler/implementation/scanner/listener.dart b/dart/lib/compiler/implementation/scanner/listener.dart
index d023b0acb6c318096f9a90f2c9ccc3c67b82721e..3dd58147924e7f7584f09ffb5f5e8797cf338226 100644
--- a/dart/lib/compiler/implementation/scanner/listener.dart
+++ b/dart/lib/compiler/implementation/scanner/listener.dart
@@ -53,6 +53,12 @@ class Listener {
void endCombinators(int count) {
}
+ void beginCompilationUnit(Token token) {
+ }
+
+ void endCompilationUnit(int count, Token token) {
+ }
+
void beginDoWhileStatement(Token token) {
}
@@ -250,6 +256,18 @@ class Listener {
Token beginToken, Token endToken) {
}
+ void beginPart(Token token) {
+ }
+
+ void endPart(Token partKeyword, Token semicolon) {
+ }
+
+ void beginPartOf(Token token) {
+ }
+
+ void endPartOf(Token partKeyword, Token semicolon) {
+ }
+
void beginReturnStatement(Token token) {
}
@@ -662,6 +680,16 @@ class ElementListener extends Listener {
pushNode(makeNodeList(count, null, null, " "));
}
+ void endPart(Token partKeyword, Token semicolon) {
+ LiteralString uri = popLiteralString();
+ addLibraryTag(new Part(partKeyword, uri));
+ }
+
+ void endPartOf(Token partKeyword, Token semicolon) {
+ Expression name = popNode();
+ addLibraryTag(new PartOf(partKeyword, name));
+ }
+
void endScriptTag(bool hasPrefix, Token beginToken, Token endToken) {
LiteralString prefix = null;
Identifier argumentName = null;
@@ -1062,6 +1090,10 @@ class NodeListener extends ElementListener {
NodeListener(DiagnosticListener listener, CompilationUnitElement element)
: super(listener, element, null);
+ void addLibraryTag(LibraryTag tag) {
+ pushNode(tag);
+ }
+
void endArgumentDefinitionTest(Token beginToken, Token endToken) {
pushNode(new Send.prefix(popNode(), new Operator(beginToken)));
}
@@ -1079,6 +1111,10 @@ class NodeListener extends ElementListener {
beginToken, extendsKeyword, body, endToken));
}
+ void endCompilationUnit(int count, Token token) {
+ pushNode(makeNodeList(count, null, null, '\n'));
+ }
+
void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
NodeList formals = popNode();
NodeList typeParameters = popNode();
« no previous file with comments | « dart/lib/compiler/implementation/scanner/keyword.dart ('k') | dart/lib/compiler/implementation/scanner/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698