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

Side by Side Diff: packages/petitparser/lib/src/debug/progress.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 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
OLDNEW
(Empty)
1 part of petitparser.debug;
2
3 /// Returns a transformed [parser] that when being used to read input
4 /// visually prints its progress while progressing.
5 ///
6 /// For example, the snippet
7 ///
8 /// var parser = letter() & word().star();
9 /// progress(parser).parse('f123');
10 ///
11 /// produces the following output:
12 ///
13 /// * Instance of 'SequenceParser'
14 /// * Instance of 'CharacterParser'[letter expected]
15 /// ** Instance of 'PossessiveRepeatingParser'[0..*]
16 /// ** Instance of 'CharacterParser'[letter or digit expected]
17 /// *** Instance of 'CharacterParser'[letter or digit expected]
18 /// **** Instance of 'CharacterParser'[letter or digit expected]
19 /// ***** Instance of 'CharacterParser'[letter or digit expected]
20 ///
21 /// Jumps backwards mean that the parser is back-tracking. Often choices can
22 /// be reordered to such expensive parses.
23 Parser progress(Parser parser, [OutputHandler output = print]) {
24 return transformParser(parser, (each) {
25 return new ContinuationParser(each, (continuation, context) {
26 output('${_repeat(1 + context.position, '*')} $each');
27 return continuation(context);
28 });
29 });
30 }
OLDNEW
« no previous file with comments | « packages/petitparser/lib/src/debug/profile.dart ('k') | packages/petitparser/lib/src/debug/trace.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698