diff options
author | Colin Kennedy <colinvfx@gmail.com> | 2019-12-04 23:02:28 -0800 |
---|---|---|
committer | Colin Kennedy <colinvfx@gmail.com> | 2019-12-04 23:02:28 -0800 |
commit | 5c329ea8832b36e4df2b323268f9c20c779b7e10 (patch) | |
tree | 2514d696acc98096104a73954cfc069560ca18a7 /pygments/lexers/usd.py | |
parent | c757abe2bda88e7d38ce78c7f4fad39321632009 (diff) | |
download | pygments-git-5c329ea8832b36e4df2b323268f9c20c779b7e10.tar.gz |
Moved punctuation into a single regex
Diffstat (limited to 'pygments/lexers/usd.py')
-rw-r--r-- | pygments/lexers/usd.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/pygments/lexers/usd.py b/pygments/lexers/usd.py index ab4e7f14..895fafa6 100644 --- a/pygments/lexers/usd.py +++ b/pygments/lexers/usd.py @@ -12,16 +12,6 @@ from pygments.token import Comment, Generic, Keyword, Name, Number, Operator, \ __all__ = ["UsdLexer"] -_PUNCTUATION = [ - (r"\(", Punctuation), - (r"\)", Punctuation), - (r"\[", Punctuation), - (r"\]", Punctuation), - ("{", Punctuation), - ("}", Punctuation), -] - - def _keywords(words, type_): """list[tuple[:class:`pygments.lexer.words`, :class:`pygments.token._TokenType`]].""" return [(words_(words, prefix=r"\b", suffix=r"\b"), type_)] @@ -117,7 +107,7 @@ class UsdLexer(RegexLexer): + _keywords(OPERATORS, Operator) # more attributes + [(type_ + r"\[\]", Keyword.Type) for type_ in TYPES] + _keywords(TYPES, Keyword.Type) - + _PUNCTUATION + + [(r"[\(\)\[\]{}]", Punctuation)], + [ ("#.*?$", Comment.Single), (",", Generic), |