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

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

Issue 11027023: Parse/unparse library combinators. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 class ScannerTask extends CompilerTask { 5 class ScannerTask extends CompilerTask {
6 ScannerTask(Compiler compiler) : super(compiler); 6 ScannerTask(Compiler compiler) : super(compiler);
7 String get name => 'Scanner'; 7 String get name => 'Scanner';
8 8
9 void scanLibrary(LibraryElement library) { 9 void scanLibrary(LibraryElement library) {
10 var compilationUnit = library.entryCompilationUnit; 10 var compilationUnit = library.entryCompilationUnit;
(...skipping 22 matching lines...) Expand all
33 return tagState; 33 return tagState;
34 } 34 }
35 return TagState.NEXT[value]; 35 return TagState.NEXT[value];
36 } 36 }
37 37
38 LinkBuilder<Import> imports = new LinkBuilder<Import>(); 38 LinkBuilder<Import> imports = new LinkBuilder<Import>();
39 Uri base = library.entryCompilationUnit.script.uri; 39 Uri base = library.entryCompilationUnit.script.uri;
40 for (LibraryTag tag in library.tags.reverse()) { 40 for (LibraryTag tag in library.tags.reverse()) {
41 if (tag.isImport) { 41 if (tag.isImport) {
42 tagState = checkTag(TagState.IMPORT, tag); 42 tagState = checkTag(TagState.IMPORT, tag);
43 if (tag.combinators != null) {
44 compiler.unimplemented('combinators', node: tag.combinators);
45 }
43 // It is not safe to import other libraries at this point as 46 // It is not safe to import other libraries at this point as
44 // another library could then observe the current library 47 // another library could then observe the current library
45 // before it fully declares all the members that are sourced 48 // before it fully declares all the members that are sourced
46 // in. 49 // in.
47 imports.addLast(tag); 50 imports.addLast(tag);
48 } else if (tag.isLibraryName) { 51 } else if (tag.isLibraryName) {
49 tagState = checkTag(TagState.LIBRARY, tag); 52 tagState = checkTag(TagState.LIBRARY, tag);
50 if (library.libraryTag !== null) { 53 if (library.libraryTag !== null) {
51 compiler.cancel("duplicated library declaration", node: tag); 54 compiler.cancel("duplicated library declaration", node: tag);
52 } else { 55 } else {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 static const int RESOURCE = 4; 212 static const int RESOURCE = 4;
210 213
211 /** Next state. */ 214 /** Next state. */
212 static const List<int> NEXT = 215 static const List<int> NEXT =
213 const <int>[NO_TAG_SEEN, 216 const <int>[NO_TAG_SEEN,
214 IMPORT, // Only one library tag is allowed. 217 IMPORT, // Only one library tag is allowed.
215 IMPORT, 218 IMPORT,
216 SOURCE, 219 SOURCE,
217 RESOURCE]; 220 RESOURCE];
218 } 221 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/scanner/listener.dart ('k') | dart/lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698