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

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

Issue 10540133: Fix for issue 1351 - Analyzer accepts non-multiline strings with newlines (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/parser/DartScanner.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartScanner.java b/compiler/java/com/google/dart/compiler/parser/DartScanner.java
index e710149510e67e59db80fad5896d45b09ee62252..eef0f3b61343b6354acad9cb9cec0664f9dc4d8e 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartScanner.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartScanner.java
@@ -946,6 +946,14 @@ public class DartScanner {
c = lookahead(0);
advance();
switch (c) {
+ case '\n':
+ if (!multiLine) {
+ // TODO(zundel): better way to report error?
+ internalState.resetModes();
+ return Token.ILLEGAL;
+ }
+ c = '\n';
+ break;
case 'b':
c = 0x08;
break;
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698