diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-10-03 17:40:50 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-10-03 17:40:50 -0400 |
| commit | cf3819ba39ce612fb518229b54ed4a77ae6f14fa (patch) | |
| tree | 34cd58791772dec72094386b40c9d2edd049395f /src | |
| parent | af7bdacce48afc6f9e6c70921e8fa680f03cc0ee (diff) | |
Test for predicates inside parentheses or lists
Diffstat (limited to 'src')
| -rw-r--r-- | src/c.bqn | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -134,7 +134,8 @@ Parse ← {r‿vn‿i‿e‿def←𝕨⋄nv←≠vn g←⍋pd←+`p←(¯1-2×r)×𝕩 M bB⋄gb←g⊏r=¯1 # Paren (actually any bracket type) depth and grade (g⊏p)(>⟜0⊸/ErrMismatchedBrackets⍟≢1-˜<⟜0⊸/)gx←g⊏𝕩 "Swapped open and closed brackets" ! 0≤(⊑g)⊑pd - "Parentheses can't contain separators"_err_(gb/G) ((⊑bB)⊸=»⊸∧sep⊸=)gb/gx + "Parentheses can't contain separators"_err_(gb/G) ((⊑bB)⊸=»⊸∧(2+⊑bH)⊸=∨sep⊸=)gbx←gb/gx + "Predicates can't be placed inside lists"_err_((sep≠GBX)/gb/G) ((4+⊑bB)⊸=»⊸∧(2+⊑bH)⊸=)sep⊸≠⊸/gbx {"Empty statement or expression"_err_(𝕩/0∾G) (4+⊑bB)≠𝕩/0∾gx}1⊸«⊸∧1∾gb dl←«⊸∨dc←r=4 # Dot left r-↩(𝕩=⊑bG)>ec←«dc<0≤r+p # Role ¯4 for exports: ⊑bG is ⇐ |
