Start of line reader macros

This commit is contained in:
2020-12-13 13:42:19 -07:00
parent 9600766b22
commit 04e6ffe3f0
8 changed files with 107 additions and 63 deletions

View File

@@ -10,6 +10,10 @@ class ReaderMacroTestCase extends Test {
Assert.equals("String that takes the rest of the line", ReaderMacroTestCase.myLine());
}
function testReadNot() {
Assert.isTrue(ReaderMacroTestCase.myBool());
}
function testDefAlias() {
Assert.equals(9, ReaderMacroTestCase.mySum);
}

View File

@@ -1,4 +1,4 @@
(defreadermacro "!" [stream]
(defreadermacro &start "!" [stream]
(let [line (stream.expect "a string line" (lambda [] (stream.takeLine)))]
(ReaderExp.StrExp line)))
@@ -6,6 +6,9 @@
!String that takes the rest of the line
)
(defun myBool []
(begin !false))
(defalias pluppers +)
(defalias fluffers 5)
(defalias buffers 4)