diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-12 19:33:54 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-12 19:33:54 -0400 |
| commit | ae2842cc07663fd07404f480f01e9196c7ccc673 (patch) | |
| tree | d5eee2f4a11eddf7a62418ec1161479987430686 /src/c.bqn | |
| parent | 1355ab3629d346fe0de63342ba400062967a94b5 (diff) | |
Check for correct special name use in headers
Diffstat (limited to 'src/c.bqn')
| -rw-r--r-- | src/c.bqn | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -174,13 +174,14 @@ Parse ← {r‿vn‿i‿e‿def←𝕨⋄nv←≠vn "Missing operand in header"_err_(/HF) ho∧hc∨hd hm←¬ho∨ha←ho<(0=hr)∧1=hn # Mask for main name; header arguments "Invalid header structure"_err_(hm//∘HF) 1⊸»⊸=hm/hc + hv←(ha×1+«hc)+(ho×4+«3=hr)+hm×3×1-˜2⌊hr + "Incorrect special name"_err_(/HF) (M⟜bI>(hv+⊑bI)⊸=)hf/𝕩 hm>↩hc⋄hr/˜↩hm⋄hx←(1»hc)/ha # Header-derived role hr and immediacy ¬hx cw←(hc/»hl∨ha)⌾(ch⊸/)1+-⟜«(»ch)<1(⊢<«)cf # Body 𝕨: 0 no, 1 allowed, 2 required - hl/˜↩hm⋄hm↩hm⌾(hf⊸/)hf + hl/˜↩hm "Header left argument without right"_err_(/HF) ha>hc+`⊸⊏hx∾0 hx∨↩1=hr - hid←vi‿nv M˜ ht←hm/𝕩 - "Header operation must be name or valid self-reference (𝕊 or 𝕣)"_err_(/HM) hid<ht≠(⊑bI)+3×1-˜2⌊hr + "Header operation must be a single name"_err_(/HF) hm>(hf/𝕩)M bI+0‿nv "Only special name inputs allowed in headers for now!"_err_((HO∨HA)//∘HF) ¬bI M˜(ho∨ha)/hf/𝕩 hu←(𝕩 M bI)<hf∧0<rr |
