diff --git a/src/comp/front/lexer.rs b/src/comp/front/lexer.rs index b6f5ab9e9c3..08409bea14c 100644 --- a/src/comp/front/lexer.rs +++ b/src/comp/front/lexer.rs @@ -632,6 +632,9 @@ fn binop(&reader rdr, token::binop op) -> token::token { case ('"') { str::push_byte(accum_str, '"' as u8); } + case ('\n') { + consume_whitespace(rdr); + } case ('x') { str::push_char(accum_str, diff --git a/src/test/run-pass/str-multiline.rs b/src/test/run-pass/str-multiline.rs new file mode 100644 index 00000000000..c5ad5b15119 --- /dev/null +++ b/src/test/run-pass/str-multiline.rs @@ -0,0 +1,15 @@ +// -*- rust -*- + +use std; +import std::str; + +fn main() { + let str a = "this \ +is a test"; + let str b = "this \ + is \ + another \ + test"; + assert (str::eq(a, "this is a test")); + assert (str::eq(b, "this is another test")); +} \ No newline at end of file