add reader syntax for []
Now [...] reads to (¤ ...) for easy semantic processing
This commit is contained in:
28
tests/reader.scm
Normal file
28
tests/reader.scm
Normal file
@@ -0,0 +1,28 @@
|
||||
(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)))))
|
||||
Reference in New Issue
Block a user