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

Side by Side Diff: lib/compiler/implementation/compiler.dart

Issue 10834061: Resolve typedefs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated scope handling and type resolution Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 final bool REPORT_EXCESS_RESOLUTION = false; 10 final bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 boolClass = lookupSpecialClass(const SourceString('bool')); 464 boolClass = lookupSpecialClass(const SourceString('bool'));
465 numClass = lookupSpecialClass(const SourceString('num')); 465 numClass = lookupSpecialClass(const SourceString('num'));
466 intClass = lookupSpecialClass(const SourceString('int')); 466 intClass = lookupSpecialClass(const SourceString('int'));
467 doubleClass = lookupSpecialClass(const SourceString('double')); 467 doubleClass = lookupSpecialClass(const SourceString('double'));
468 stringClass = lookupSpecialClass(const SourceString('String')); 468 stringClass = lookupSpecialClass(const SourceString('String'));
469 functionClass = lookupSpecialClass(const SourceString('Function')); 469 functionClass = lookupSpecialClass(const SourceString('Function'));
470 listClass = lookupSpecialClass(const SourceString('List')); 470 listClass = lookupSpecialClass(const SourceString('List'));
471 closureClass = lookupSpecialClass(const SourceString('Closure')); 471 closureClass = lookupSpecialClass(const SourceString('Closure'));
472 dynamicClass = lookupSpecialClass(const SourceString('Dynamic')); 472 dynamicClass = lookupSpecialClass(const SourceString('Dynamic'));
473 nullClass = lookupSpecialClass(const SourceString('Null')); 473 nullClass = lookupSpecialClass(const SourceString('Null'));
474 types = new Types(dynamicClass); 474 types = new Types(this, dynamicClass);
475 if (!coreLibValid) { 475 if (!coreLibValid) {
476 cancel('core library does not contain required classes'); 476 cancel('core library does not contain required classes');
477 } 477 }
478 478
479 jsIndexingBehaviorInterface = 479 jsIndexingBehaviorInterface =
480 findHelper(const SourceString('JavaScriptIndexingBehavior')); 480 findHelper(const SourceString('JavaScriptIndexingBehavior'));
481 } 481 }
482 482
483 void scanBuiltinLibraries() { 483 void scanBuiltinLibraries() {
484 coreImplLibrary = scanBuiltinLibrary('coreimpl'); 484 coreImplLibrary = scanBuiltinLibrary('coreimpl');
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 return withCurrentElement(element, 920 return withCurrentElement(element,
921 () => resolver.resolveSignature(element)); 921 () => resolver.resolveSignature(element));
922 } 922 }
923 923
924 FunctionSignature resolveFunctionExpression(Element element, 924 FunctionSignature resolveFunctionExpression(Element element,
925 FunctionExpression node) { 925 FunctionExpression node) {
926 return withCurrentElement(element, 926 return withCurrentElement(element,
927 () => resolver.resolveFunctionExpression(element, node)); 927 () => resolver.resolveFunctionExpression(element, node));
928 } 928 }
929 929
930 FunctionSignature resolveTypedef(TypedefElement element) { 930 void resolveTypedef(TypedefElement element) {
931 return withCurrentElement(element, 931 withCurrentElement(element,
932 () => resolver.resolveTypedef(element)); 932 () => resolver.resolveTypedef(element));
933 } 933 }
934 934
935 FunctionType computeFunctionType(Element element, 935 FunctionType computeFunctionType(Element element,
936 FunctionSignature signature) { 936 FunctionSignature signature) {
937 return withCurrentElement(element, 937 return withCurrentElement(element,
938 () => resolver.computeFunctionType(element, signature)); 938 () => resolver.computeFunctionType(element, signature));
939 } 939 }
940 940
941 Constant compileVariable(VariableElement element) { 941 Constant compileVariable(VariableElement element) {
942 return withCurrentElement(element, () { 942 return withCurrentElement(element, () {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 final endOffset = end.charOffset + end.slowCharCount; 1091 final endOffset = end.charOffset + end.slowCharCount;
1092 1092
1093 // [begin] and [end] might be the same for the same empty token. This 1093 // [begin] and [end] might be the same for the same empty token. This
1094 // happens for instance when scanning '$$'. 1094 // happens for instance when scanning '$$'.
1095 assert(endOffset >= beginOffset); 1095 assert(endOffset >= beginOffset);
1096 return f(beginOffset, endOffset); 1096 return f(beginOffset, endOffset);
1097 } 1097 }
1098 1098
1099 String toString() => 'SourceSpan($uri, $begin, $end)'; 1099 String toString() => 'SourceSpan($uri, $begin, $end)';
1100 } 1100 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/elements/elements.dart » ('j') | lib/compiler/implementation/elements/elements.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698