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

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

Issue 10831125: Revert 'Port the remaining of dart:core to the unified corelib.' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/lib/core.dart » ('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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 final VariableListElement variables; 437 final VariableListElement variables;
438 Expression cachedNode; // The send or the identifier in the variables list. 438 Expression cachedNode; // The send or the identifier in the variables list.
439 439
440 Modifiers get modifiers() => variables.modifiers; 440 Modifiers get modifiers() => variables.modifiers;
441 441
442 VariableElement(SourceString name, 442 VariableElement(SourceString name,
443 VariableListElement this.variables, 443 VariableListElement this.variables,
444 ElementKind kind, 444 ElementKind kind,
445 Element enclosing, 445 Element enclosing,
446 [Node node]) 446 [Node node])
447 : super(name, kind, enclosing), cachedNode = node; 447 : super(name, kind, enclosing), cachedNode = node;
448
449 VariableElement.from(SourceString name,
450 VariableElement other,
451 Element enclosing)
452 : this(name,
453 new VariableListElement.from(other.variables, enclosing),
454 other.kind,
455 enclosing,
456 other.cachedNode);
457 448
458 Node parseNode(DiagnosticListener listener) { 449 Node parseNode(DiagnosticListener listener) {
459 if (cachedNode !== null) return cachedNode; 450 if (cachedNode !== null) return cachedNode;
460 VariableDefinitions definitions = variables.parseNode(listener); 451 VariableDefinitions definitions = variables.parseNode(listener);
461 for (Link<Node> link = definitions.definitions.nodes; 452 for (Link<Node> link = definitions.definitions.nodes;
462 !link.isEmpty(); link = link.tail) { 453 !link.isEmpty(); link = link.tail) {
463 Expression initializedIdentifier = link.head; 454 Expression initializedIdentifier = link.head;
464 Identifier identifier = initializedIdentifier.asIdentifier(); 455 Identifier identifier = initializedIdentifier.asIdentifier();
465 if (identifier === null) { 456 if (identifier === null) {
466 identifier = initializedIdentifier.asSendSet().selector.asIdentifier(); 457 identifier = initializedIdentifier.asSendSet().selector.asIdentifier();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 Element enclosing) 515 Element enclosing)
525 : super(null, kind, enclosing); 516 : super(null, kind, enclosing);
526 517
527 VariableListElement.node(VariableDefinitions node, 518 VariableListElement.node(VariableDefinitions node,
528 ElementKind kind, 519 ElementKind kind,
529 Element enclosing) 520 Element enclosing)
530 : super(null, kind, enclosing), 521 : super(null, kind, enclosing),
531 this.cachedNode = node, 522 this.cachedNode = node,
532 this.modifiers = node.modifiers; 523 this.modifiers = node.modifiers;
533 524
534 factory VariableListElement.from(VariableListElement other,
535 Element enclosing) {
536 var variableList;
537 if (other is PartialFieldListElement) {
538 variableList = new PartialFieldListElement(other.beginToken,
539 other.endToken,
540 other.modifiers,
541 enclosing);
542 } else {
543 variableList = new VariableListElement(other.kind,
544 other.modifiers,
545 enclosing);
546 }
547 variableList.cachedNode = other.cachedNode;
548 variableList.type = other.type;
549 return variableList;
550 }
551
552 VariableDefinitions parseNode(DiagnosticListener listener) { 525 VariableDefinitions parseNode(DiagnosticListener listener) {
553 return cachedNode; 526 return cachedNode;
554 } 527 }
555 528
556 Type computeType(Compiler compiler) { 529 Type computeType(Compiler compiler) {
557 if (type != null) return type; 530 if (type != null) return type;
558 VariableDefinitions node = parseNode(compiler); 531 VariableDefinitions node = parseNode(compiler);
559 if (node.type !== null) { 532 if (node.type !== null) {
560 type = compiler.resolveTypeAnnotation(this, node.type); 533 type = compiler.resolveTypeAnnotation(this, node.type);
561 } else { 534 } else {
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 final Node node; 1182 final Node node;
1210 Type bound; 1183 Type bound;
1211 Type type; 1184 Type type;
1212 TypeVariableElement(name, Element enclosing, this.node, this.type, 1185 TypeVariableElement(name, Element enclosing, this.node, this.type,
1213 [this.bound]) 1186 [this.bound])
1214 : super(name, ElementKind.TYPE_VARIABLE, enclosing); 1187 : super(name, ElementKind.TYPE_VARIABLE, enclosing);
1215 Type computeType(compiler) => type; 1188 Type computeType(compiler) => type;
1216 Node parseNode(compiler) => node; 1189 Node parseNode(compiler) => node;
1217 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; 1190 toString() => "${enclosingElement.toString()}.${name.slowToString()}";
1218 } 1191 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/lib/core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698