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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java

Issue 11364134: Merge libv1. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Reupload due to error Created 8 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 side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java
index a728e6a2979727943206c5b99aa68316f0e8e7b7..6dccc7d7284540c86d6a0fb7b6c7e813578e07d9 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/scanner/AbstractScanner.java
@@ -191,9 +191,9 @@ public abstract class AbstractScanner {
private void appendEofToken() {
Token eofToken;
if (firstComment == null) {
- eofToken = new Token(TokenType.EOF, getOffset());
+ eofToken = new Token(TokenType.EOF, getOffset() + 1);
} else {
- eofToken = new TokenWithComment(TokenType.EOF, getOffset(), firstComment);
+ eofToken = new TokenWithComment(TokenType.EOF, getOffset() + 1, firstComment);
firstComment = null;
lastComment = null;
}
@@ -674,15 +674,23 @@ public abstract class AbstractScanner {
}
private int tokenizeInterpolatedExpression(int next, int start) {
- appendStringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "${", 0);
+ appendBeginToken(TokenType.STRING_INTERPOLATION_EXPRESSION);
next = advance();
while (next != -1) {
if (next == '}') {
- beginToken();
- appendToken(TokenType.CLOSE_CURLY_BRACKET);
- next = advance();
- beginToken();
- return next;
+ BeginToken begin = groupingStack.get(groupingStack.size() - 1);
+ if (begin.getType() == TokenType.OPEN_CURLY_BRACKET) {
+ beginToken();
+ appendEndToken(TokenType.CLOSE_CURLY_BRACKET, TokenType.OPEN_CURLY_BRACKET);
+ next = advance();
+ beginToken();
+ } else if (begin.getType() == TokenType.STRING_INTERPOLATION_EXPRESSION) {
+ beginToken();
+ appendEndToken(TokenType.CLOSE_CURLY_BRACKET, TokenType.STRING_INTERPOLATION_EXPRESSION);
+ next = advance();
+ beginToken();
+ return next;
+ }
} else {
next = bigSwitch(next);
}

Powered by Google App Engine
This is Rietveld 408576698