diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-10-02 13:59:20 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-10-02 13:59:20 -0400 |
| commit | cac51b1a0e524f01b22458a6cec9ac3740aeee99 (patch) | |
| tree | 669506af86f66ec7670ae3074b1365ac8750ec04 | |
| parent | 0e251f26bef84a3e861bd2eca44c54ad92a6c55c (diff) | |
Simpler FindPairs implementation
| -rw-r--r-- | md.bqn | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -366,7 +366,7 @@ Markdown ← {filename𝕊𝕩: # Find matched-depth [] and () pairs, then join adjacent ones brak ← (unused ∧ 𝕩⊸=)¨ 2‿2⥊"[]()" depth ← (+`-0⌊⊢)∘(-´)˘ brak - FindPairs ← ∘‿2 ⥊ 1⊸⊏ /˜ 2⊸⊏ (≠∧0≤⊢) ((1-˜+˜+»)∞⊸«⊸=)∘⊏ + FindPairs ← ∘‿2 ⥊ 1⊸⊏ /˜ 2⊸⊏ (<∨∧⟜») ·∞⊸«⊸=⊏ pairs ← depth <∘(FindPairs⍟(0<≠))∘⍉∘(∧(⊏˜≍˘⊢)⟜∾∾˘·/≠¨∘⊢)˘ /¨brak JoinPairs ← { e←1+1⊏˘𝕨 ⋄ b←⊏˘𝕩 ⋄ m←(≠b)>i←b⊐e |
