Skip to content

Commit 3b4f14c

Browse files
Rust: Fixed Unicode char literals (#2550)
1 parent 4d31e22 commit 3b4f14c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

components/prism-rust.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
greedy: true
2727
},
2828
'char': {
29-
pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u{(?:[\da-fA-F]_*){1,6}|.)|[^\\\r\n\t'])'/,
29+
pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,
3030
greedy: true,
3131
alias: 'string'
3232
},

components/prism-rust.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+10-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
'a'
22
'स'
3+
'\''
4+
'\n'
5+
'\u{00e9}'
6+
'\x41'
37

48
----------------------------------------------------
59

610
[
711
["char", "'a'"],
8-
["char", "'स'"]
12+
["char", "'स'"],
13+
["char", "'\\''"],
14+
["char", "'\\n'"],
15+
["char", "'\\u{00e9}'"],
16+
["char", "'\\x41'"]
917
]
1018

1119
----------------------------------------------------
1220

13-
Checks for chars.
21+
Checks for chars.

0 commit comments

Comments
 (0)