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

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

Issue 10310040: Sort the output (for now just the classes and instance members). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove (now) unnecessary changes. Created 8 years, 7 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: lib/compiler/implementation/scanner/listener.dart
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
index cb986b4c08dd3bb63de7d14563f296751fc893ac..1b153354b228ea7ce4015918ebccfd1d27ce1cf4 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -500,6 +500,7 @@ class ParserError {
* [compilationUnitElement].
*/
class ElementListener extends Listener {
+ Function idGenerator;
final DiagnosticListener listener;
final CompilationUnitElement compilationUnitElement;
final StringValidator stringValidator;
@@ -508,8 +509,10 @@ class ElementListener extends Listener {
Link<Node> nodes = const EmptyLink<Node>();
ElementListener(DiagnosticListener listener,
- CompilationUnitElement this.compilationUnitElement)
+ CompilationUnitElement this.compilationUnitElement,
+ int idGenerator())
: this.listener = listener,
+ this.idGenerator = idGenerator,
stringValidator = new StringValidator(listener),
interpolationScope = const EmptyLink<StringQuoting>();
@@ -558,8 +561,9 @@ class ElementListener extends Listener {
TypeAnnotation supertype = popNode();
NodeList typeParameters = popNode();
Identifier name = popNode();
+ int id = idGenerator();
ClassElement element = new PartialClassElement(
- name.source, beginToken, endToken, compilationUnitElement);
+ name.source, beginToken, endToken, compilationUnitElement, id);
element.nativeName = nativeName;
pushElement(element);
}
@@ -582,9 +586,9 @@ class ElementListener extends Listener {
makeNodeList(supertypeCount, extendsKeyword, null, ",");
NodeList typeParameters = popNode();
Identifier name = popNode();
- pushElement(new PartialClassElement(name.source, interfaceKeyword,
- endToken,
- compilationUnitElement));
+ int id = idGenerator();
+ pushElement(new PartialClassElement(
+ name.source, interfaceKeyword, endToken, compilationUnitElement, id));
}
void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
@@ -877,7 +881,7 @@ class ElementListener extends Listener {
class NodeListener extends ElementListener {
NodeListener(DiagnosticListener listener, CompilationUnitElement element)
- : super(listener, element);
+ : super(listener, element, null);
void endClassDeclaration(int interfacesCount, Token beginToken,
Token extendsKeyword, Token implementsKeyword,

Powered by Google App Engine
This is Rietveld 408576698