Skip to content

Commit 5450e24

Browse files
Elixir: Added support for attributes names ending with ? (#2182)
1 parent 6fd5c96 commit 5450e24

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

components/prism-elixir.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Prism.languages.elixir = {
3737
alias: 'symbol'
3838
},
3939
// Look-ahead prevents bad highlighting of the :: operator
40-
'attr-name': /\w+:(?!:)/,
40+
'attr-name': /\w+\??:(?!:)/,
4141
'capture': {
4242
// Look-behind prevents bad highlighting of the && operator
4343
pattern: /(^|[^&])&(?:[^&\s\d()][^\s()]*|(?=\())/,

components/prism-elixir.min.js

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

tests/languages/elixir/attr-name_feature.test

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[a: 1, b: 2]
22
do: :this, else: :that
33
where: foo,
4-
select: bar
4+
select: bar,
5+
attr?: a
56

67
----------------------------------------------------
78

@@ -16,9 +17,10 @@ select: bar
1617
["punctuation", ","],
1718
["attr-name", "else:"], ["atom", ":that"],
1819
["attr-name", "where:"], " foo", ["punctuation", ","],
19-
["attr-name", "select:"], " bar"
20+
["attr-name", "select:"], " bar", ["punctuation", ","],
21+
["attr-name", "attr?:"], " a"
2022
]
2123

2224
----------------------------------------------------
2325

24-
Checks for keyword list keys.
26+
Checks for keyword list keys.

0 commit comments

Comments
 (0)