summaryrefslogtreecommitdiff
path: root/tests/examplefiles/scheme
diff options
context:
space:
mode:
authorJean Abou Samra <jean@abou-samra.fr>2022-02-01 13:34:22 +0100
committerGeorg Brandl <georg@python.org>2022-02-08 16:36:49 +0100
commit801d2b24ddc31bfdc6da698f9befc992cf943193 (patch)
tree70ab6ce8da294d30aa2b666fad5b2e4070461093 /tests/examplefiles/scheme
parent93d4cce817553c4bc2694747cfa6b3a04c6e5ddf (diff)
downloadpygments-git-801d2b24ddc31bfdc6da698f9befc992cf943193.tar.gz
Scheme: support datum commented with #;
Previously, #; awaited an S-expression but could not cope with a simple datum like a number literal. While at it, also support R6RS brackets for S-expressions.
Diffstat (limited to 'tests/examplefiles/scheme')
-rw-r--r--tests/examplefiles/scheme/r6rs-comments.scm8
-rw-r--r--tests/examplefiles/scheme/r6rs-comments.scm.output39
2 files changed, 42 insertions, 5 deletions
diff --git a/tests/examplefiles/scheme/r6rs-comments.scm b/tests/examplefiles/scheme/r6rs-comments.scm
index cd5c3636..4c4188f5 100644
--- a/tests/examplefiles/scheme/r6rs-comments.scm
+++ b/tests/examplefiles/scheme/r6rs-comments.scm
@@ -6,6 +6,8 @@
of a non-negative integer.
+ #| These comments can be nested too. |#
+
|#
(define fact
@@ -17,7 +19,9 @@
(if (= n 0)
#;(= n 1)
-
- 1 ; identity of *
+ #;(= n [1+ (eval '(n))])1
+ #;[= n (1+ [eval '[n]])];; another comment
+ #;1
+ ; identity of *
(* n (fact (- n 1))))))
diff --git a/tests/examplefiles/scheme/r6rs-comments.scm.output b/tests/examplefiles/scheme/r6rs-comments.scm.output
index a8232cd4..6611cb9a 100644
--- a/tests/examplefiles/scheme/r6rs-comments.scm.output
+++ b/tests/examplefiles/scheme/r6rs-comments.scm.output
@@ -2,7 +2,11 @@
'\n\n' Text
'#|' Comment.Multiline
-'\n\n The FACT procedure computes the factorial\n\n of a non-negative integer.\n\n' Comment.Multiline
+'\n\n The FACT procedure computes the factorial\n\n of a non-negative integer.\n\n ' Comment.Multiline
+'#|' Comment.Multiline
+' These comments can be nested too. ' Comment.Multiline
+'|#' Comment.Multiline
+'\n\n' Comment.Multiline
'|#' Comment.Multiline
'\n\n' Text
@@ -35,9 +39,38 @@
'#;(' Comment
'= n 1' Comment
')' Comment
-'\n\n ' Text
+'\n ' Text
+'#;(' Comment
+'= n ' Comment
+'[' Comment
+'1+ ' Comment
+'(' Comment
+"eval '" Comment
+'(' Comment
+'n' Comment
+')' Comment
+')' Comment
+']' Comment
+')' Comment
'1' Literal.Number.Integer
-' ' Text
+'\n ' Text
+'#;[' Comment
+'= n ' Comment
+'(' Comment
+'1+ ' Comment
+'[' Comment
+"eval '" Comment
+'[' Comment
+'n' Comment
+']' Comment
+']' Comment
+')' Comment
+']' Comment
+';; another comment' Comment.Single
+'\n ' Text
+'#;' Comment
+'1' Comment
+'\n ' Text
'; identity of *' Comment.Single
'\n\n ' Text
'(' Punctuation