summaryrefslogtreecommitdiff
path: root/pygments/lexers/dotnet.py
diff options
context:
space:
mode:
authorAlex Zimin <ziminav@gmail.com>2011-05-20 21:33:13 +0800
committerAlex Zimin <ziminav@gmail.com>2011-05-20 21:33:13 +0800
commit61b7028e766919dde16f7e9e274daa3e086c9690 (patch)
treecf22a8c16cf4f576eff0c9a99b7e54071e6c0a43 /pygments/lexers/dotnet.py
parent9140f695738b8c2ff6791926d4f190e252884d63 (diff)
downloadpygments-61b7028e766919dde16f7e9e274daa3e086c9690.tar.gz
Recursive string support
Diffstat (limited to 'pygments/lexers/dotnet.py')
-rw-r--r--pygments/lexers/dotnet.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py
index 21990122..6e74af1f 100644
--- a/pygments/lexers/dotnet.py
+++ b/pygments/lexers/dotnet.py
@@ -202,7 +202,7 @@ class NemerleLexer(RegexLexer):
(r'\n', Text),
(r'\$\s*"', String, 'splice-string'),
(r'\$\s*<#', String, 'splice-string2'),
- (r'<#(?:[^#>])*#>', String),
+ (r'<#', String, 'recursive-string'),
(r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
(r'[{}]', Punctuation),
(r'@"(\\\\|\\"|[^"])*"', String),
@@ -248,9 +248,15 @@ class NemerleLexer(RegexLexer):
(r'"', String, '#pop')
],
'splice-string2': [
- (r'[^#>$]', String),
+ (r'[^#<>$]', String),
(r'\$\(', Name, 'splice-string-content'),
(r'\$', Name, 'splice-string-ident'),
+ (r'<#', String, '#push'),
+ (r'#>', String, '#pop')
+ ],
+ 'recursive-string': [
+ (r'[^#<>]', String),
+ (r'<#', String, '#push'),
(r'#>', String, '#pop')
],
'splice-string-content': [