aboutsummaryrefslogtreecommitdiff
path: root/src/c.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-08-18 21:13:13 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-08-18 21:13:13 -0400
commitd9546b5085d95696e93b2796545ff94eafe05928 (patch)
treec772933e522f2b20ecab1f3b8ffcc63b9da56405 /src/c.bqn
parentd01198f380e89979e9583117b7fef44cb222364c (diff)
Fix handling of different roles in strands in headers
Diffstat (limited to 'src/c.bqn')
-rw-r--r--src/c.bqn6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/c.bqn b/src/c.bqn
index 557e5ced..17ba9a5a 100644
--- a/src/c.bqn
+++ b/src/c.bqn
@@ -167,9 +167,9 @@ Parse ← {r‿vn‿i‿e‿def←𝕨⋄nv←≠vn
"Header-less bodies must come last"_err_(/CB) 1(-⊸↓<co∧↓)ch
"At most two header-less bodies allowed"_err_(/CB) »⊸∧co>¯1↓ch
cc←(⍋⍋«co)⊏c∾/cs # Case close
- rr←rev⊏r
- hr←rr⊏˜hi←/hf←hh⊏˜⟜IT⌾((⌽g)⊸⊏)cb∨hh
- hl←2=hn←(1⊸»+«)hc←¯1=hr
+ hi←/hf←hh⊏˜⟜IT⌾((⌽g)⊸⊏)cb∨hh # Header component indices
+ hr←(⊏⟜ns×⊏⟜r)rev⊏˜hi # And their roles
+ hl←2=hn←(1⊸»+«)hc←¯1=hr # hl: is label, hc: is :
"Only one header per body allowed"_err_(hc/HI) (1+hc/hi)⊏hf
ho←(»∨·«(hr=3)∧⊢)hl<hy←2≤hr # Header operands
"Missing operand in header"_err_(HI) ho∧hc∨hy