@@ -84,6 +84,107 @@ let raw_bytes = br#"This won't escape anything either \x01 \""#;
84
84
// ^^ storage.type
85
85
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.double - constant.character.escape
86
86
87
+ let b_simple = b'a' ;
88
+ // ^^^^ string.quoted.single
89
+ // ^ storage.type.string
90
+ // ^ punctuation.definition.string.begin
91
+ // ^ punctuation.definition.string.end
92
+ // ^ punctuation.terminator
93
+ let b_newline = b'\n' ;
94
+ // ^^^^^ string.quoted.single
95
+ // ^^ string.quoted.single constant.character.escape
96
+ let b_nul = b'\0' ;
97
+ // ^^ string.quoted.single constant.character.escape
98
+ let b_back = b'\\' ;
99
+ // ^^ string.quoted.single constant.character.escape
100
+ let b_quote = b'\'' ;
101
+ // ^^ string.quoted.single constant.character.escape
102
+ let b_esc_nul = b'\x00' ;
103
+ // ^^^^ string.quoted.single constant.character.escape
104
+ let b_esc_255 = b'\xff' ;
105
+ // ^^^^ string.quoted.single constant.character.escape
106
+ let b_esc_inv = b'\a' ;
107
+ // ^^ invalid.illegal.byte
108
+ // ^ string.quoted.single punctuation.definition.string.end
109
+ let b_inv_len = b' abc' ;
110
+ // ^ string.quoted.single
111
+ // ^^ invalid.illegal.byte
112
+ // ^ string.quoted.single punctuation.definition.string.end
113
+ let b_inv_uni = b'♥' ;
114
+ // ^ invalid.illegal.byte
115
+ // ^ string.quoted.single punctuation.definition.string.end
116
+ let b_inv_empty = b'' ;
117
+ // ^^^ string.quoted.single
118
+ // ^ punctuation.definition.string.begin
119
+ // ^ punctuation.definition.string.end
120
+ let b_unclosed1 = b'
121
+ // Avoid error on entire file.
122
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash - invalid - string
123
+
124
+ let bs_newline = b"abc\n " ;
125
+ // ^^^^^^^^ string.quoted.double
126
+ // ^ punctuation.definition.string.begin
127
+ // ^^ constant.character.escape
128
+ // ^ punctuation.definition.string.end
129
+ // ^ punctuation.terminator
130
+ let bs_nul = b"abc\0 " ;
131
+ // ^^ string.quoted.double constant.character.escape
132
+ let bs_esc_nul = b"abc\x00 " ;
133
+ // ^^^^ string.quoted.double constant.character.escape
134
+ let bs_esc_255 = b"abc\xff " ;
135
+ // ^^^^ string.quoted.double constant.character.escape
136
+ let bs_esc_inv = b"abc\a " ;
137
+ // ^^ string.quoted.double invalid.illegal.character.escape
138
+ // ^ string.quoted.double punctuation.definition.string.end - invalid
139
+
140
+ let char_newline = '\n' ;
141
+ // ^^^^ string.quoted.single
142
+ // ^ punctuation.definition.string.begin
143
+ // ^^ constant.character.escape
144
+ // ^ punctuation.definition.string.end
145
+ // ^ punctuation.terminator
146
+ let char_nul = '\0' ;
147
+ // ^^ string.quoted.single constant.character.escape
148
+ let char_extra_inv = ' ab' ;
149
+ // ^ string.quoted.single
150
+ // ^ invalid.illegal.char
151
+ // ^ string.quoted.single punctuation.definition.string.end
152
+ let char_ascii_esc_nul = '\x00' ;
153
+ // ^^^^ string.quoted.single constant.character.escape
154
+ let char_ascii_esc_127 = '\x7f' ;
155
+ // ^^^^ string.quoted.single constant.character.escape
156
+ let char_ascii_inv_255 = '\xff' ;
157
+ // ^^^^ invalid.illegal.char
158
+ let char_uni_esc = '\u{3b1}' ;
159
+ // ^^^^^^^ string.quoted.single constant.character.escape
160
+ let char_uni_esc_empty = ' \u{} ' ;
161
+ // ^^^^ invalid.illegal.char
162
+ let char_uni_esc_under_start = ' \u{_1_} ' ;
163
+ // ^^^^^^^ invalid.illegal.char
164
+ let char_uni_esc_under1 = ' \u{1_} ' ;
165
+ // ^^^^^^ string.quoted.single constant.character.escape
166
+ let char_uni_esc_under2 = ' \u{1_2__3___} ' ;
167
+ // ^^^^^^^^^^^^^ string.quoted.single constant.character.escape
168
+ let char_uni_esc_under3 = ' \u{10__FFFF} ' ;
169
+ // ^^^^^^^^^^^^ string.quoted.single constant.character.escape
170
+ let char_uni_esc_extra = '\u{1234567}' ;
171
+ // ^^^^^^^^^^^ invalid.illegal.char
172
+
173
+ let s_ascii_inv_255 = "\xff " ;
174
+ // ^^ string.quoted.double invalid.illegal.character.escape
175
+ let s_uni_esc_empty = "\u{} " ;
176
+ // ^^^^ string.quoted.double invalid.illegal.character.escape
177
+ let s_uni_esc_under_start = "\u{_1_} ";
178
+ // ^^^^^^^ string.quoted.double invalid.illegal.character.escape
179
+ let s_uni_esc_under1 = "\u{1_} " ;
180
+ // ^^^^^^ string.quoted.double constant.character.escape
181
+ let s_uni_esc_under2 = "\u{1_2__3___} ";
182
+ // ^^^^^^^^^^^^^ string.quoted.double constant.character.escape
183
+ let s_uni_esc_under3 = "\u{10__FFFF} ";
184
+ // ^^^^^^^^^^^^ string.quoted.double constant.character.escape
185
+ let s_uni_esc_extra = "\u{1234567} " ;
186
+ // ^^^^^^^^^^^ string.quoted.double invalid.illegal.character.escape
187
+
87
188
0 ;
88
189
// <- constant.numeric.integer.decimal
89
190
1_000u32 ;
0 commit comments