Commits

Dietmar Winkler committed 7ff436e

ModelicaLexer: Classes in end clauses are now properly detected

Avoiding false positives in "end if|when|while;"

Comments (0)

Files changed (1)

pygments/lexers/other.py

              r'terminate)\b', Name.Builtin),
         ],
         'classes': [
-            (r'(block|class|connector|function|model|package|'
-             r'record|type)(\s+)([A-Za-z_][\w]*|[\'][^\']+[\'])([;]?)',
+            (r'(block|class|connector|end|function|model|package|'
+             r'record|type)(\s+)((?!if|when|while)[A-Za-z_]\w*|[\'][^\']+[\'])([;]?)',
              bygroups(Keyword, Text, Name.Class, Text))
         ],
         'quoted_ident': [