summaryrefslogtreecommitdiff
path: root/pygments/lexers/dotnet.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/dotnet.py')
-rw-r--r--pygments/lexers/dotnet.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py
index f78df352..20f645e1 100644
--- a/pygments/lexers/dotnet.py
+++ b/pygments/lexers/dotnet.py
@@ -92,7 +92,7 @@ class CSharpLexer(RegexLexer):
(r'\n', Text),
(r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
(r'[{}]', Punctuation),
- (r'@"(\\\\|\\"|[^"])*"', String),
+ (r'@"(""|[^"])*"', String),
(r'"(\\\\|\\"|[^"\n])*["\n]', String),
(r"'\\.'|'[^\\]'", String.Char),
(r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?"
@@ -111,10 +111,12 @@ class CSharpLexer(RegexLexer):
r'ref|return|sealed|sizeof|stackalloc|static|'
r'switch|this|throw|true|try|typeof|'
r'unchecked|unsafe|virtual|void|while|'
- r'get|set|new|partial|yield|add|remove|value)\b', Keyword),
+ r'get|set|new|partial|yield|add|remove|value|alias|ascending|'
+ r'descending|from|group|into|orderby|select|where|'
+ r'join|equals)\b', Keyword),
(r'(global)(::)', bygroups(Keyword, Punctuation)),
- (r'(bool|byte|char|decimal|double|float|int|long|object|sbyte|'
- r'short|string|uint|ulong|ushort)\b\??', Keyword.Type),
+ (r'(bool|byte|char|decimal|double|dynamic|float|int|long|object|'
+ r'sbyte|short|string|uint|ulong|ushort|var)\b\??', Keyword.Type),
(r'(class|struct)(\s+)', bygroups(Keyword, Text), 'class'),
(r'(namespace|using)(\s+)', bygroups(Keyword, Text), 'namespace'),
(cs_ident, Name),
@@ -214,7 +216,7 @@ class NemerleLexer(RegexLexer):
(r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
(r'[{}]', Punctuation),
- (r'@"(\\\\|\\"|[^"])*"', String),
+ (r'@"(""|[^"])*"', String),
(r'"(\\\\|\\"|[^"\n])*["\n]', String),
(r"'\\.'|'[^\\]'", String.Char),
(r"0[xX][0-9a-fA-F]+[Ll]?", Number),
@@ -278,8 +280,9 @@ class NemerleLexer(RegexLexer):
],
'splice-string-content': [
(r'if|match', Keyword),
- (r'[~!%^&*+=|\[\]:;,.<>/?-]', Punctuation),
+ (r'[~!%^&*+=|\[\]:;,.<>/?-\\"$ ]', Punctuation),
(cs_ident, Name),
+ (r'\d+', Number),
(r'\(', Punctuation, '#push'),
(r'\)', Punctuation, '#pop')
]
@@ -581,7 +584,7 @@ class FSharpLexer(RegexLexer):
Name.Namespace, 'dotted'),
(r'\b([A-Z][A-Za-z0-9_\']*)', Name.Class),
(r'//.*?\n', Comment.Single),
- (r'\(\*', Comment, 'comment'),
+ (r'\(\*(?!\))', Comment, 'comment'),
(r'\b(%s)\b' % '|'.join(keywords), Keyword),
(r'(%s)' % '|'.join(keyopts), Operator),
(r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator),