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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/tree/nodes.dart

Issue 201613006: Introduces the new syntax for deferred loading (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 part of tree; 5 part of tree;
6 6
7 abstract class Visitor<R> { 7 abstract class Visitor<R> {
8 const Visitor(); 8 const Visitor();
9 9
10 R visitNode(Node node); 10 R visitNode(Node node);
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 /** 1794 /**
1795 * An [:import:] library tag. 1795 * An [:import:] library tag.
1796 * 1796 *
1797 * An import tag is dependency on another library where the exported identifiers 1797 * An import tag is dependency on another library where the exported identifiers
1798 * are put into the import scope of the importing library. The import scope is 1798 * are put into the import scope of the importing library. The import scope is
1799 * only visible inside the library. 1799 * only visible inside the library.
1800 */ 1800 */
1801 class Import extends LibraryDependency { 1801 class Import extends LibraryDependency {
1802 final Identifier prefix; 1802 final Identifier prefix;
1803 final Token importKeyword; 1803 final Token importKeyword;
1804 final bool isDeferred;
1804 1805
1805 Import(this.importKeyword, StringNode uri, 1806 Import(this.importKeyword, StringNode uri,
1806 this.prefix, NodeList combinators, 1807 this.prefix, NodeList combinators,
1807 Link<MetadataAnnotation> metadata) 1808 Link<MetadataAnnotation> metadata,
1809 {this.isDeferred})
1808 : super(uri, combinators, metadata); 1810 : super(uri, combinators, metadata);
1809 1811
1810 bool get isImport => true; 1812 bool get isImport => true;
1811 1813
1812 Import asImport() => this; 1814 Import asImport() => this;
1813 1815
1814 Token get asKeyword => prefix == null ? null : uri.getEndToken().next;
1815
1816 accept(Visitor visitor) => visitor.visitImport(this); 1816 accept(Visitor visitor) => visitor.visitImport(this);
1817 1817
1818 visitChildren(Visitor visitor) { 1818 visitChildren(Visitor visitor) {
1819 uri.accept(visitor); 1819 uri.accept(visitor);
1820 if (prefix != null) prefix.accept(visitor); 1820 if (prefix != null) prefix.accept(visitor);
1821 if (combinators != null) combinators.accept(visitor); 1821 if (combinators != null) combinators.accept(visitor);
1822 } 1822 }
1823 1823
1824 Token getBeginToken() => importKeyword; 1824 Token getBeginToken() => importKeyword;
1825 1825
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 } 2107 }
2108 2108
2109 class IsInterpolationVisitor extends Visitor<bool> { 2109 class IsInterpolationVisitor extends Visitor<bool> {
2110 const IsInterpolationVisitor(); 2110 const IsInterpolationVisitor();
2111 bool visitNode(Node node) => false; 2111 bool visitNode(Node node) => false;
2112 bool visitStringInterpolation(StringInterpolation node) => true; 2112 bool visitStringInterpolation(StringInterpolation node) => true;
2113 bool visitStringJuxtaposition(StringJuxtaposition node) 2113 bool visitStringJuxtaposition(StringJuxtaposition node)
2114 => node.isInterpolation; 2114 => node.isInterpolation;
2115 } 2115 }
2116 2116
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698