Skip to content

Commit

Permalink
Elm: Recognise unicode escapes as valid Char (#3105)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonweiting committed Oct 3, 2021
1 parent d908e45 commit 736c581
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/prism-elm.js
@@ -1,7 +1,7 @@
Prism.languages.elm = {
'comment': /--.*|\{-[\s\S]*?-\}/,
'char': {
pattern: /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+))'/,
pattern: /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}))'/,
greedy: true
},
'string': [
Expand Down
2 changes: 1 addition & 1 deletion components/prism-elm.min.js

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

10 changes: 8 additions & 2 deletions tests/languages/elm/char_feature.test
Expand Up @@ -3,6 +3,9 @@
'\n'
'\23'
'\xFE'
'\u{0000}'
'\u{1F648}'
'\u{10FFFF}'

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

Expand All @@ -11,9 +14,12 @@
["char", "'\\''"],
["char", "'\\n'"],
["char", "'\\23'"],
["char", "'\\xFE'"]
["char", "'\\xFE'"],
["char", "'\\u{0000}'"],
["char", "'\\u{1F648}'"],
["char", "'\\u{10FFFF}'"]
]

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

Checks for chars.
Checks for chars.

0 comments on commit 736c581

Please sign in to comment.