summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/lexers/functional.py8
-rw-r--r--tests/examplefiles/example_elixir.ex8
2 files changed, 14 insertions, 2 deletions
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py
index ed63be44..9b4d26c2 100644
--- a/pygments/lexers/functional.py
+++ b/pygments/lexers/functional.py
@@ -3184,10 +3184,14 @@ class ElixirLexer(RegexLexer):
PSEUDO_VAR = ['_', '__MODULE__', '__DIR__', '__ENV__', '__CALLER__']
- OPERATORS3 = ['<<<', '>>>', '|||', '&&&', '^^^', '~~~', '===', '!==']
+
+ OPERATORS3 = [
+ '<<<', '>>>', '|||', '&&&', '^^^', '~~~', '===', '!==',
+ '~>>', '<~>', '\|~>', '<\|>',
+ ]
OPERATORS2 = [
'==', '!=', '<=', '>=', '&&', '||', '<>', '++', '--', '|>', '=~',
- '->', '<-', '|', '.', '='
+ '->', '<-', '|', '.', '=', '~>', '<~',
]
OPERATORS1 = ['<', '>', '+', '-', '*', '/', '!', '^', '&']
diff --git a/tests/examplefiles/example_elixir.ex b/tests/examplefiles/example_elixir.ex
index 27462268..ddca7f60 100644
--- a/tests/examplefiles/example_elixir.ex
+++ b/tests/examplefiles/example_elixir.ex
@@ -66,6 +66,14 @@ y = true and false; z = false or true
"hello" |> String.upcase |> String.downcase()
{^z, a} = {true, x}
+# Free operators (added in 1.0.0)
+p ~>> f = bind(p, f)
+p1 ~> p2 = pair_right(p1, p2)
+p1 <~ p2 = pair_left(p1, p2)
+p1 <~> p2 = pair_both(p1, p2)
+p |~> f = map(p, f)
+p1 <|> p2 = either(p1, p2)
+
# Lists, tuples, maps, keywords
[1, :a, 'hello'] ++ [2, 3]
[:head | [?t, ?a, ?i, ?l]]