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

Side by Side Diff: dart/frog/leg/scanner/scanner_bench.dart

Issue 8497042: Allow error-recovery in top-level nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased, address review comments, and frogsh Created 9 years, 1 month 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/frog/leg/scanner/parser.dart ('k') | dart/tests/language/language.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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('scanner_bench'); 5 #library('scanner_bench');
6 #import('scannerlib.dart'); 6 #import('scannerlib.dart');
7 #import('scanner_implementation.dart'); 7 #import('scanner_implementation.dart');
8 #source('source_list.dart'); 8 #source('source_list.dart');
9 9
10 /** 10 /**
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 static final String spaces = " "; 70 static final String spaces = " ";
71 71
72 final String esc; 72 final String esc;
73 final String up; 73 final String up;
74 final String clear; 74 final String clear;
75 final int total; 75 final int total;
76 int ticks = 0; 76 int ticks = 0;
77 77
78 ProgressBar(int total) : this.escape(total, new String.fromCharCodes([27])); 78 ProgressBar(int total) : this.escape(total, new String.fromCharCodes([27]));
79 79
80 ProgressBar.escape(this.total, int esc) 80 ProgressBar.escape(this.total, String esc)
81 : esc = esc, up = "$esc[1A", clear = "$esc[K"; 81 : esc = esc, up = "$esc[1A", clear = "$esc[K";
82 82
83 void begin() { 83 void begin() {
84 if (total > 10) { 84 if (total > 10) {
85 print("[$spaces] 0%"); 85 print("[$spaces] 0%");
86 print("$up[${hashes.substring(0, ticks * spaces.length ~/ total)}"); 86 print("$up[${hashes.substring(0, ticks * spaces.length ~/ total)}");
87 } 87 }
88 } 88 }
89 89
90 void tick() { 90 void tick() {
91 if (total > 10 && ticks % 5 == 0) { 91 if (total > 10 && ticks % 5 == 0) {
92 print("$up$clear[$spaces] ${ticks * 100 ~/ total}%"); 92 print("$up$clear[$spaces] ${ticks * 100 ~/ total}%");
93 print("$up[${hashes.substring(0, ticks * spaces.length ~/ total)}"); 93 print("$up[${hashes.substring(0, ticks * spaces.length ~/ total)}");
94 } 94 }
95 ++ticks; 95 ++ticks;
96 } 96 }
97 97
98 void end() { 98 void end() {
99 if (total > 10) { 99 if (total > 10) {
100 print("$up$clear[$hashes] 100%"); 100 print("$up$clear[$hashes] 100%");
101 } 101 }
102 } 102 }
103 } 103 }
OLDNEW
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698