From 59762649a4ffc09d65fa6fe9a7ccb5df2488cca9 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 28 Jan 2023 12:42:58 -0500 Subject: boot3 organization and comments --- src/bootstrap/boot3.bqn | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/bootstrap/boot3.bqn b/src/bootstrap/boot3.bqn index f26e8499..48cd6402 100644 --- a/src/bootstrap/boot3.bqn +++ b/src/bootstrap/boot3.bqn @@ -57,46 +57,48 @@ sk←sb/˜pb>∨⟜«eb∊˜pb+(sb-pb)⊏t # Keep the first of each group that's not just inside a bracket sr←ts≤t≠⊸↑/⁼sk⋄r↩sr/r⋄t↩sr/t # Remove the rest 𝕩↩t⋄ev←vi+≠⊑k - # End of tokenization! # Bracket roles # Open brackets initially have role ¯1 and closed ones have role 0 gb←⍋+`p←(¯1-2×r)×𝕩 M bB # Paren (actually any bracket type) depth and grade r↩r+𝕩=3+⊑bB # Assume blocks are functions cp←𝕩=1+⊑bB # Closed paren - ir←(IT cp⊸≤)⊸⊏0∨|)ps(⊢-TT)+`¬op # Train argument (first-level) - fa←/(ta∨op∨aa)<(r=1)∨»op # Active functions - os←⌽↕∘≠⊸(⊣-TT)⌽¬op # Operator skip: distance rightward to derived function start - dy←fa⊏«(tr∧r≥0)∨op∨|)ps(⊢-TT)+`¬op # Train argument (first-level) + fa←/(ta∨op∨aa)<(r=1)∨»op # Active function + os←⌽↕∘≠⊸(⊣-TT)⌽¬op # Operator skip: distance rightward to derived function start + dy←fa⊏«(tr∧r≥0)∨op