on master help sign in
Note how deep the rests of a body can nest
706e9caClaude
jibb-dev/lib/jibb.hoon+5−2
@@ -576,7 +576,10 @@
576:: line, so ^- @ud ?- x keeps its arms deeper. A line nothing takes
576:: line, so ^- @ud ?- x keeps its arms deeper. A line nothing takes
577:: is an error as before. A rest ends at its body's DEDENT, which
577:: is an error as before. A rest ends at its body's DEDENT, which
578:: +read-rest leaves for whatever opened the body, so one DEDENT
578:: +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.
580:: - Where errors point: the doc says only "line, column and an
583:: - Where errors point: the doc says only "line, column and an
581:: excerpt"; 2.0 and Errors below say where.
584:: excerpt"; 2.0 and Errors below say where.
582::
585::
@@ -3260,7 +3263,7 @@
3260 ?> ?=([[* * %dedent] *] after)
3263 ?> ?=([[* * %dedent] *] after)
3261 [%& e t.after]
3264 [%& e t.after]
3262 ::
3265 ::
3263− :: +read-rest: { definition NEWLINE } expr, up to the DEDENT that ends
3266+ :: +read-rest: { definition NEWLINE } last, up to the DEDENT that ends
3264 :: a body, which it leaves for whatever opened the body: its INDENT's
3267 :: a body, which it leaves for whatever opened the body: its INDENT's
3265 :: reader, or the rune on the final line that took the rest of it
3268 :: reader, or the rune on the final line that took the rest of it
3266 :: (+read-last)
3269 :: (+read-last)