aboutsummaryrefslogtreecommitdiff
path: root/java/com/google/turbine/parse/StreamLexer.java
diff options
context:
space:
mode:
authorcushon <cushon@google.com>2018-10-01 16:59:25 -0700
committerLiam Miller-Cushon <cushon@google.com>2018-10-17 20:45:16 -0700
commit4b6a14fefe99e5f172d233a5ccb7d124afa43c0f (patch)
tree37541dda2848c8ab8e95c02f6db3ae06a76991e2 /java/com/google/turbine/parse/StreamLexer.java
parent72e07cbbf3b539f280cc7059c03123d3433b7512 (diff)
downloadturbine-4b6a14fefe99e5f172d233a5ccb7d124afa43c0f.tar.gz
Report better errors for unterminated string literals
MOE_MIGRATED_REVID=215306391
Diffstat (limited to 'java/com/google/turbine/parse/StreamLexer.java')
-rw-r--r--java/com/google/turbine/parse/StreamLexer.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/java/com/google/turbine/parse/StreamLexer.java b/java/com/google/turbine/parse/StreamLexer.java
index 35fac45..c108332 100644
--- a/java/com/google/turbine/parse/StreamLexer.java
+++ b/java/com/google/turbine/parse/StreamLexer.java
@@ -370,6 +370,8 @@ public class StreamLexer implements Lexer {
saveValue(sb.toString());
eat();
return Token.STRING_LITERAL;
+ case '\n':
+ throw error(ErrorKind.UNTERMINATED_STRING);
case ASCII_SUB:
if (reader.done()) {
return Token.EOF;