diff options
author | Tim Hatch <tim@timhatch.com> | 2014-06-05 16:23:02 -0700 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-06-05 16:23:02 -0700 |
commit | 1725e215f9833d271462ccc7d3bd5fc7c0e41bab (patch) | |
tree | ac8f4836d453157b0b86aa56c69d3e49ae3d93f8 /pygments | |
parent | 9d5a623b666c12b243c096fa48945536bdd5e1c2 (diff) | |
parent | ad0bd3e40bff8d2735d8ec6b08b3b71622821184 (diff) | |
download | pygments-1725e215f9833d271462ccc7d3bd5fc7c0e41bab.tar.gz |
Merged in llllllllll/pygments-main (pull request #369)
Adds commented form #;(sexpr) to comment out whole sexprs and support
Diffstat (limited to 'pygments')
-rw-r--r-- | pygments/lexers/functional.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py index efe4d240..bbee8c83 100644 --- a/pygments/lexers/functional.py +++ b/pygments/lexers/functional.py @@ -999,11 +999,16 @@ class SchemeLexer(RegexLexer): tokens = { 'root' : [ - # the comments - always starting with semicolon + # the comments # and going to the end of the line (r';.*$', Comment.Single), # multi-line comment (r'#\|', Comment.Multiline, 'multiline-comment'), + # commented form (entire sexpr folliwng) + (r'#;\s*\(', Comment, 'commented-form'), + # signifies that the program text that follows is written with the + # lexical and datum syntax described in r6rs + (r'#!r6rs', Comment), # whitespaces - usually not relevant (r'\s+', Text), @@ -1058,6 +1063,11 @@ class SchemeLexer(RegexLexer): (r'[^|#]+', Comment.Multiline), (r'[|#]', Comment.Multiline), ], + 'commented-form' : [ + (r'\(', Comment, '#push'), + (r'\)', Comment, '#pop'), + (r'[^()]+', Comment), + ], } |