diff options
Diffstat (limited to 'pygments/lexers/nit.py')
-rw-r--r-- | pygments/lexers/nit.py | 8 |
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 |