summaryrefslogtreecommitdiff
path: root/pygments/lexers
diff options
context:
space:
mode:
authorblackbird <devnull@localhost>2006-10-22 10:37:56 +0200
committerblackbird <devnull@localhost>2006-10-22 10:37:56 +0200
commit73b2c7c6352e2ba46873c7c070189cc8817b6f69 (patch)
treed604c9dc32c56fbcccbaf03221d9b7e65d7269df /pygments/lexers
parent0c3c48236e40ed227b4f043577408caf051eb733 (diff)
downloadpygments-73b2c7c6352e2ba46873c7c070189cc8817b6f69.tar.gz
[svn] removed property regex (i think we don't need them really) and addded support for @strings in csharp lexer
Diffstat (limited to 'pygments/lexers')
-rw-r--r--pygments/lexers/dotnet.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py
index 55366e28..f7b53484 100644
--- a/pygments/lexers/dotnet.py
+++ b/pygments/lexers/dotnet.py
@@ -24,23 +24,14 @@ class CSharpLexer(RegexLexer):
flags = re.MULTILINE | re.DOTALL
- #: optional Comment or Whitespace
- _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
-
tokens = {
'root': [
# method names
(r'^([ \t]*(?:[a-zA-Z_][a-zA-Z0-9_\.]*\s+)+?)' # return arguments
r'([a-zA-Z_][a-zA-Z0-9_]*)' # method name
r'(\s*\([^;]*?\))' # signature
- r'(?=' + _ws + '\{)', # lookahead for {
+ r'(?=(?:\s|//.*?\n|/[*].*?[*]/)+\{)', # lookahead for {
bygroups(using(this), Name.Function, using(this))),
- # properties
- #(r'^([ \t]*(?:[a-zA-Z_][a-zA-Z0-9_\.]*\s+)+?)' # return arguments
- # r'([a-zA-Z_][a-zA-Z0-9_]*)' # property name
- # r'(?=' + _ws + r'\{' + _ws + # lookahead for
- # r'(?:get|set)' + _ws + r'\{)', # get/set
- # bygroups(using(this), Name.Function)),
(r'^\s*\[.*?\]', Name.Attribute),
(r'[^\S\n]+', Text),
(r'\\\n', Text), # line continuation
@@ -50,7 +41,7 @@ class CSharpLexer(RegexLexer):
(r'[~!%^&*()+=|\[\]:;,.<>/?-]', Text),
(r'[{}]', Keyword),
(r'@"(\\\\|\\"|[^"])*"', String),
- (r'"(\\\\|\\"|[^\n"])*"', String),
+ (r'"(\\\\|\\"|[^"\n])*["\n]', String),
(r"'\\.'|'[^\\]'", String.Char),
(r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?"
r"[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?", Number),