Skip to content

Commit 869bc2d

Browse files
committed
Add check for newline in quoted strings
1 parent 5f6829c commit 869bc2d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/tokenizer.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,17 @@ impl<'a> TokenStream<'a> {
203203
'"' => {
204204
return Ok((StringValue, idx+1));
205205
}
206-
// TODO(tailhook) ensure SourceCharacter
207-
// and not newline
206+
'\n' => {
207+
return Err(Error::unexpected_message(
208+
"unterminated string value"));
209+
}
208210
_ => {}
209211
}
210212
prev_char = cur_char;
211213
}
214+
return Err(Error::unexpected_message(
215+
"unterminated string value"));
212216
}
213-
return Ok((Name, self.buf.len() - self.off));
214217
}
215218
_ => return Err(Error::unexpected_message(
216219
format_args!("unexpected character {:?}", cur_char))),

0 commit comments

Comments
 (0)