on master help sign in
Note how deep the rests of a body can nest

Each rest is a level of nesting, so a body of many ~& or ^- lines at one depth grows the parser's stack as nested brackets do: 20.000 such lines parse, and 40.000 run out of memory under eval, where 40.000 nested parentheses don't. +read-rest's comment names the EBNF's last. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U4FzmThon6Q3x1uL8yUKEY

commit706e9cabc569e7481fb395780fc930ebaac2ccc6 authorClaude <noreply@anthropic.com> dateTue 3 Nov 2026, 03:24 (4 hours ago) parent6b9ce23
1 file changed+5−2
jibb-dev/lib/jibb.hoon+5−2
jibb-dev/lib/jibb.hoon+5−2
@@ -576,7 +576,10 @@
576576:: line, so ^- @ud ?- x keeps its arms deeper. A line nothing takes
577577:: is an error as before. A rest ends at its body's DEDENT, which
578578:: +read-rest leaves for whatever opened the body, so one DEDENT
579−:: ends every rest nested on that body's lines.
579+:: ends every rest nested on that body's lines. Each rest is a level
580+:: of nesting, so the stack grows with them, as with brackets: a
581+:: body of 20.000 ~& x lines at one depth parses, and one of 40.000
582+:: runs out of memory, where 40.000 nested parentheses don't.
580583:: - Where errors point: the doc says only "line, column and an
581584:: excerpt"; 2.0 and Errors below say where.
582585::
@@ -3260,7 +3263,7 @@
32603263 ?> ?=([[* * %dedent] *] after)
32613264 [%& e t.after]
32623265 ::
3263− :: +read-rest: { definition NEWLINE } expr, up to the DEDENT that ends
3266+ :: +read-rest: { definition NEWLINE } last, up to the DEDENT that ends
32643267 :: a body, which it leaves for whatever opened the body: its INDENT's
32653268 :: reader, or the rune on the final line that took the rest of it
32663269 :: (+read-last)