summaryrefslogtreecommitdiff
path: root/pygments/lexers/functional.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/functional.py')
-rw-r--r--pygments/lexers/functional.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py
index 16d9bad8..bbee8c83 100644
--- a/pygments/lexers/functional.py
+++ b/pygments/lexers/functional.py
@@ -999,9 +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),
@@ -1050,6 +1057,17 @@ class SchemeLexer(RegexLexer):
(r'(\(|\))', Punctuation),
(r'(\[|\])', Punctuation),
],
+ 'multiline-comment' : [
+ (r'#\|', Comment.Multiline, '#push'),
+ (r'\|#', Comment.Multiline, '#pop'),
+ (r'[^|#]+', Comment.Multiline),
+ (r'[|#]', Comment.Multiline),
+ ],
+ 'commented-form' : [
+ (r'\(', Comment, '#push'),
+ (r'\)', Comment, '#pop'),
+ (r'[^()]+', Comment),
+ ],
}