summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Sholik <alcosholik@gmail.com>2014-09-11 23:41:23 +0300
committerAlexei Sholik <alcosholik@gmail.com>2014-09-11 23:41:23 +0300
commit110968fa96000d3167a79beeb84d1a4047771b3b (patch)
treed7f5989dd67b474d4c9c44d67564b75a4d3701b4
parenta5e8f686cea05a44f62423cfdb5c628f452bb55a (diff)
downloadpygments-110968fa96000d3167a79beeb84d1a4047771b3b.tar.gz
[Elixir] Fix some inconsistencies in operator parsing.
-rw-r--r--pygments/lexers/functional.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py
index 9b4d26c2..04594036 100644
--- a/pygments/lexers/functional.py
+++ b/pygments/lexers/functional.py
@@ -3187,7 +3187,7 @@ class ElixirLexer(RegexLexer):
OPERATORS3 = [
'<<<', '>>>', '|||', '&&&', '^^^', '~~~', '===', '!==',
- '~>>', '<~>', '\|~>', '<\|>',
+ '~>>', '<~>', '|~>', '<|>',
]
OPERATORS2 = [
'==', '!=', '<=', '>=', '&&', '||', '<>', '++', '--', '|>', '=~',
@@ -3275,7 +3275,7 @@ class ElixirLexer(RegexLexer):
ops_re = r'(?:%s|%s|%s)' % (op3_re, op2_re, op1_re)
punctuation_re = "|".join(re.escape(s) for s in PUNCTUATION)
alnum = '[A-Za-z_0-9]'
- name_re = r'[a-z_]%s*[!\?]?' % alnum
+ name_re = r'(?:\.\.\.|[a-z_]%s*[!\?]?)' % alnum
modname_re = r'[A-Z]%(alnum)s*(?:\.[A-Z]%(alnum)s*)*' % {'alnum': alnum}
complex_name_re = r'(?:%s|%s|%s)' % (name_re, modname_re, ops_re)
special_atom_re = r'(?:\.\.\.|<<>>|%{}|%|{})'
@@ -3316,6 +3316,10 @@ class ElixirLexer(RegexLexer):
# @attributes
(r'@' + name_re, Name.Attribute),
+ # identifiers
+ (name_re, Name),
+ (r'(%%?)(%s)' % (modname_re,), bygroups(Punctuation, Name.Class)),
+
# operators and punctuation
(op3_re, Operator),
(op2_re, Operator),
@@ -3323,10 +3327,6 @@ class ElixirLexer(RegexLexer):
(r'&\d', Name.Entity), # anon func arguments
(op1_re, Operator),
- # identifiers
- (name_re, Name),
- (r'(%%?)(%s)' % (modname_re,), bygroups(Punctuation, Name.Class)),
-
# numbers
(r'0b[01]+', Number.Bin),
(r'0o[0-7]+', Number.Oct),