Skip to content

Commit

Permalink
Rust: Fixed Unicode char literals (#2550)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Sep 13, 2020
1 parent 4d31e22 commit 3b4f14c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/prism-rust.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
greedy: true
},
'char': {
pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u{(?:[\da-fA-F]_*){1,6}|.)|[^\\\r\n\t'])'/,
pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,
greedy: true,
alias: 'string'
},
Expand Down
2 changes: 1 addition & 1 deletion components/prism-rust.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions tests/languages/rust/char_feature.test
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
'a'
'स'
'\''
'\n'
'\u{00e9}'
'\x41'

----------------------------------------------------

[
["char", "'a'"],
["char", "'स'"]
["char", "'स'"],
["char", "'\\''"],
["char", "'\\n'"],
["char", "'\\u{00e9}'"],
["char", "'\\x41'"]
]

----------------------------------------------------

Checks for chars.
Checks for chars.

0 comments on commit 3b4f14c

Please sign in to comment.