1. Joshua Peek
  2. pygments

Commits

ziaw  committed e7e8d10

Recursive string support

  • Participants
  • Parent commits e1d19e7
  • Branches default

Comments (0)

Files changed (1)

File pygments/lexers/dotnet.py

View file
  • Ignore whitespace
                 (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),
                 (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': [