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

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

Issue 10698096: Reapply "Make patch file import declarations apply to the patched library too." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/lib/math.dartp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #library('elements'); 5 #library('elements');
6 6
7 #import('../tree/tree.dart'); 7 #import('../tree/tree.dart');
8 #import('../scanner/scannerlib.dart'); 8 #import('../scanner/scannerlib.dart');
9 #import('../leg.dart'); // TODO(karlklose): we only need type. 9 #import('../leg.dart'); // TODO(karlklose): we only need type.
10 #import('../util/util.dart'); 10 #import('../util/util.dart');
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // Use the file name as script name. 379 // Use the file name as script name.
380 var path = script.uri.path; 380 var path = script.uri.path;
381 return path.substring(path.lastIndexOf('/') + 1); 381 return path.substring(path.lastIndexOf('/') + 1);
382 } 382 }
383 } 383 }
384 } 384 }
385 385
386 class PrefixElement extends Element { 386 class PrefixElement extends Element {
387 Map<SourceString, Element> imported; 387 Map<SourceString, Element> imported;
388 Token firstPosition; 388 Token firstPosition;
389 final CompilationUnitElement patchSource;
389 390
390 PrefixElement(SourceString prefix, Element enclosing, this.firstPosition) 391 PrefixElement(SourceString prefix, Element enclosing, this.firstPosition,
392 [this.patchSource])
391 : imported = new Map<SourceString, Element>(), 393 : imported = new Map<SourceString, Element>(),
392 super(prefix, ElementKind.PREFIX, enclosing); 394 super(prefix, ElementKind.PREFIX, enclosing);
393 395
396 CompilationUnitElement getCompilationUnit() {
397 if (patchSource !== null) return patchSource;
398 return super.getCompilationUnit();
399 }
400
394 lookupLocalMember(SourceString memberName) => imported[memberName]; 401 lookupLocalMember(SourceString memberName) => imported[memberName];
395 402
396 Type computeType(Compiler compiler) => compiler.types.dynamicType; 403 Type computeType(Compiler compiler) => compiler.types.dynamicType;
397 404
398 Token position() => firstPosition; 405 Token position() => firstPosition;
399 } 406 }
400 407
401 class TypedefElement extends Element { 408 class TypedefElement extends Element {
402 Type cachedType; 409 Type cachedType;
403 Typedef cachedNode; 410 Typedef cachedNode;
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 final Node node; 1136 final Node node;
1130 Type bound; 1137 Type bound;
1131 Type type; 1138 Type type;
1132 TypeVariableElement(name, Element enclosing, this.node, this.type, 1139 TypeVariableElement(name, Element enclosing, this.node, this.type,
1133 [this.bound]) 1140 [this.bound])
1134 : super(name, ElementKind.TYPE_VARIABLE, enclosing); 1141 : super(name, ElementKind.TYPE_VARIABLE, enclosing);
1135 Type computeType(compiler) => type; 1142 Type computeType(compiler) => type;
1136 Node parseNode(compiler) => node; 1143 Node parseNode(compiler) => node;
1137 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; 1144 toString() => "${enclosingElement.toString()}.${name.slowToString()}";
1138 } 1145 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/lib/math.dartp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698