Skip to content

Commit

Permalink
Elixir: Fix attributes consuming punctuation. Fix #1392
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Apr 16, 2018
1 parent 5b043cf commit dac0485
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/prism-elixir.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Prism.languages.elixir = {
alias: 'variable'
},
'attribute': {
pattern: /@[\S]+/,
pattern: /@\w+/,
alias: 'variable'
},
'number': /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-elixir.min.js

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

16 changes: 16 additions & 0 deletions tests/languages/elixir/issue1392.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
String.upcase(@fixed)

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

[
"String",
["punctuation", "."],
"upcase",
["punctuation", "("],
["attribute", "@fixed"],
["punctuation", ")"]
]

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

Ensure module attributes don't consume punctuation.

0 comments on commit dac0485

Please sign in to comment.