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

Side by Side Diff: dart/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart

Issue 10911298: Parse new library syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update status file after rebasing. Created 8 years, 3 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 | « dart/lib/compiler/implementation/tree/nodes.dart ('k') | dart/tests/co19/co19-dart2js.status » ('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('mirrors.dart2js'); 5 #library('mirrors.dart2js');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 #import('dart:uri'); 8 #import('dart:uri');
9 9
10 #import('../../../../../lib/compiler/compiler.dart', prefix: 'diagnostics'); 10 #import('../../../../../lib/compiler/compiler.dart', prefix: 'diagnostics');
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 String get canonicalName => simpleName; 486 String get canonicalName => simpleName;
487 487
488 /** 488 /**
489 * Returns the library name (for libraries with a #library tag) or the script 489 * Returns the library name (for libraries with a #library tag) or the script
490 * file name (for scripts without a #library tag). The latter case is used to 490 * file name (for scripts without a #library tag). The latter case is used to
491 * provide a 'library name' for scripts, to use for instance in dartdoc. 491 * provide a 'library name' for scripts, to use for instance in dartdoc.
492 */ 492 */
493 String get simpleName { 493 String get simpleName {
494 if (_library.libraryTag !== null) { 494 if (_library.libraryTag !== null) {
495 return _library.libraryTag.argument.dartString.slowToString(); 495 // TODO(ahe): Remove StringNode check when old syntax is removed.
496 StringNode name = _library.libraryTag.name.asStringNode();
497 if (name !== null) {
498 return name.dartString.slowToString();
499 } else {
500 return _library.libraryTag.name.toString();
501 }
496 } else { 502 } else {
497 // Use the file name as script name. 503 // Use the file name as script name.
498 String path = _library.uri.path; 504 String path = _library.uri.path;
499 return path.substring(path.lastIndexOf('/') + 1); 505 return path.substring(path.lastIndexOf('/') + 1);
500 } 506 }
501 } 507 }
502 508
503 String get qualifiedName => simpleName; 509 String get qualifiedName => simpleName;
504 510
505 void _ensureTypes() { 511 void _ensureTypes() {
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 if (node !== null) { 1391 if (node !== null) {
1386 var span = system.compiler.spanFromNode(node, script.uri); 1392 var span = system.compiler.spanFromNode(node, script.uri);
1387 return new Dart2JsLocation(script, span); 1393 return new Dart2JsLocation(script, span);
1388 } else { 1394 } else {
1389 var span = system.compiler.spanFromElement(_variable); 1395 var span = system.compiler.spanFromElement(_variable);
1390 return new Dart2JsLocation(script, span); 1396 return new Dart2JsLocation(script, span);
1391 } 1397 }
1392 } 1398 }
1393 } 1399 }
1394 1400
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/tree/nodes.dart ('k') | dart/tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698