summaryrefslogtreecommitdiff
path: root/pygments/lexers/functional.py
diff options
context:
space:
mode:
authorAlexei Sholik <alcosholik@gmail.com>2014-08-15 12:14:00 +0300
committerAlexei Sholik <alcosholik@gmail.com>2014-08-15 12:14:00 +0300
commitb5bc6c6d441b87f1b2cce478cd4de3c3143eac3a (patch)
tree94daa8e4614584b82e22ad5d7b7c4ce32ee91718 /pygments/lexers/functional.py
parenteeaff14517a7779c28d1e3eaacdc9ad501e862e8 (diff)
downloadpygments-b5bc6c6d441b87f1b2cce478cd4de3c3143eac3a.tar.gz
[Elixir] Resolve issues with ':' and '::' punctionation
Diffstat (limited to 'pygments/lexers/functional.py')
-rw-r--r--pygments/lexers/functional.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py
index 9c010b1e..b307a7d7 100644
--- a/pygments/lexers/functional.py
+++ b/pygments/lexers/functional.py
@@ -3135,7 +3135,7 @@ def gen_elixir_string_rules(name, symbol, token):
(r'[^#%s\\]+' % (symbol,), token),
include('escapes'),
(r'\\.', token),
- (r'(%s)(:?)' % (symbol,), bygroups(token, Punctuation), "#pop"),
+ (r'(%s)' % (symbol,), bygroups(token), "#pop"),
include('interpol')
]
return states
@@ -3186,13 +3186,13 @@ class ElixirLexer(RegexLexer):
OPERATORS3 = ['<<<', '>>>', '|||', '&&&', '^^^', '~~~', '===', '!==']
OPERATORS2 = [
- '==', '!=', '<=', '>=', '&&', '||', '<>', '++', '--', '|>', '=~'
+ '==', '!=', '<=', '>=', '&&', '||', '<>', '++', '--', '|>', '=~',
+ '->', '<-', '|', '.', '%', '='
]
OPERATORS1 = ['<', '>', '+', '-', '*', '/', '!', '^', '&']
PUNCTUATION = [
- '\\\\', '<<', '>>', '::', '->', '<-', '=>', '|', '(', ')',
- '{', '}', ';', ',', '.', '[', ']', '%', '='
+ '\\\\', '<<', '>>', '=>', '(', ')', '{', '}', ':', ';', ',', '[', ']'
]
def get_tokens_unprocessed(self, text):
@@ -3295,6 +3295,10 @@ class ElixirLexer(RegexLexer):
bygroups(String.Char, String.Escape)),
(r'\?\\?.', String.Char),
+ # '::' has to go before atoms
+ (r':::', String.Symbol),
+ (r'::', Operator),
+
# atoms
(r':' + special_atom_re, String.Symbol),
(r':' + complex_name_re, String.Symbol),