Skip to content

Commit 736c581

Browse files
authoredOct 3, 2021
Elm: Recognise unicode escapes as valid Char (#3105)
1 parent d908e45 commit 736c581

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
 

‎components/prism-elm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Prism.languages.elm = {
22
'comment': /--.*|\{-[\s\S]*?-\}/,
33
'char': {
4-
pattern: /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+))'/,
4+
pattern: /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}))'/,
55
greedy: true
66
},
77
'string': [

‎components/prism-elm.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/languages/elm/char_feature.test

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
'\n'
44
'\23'
55
'\xFE'
6+
'\u{0000}'
7+
'\u{1F648}'
8+
'\u{10FFFF}'
69

710
----------------------------------------------------
811

@@ -11,9 +14,12 @@
1114
["char", "'\\''"],
1215
["char", "'\\n'"],
1316
["char", "'\\23'"],
14-
["char", "'\\xFE'"]
17+
["char", "'\\xFE'"],
18+
["char", "'\\u{0000}'"],
19+
["char", "'\\u{1F648}'"],
20+
["char", "'\\u{10FFFF}'"]
1521
]
1622

1723
----------------------------------------------------
1824

19-
Checks for chars.
25+
Checks for chars.

0 commit comments

Comments
 (0)
Please sign in to comment.