diff options
author | Georg Brandl <georg@python.org> | 2014-11-06 12:41:40 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-11-06 12:41:40 +0100 |
commit | 6fe296e816745123f1d3dbb3a55d8033ddb943d9 (patch) | |
tree | de7f51cf9a1c1db6390fb10eb6d94c76a6b85029 /pygments/lexers/prolog.py | |
parent | 24935597c6308c1e61c408abea331af5ef892579 (diff) | |
download | pygments-6fe296e816745123f1d3dbb3a55d8033ddb943d9.tar.gz |
Simplify charclasses in a few more modules
Diffstat (limited to 'pygments/lexers/prolog.py')
-rw-r--r-- | pygments/lexers/prolog.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pygments/lexers/prolog.py b/pygments/lexers/prolog.py index 95acf8e0..270239de 100644 --- a/pygments/lexers/prolog.py +++ b/pygments/lexers/prolog.py @@ -114,7 +114,7 @@ class LogtalkLexer(RegexLexer): (r'0x[0-9a-fA-F]+', Number.Hex), (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number), # Variables - (r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable), + (r'([A-Z_]\w*)', Name.Variable), # Event handlers (r'(after|before)(?=[(])', Keyword), # Message forwarding handler @@ -230,7 +230,7 @@ class LogtalkLexer(RegexLexer): # Ponctuation (r'[()\[\],.|]', Text), # Atoms - (r"[a-z][a-zA-Z0-9_]*", Text), + (r"[a-z]\w*", Text), (r"'", String, 'quoted_atom'), ], @@ -259,8 +259,8 @@ class LogtalkLexer(RegexLexer): r's(et_(logtalk|prolog)_flag|ynchronized))(?=[(])', Keyword, 'root'), (r'op(?=[(])', Keyword, 'root'), (r'(c(alls|oinductive)|module|reexport|use(s|_module))(?=[(])', Keyword, 'root'), - (r'[a-z][a-zA-Z0-9_]*(?=[(])', Text, 'root'), - (r'[a-z][a-zA-Z0-9_]*[.]', Text, 'root'), + (r'[a-z]\w*(?=[(])', Text, 'root'), + (r'[a-z]\w*[.]', Text, 'root'), ], 'entityrelations': [ @@ -272,9 +272,9 @@ class LogtalkLexer(RegexLexer): (r'0x[0-9a-fA-F]+', Number.Hex), (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number), # Variables - (r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable), + (r'([A-Z_]\w*)', Name.Variable), # Atoms - (r"[a-z][a-zA-Z0-9_]*", Text), + (r"[a-z]\w*", Text), (r"'", String, 'quoted_atom'), # Strings (r'"(\\\\|\\"|[^"])*"', String), |