Skip to content

Commit

Permalink
Simplify patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
gordalina committed Feb 23, 2021
1 parent 0ea2d58 commit 5ba3aea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/prism-elixir.js
Expand Up @@ -40,8 +40,9 @@ Prism.languages.elixir = {
lookbehind: true,
alias: 'symbol'
},
'class-name': {
pattern: /\b[A-Z](?:[A-Z_a-z]|\dx?)*\b/
'atom-module': {
pattern: /\b[A-Z][A-Z_a-z0-9]*\b/,
alias: 'class-name'
},
// Look-ahead prevents bad highlighting of the :: operator
'attr-name': /\w+\??:(?!:)/,
Expand All @@ -52,7 +53,7 @@ Prism.languages.elixir = {
alias: 'function'
},
'function-call': {
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(\?|!)?(?=\s*(?:\.\s*\s*)?\()/,
pattern: /[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\?|!)?(?:(?=\s*(?:\.\s*)?\()|\/\d+)/,
alias: 'function'
},
'argument': {
Expand Down Expand Up @@ -81,7 +82,7 @@ Prism.languages.elixir = {
lookbehind: true
}
],
'punctuation': /<<|>>|[.,%\[\]{}()]/
'punctuation': /<<|>>|[.,%\[\]{}()]/,
};

Prism.languages.insertBefore('elixir', 'keyword', {
Expand Down

0 comments on commit 5ba3aea

Please sign in to comment.