| Index: packages/petitparser/lib/src/debug/profile.dart
|
| diff --git a/petitparser/lib/src/debug/profile.dart b/packages/petitparser/lib/src/debug/profile.dart
|
| similarity index 50%
|
| rename from petitparser/lib/src/debug/profile.dart
|
| rename to packages/petitparser/lib/src/debug/profile.dart
|
| index 7c285567dd41f2ae4138f969d93883b68cfc59d8..b4e442479eea2c5b0a7b7da6cb5926c44f1b7953 100644
|
| --- a/petitparser/lib/src/debug/profile.dart
|
| +++ b/packages/petitparser/lib/src/debug/profile.dart
|
| @@ -1,25 +1,23 @@
|
| -part of debug;
|
| +part of petitparser.debug;
|
|
|
| -/**
|
| - * Returns a transformed [parser] that when being used measures
|
| - * the activation count and total time of each parser.
|
| - *
|
| - * For example, the snippet
|
| - *
|
| - * var parser = letter() & word().star();
|
| - * profile(parser).parse('f1234567890');
|
| - *
|
| - * produces the following output:
|
| - *
|
| - * 1 2006 Instance of 'SequenceParser'
|
| - * 1 697 Instance of 'PossessiveRepeatingParser'[0..*]
|
| - * 11 406 Instance of 'CharacterParser'[letter or digit expected]
|
| - * 1 947 Instance of 'CharacterParser'[letter expected]
|
| - *
|
| - * The first number refers to the number of activations of each parser, and
|
| - * the second number is the microseconds spent in this parser and all its
|
| - * children.
|
| - */
|
| +/// Returns a transformed [parser] that when being used measures
|
| +/// the activation count and total time of each parser.
|
| +///
|
| +/// For example, the snippet
|
| +///
|
| +/// var parser = letter() & word().star();
|
| +/// profile(parser).parse('f1234567890');
|
| +///
|
| +/// produces the following output:
|
| +///
|
| +/// 1 2006 Instance of 'SequenceParser'
|
| +/// 1 697 Instance of 'PossessiveRepeatingParser'[0..*]
|
| +/// 11 406 Instance of 'CharacterParser'[letter or digit expected]
|
| +/// 1 947 Instance of 'CharacterParser'[letter expected]
|
| +///
|
| +/// The first number refers to the number of activations of each parser, and
|
| +/// the second number is the microseconds spent in this parser and all its
|
| +/// children.
|
| Parser profile(Parser root, [OutputHandler output = print]) {
|
| var count = new Map();
|
| var watch = new Map();
|
| @@ -42,7 +40,7 @@ Parser profile(Parser root, [OutputHandler output = print]) {
|
| parsers.forEach((parser) {
|
| output('${count[parser]}\t'
|
| '${watch[parser].elapsedMicroseconds}\t'
|
| - '${parser}');
|
| + '$parser');
|
| });
|
| return result;
|
| });
|
|
|