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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartScanner.java

Issue 8966004: Fix the Dart formatter (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
Index: compiler/java/com/google/dart/compiler/parser/DartScanner.java
===================================================================
--- compiler/java/com/google/dart/compiler/parser/DartScanner.java (revision 2471)
+++ compiler/java/com/google/dart/compiler/parser/DartScanner.java (working copy)
@@ -541,6 +541,7 @@
* #restoreState(State)}.
*/
public State getState() {
+// System.out.println("get state: " + internalState.currentOffset + " hash: 0x" + Integer.toHexString(this.hashCode()));
return new State(internalState.currentOffset);
}
@@ -622,6 +623,7 @@
* Sets the scanner's state, using a state object returned from {@link #getState()}.
*/
public void restoreState(State oldState) {
+// System.out.println("restore state " + oldState.baseOffset + " hash: 0x" + Integer.toHexString(this.hashCode()));
// reset offset
internalState.currentOffset = oldState.baseOffset;
}
@@ -757,6 +759,17 @@
internalState.lastToken.location = new Location(begin, end);
internalState.tokens.add(internalState.lastToken);
if (token == Token.EOS) {
+// System.out.print("tokens: ");
+// for(TokenData t : internalState.tokens) {
+// if (t != null) {
+// if (t.token != null) {
+// System.out.print(t + ", ");
+// } else {
+// System.out.print("Null, ");
+// }
+// }
+// }
+// System.out.println();
return;
}
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/formatter/CodeFormatterVisitor.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698