automatic preload and end

This commit is contained in:
2021-12-21 17:06:06 -07:00
parent 01228038e2
commit 569dd72893

View File

@@ -14,7 +14,6 @@
(_labelLines.push (- .line (stream.position) 1)) (_labelLines.push (- .line (stream.position) 1))
`(cc)) `(cc))
// TODO could make an &eof style of reader macro, and have (end) read automatically at the end of any Hollywoo file.
(defMacro end [] (defMacro end []
(let [labelSetters (let [labelSetters
(for [label idx] (zipThrow _labelNames _labelLines) (for [label idx] (zipThrow _labelNames _labelLines)
@@ -35,4 +34,6 @@
(collectedBlocks cleanup)) (collectedBlocks cleanup))
(doCleanup) (doCleanup)
})) }))
// TODO also &bof could call (doPreload)
(defReaderMacro &bof "" [stream] `(#when (StringTools.contains kissFile className) (doPreload cc)))
(defReaderMacro &eof "" [stream] `(#when (StringTools.contains kissFile className) (end)))