diff options
author | Tim Hatch <tim@timhatch.com> | 2014-10-04 11:06:28 -0700 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-10-04 11:06:28 -0700 |
commit | 900ce2be770ce98e7a93d5e687ae6a0184b2015c (patch) | |
tree | 79326f0131a31ddb903294f2e21973a7de1c6a6a | |
parent | 9bfaf9454e6301a6b5da0c30f4ca029c1f227a97 (diff) | |
download | pygments-900ce2be770ce98e7a93d5e687ae6a0184b2015c.tar.gz |
Fix minor problems noted by regexlint and 'make check'
-rw-r--r-- | pygments/lexers/dylan.py | 2 | ||||
-rw-r--r-- | pygments/lexers/erlang.py | 2 | ||||
-rw-r--r-- | pygments/lexers/haskell.py | 2 | ||||
-rw-r--r-- | pygments/lexers/nit.py | 4 | ||||
-rw-r--r-- | pygments/lexers/scripting.py | 2 | ||||
-rw-r--r-- | pygments/lexers/theorem.py | 4 | ||||
-rw-r--r-- | tests/test_basic_api.py | 4 |
7 files changed, 11 insertions, 9 deletions
diff --git a/pygments/lexers/dylan.py b/pygments/lexers/dylan.py index 238bfe90..b4f2a976 100644 --- a/pygments/lexers/dylan.py +++ b/pygments/lexers/dylan.py @@ -160,7 +160,7 @@ class DylanLexer(RegexLexer): (r'\?' + valid_name, Name.Tag), # Punctuation - (r'(=>|::|#\(|#\[|##|\?|\?\?|\?=|[(){}\[\],\.;])', Punctuation), + (r'(=>|::|#\(|#\[|##|\?\?|\?=|\?|[(){}\[\],\.;])', Punctuation), # Most operators are picked up as names and then re-flagged. # This one isn't valid in a name though, so we pick it up now. diff --git a/pygments/lexers/erlang.py b/pygments/lexers/erlang.py index 622e5bf6..b8ed7ff2 100644 --- a/pygments/lexers/erlang.py +++ b/pygments/lexers/erlang.py @@ -94,7 +94,7 @@ class ErlangLexer(RegexLexer): (r'%.*\n', Comment), (words(keywords, suffix=r'\b'), Keyword), (words(builtins, suffix=r'\b'), Name.Builtin), - (words(word_operators, suffix='\b'), Operator.Word), + (words(word_operators, suffix=r'\b'), Operator.Word), (r'^-', Punctuation, 'directive'), (operators, Operator), (r'"', String, 'string'), diff --git a/pygments/lexers/haskell.py b/pygments/lexers/haskell.py index 6cee1223..9b13cbc6 100644 --- a/pygments/lexers/haskell.py +++ b/pygments/lexers/haskell.py @@ -320,7 +320,7 @@ class AgdaLexer(RegexLexer): 'module': [ (r'{-', Comment.Multiline, 'comment'), (r'[a-zA-Z][\w.]*', Name, '#pop'), - (r'[^a-zA-Z]*', Text) + (r'[^a-zA-Z]+', Text) ], 'comment': HaskellLexer.tokens['comment'], 'character': HaskellLexer.tokens['character'], diff --git a/pygments/lexers/nit.py b/pygments/lexers/nit.py index ba267086..84690cf2 100644 --- a/pygments/lexers/nit.py +++ b/pygments/lexers/nit.py @@ -37,7 +37,7 @@ class NitLexer(RegexLexer): 'else', 'while', 'loop', 'for', 'in', 'and', 'or', 'not', 'implies', 'return', 'continue', 'break', 'abort', 'assert', 'new', 'is', 'once', 'super', 'self', 'true', 'false', 'nullable', - 'null', 'as', 'isset', 'label', '__debug__'), suffix='(?=( |\n|\t|\r|\())'), + 'null', 'as', 'isset', 'label', '__debug__'), suffix=r'(?=[\r\n\t\( ])'), Keyword), (r'[A-Z][A-Za-z0-9_]*', Name.Class), (r'"""(([^\'\\]|\\.)|\\r|\\n)*(({{?)?(""?{{?)*""""*)', String), # Simple long string @@ -59,6 +59,6 @@ class NitLexer(RegexLexer): (r'==|!=|<==>|>=|>>|>|<=|<<|<|\+|-|=|/|\*|%|\+=|-=|!|@', Operator), (r'\(|\)|\[|\]|,|\.\.\.|\.\.|\.|::|:', Punctuation), (r'`{[^`]*`}', Text), # Extern blocks won't be Lexed by Nit - ('(\r|\n| |\t)+', Text), + (r'[\r\n\t ]+', Text), ], } diff --git a/pygments/lexers/scripting.py b/pygments/lexers/scripting.py index a82f1343..63a8c3a5 100644 --- a/pygments/lexers/scripting.py +++ b/pygments/lexers/scripting.py @@ -240,7 +240,7 @@ class ChaiscriptLexer(RegexLexer): default('#pop') ], 'badregex': [ - ('\n', Text, '#pop') + (r'\n', Text, '#pop') ], 'root': [ include('commentsandwhitespace'), diff --git a/pygments/lexers/theorem.py b/pygments/lexers/theorem.py index 94e6bae8..5292c892 100644 --- a/pygments/lexers/theorem.py +++ b/pygments/lexers/theorem.py @@ -300,8 +300,8 @@ class IsabelleLexer(RegexLexer): (r'\(\*', Comment, 'comment'), (r'\{\*', Comment, 'text'), - (r'(%s)' % '|'.join(operators), Operator), - (r'(%s)' % '|'.join(proof_operators), Operator.Word), + (words(operators), Operator), + (words(proof_operators), Operator.Word), (words(keyword_minor, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo), diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py index 37d170aa..eff49383 100644 --- a/tests/test_basic_api.py +++ b/tests/test_basic_api.py @@ -68,7 +68,9 @@ def test_lexer_classes(): try: tokens = list(inst.get_tokens(test_content)) except KeyboardInterrupt: - raise KeyboardInterrupt('interrupted %s.get_tokens(): test_content=%r' % (cls.__name__, test_content)) + raise KeyboardInterrupt( + 'interrupted %s.get_tokens(): test_content=%r' % + (cls.__name__, test_content)) txt = "" for token in tokens: assert isinstance(token, tuple) |