Added datum comments

This commit is contained in:
Justin Ethier 2016-03-24 23:17:42 -04:00
parent 8b43a0d4ac
commit 2fe66e08c7
2 changed files with 12 additions and 1 deletions

View file

@ -4,7 +4,7 @@ This is the status of Scheme programming language features implemented from the
Section | Status | Comments
------- | ------ | ---------
2.2 Whitespace and comments | Yes | No datum comments
2.2 Whitespace and comments | Yes |
2.3 Other notations | Yes |
2.4 Datum labels | No |
3.1 Variables, syntactic keywords, and regions | Yes |

View file

@ -386,6 +386,17 @@
(if all?
(parse fp '() new-toks all? #f parens ptbl)
(car new-toks))))
;; Datum comment
((eq? #\; next-c)
; Read and discard next datum
(parse fp '() '() #f #f 0 ptbl)
(cond
((and (not all?) (not (null? tok)))
;; Reached a terminal char, read out previous token
(in-port:set-buf! ptbl c)
(car (add-tok (->tok tok) toks)))
(else
(parse fp tok toks all? #f parens ptbl))))
(else
(parse-error "Unhandled input sequence"
(in-port:get-lnum ptbl)