Skip to content

Commit

Permalink
pygments: Don't add a WarnOnErrorTokenFilter to lexers other than Coq
Browse files Browse the repository at this point in the history
  • Loading branch information
cpitclaudel committed Aug 27, 2021
1 parent 666b7a5 commit 622fa8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alectryon/pygments.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ def get_lexer(lang):
# LATER: Upstream Coq lexer, remove this branch
if lang == "coq":
lexer = CoqLexer(ensurenl=False)
# Coq only, since some lexers report plenty of errors
lexer.add_filter(WarnOnErrorTokenFilter())
else:
lexer = get_lexer_by_name(lang, ensurenl=False)
lexer.add_filter(TokenMergeFilter())
lexer.add_filter(WarnOnErrorTokenFilter())
return lexer

def add_tokens(tokens, lang="coq"):
Expand Down

0 comments on commit 622fa8e

Please sign in to comment.