diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-17 14:25:49 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-17 14:25:49 -0400 |
| commit | c2d63aff3fab48acca2d865cb6ba4f23c377812c (patch) | |
| tree | 245222e3df6a546e08a42d742415386e98ba4c7e /src | |
| parent | 9987a58408580bc78d536c71279b91fc851965e8 (diff) | |
Catch errors in bodies that should fail on 𝕨 instead of skipping them
Diffstat (limited to 'src')
| -rw-r--r-- | src/c.bqn | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -239,7 +239,8 @@ Parse ← {r‿vn‿i‿e‿def←𝕨⋄nv←≠vn nf←H ac<xv=vi-˜⊑bG # Namespace bodies fw←H gi⊏nx # Bodies where 𝕨 must be defined {"Can't return Nothing (·)"_err_(𝕩⊏⍋∘Rev) 2=fw⌈↩nf¬⊸×𝕩⊏nr} 1-˜0∾cc⊏rev - "Invalid use of 𝕨 in monadic case"_err_(/CB) 1↓fw∧cw=0 + fv←fw⋄fw≥○I1T↩cf # If a body fails on 𝕨, later ones won't see 𝕨 + (∨´(1↓fv)⊸<)◶"Invalid use of 𝕨 in monadic case"‿"Unreachable body"_err_(/CB) 1↓fw∧cw=0 cw⌈↩2×fw nn←fo+`⊸⊏2=cw⋄no(⊣-=)↩nn⋄ne(⊣-=)↩nn # 2=cw indicates 𝕨 is never Nothing "Assignment target must be a name or list of targets"_err_(G) (a∨aid∨ps∨𝕩(=⟜(3+⊑)<M)bB)<aa |
