diff options
author | Joe Jevnik <joejev@gmail.com> | 2014-06-04 22:50:52 -0400 |
---|---|---|
committer | Joe Jevnik <joejev@gmail.com> | 2014-06-04 22:50:52 -0400 |
commit | 5550fcbc4c47b18f0d8bf4bf2c4982b9057c794b (patch) | |
tree | 67fee669e4066555383e5926d8cdbbfd07a93beb /pygments | |
parent | fa154d6c41ab291e63371399e9f5b48cf9b6a69a (diff) | |
download | pygments-5550fcbc4c47b18f0d8bf4bf2c4982b9057c794b.tar.gz |
Adds commented form #;(sexpr) to comment out whole sexprs and support
for the '#!r6rs' lexeme as defined in:
http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2.3
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), + ], } |