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

Side by Side Diff: frog/reader.dart

Issue 9555013: Get dartdoc in the SDK and working correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update copyright date. Created 8 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) 2011, 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 /** 5 /**
6 * An code reader that abstracts away the distinction between internal and user 6 * An code reader that abstracts away the distinction between internal and user
7 * libraries. 7 * libraries.
8 */ 8 */
9 class LibraryReader { 9 class LibraryReader {
10 Map _specialLibs; 10 Map _specialLibs;
11 LibraryReader() { 11 LibraryReader() {
12 if (options.config == 'dev') { 12 if (options.config == 'dev') {
13 _specialLibs = { 13 _specialLibs = {
14 'dart:core': joinPaths(options.libDir, 'corelib.dart'), 14 'dart:core': joinPaths(options.libDir, 'corelib.dart'),
15 'dart:coreimpl': joinPaths(options.libDir, 'corelib_impl.dart'), 15 'dart:coreimpl': joinPaths(options.libDir, 'corelib_impl.dart'),
16 'dart:html': joinPaths(options.libDir, 16 'dart:html': joinPaths(options.libDir,
17 '../../client/html/release/html.dart'), 17 '../../client/html/release/html.dart'),
18 'dart:htmlimpl': joinPaths(options.libDir, 18 'dart:htmlimpl': joinPaths(options.libDir,
19 '../../client/html/release/htmlimpl.dart'), 19 '../../client/html/release/htmlimpl.dart'),
20 'dart:dom': joinPaths(options.libDir, 20 'dart:dom': joinPaths(options.libDir,
21 '../../client/dom/frog/dom_frog.dart'), 21 '../../client/dom/frog/dom_frog.dart'),
22 'dart:json': joinPaths(options.libDir, '../../lib/json/json_frog.dart'), 22 'dart:json': joinPaths(options.libDir, '../../lib/json/json_frog.dart'),
23 'dart:isolate': joinPaths(options.libDir, 23 'dart:isolate': joinPaths(options.libDir,
24 '../../lib/isolate/isolate_frog.dart'), 24 '../../lib/isolate/isolate_frog.dart'),
25 }; 25 };
26 } else if (options.config == 'sdk') { 26 } else if (options.config == 'sdk') {
27 _specialLibs = { 27 _specialLibs = {
28 'dart:core': joinPaths(options.libDir, 'core/core_frog.dart'), 28 'dart:core': joinPaths(options.libDir, 'core/core_frog.dart'),
29 'dart:coreimpl': joinPaths(options.libDir, 29 'dart:coreimpl': joinPaths(options.libDir,
30 'coreimpl/coreimpl_frog.dart'), 30 'coreimpl/coreimpl_frog.dart'),
31 'dart:html': joinPaths(options.libDir, 'html/html.dart'), 31 'dart:html': joinPaths(options.libDir, 'html/html.dart'),
32 'dart:htmlimpl': joinPaths(options.libDir, 'htmlimpl/htmlimpl.dart'), 32 'dart:htmlimpl': joinPaths(options.libDir, 'htmlimpl/htmlimpl.dart'),
33 'dart:dom': joinPaths(options.libDir, 'dom/dom_frog.dart'), 33 'dart:dom': joinPaths(options.libDir, 'dom/dom_frog.dart'),
34 'dart:json': joinPaths(options.libDir, 'json/json_frog.dart'), 34 'dart:json': joinPaths(options.libDir, 'json/json_frog.dart'),
35 'dart:isolate': joinPaths(options.libDir, 'isolate/isolate_frog.dart'), 35 'dart:isolate': joinPaths(options.libDir, 'isolate/isolate_frog.dart'),
36 }; 36 };
37 } else { 37 } else {
38 world.error('Invalid configuration ${options.config}'); 38 world.error('Invalid configuration ${options.config}');
39 } 39 }
40 } 40 }
41 41
42 SourceFile readFile(String fullname) { 42 SourceFile readFile(String fullname) {
43 var filename = _specialLibs[fullname]; 43 var filename = _specialLibs[fullname];
44 if (filename == null) { 44 if (filename == null) {
45 filename = fullname; 45 filename = fullname;
46 } 46 }
47 47
48 if (world.files.fileExists(filename)) { 48 if (world.files.fileExists(filename)) {
49 // TODO(jimhug): Should we cache these based on time stamps here? 49 // TODO(jimhug): Should we cache these based on time stamps here?
50 return new SourceFile(filename, world.files.readAll(filename)); 50 return new SourceFile(filename, world.files.readAll(filename));
51 } else { 51 } else {
52 world.error('File not found: $filename', null); 52 world.error('File not found: $filename', null);
53 return new SourceFile(filename, ''); 53 return new SourceFile(filename, '');
54 } 54 }
55 } 55 }
56 } 56 }
OLDNEW
« frog/presubmit.py ('K') | « frog/presubmit.py ('k') | lib/dartdoc/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698