diff options
author | Georg Brandl <georg@python.org> | 2014-10-16 09:33:43 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-16 09:33:43 +0200 |
commit | 5727fe42393a86817bd0f702d93c3fc399b68eb3 (patch) | |
tree | 796e787baf37e7362a802aaf9b6303127ff35098 /pygments/lexers/modeling.py | |
parent | f8f38adf82e18ea5c33d532ab3429bb22eed0921 (diff) | |
download | pygments-5727fe42393a86817bd0f702d93c3fc399b68eb3.tar.gz |
Fix "matches empty string" complaints from regexlint.
Diffstat (limited to 'pygments/lexers/modeling.py')
-rw-r--r-- | pygments/lexers/modeling.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pygments/lexers/modeling.py b/pygments/lexers/modeling.py index 02e2936e..9e7c172d 100644 --- a/pygments/lexers/modeling.py +++ b/pygments/lexers/modeling.py @@ -11,7 +11,7 @@ import re -from pygments.lexer import RegexLexer, include, bygroups, using +from pygments.lexer import RegexLexer, include, bygroups, using, default from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ Number, Punctuation @@ -78,11 +78,13 @@ class ModelicaLexer(RegexLexer): include('whitespace'), (r'(function|record)\b', Keyword.Reserved), (r'(if|for|when|while)\b', Keyword.Reserved, '#pop'), - (r'%s?' % _name, Name.Class, '#pop') + (_name, Name.Class, '#pop'), + default('#pop') ], 'package-prefix': [ include('whitespace'), - (r'%s?' % _name, Name.Namespace, '#pop') + (_name, Name.Namespace, '#pop'), + default('#pop') ], 'string': [ (r'"', String.Double, '#pop'), |