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

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

Issue 10704080: Revert "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;
390 389
391 PrefixElement(SourceString prefix, Element enclosing, this.firstPosition, 390 PrefixElement(SourceString prefix, Element enclosing, this.firstPosition)
392 [this.patchSource])
393 : imported = new Map<SourceString, Element>(), 391 : imported = new Map<SourceString, Element>(),
394 super(prefix, ElementKind.PREFIX, enclosing); 392 super(prefix, ElementKind.PREFIX, enclosing);
395 393
396 CompilationUnitElement getCompilationUnit() {
397 if (patchSource !== null) return patchSource;
398 return super.getCompilationUnit();
399 }
400
401 lookupLocalMember(SourceString memberName) => imported[memberName]; 394 lookupLocalMember(SourceString memberName) => imported[memberName];
402 395
403 Type computeType(Compiler compiler) => compiler.types.dynamicType; 396 Type computeType(Compiler compiler) => compiler.types.dynamicType;
404 397
405 Token position() => firstPosition; 398 Token position() => firstPosition;
406 } 399 }
407 400
408 class TypedefElement extends Element { 401 class TypedefElement extends Element {
409 Type cachedType; 402 Type cachedType;
410 Typedef cachedNode; 403 Typedef cachedNode;
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 final Node node; 1129 final Node node;
1137 Type bound; 1130 Type bound;
1138 Type type; 1131 Type type;
1139 TypeVariableElement(name, Element enclosing, this.node, this.type, 1132 TypeVariableElement(name, Element enclosing, this.node, this.type,
1140 [this.bound]) 1133 [this.bound])
1141 : super(name, ElementKind.TYPE_VARIABLE, enclosing); 1134 : super(name, ElementKind.TYPE_VARIABLE, enclosing);
1142 Type computeType(compiler) => type; 1135 Type computeType(compiler) => type;
1143 Node parseNode(compiler) => node; 1136 Node parseNode(compiler) => node;
1144 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; 1137 toString() => "${enclosingElement.toString()}.${name.slowToString()}";
1145 } 1138 }
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