aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2024-09-22 00:49:18 -0400
committerGravatar Peter McGoron 2024-09-22 00:49:18 -0400
commitf52235cc514ccdb9ee6420534f9e1b85f6895f74 (patch)
treed3264965c25c432860f083047ca2e9ae48330262
parentread: block comments (diff)
read: datum comments
-rw-r--r--read.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/read.scm b/read.scm
index 8d68093..a8b8c50 100644
--- a/read.scm
+++ b/read.scm
@@ -436,10 +436,18 @@
port))))))
loop))
+;;; Reads the next toplevel datum, discards it, and then continues at the
+;;; toplevel.
+(define readtable:datum-comment
+ (lambda (_ __ toplevel port)
+ (readtable:next toplevel #f port)
+ (readtable:next toplevel #f port)))
+
(define readtable:hash
(readtable:process
(readtable:empty/default (readtable:error "unimplemented"))
(list readtable:update #\| (readtable:jump/next readtable:block-comment))
+ (list readtable:update #\; readtable:datum-comment)
(list readtable:update %bol readtable:vector)))
;;; ;;;;;;;;;;;;;;;;
@@ -498,3 +506,4 @@
(read-all "(x y #| this is a block\n comment\n |# z w)")
(read-all "#( a b #| this is a #| nested block |# comment|# z w)")
(read-all "#(a b #(c #|close#|comment|#|#y))")
+(read-all "(this has a #;(call with current continuation) datum comment)")