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

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

Issue 10962014: Fixes for raw string and block clean ups (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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
Index: compiler/java/com/google/dart/compiler/parser/DartParser.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
index 6b6f68339e243697f44a4e19e0b3689cf72a3af9..642682c6a3866973a5fbb7f649228ef9cdec642b 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -1755,14 +1755,15 @@ public class DartParser extends CompletionHooksParserBase {
if (!corelibParse) {
reportError(position(), ParserErrorCode.NATIVE_ONLY_CORE_LIB);
}
+ DartExpression body = null;
if (match(Token.STRING)) {
- parseStringWithPasting();
+ body = parseStringWithPasting();
}
if (match(Token.LBRACE) || match(Token.ARROW)) {
return done(parseFunctionStatementBody(!modifiers.isExternal(), true));
} else {
expect(Token.SEMICOLON);
- return done(new DartNativeBlock());
+ return done(new DartNativeBlock(body));
}
}
@@ -2703,11 +2704,14 @@ public class DartParser extends CompletionHooksParserBase {
}
// Synthesize a single String literal
+ List<DartStringLiteral> stringParts = new ArrayList<DartStringLiteral>();
StringBuilder builder = new StringBuilder();
for (DartExpression expr : expressions) {
- builder.append(((DartStringLiteral)expr).getValue());
+ DartStringLiteral stringPart = (DartStringLiteral)expr;
+ stringParts.add(stringPart);
+ builder.append(stringPart.getValue());
}
- return done(DartStringLiteral.get(builder.toString()));
+ return done(DartStringLiteral.get(builder.toString(), stringParts));
}
private DartExpression parseString() {

Powered by Google App Engine
This is Rietveld 408576698