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

Unified Diff: packages/petitparser/lib/src/debug/trace.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/petitparser/lib/src/debug/progress.dart ('k') | packages/petitparser/lib/src/json/grammar.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/petitparser/lib/src/debug/trace.dart
diff --git a/packages/petitparser/lib/src/debug/trace.dart b/packages/petitparser/lib/src/debug/trace.dart
deleted file mode 100644
index d47deb8736dddf193686df24236f6dc0dbb1fae7..0000000000000000000000000000000000000000
--- a/packages/petitparser/lib/src/debug/trace.dart
+++ /dev/null
@@ -1,39 +0,0 @@
-part of petitparser.debug;
-
-/// Returns a transformed [parser] that when being used to read input prints a
-/// trace of all activated parsers and their respective parse results.
-///
-/// For example, the snippet
-///
-/// var parser = letter() & word().star();
-/// trace(parser).parse('f1');
-///
-/// produces the following output:
-///
-/// Instance of 'SequenceParser'
-/// Instance of 'CharacterParser'[letter expected]
-/// Success[1:2]: f
-/// Instance of 'PossessiveRepeatingParser'[0..*]
-/// Instance of 'CharacterParser'[letter or digit expected]
-/// Success[1:3]: 1
-/// Instance of 'CharacterParser'[letter or digit expected]
-/// Failure[1:3]: letter or digit expected
-/// Success[1:3]: [1]
-/// Success[1:3]: [f, [1]]
-///
-/// Indentation signifies the activation of a parser object. Reverse indentation
-/// signifies the returning of a parse result either with a success or failure
-/// context.
-Parser trace(Parser parser, [OutputHandler output = print]) {
- var level = 0;
- return transformParser(parser, (each) {
- return new ContinuationParser(each, (continuation, context) {
- output('${_repeat(level, ' ')}$each');
- level++;
- var result = continuation(context);
- level--;
- output('${_repeat(level, ' ')}$result');
- return result;
- });
- });
-}
« no previous file with comments | « packages/petitparser/lib/src/debug/progress.dart ('k') | packages/petitparser/lib/src/json/grammar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698