Files
sex/tests/reader.scm
alex-eg 45d9199c27 add reader syntax for []
Now [...] reads to (¤ ...) for easy semantic processing
2025-10-30 18:05:44 +03:00

29 lines
762 B
Scheme

(import (chicken port))
(test-group "reader"
;; []-syntax. For array types and array access expressions
(test '((¤ * char))
(with-input-from-string "[* char]"
(lambda ()
(read-raw-forms 'stdin))))
(test '((¤ * * char const 512))
(with-input-from-string "[* * char const 512]"
(lambda ()
(read-raw-forms 'stdin))))
(test '((¤))
(with-input-from-string "[]"
(lambda ()
(read-raw-forms 'stdin))))
(test '((¤ (¤)))
(with-input-from-string "[[]]"
(lambda ()
(read-raw-forms 'stdin))))
(test '((¤ (¤ const char)))
(with-input-from-string "[[const char]]"
(lambda ()
(read-raw-forms 'stdin)))))