diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-18 08:16:39 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-18 08:16:39 -0400 |
| commit | 789064ff89787e29d6617778dda3cf224f646616 (patch) | |
| tree | 4765b0a07b76a8762700b7b57be2e072e8b9f08f /src | |
| parent | 2927dd121c6cc8a2625c4a25a202c9660d359069 (diff) | |
Handle headers with omitted monadic function name
Diffstat (limited to 'src')
| -rw-r--r-- | src/c.bqn | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -176,14 +176,15 @@ Parse ← {r‿vn‿i‿e‿def←𝕨⋄nv←≠vn hm←¬ho∨ha←ho<(0=hr)∧1=hn # Mask for main name; header arguments "Invalid header structure"_err_(hm/HI) 1⊸»⊸=hm/hc hk←3|1-˜(+`bI∾nv)⍋ht←hi⊏𝕩׬rev⊏sr # Kind: 0 special, 1 name, 2 compound - hv←(ha×1+«hc)+(ho×4+«3=hr)+hm×3×1-˜2⌊hr # Special name for position + hma←hm>ha+↩hla←hl∧(0=hr)∧2=hk⋄hr+↩hla # Lone non-name subject is 𝕩 with 𝕊 omitted + hv←(ha×1+hla<«hc)+(ho×4+«3=hr)+hma×3×1-˜2⌊hr # Special name for position "Incorrect special name"_err_(HI) (0=hk)∧ht≠hv+⊑bI hk×↩¬hc∨hl∧0=hr # Treat subject labels like special names hm>↩hc⋄hr/˜↩hm⋄hx←(1»hc)/ha # Header-derived role hr and immediacy ¬hx cw←1+-⟜«(»ch)<1(⊢<«)cf # Body 𝕨: 0 no, 1 allowed, 2 required - cw↩(hc/»hl⌈ha×1+he←0≠hk)⌾(ch⊸/)cw + cw↩(hc/»hla¬⊸×hl⌈ha×1+he←0≠hk)⌾(ch⊸/)cw "Header left argument without right"_err_(HI) ha>hc+`⊸⊏hx∾0 - "Header operation must be a plain name"_err_(HI) hm>hk≠2 + "Header operation must be a plain name"_err_(HI) hma>hk≠2 hx∨↩1=hr⋄hu←(¬he)⌾(hi⊸⊏)hf hj←gi⊏˜he/hi⋄hd←2=he/hk |
