diff options
Diffstat (limited to 'pygments/lexers/other.py')
-rw-r--r-- | pygments/lexers/other.py | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py index cef71f95..42d02301 100644 --- a/pygments/lexers/other.py +++ b/pygments/lexers/other.py @@ -156,15 +156,15 @@ class ECLLexer(RegexLexer): include('hash'), (r'"', String, 'string'), (r'\'', String, 'string'), - (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float), + (r'(\d+\.\d*|\.\d+|\d+)e[+-]?\d+[lu]*', Number.Float), (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), - (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex), - (r'0[0-7]+[LlUu]*', Number.Oct), + (r'0x[0-9a-f]+[lu]*', Number.Hex), + (r'0[0-7]+[lu]*', Number.Oct), (r'\d+[LlUu]*', Number.Integer), (r'\*/', Error), (r'[~!%^&*+=|?:<>/-]+', Operator), (r'[{}()\[\],.;]', Punctuation), - (r'[a-zA-Z_]\w*', Name), + (r'[a-z_]\w*', Name), ], 'hash': [ (r'^#.*$', Comment.Preproc), @@ -1306,9 +1306,9 @@ class ModelicaLexer(RegexLexer): (r'\d+[Ll]?', Number.Integer), (r'[~!%^&*+=|?:<>/-]', Operator), (r'(true|false|NULL|Real|Integer|Boolean)\b', Name.Builtin), - (r'([a-zA-Z_][\w]*|[\'][^\']+[\'])' + (r'([a-z_][\w]*|\'[^\']+\')' r'([\[\d,:\]]*)' - r'(\.([a-zA-Z_][\w]*|[\'][^\']+[\']))+' + r'(\.([a-z_][\w]*|\'[^\']+\'))+' r'([\[\d,:\]]*)', Name.Class), (r'(\'[\w\+\-\*\/\^]+\'|\w+)', Name), (r'[()\[\]{},.;]', Punctuation), @@ -1350,7 +1350,7 @@ class ModelicaLexer(RegexLexer): 'classes': [ (r'(operator)?(\s+)?(block|class|connector|end|function|model|' r'operator|package|record|type)(\s+)' - r'((?!if|for|when|while)[A-Za-z_]\w*|[\'][^\']+[\'])([;]?)', + r'((?!if|for|when|while)[a-z_]\w*|\'[^\']+\')([;]?)', bygroups(Keyword, Text, Keyword, Text, Name.Class, Text)) ], 'quoted_ident': [ @@ -1359,7 +1359,7 @@ class ModelicaLexer(RegexLexer): ], 'string': [ (r'"', String, '#pop'), - (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', + (r'\\([\\abfnrtv"\']|x[a-f0-9]{2,4}|[0-7]{1,3})', String.Escape), (r'[^\\"\n]+', String), # all other characters (r'\\\n', String), # line continuation @@ -1387,7 +1387,7 @@ class RebolLexer(RegexLexer): re.IGNORECASE - escape_re = r'(?:\^\([0-9a-fA-F]{1,4}\)*)' + escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)' def word_callback(lexer, match): word = match.group() @@ -1483,9 +1483,9 @@ class RebolLexer(RegexLexer): 'script': [ (r'\s+', Text), (r'#"', String.Char, 'char'), - (r'#{[0-9a-fA-F]*}', Number.Hex), + (r'#{[0-9a-f]*}', Number.Hex), (r'2#{', Number.Hex, 'bin2'), - (r'64#{[0-9a-zA-Z+/=\s]*}', Number.Hex), + (r'64#{[0-9a-z+/=\s]*}', Number.Hex), (r'"', String, 'string'), (r'{', String, 'string2'), (r';#+.*\n', Comment.Special), @@ -1493,9 +1493,9 @@ class RebolLexer(RegexLexer): (r';.*\n', Comment), (r'%"', Name.Decorator, 'stringFile'), (r'%[^(\^{^")\s\[\]]+', Name.Decorator), - (r'[+-]?([a-zA-Z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money + (r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money (r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time - (r'\d+[\-\/][0-9a-zA-Z]+[\-\/]\d+(\/\d+\:\d+((\:\d+)?' + (r'\d+[\-\/][0-9a-z]+[\-\/]\d+(\/\d+\:\d+((\:\d+)?' r'([\.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date (r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple (r'\d+[xX]\d+', Keyword.Constant), # pair @@ -1503,7 +1503,7 @@ class RebolLexer(RegexLexer): (r'[+-]?\d+(\'\d+)?[\.,]\d*', Number.Float), (r'[+-]?\d+(\'\d+)?', Number), (r'[\[\]\(\)]', Generic.Strong), - (r'[a-zA-Z]+[^(\^{"\s:)]*://[^(\^{"\s)]*', Name.Decorator), # url + (r'[a-z]+[^(\^{"\s:)]*://[^(\^{"\s)]*', Name.Decorator), # url (r'mailto:[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # url (r'[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # email (r'comment\s"', Comment, 'commentString1'), @@ -1512,7 +1512,7 @@ class RebolLexer(RegexLexer): (r'comment\s[^(\s{\"\[]+', Comment), (r'/[^(\^{^")\s/[\]]*', Name.Attribute), (r'([^(\^{^")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback), - (r'<[a-zA-Z0-9:._-]*>', Name.Tag), + (r'<[\w:.-]*>', Name.Tag), (r'<[^(<>\s")]+', Name.Tag, 'tag'), (r'([^(\^{^")\s]+)', Text), ], @@ -1619,7 +1619,7 @@ class ABAPLexer(RegexLexer): (r'\".*?\n', Comment.Single), ], 'variable-names': [ - (r'<[\S_]+>', Name.Variable), + (r'<\S+>', Name.Variable), (r'\w[\w~]*(?:(\[\])|->\*)?', Name.Variable), ], 'root': [ @@ -2393,7 +2393,7 @@ class MaqlLexer(RegexLexer): r'SYNCHRONIZE|TYPE|DEFAULT|ORDER|ASC|DESC|HYPERLINK|' r'INCLUDE|TEMPLATE|MODIFY)\b', Keyword), # FUNCNAME - (r'[a-zA-Z]\w*\b', Name.Function), + (r'[a-z]\w*\b', Name.Function), # Comments (r'#.*', Comment.Single), # Punctuation @@ -2428,7 +2428,7 @@ class GoodDataCLLexer(RegexLexer): # Comments (r'#.*', Comment.Single), # Function call - (r'[a-zA-Z]\w*', Name.Function), + (r'[a-z]\w*', Name.Function), # Argument list (r'\(', Token.Punctuation, 'args-list'), # Punctuation @@ -2439,7 +2439,7 @@ class GoodDataCLLexer(RegexLexer): 'args-list': [ (r'\)', Token.Punctuation, '#pop'), (r',', Token.Punctuation), - (r'[a-zA-Z]\w*', Name.Variable), + (r'[a-z]\w*', Name.Variable), (r'=', Operator), (r'"', Literal.String, 'string-literal'), (r'[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]{1,3})?', Literal.Number), @@ -3202,9 +3202,9 @@ class VGLLexer(RegexLexer): (r'(true|false|null|empty|error|locked)', Keyword.Constant), (r'[~\^\*\#!%&\[\]\(\)<>\|+=:;,./?-]', Operator), (r'"[^"]*"', String), - (r'(\.)([a-z_\$][a-z0-9_\$]*)', bygroups(Operator, Name.Attribute)), + (r'(\.)([a-z_\$][\w\$]*)', bygroups(Operator, Name.Attribute)), (r'[0-9][0-9]*(\.[0-9]+(e[+\-]?[0-9]+)?)?', Number), - (r'[a-z_\$][a-z0-9_\$]*', Name), + (r'[a-z_\$][\w\$]*', Name), (r'[\r\n]+', Text), (r'\s+', Text) ] @@ -3800,15 +3800,15 @@ class RexxLexer(RegexLexer): (r'"', String, 'string_double'), (r"'", String, 'string_single'), (r'[0-9]+(\.[0-9]+)?(e[+-]?[0-9])?', Number), - (r'([a-z_][a-z0-9_]*)(\s*)(:)(\s*)(procedure)\b', + (r'([a-z_]\w*)(\s*)(:)(\s*)(procedure)\b', bygroups(Name.Function, Whitespace, Operator, Whitespace, Keyword.Declaration)), - (r'([a-z_][a-z0-9_]*)(\s*)(:)', + (r'([a-z_]\w*)(\s*)(:)', bygroups(Name.Label, Whitespace, Operator)), include('function'), include('keyword'), include('operator'), - (r'[a-z_][a-z0-9_]*', Text), + (r'[a-z_]\w*', Text), ], 'function': [ (r'(abbrev|abs|address|arg|b2x|bitand|bitor|bitxor|c2d|c2x|' @@ -3856,7 +3856,7 @@ class RexxLexer(RegexLexer): _ADDRESS_PATTERN = _c(r'^\s*address\s+') _DO_WHILE_PATTERN = _c(r'^\s*do\s+while\b') _IF_THEN_DO_PATTERN = _c(r'^\s*if\b.+\bthen\s+do\s*$') - _PROCEDURE_PATTERN = _c(r'^\s*([a-z_][a-z0-9_]*)(\s*)(:)(\s*)(procedure)\b') + _PROCEDURE_PATTERN = _c(r'^\s*([a-z_]\w*)(\s*)(:)(\s*)(procedure)\b') _ELSE_DO_PATTERN = _c(r'\belse\s+do\s*$') _PARSE_ARG_PATTERN = _c(r'^\s*parse\s+(upper\s+)?(arg|value)\b') PATTERNS_AND_WEIGHTS = ( @@ -4255,7 +4255,7 @@ class RedLexer(RegexLexer): flags = re.IGNORECASE | re.MULTILINE - escape_re = r'(?:\^\([0-9a-fA-F]{1,4}\)*)' + escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)' def word_callback(lexer, match): word = match.group() @@ -4326,10 +4326,10 @@ class RedLexer(RegexLexer): 'script': [ (r'\s+', Text), (r'#"', String.Char, 'char'), - (r'#{[0-9a-fA-F\s]*}', Number.Hex), + (r'#{[0-9a-f\s]*}', Number.Hex), (r'2#{', Number.Hex, 'bin2'), - (r'64#{[0-9a-zA-Z+/=\s]*}', Number.Hex), - (r'([0-9a-fA-F]+)(h)((\s)|(?=[\[\]{}""\(\)]))', + (r'64#{[0-9a-z+/=\s]*}', Number.Hex), + (r'([0-9a-f]+)(h)((\s)|(?=[\[\]{}""\(\)]))', bygroups(Number.Hex, Name.Variable, Whitespace)), (r'"', String, 'string'), (r'{', String, 'string2'), @@ -4338,9 +4338,9 @@ class RedLexer(RegexLexer): (r';.*\n', Comment), (r'%"', Name.Decorator, 'stringFile'), (r'%[^(\^{^")\s\[\]]+', Name.Decorator), - (r'[+-]?([a-zA-Z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money + (r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money (r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time - (r'\d+[\-\/][0-9a-zA-Z]+[\-\/]\d+(\/\d+\:\d+((\:\d+)?' + (r'\d+[\-\/][0-9a-z]+[\-\/]\d+(\/\d+\:\d+((\:\d+)?' r'([\.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date (r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple (r'\d+[xX]\d+', Keyword.Constant), # pair @@ -4348,7 +4348,7 @@ class RedLexer(RegexLexer): (r'[+-]?\d+(\'\d+)?[\.,]\d*', Number.Float), (r'[+-]?\d+(\'\d+)?', Number), (r'[\[\]\(\)]', Generic.Strong), - (r'[a-zA-Z]+[^(\^{"\s:)]*://[^(\^{"\s)]*', Name.Decorator), # url + (r'[a-z]+[^(\^{"\s:)]*://[^(\^{"\s)]*', Name.Decorator), # url (r'mailto:[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # url (r'[^(\^{"@\s)]+@[^(\^{"@\s)]+', Name.Decorator), # email (r'comment\s"', Comment, 'commentString1'), |