Chromium Code Reviews| 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 5cd44292c5c2388c0fa99702be067290c4c847bd..e710149510e67e59db80fad5896d45b09ee62252 100644 |
| --- a/compiler/java/com/google/dart/compiler/parser/DartScanner.java |
| +++ b/compiler/java/com/google/dart/compiler/parser/DartScanner.java |
| @@ -861,7 +861,7 @@ public class DartScanner { |
| int quote = internalState.getQuote(); |
| boolean multiLine = internalState.isMultiLine(); |
| // TODO(floitsch): Do we really need a StringBuffer to accumulate the characters? |
| - StringBuffer tokenValueBuffer = new StringBuffer(); |
| + StringBuilder tokenValueBuffer = new StringBuilder(); |
| while (true) { |
| if (isEos()) { |
| // Unterminated string (either multi-line or not). |
| @@ -880,6 +880,11 @@ public class DartScanner { |
| advance(); |
| break; |
| } |
| + } else if (c == '\n' && !multiLine) { |
|
codefu
2012/02/16 18:59:38
Will this catch the case on windows as well?
scheglov
2012/02/16 19:13:26
Yes, on Windows \r\n is used.
|
| + advance(); |
| + internalState.popMode(); |
| + // unterminated (non multi-line) string |
| + return Token.ILLEGAL; |
| } |
| tokenValueBuffer.appendCodePoint(c); |
| } |