diff options
author | gbrandl <devnull@localhost> | 2009-03-09 19:42:24 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2009-03-09 19:42:24 +0100 |
commit | 932a2f35908b55678bc8f8da628873989278cabe (patch) | |
tree | 6f6eb1db80135c26a9a8c02573f0d583ca1d1b83 | |
parent | a2763205e2333ec2f98f8de162246fb0b114f3f2 (diff) | |
download | pygments-932a2f35908b55678bc8f8da628873989278cabe.tar.gz |
ModelicaLexer: Enhancements and fixes.
* 'Strings' and operator classes ('+') are now matched.
* removed unneeded and erroneous matches from other languages.
-rw-r--r-- | pygments/lexers/other.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py index 7c0b5e94..d85eafae 100644 --- a/pygments/lexers/other.py +++ b/pygments/lexers/other.py @@ -1563,18 +1563,17 @@ class ModelicaLexer(RegexLexer): (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment), ], 'statements': [ - (r'L?"', String, 'string'), - (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", - String.Char), + (r'"', String, 'string'), (r'(\d+\.\d*|\.\d+|\d+|\d.)[eE][+-]?\d+[lL]?', Number.Float), (r'(\d+\.\d*|\.\d+)', Number.Float), (r'\d+[Ll]?', Number.Integer), (r'[~!%^&*+=|?:<>/-]', Operator), (r'[()\[\]{},.;]', Punctuation), (r'(true|false|NULL|Real|Integer|Boolean)\b', Name.Builtin), - ('[a-zA-Z_][a-zA-Z0-9_]*:(?!:)', Name.Label), - ('\w+(\.\w+)+', Name.Class), - ('[a-zA-Z_][a-zA-Z0-9_]*', Name) + (r"('([~!%^&*+=|?:<>/-]+|[a-zA-Z_][\w]*)'|[a-zA-Z_][\w]*)+" + r"(\.('([~!%^&*+=|?:<>/-]|[a-zA-Z_][\w]*)'|[a-zA-Z_][\w]*)+)+", + Name.Class), + (r"('([~!%^&*+=|?:<>/-]+|[a-zA-Z_][\w]*)'|[a-zA-Z_][\w]*)", Name) ], 'root': [ include('whitespace'), |