1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
---input---
fn main() {
let raw_str = r"Escapes don't work
here: \x3F \u{211D}";
println!("{}", raw_str);
// If you need quotes in a raw string, add a pair of #s
let quotes = r#"And then I said:
"There is no escape!""#;
println!("{}", quotes);
// If you need "# in your string, just use more #s in the delimiter.
// There is no limit for the number of #s you can use.
let longer_delimiter = r###"A string
with "# in it. And even "##!"###;
println!("{}", longer_delimiter);
}
---tokens---
'fn' Keyword
' ' Text
'main' Name.Function
'(' Punctuation
')' Punctuation
' ' Text.Whitespace
'{' Punctuation
'\n' Text.Whitespace
' ' Text.Whitespace
'let' Keyword.Declaration
' ' Text.Whitespace
'raw_str' Name
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'r"Escapes don\'t work\n\n here: \\x3F \\u{211D}"' Literal.String
';' Punctuation
'\n' Text.Whitespace
' ' Text.Whitespace
'println!' Name.Function.Magic
'(' Punctuation
'"' Literal.String
'{}' Literal.String
'"' Literal.String
',' Punctuation
' ' Text.Whitespace
'raw_str' Name
')' Punctuation
';' Punctuation
'\n' Text.Whitespace
'\n' Text.Whitespace
' ' Text.Whitespace
'// If you need quotes in a raw string, add a pair of #s\n' Comment.Single
' ' Text.Whitespace
'let' Keyword.Declaration
' ' Text.Whitespace
'quotes' Name
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'r#"And then I said:\n\n "There is no escape!""#' Literal.String
';' Punctuation
'\n' Text.Whitespace
' ' Text.Whitespace
'println!' Name.Function.Magic
'(' Punctuation
'"' Literal.String
'{}' Literal.String
'"' Literal.String
',' Punctuation
' ' Text.Whitespace
'quotes' Name
')' Punctuation
';' Punctuation
'\n' Text.Whitespace
'\n' Text.Whitespace
' ' Text.Whitespace
'// If you need "# in your string, just use more #s in the delimiter.\n' Comment.Single
' ' Text.Whitespace
'// There is no limit for the number of #s you can use.\n' Comment.Single
' ' Text.Whitespace
'let' Keyword.Declaration
' ' Text.Whitespace
'longer_delimiter' Name
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'r###"A string\n with "# in it. And even "##!"###' Literal.String
';' Punctuation
'\n' Text.Whitespace
' ' Text.Whitespace
'println!' Name.Function.Magic
'(' Punctuation
'"' Literal.String
'{}' Literal.String
'"' Literal.String
',' Punctuation
' ' Text.Whitespace
'longer_delimiter' Name
')' Punctuation
';' Punctuation
'\n' Text.Whitespace
'}' Punctuation
'\n' Text.Whitespace
|