summaryrefslogtreecommitdiff
path: root/pygments/lexers/dotnet.py
diff options
context:
space:
mode:
authorGaurav Jain <gaurav@gauravjain.org>2014-05-14 22:08:28 -0400
committerGaurav Jain <gaurav@gauravjain.org>2014-05-14 22:08:28 -0400
commit745f1e190950d2510aecc33de9f1727e24ddddf0 (patch)
treecf23557213ee9ab7b6cae7cfb30b54f92bdf9fc6 /pygments/lexers/dotnet.py
parent41dc0d839cbee3a6bde8511d6fe246503b605c66 (diff)
downloadpygments-745f1e190950d2510aecc33de9f1727e24ddddf0.tar.gz
Replace all occurences of [a-zA-Z0-9_] with \w
Diffstat (limited to 'pygments/lexers/dotnet.py')
-rw-r--r--pygments/lexers/dotnet.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py
index d6691bf1..491ac9c8 100644
--- a/pygments/lexers/dotnet.py
+++ b/pygments/lexers/dotnet.py
@@ -58,7 +58,7 @@ class CSharpLexer(RegexLexer):
# see http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf
levels = {
- 'none': '@?[_a-zA-Z][a-zA-Z0-9_]*',
+ 'none': '@?[_a-zA-Z]\w*',
'basic': ('@?[_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + ']' +
'[' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl +
uni.Nd + uni.Pc + uni.Cf + uni.Mn + uni.Mc + ']*'),
@@ -170,7 +170,7 @@ class NemerleLexer(RegexLexer):
# http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf
levels = dict(
- none = '@?[_a-zA-Z][a-zA-Z0-9_]*',
+ none = '@?[_a-zA-Z]\w*',
basic = ('@?[_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + ']' +
'[' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl +
uni.Nd + uni.Pc + uni.Cf + uni.Mn + uni.Mc + ']*'),
@@ -336,7 +336,7 @@ class BooLexer(RegexLexer):
(r'"""(\\\\|\\"|.*?)"""', String.Double),
(r'"(\\\\|\\"|[^"]*?)"', String.Double),
(r"'(\\\\|\\'|[^']*?)'", String.Single),
- (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
+ (r'[a-zA-Z_]\w*', Name),
(r'(\d+\.\d*|\d*\.\d+)([fF][+-]?[0-9]+)?', Number.Float),
(r'[0-9][0-9\.]*(ms?|d|h|s)', Number),
(r'0\d+', Number.Oct),
@@ -351,10 +351,10 @@ class BooLexer(RegexLexer):
('[*/]', Comment.Multiline)
],
'funcname': [
- ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Function, '#pop')
+ ('[a-zA-Z_]\w*', Name.Function, '#pop')
],
'classname': [
- ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
+ ('[a-zA-Z_]\w*', Name.Class, '#pop')
],
'namespace': [
('[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace, '#pop')
@@ -425,7 +425,7 @@ class VbNetLexer(RegexLexer):
r'<=|>=|<>|[-&*/\\^+=<>]',
Operator),
('"', String, 'string'),
- ('[a-zA-Z_][a-zA-Z0-9_]*[%&@!#$]?', Name),
+ ('[a-zA-Z_]\w*[%&@!#$]?', Name),
('#.*?#', Literal.Date),
(r'(\d+\.\d*|\d*\.\d+)([fF][+-]?[0-9]+)?', Number.Float),
(r'\d+([SILDFR]|US|UI|UL)?', Number.Integer),
@@ -608,11 +608,11 @@ class FSharpLexer(RegexLexer):
(r'\b(open|module)(\s+)([a-zA-Z0-9_.]+)',
bygroups(Keyword, Text, Name.Namespace)),
- (r'\b(let!?)(\s+)([a-zA-Z0-9_]+)',
+ (r'\b(let!?)(\s+)(\w+)',
bygroups(Keyword, Text, Name.Variable)),
- (r'\b(type)(\s+)([a-zA-Z0-9_]+)',
+ (r'\b(type)(\s+)(\w+)',
bygroups(Keyword, Text, Name.Class)),
- (r'\b(member|override)(\s+)([a-zA-Z0-9_]+)(\.)([a-zA-Z0-9_]+)',
+ (r'\b(member|override)(\s+)(\w+)(\.)(\w+)',
bygroups(Keyword, Text, Name, Punctuation, Name.Function)),
(r'\b(%s)\b' % '|'.join(keywords), Keyword),
(r'(%s)' % '|'.join(keyopts), Operator),