From 09903f00ce46882cd17d7b54ac055ffdeb328ccc Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Sun, 2 Jun 2019 10:41:58 +0300 Subject: Fixes #1521, Erlang and Elixir shell lexers --- pygments/lexers/erlang.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygments/lexers/erlang.py b/pygments/lexers/erlang.py index 3d9b0fd7..07a46c80 100644 --- a/pygments/lexers/erlang.py +++ b/pygments/lexers/erlang.py @@ -163,7 +163,7 @@ class ErlangShellLexer(Lexer): filenames = ['*.erl-sh'] mimetypes = ['text/x-erl-shellsession'] - _prompt_re = re.compile(r'\d+>(?=\s|\Z)') + _prompt_re = re.compile(r'(?:\([\w@_.]+\))?\d+>(?=\s|\Z)') def get_tokens_unprocessed(self, text): erlexer = ErlangLexer(**self.options) @@ -495,7 +495,7 @@ class ElixirConsoleLexer(Lexer): aliases = ['iex'] mimetypes = ['text/x-elixir-shellsession'] - _prompt_re = re.compile(r'(iex|\.{3})(\(\d+\))?> ') + _prompt_re = re.compile(r'(iex|\.{3})((?:\([\w@_.]+\))?\d+|\(\d+\))?> ') def get_tokens_unprocessed(self, text): exlexer = ElixirLexer(**self.options) -- cgit v1.2.1