From 3a3da137cf6ee3b8e1a11b7f5d1e1b625df6d9bb Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Fri, 27 Sep 2024 16:15:44 -0400 Subject: [PATCH] read: make whitespace after "#" an error --- read.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/read.scm b/read.scm index 66b3962..1007c00 100644 --- a/read.scm +++ b/read.scm @@ -676,7 +676,8 @@ (define readtable:hash (readtable:process (readtable:empty/default read:read-hash-messages) - ;; TODO: add whitespace to fail + (list readtable:update-list readtable:ASCII-whitespace + (readtable:error 'hash 'whitespace-after-hash)) (list readtable:update #\| (readtable:jump/next readtable:block-comment)) (list readtable:update #\; readtable:datum-comment) (list readtable:update #\\ readtable:character) @@ -697,9 +698,7 @@ (lambda () (readtable:process (readtable:empty/default readtable:read-ident) - (list readtable:update-list - readtable:ASCII-whitespace - readtable:skip) + (list readtable:update-list readtable:ASCII-whitespace readtable:skip) (list readtable:update #f (readtable:return 'eof)) (list readtable:update %bol readtable:read-list) (list readtable:update %eol (readtable:error 'top "unbalanced list")) @@ -794,3 +793,4 @@ (read-all "#!fold-case #TRUE") (read-all "#u8(x y z w)") (read-all "#\\newline") +(read-all "#\\a")