summaryrefslogtreecommitdiff
path: root/pygments/lexers/nit.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-11-06 14:00:28 +0100
committerGeorg Brandl <georg@python.org>2014-11-06 14:00:28 +0100
commitc863ac19ce4d591b93be8b36cb69b04422c8dc9f (patch)
tree98bd701a6fb0da18d92897960eabdd9a139ad7d4 /pygments/lexers/nit.py
parent90fe03b0f663810f4b6718d89b5e830ec2c67960 (diff)
downloadpygments-c863ac19ce4d591b93be8b36cb69b04422c8dc9f.tar.gz
Simplify charclasses in the remaining modules
Diffstat (limited to 'pygments/lexers/nit.py')
-rw-r--r--pygments/lexers/nit.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pygments/lexers/nit.py b/pygments/lexers/nit.py
index e0947447..5d4864db 100644
--- a/pygments/lexers/nit.py
+++ b/pygments/lexers/nit.py
@@ -37,9 +37,9 @@ class NitLexer(RegexLexer):
'else', 'while', 'loop', 'for', 'in', 'and', 'or', 'not',
'implies', 'return', 'continue', 'break', 'abort', 'assert',
'new', 'is', 'once', 'super', 'self', 'true', 'false', 'nullable',
- 'null', 'as', 'isset', 'label', '__debug__'), suffix=r'(?=[\r\n\t\( ])'),
+ 'null', 'as', 'isset', 'label', '__debug__'), suffix=r'(?=[\r\n\t( ])'),
Keyword),
- (r'[A-Z][A-Za-z0-9_]*', Name.Class),
+ (r'[A-Z]\w*', Name.Class),
(r'"""(([^\'\\]|\\.)|\\r|\\n)*((\{\{?)?(""?\{\{?)*""""*)', String), # Simple long string
(r'\'\'\'(((\\.|[^\'\\])|\\r|\\n)|\'((\\.|[^\'\\])|\\r|\\n)|'
r'\'\'((\\.|[^\'\\])|\\r|\\n))*\'\'\'', String), # Simple long string alt
@@ -54,8 +54,8 @@ class NitLexer(RegexLexer):
(r'[0-9]+', Number.Integer),
(r'[0-9]*.[0-9]+', Number.Float),
(r'0(x|X)[0-9A-Fa-f]+', Number.Hex),
- (r'[a-z][A-Za-z0-9_]*', Name),
- (r'_[A-Za-z0-9_]+', Name.Variable.Instance),
+ (r'[a-z]\w*', Name),
+ (r'_\w+', Name.Variable.Instance),
(r'==|!=|<==>|>=|>>|>|<=|<<|<|\+|-|=|/|\*|%|\+=|-=|!|@', Operator),
(r'\(|\)|\[|\]|,|\.\.\.|\.\.|\.|::|:', Punctuation),
(r'`\{[^`]*`\}', Text), # Extern blocks won't be Lexed by Nit