summaryrefslogtreecommitdiff
path: root/pygments/lexers/dotnet.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2016-02-14 17:10:00 +0100
committerGeorg Brandl <georg@python.org>2016-02-14 17:10:00 +0100
commitfff7caebc1befe71ab088a5d245fbb7708cfc0f2 (patch)
tree346052a8c49dd99ab7dc5abbdc603cc3717308c9 /pygments/lexers/dotnet.py
parent2882c34a141f4f36ded54d1473c6d4f73684ffc7 (diff)
downloadpygments-fff7caebc1befe71ab088a5d245fbb7708cfc0f2.tar.gz
Fix most complaints from regexlint.
Diffstat (limited to 'pygments/lexers/dotnet.py')
-rw-r--r--pygments/lexers/dotnet.py45
1 files changed, 23 insertions, 22 deletions
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py
index eac4b5e5..11b4573e 100644
--- a/pygments/lexers/dotnet.py
+++ b/pygments/lexers/dotnet.py
@@ -11,7 +11,7 @@
import re
from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, \
- using, this, default
+ using, this, default, words
from pygments.token import Punctuation, \
Text, Comment, Operator, Keyword, Name, String, Number, Literal, Other
from pygments.util import get_choice_opt, iteritems
@@ -375,8 +375,8 @@ class VbNetLexer(RegexLexer):
filenames = ['*.vb', '*.bas']
mimetypes = ['text/x-vbnet', 'text/x-vba'] # (?)
- uni_name = '[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + \
- '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc',
+ uni_name = '[_' + uni.combine('Ll', 'Lt', 'Lm', 'Nl') + ']' + \
+ '[' + uni.combine('Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc',
'Cf', 'Mn', 'Mc') + ']*'
flags = re.MULTILINE | re.IGNORECASE
@@ -394,25 +394,26 @@ class VbNetLexer(RegexLexer):
(r'[(){}!#,.:]', Punctuation),
(r'Option\s+(Strict|Explicit|Compare)\s+'
r'(On|Off|Binary|Text)', Keyword.Declaration),
- (r'(?<!\.)(AddHandler|Alias|'
- r'ByRef|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|'
- r'CDec|CDbl|CInt|CLng|CObj|Continue|CSByte|CShort|'
- r'CSng|CStr|CType|CUInt|CULng|CUShort|Declare|'
- r'Default|Delegate|DirectCast|Do|Each|Else|ElseIf|'
- r'EndIf|Erase|Error|Event|Exit|False|Finally|For|'
- r'Friend|Get|Global|GoSub|GoTo|Handles|If|'
- r'Implements|Inherits|Interface|'
- r'Let|Lib|Loop|Me|MustInherit|'
- r'MustOverride|MyBase|MyClass|Narrowing|New|Next|'
- r'Not|Nothing|NotInheritable|NotOverridable|Of|On|'
- r'Operator|Option|Optional|Overloads|Overridable|'
- r'Overrides|ParamArray|Partial|Private|Protected|'
- r'Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|'
- r'Return|Select|Set|Shadows|Shared|Single|'
- r'Static|Step|Stop|SyncLock|Then|'
- r'Throw|To|True|Try|TryCast|Wend|'
- r'Using|When|While|Widening|With|WithEvents|'
- r'WriteOnly)\b', Keyword),
+ (words((
+ 'AddHandler', 'Alias', 'ByRef', 'ByVal', 'Call', 'Case',
+ 'Catch', 'CBool', 'CByte', 'CChar', 'CDate', 'CDec', 'CDbl',
+ 'CInt', 'CLng', 'CObj', 'Continue', 'CSByte', 'CShort', 'CSng',
+ 'CStr', 'CType', 'CUInt', 'CULng', 'CUShort', 'Declare',
+ 'Default', 'Delegate', 'DirectCast', 'Do', 'Each', 'Else',
+ 'ElseIf', 'EndIf', 'Erase', 'Error', 'Event', 'Exit', 'False',
+ 'Finally', 'For', 'Friend', 'Get', 'Global', 'GoSub', 'GoTo',
+ 'Handles', 'If', 'Implements', 'Inherits', 'Interface', 'Let',
+ 'Lib', 'Loop', 'Me', 'MustInherit', 'MustOverride', 'MyBase',
+ 'MyClass', 'Narrowing', 'New', 'Next', 'Not', 'Nothing',
+ 'NotInheritable', 'NotOverridable', 'Of', 'On', 'Operator',
+ 'Option', 'Optional', 'Overloads', 'Overridable', 'Overrides',
+ 'ParamArray', 'Partial', 'Private', 'Protected', 'Public',
+ 'RaiseEvent', 'ReadOnly', 'ReDim', 'RemoveHandler', 'Resume',
+ 'Return', 'Select', 'Set', 'Shadows', 'Shared', 'Single',
+ 'Static', 'Step', 'Stop', 'SyncLock', 'Then', 'Throw', 'To',
+ 'True', 'Try', 'TryCast', 'Wend', 'Using', 'When', 'While',
+ 'Widening', 'With', 'WithEvents', 'WriteOnly'),
+ prefix='(?<!\.)', suffix=r'\b'), Keyword),
(r'(?<!\.)End\b', Keyword, 'end'),
(r'(?<!\.)(Dim|Const)\b', Keyword, 'dim'),
(r'(?<!\.)(Function|Sub|Property)(\s+)',