Skip to content

Commit

Permalink
Attempts to fix Coconut syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
evhub committed Feb 12, 2016
1 parent e1a3748 commit 2b0254b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion coconut/highlighter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ class coclexer(Python3Lexer):
(words(const_vars, suffix=r"\b"), Keyword.Constant)
]
tokens["backtick"] = [(r"`.*?`", String.Backtick)]
tokens["name"] = tokens["name"] + [(r"[$]", Operator)]
tokens["name"] = tokens["name"] + [(r"[$|::]", Operator)]

def __init__(self, stripnl=False, stripall=False, ensurenl=True, tabsize=tablen, encoding=encoding):
"""Initialize the Python syntax highlighter."""
super(coclexer, self).__init__(stripnl=stripnl, stripall=stripall, ensurenl=ensurenl, tabsize=tabsize, encoding=encoding)
def add_filter(self, *args, **kwargs):
"""Disables the raiseonerror filter."""
if len(args) >= 1 and args[0] != "raiseonerror":
super(coclexer, self).add_filter(*args, **kwargs)

0 comments on commit 2b0254b

Please sign in to comment.