
committed by
Misko Hevery

parent
64ad74acbe
commit
5c25248582
@ -5,14 +5,14 @@ import 'dart:convert';
|
||||
|
||||
import 'package:barback/barback.dart';
|
||||
|
||||
/// A class that allows fetching code using [AssetId]s without all the
|
||||
/// additional baggage of a [Transform].
|
||||
/// A class that allows fetching code using {@link AssetId}s without all the
|
||||
/// additional baggage of a {@link Transform}.
|
||||
abstract class AssetReader {
|
||||
Future<String> readAsString(AssetId id, {Encoding encoding});
|
||||
Future<bool> hasInput(AssetId id);
|
||||
|
||||
/// Creates an [AssetReader] using the `transform`, which should be a
|
||||
/// [Transform] or [AggregateTransform].
|
||||
/// Creates an {@link AssetReader} using the `transform`, which should be a
|
||||
/// {@link Transform} or {@link AggregateTransform}.
|
||||
factory AssetReader.fromTransform(dynamic transform) =>
|
||||
new _TransformAssetReader(transform);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:angular2/src/transform/common/logging.dart';
|
||||
import 'package:barback/barback.dart';
|
||||
import 'package:code_transformers/assets.dart';
|
||||
|
||||
/// Creates a mapping of [AssetId]s to the [ClassDeclaration]s which they
|
||||
/// Creates a mapping of {@link AssetId}s to the {@link ClassDeclaration}s which they
|
||||
/// define.
|
||||
Future<Map<AssetId, List<ClassDeclaration>>> createTypeMap(
|
||||
AssetReader reader, AssetId id) {
|
||||
|
@ -7,12 +7,12 @@ import 'package:source_span/source_span.dart';
|
||||
|
||||
BuildLogger _logger;
|
||||
|
||||
/// Prepares [logger] for use throughout the transformer.
|
||||
/// Prepares {@link logger} for use throughout the transformer.
|
||||
void init(Transform t) {
|
||||
_logger = new BuildLogger(t);
|
||||
}
|
||||
|
||||
/// Sets [logger] directly. Used for testing - in general use [init].
|
||||
/// Sets {@link logger} directly. Used for testing - in general use {@link init}.
|
||||
void setLogger(BuildLogger logger) {
|
||||
_logger = logger;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class TransformerOptions {
|
||||
/// The path to the files where the application's calls to `bootstrap` are.
|
||||
final List<String> entryPoints;
|
||||
|
||||
/// The paths to the files where the application's [ReflectionCapabilities]
|
||||
/// The paths to the files where the application's {@link ReflectionCapabilities}
|
||||
/// are set.
|
||||
final List<String> reflectionEntryPoints;
|
||||
|
||||
|
@ -14,7 +14,7 @@ TransformerOptions parseBarbackSettings(BarbackSettings settings) {
|
||||
}
|
||||
|
||||
/// Cribbed from the polymer project.
|
||||
/// [https://github.com/dart-lang/polymer-dart]
|
||||
/// {@link https://github.com/dart-lang/polymer-dart}
|
||||
List<String> _readFileList(Map config, String paramName) {
|
||||
var value = config[paramName];
|
||||
if (value == null) return null;
|
||||
|
@ -13,8 +13,8 @@ import 'registered_type.dart';
|
||||
|
||||
export 'registered_type.dart';
|
||||
|
||||
/// A parser that reads `.ng_deps.dart` files (represented by [AssetId]s into
|
||||
/// easier to manage [NgDeps] files.
|
||||
/// A parser that reads `.ng_deps.dart` files (represented by {@link AssetId}s into
|
||||
/// easier to manage {@link NgDeps} files.
|
||||
class Parser {
|
||||
final AssetReader _reader;
|
||||
final _ParseNgDepsVisitor _visitor = new _ParseNgDepsVisitor();
|
||||
@ -28,7 +28,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/// Parses only the `.ng_deps.dart` file represented by `id`.
|
||||
/// See also [parseRecursive].
|
||||
/// See also {@link parseRecursive}.
|
||||
Future<NgDeps> parse(AssetId id) async {
|
||||
if (!(await _reader.hasInput(id))) return null;
|
||||
var ngDeps = new NgDeps(await _reader.readAsString(id));
|
||||
@ -37,9 +37,9 @@ class Parser {
|
||||
return ngDeps;
|
||||
}
|
||||
|
||||
/// Parses the `.ng_deps.dart` file represented by [id] into an [NgDeps]
|
||||
/// object. All `.ng_deps.dart` files imported by [id] are then parsed. The
|
||||
/// results are added to [allDeps].
|
||||
/// Parses the `.ng_deps.dart` file represented by {@link id} into an {@link NgDeps}
|
||||
/// object. All `.ng_deps.dart` files imported by {@link id} are then parsed. The
|
||||
/// results are added to {@link allDeps}.
|
||||
Future<List<NgDeps>> _recurse(AssetId id,
|
||||
[List<NgDeps> allDeps, Set<AssetId> seen]) async {
|
||||
if (seen == null) seen = new Set<AssetId>();
|
||||
|
@ -5,7 +5,7 @@ import 'package:analyzer/src/generated/scanner.dart' show Keyword;
|
||||
/// Whether `name` is a valid property name.
|
||||
bool isValid(String name) => !Keyword.keywords.containsKey(name);
|
||||
|
||||
/// Prepares [name] to be emitted inside a string.
|
||||
/// Prepares `name` to be emitted inside a string.
|
||||
String sanitize(String name) => name.replaceAll('\$', '\\\$');
|
||||
|
||||
/// Get a string usable as a lazy invalid setter, that is, one which will
|
||||
|
@ -19,7 +19,7 @@ class RegisteredType {
|
||||
RegisteredType._(this.typeName, this.registerMethod, this.factoryFn,
|
||||
this.parameters, this.annotations);
|
||||
|
||||
/// Creates a [RegisteredType] given a [MethodInvocation] node representing
|
||||
/// Creates a {@link RegisteredType} given a {@link MethodInvocation} node representing
|
||||
/// a call to `registerType`.
|
||||
factory RegisteredType.fromMethodInvocation(MethodInvocation registerMethod) {
|
||||
var visitor = new _ParseRegisterTypeVisitor();
|
||||
|
Reference in New Issue
Block a user