auto merge of #9674 : ben0x539/rust/raw-str, r=alexcrichton
This branch parses raw string literals as in #9411.
This commit is contained in:
commit
c9196290af
35 changed files with 274 additions and 80 deletions
13
src/test/compile-fail/raw-str-delim.rs
Normal file
13
src/test/compile-fail/raw-str-delim.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
static s: &'static str =
|
||||
r#x"#"x# //~ ERROR only `#` is allowed in raw string delimitation; found illegal character
|
||||
;
|
||||
14
src/test/compile-fail/raw-str-unbalanced.rs
Normal file
14
src/test/compile-fail/raw-str-unbalanced.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
static s: &'static str =
|
||||
r#"
|
||||
"## //~ ERROR expected `;` but found `#`
|
||||
;
|
||||
14
src/test/compile-fail/raw-str-unterminated.rs
Normal file
14
src/test/compile-fail/raw-str-unterminated.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
static s: &'static str =
|
||||
r#" string literal goes on
|
||||
and on
|
||||
//~^^ ERROR unterminated raw string
|
||||
16
src/test/pretty/raw-str-nonexpr.rs
Normal file
16
src/test/pretty/raw-str-nonexpr.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// pp-exact
|
||||
|
||||
#[cfg = r#"just parse this"#]
|
||||
extern mod blah = r##"blah"##;
|
||||
|
||||
fn main() { unsafe { asm!(r###"blah"###); } }
|
||||
BIN
src/test/run-pass/raw-str.rs
Normal file
BIN
src/test/run-pass/raw-str.rs
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue