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

Unified Diff: runtime/vm/scanner.cc

Issue 9346005: Fix string escape, recognize escaped newline (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scanner.cc
===================================================================
--- runtime/vm/scanner.cc (revision 3998)
+++ runtime/vm/scanner.cc (working copy)
@@ -517,11 +517,12 @@
return;
}
break;
- case '\0':
- ErrorMsg("illegal escape sequence in string");
- EndStringLiteral();
- return;
default:
+ if ((c0_ == '\0') || (c0_ == '\n') && !string_is_multiline_) {
+ ErrorMsg("unterminated string literal");
+ EndStringLiteral();
+ return;
+ }
escape_char = c0_;
break;
}
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698