Manually handle nested expression arrays in KissInterp2

This commit is contained in:
2025-11-09 19:46:03 -06:00
parent 8c8ab177bd
commit f2e46e0b7b
2 changed files with 11 additions and 0 deletions

View File

@@ -95,8 +95,10 @@
(let [stream (Stream.fromString str)]
(read stream)))
([:Stream s]
(localVar nested (Reader.handleNesting s))
(ifLet [(Some exp) (Reader.read s this)]
{
(when nested (Reader.deNest s))
(s.dropWhitespace)
exp
}

View File

@@ -439,6 +439,15 @@ class Reader {
return array;
}
public static function handleNesting(stream:Stream) {
var nested = readExpArrayStartPositions.length != 0;
_handleNesting(stream, nested);
return nested;
}
public static function deNest(stream:Stream) {
_finish(stream, true);
}
static function _handleNesting(stream:Stream, nested:Bool) {
if (nested) {
nestedReadExpArrayStartPositions.push(readExpArrayStartPositions);