// Single line comment
/// Doc comments
/* Multiline
comment */
'C'; '\''; '\n'; '\u7FFF'; // Characters
"foo \"bar\" baz"; // String
r##"foo #"bar"# baz"##; // Raw string with # pairs
b'C'; b'\''; b'\n'; // Bytes
b"foo \"bar\" baz"; // Byte string
br##"foo #"bar"# baz"##; // Raw byte string with # pairs
123i; // type int
123u; // type uint
123_u; // type uint
0xff_u8; // type u8
0o70_i16; // type i16
0b1111_1111_1001_0000_i32; // type i32
123.0f64; // type f64
0.1f64; // type f64
0.1f32; // type f32
12E+99_f64; // type f64
true; false;
println!("x is {}", x);
fn next_two(x: int) -> (int, int) { (x + 1i, x + 2i) }
next_two(5i);
vec![1i, 2, 3];
#![warn(unstable)]
#[test]
fn a_test() {
// ...
}
let x = a | b;
let y = c || d;
let add_one = |x: int| -> int { 1i + x };
let printer = || { println!("x is: {}", x); };
There are certain edge cases where Prism will fail. There are always such cases in every regex-based syntax highlighter. However, Prism dares to be open and honest about them. If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
/* Nested block
/* comments
are */
not supported */
|x| x + 1i;