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

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

Issue 10441071: Use the typedef arity to know how to invoke a closure given by the dom. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: 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
« no previous file with comments | « dart/lib/compiler/implementation/resolver.dart ('k') | dart/lib/compiler/implementation/typechecker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/scanner/listener.dart
===================================================================
--- dart/lib/compiler/implementation/scanner/listener.dart (revision 8060)
+++ dart/lib/compiler/implementation/scanner/listener.dart (working copy)
@@ -601,8 +601,8 @@
NodeList typeVariables = popNode(); // TOOD(karlklose): do not throw away.
Identifier name = popNode();
TypeAnnotation returnType = popNode();
- pushElement(new TypedefElement(name.source, compilationUnitElement,
- typedefKeyword));
+ pushElement(new PartialTypedefElement(name.source, compilationUnitElement,
+ typedefKeyword));
}
void handleVoidKeyword(Token token) {
@@ -904,7 +904,7 @@
void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
NodeList formals = popNode();
- NodeList typeParameters = null; // TODO(ahe): Don't discard these.
+ NodeList typeParameters = popNode();
Identifier name = popNode();
TypeAnnotation returnType = popNode();
pushNode(new Typedef(returnType, name, typeParameters, formals,
@@ -1510,6 +1510,23 @@
Token position() => beginToken; // findMyName doesn't work. I'm nameless.
}
+class PartialTypedefElement extends TypedefElement {
+ final Token token;
+
+ PartialTypedefElement(SourceString name, Element enclosing, this.token)
+ : super(name, enclosing);
+
+ Node parseNode(DiagnosticListener listener) {
+ if (cachedNode !== null) return cachedNode;
+ cachedNode = parse(listener,
+ getCompilationUnit(),
+ (p) => p.parseTopLevelDeclaration(token));
+ return cachedNode;
+ }
+
+ position() => findMyName(token);
+}
+
Node parse(DiagnosticListener diagnosticListener,
CompilationUnitElement element,
doParse(Parser parser)) {
« no previous file with comments | « dart/lib/compiler/implementation/resolver.dart ('k') | dart/lib/compiler/implementation/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698