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

Side by Side Diff: frog/library.dart

Issue 10032015: Add support for the package: directive in Frog and dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change Created 8 years, 8 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 | « no previous file | frog/reader.dart » ('j') | lib/compiler/implementation/apiimpl.dart » ('J')
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 class LibraryImport { 5 class LibraryImport {
6 final String prefix; 6 final String prefix;
7 final Library library; 7 final Library library;
8 final SourceSpan span; 8 final SourceSpan span;
9 LibraryImport(this.library, [this.prefix, this.span]); 9 LibraryImport(this.library, [this.prefix, this.span]);
10 } 10 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 bool get isCore() => this == world.corelib; 52 bool get isCore() => this == world.corelib;
53 bool get isCoreImpl() => this == world.coreimpl; 53 bool get isCoreImpl() => this == world.coreimpl;
54 54
55 // TODO(jmesserly): we shouldn't be special casing DOM anywhere. 55 // TODO(jmesserly): we shouldn't be special casing DOM anywhere.
56 bool get isDom() => this == world.dom; 56 bool get isDom() => this == world.dom;
57 57
58 SourceSpan get span() => new SourceSpan(baseSource, 0, 0); 58 SourceSpan get span() => new SourceSpan(baseSource, 0, 0);
59 59
60 String makeFullPath(String filename) { 60 String makeFullPath(String filename) {
61 if (filename.startsWith('dart:')) return filename; 61 if (filename.startsWith('dart:')) return filename;
62 if (filename.startsWith('package:')) return filename;
62 // TODO(jmesserly): replace with node.js path.resolve 63 // TODO(jmesserly): replace with node.js path.resolve
63 if (filename.startsWith('/')) return filename; 64 if (filename.startsWith('/')) return filename;
64 if (filename.startsWith('file:///')) return filename; 65 if (filename.startsWith('file:///')) return filename;
65 if (filename.startsWith('http://')) return filename; 66 if (filename.startsWith('http://')) return filename;
66 if (const RegExp('^[a-zA-Z]:/').hasMatch(filename)) return filename; 67 if (const RegExp('^[a-zA-Z]:/').hasMatch(filename)) return filename;
67 return joinPaths(sourceDir, filename); 68 return joinPaths(sourceDir, filename);
68 } 69 }
69 70
70 /** Adds an import to the library. */ 71 /** Adds an import to the library. */
71 addImport(String fullname, String prefix, SourceSpan span) { 72 addImport(String fullname, String prefix, SourceSpan span) {
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 504
504 void visitFunctionDefinition(FunctionDefinition node) { 505 void visitFunctionDefinition(FunctionDefinition node) {
505 currentType.addMethod(node.name.name, node); 506 currentType.addMethod(node.name.name, node);
506 } 507 }
507 508
508 void visitFunctionTypeDefinition(FunctionTypeDefinition node) { 509 void visitFunctionTypeDefinition(FunctionTypeDefinition node) {
509 var type = library.addType(node.func.name.name, node, false); 510 var type = library.addType(node.func.name.name, node, false);
510 type.addMethod(':call', node.func); 511 type.addMethod(':call', node.func);
511 } 512 }
512 } 513 }
OLDNEW
« no previous file with comments | « no previous file | frog/reader.dart » ('j') | lib/compiler/implementation/apiimpl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698