From eecbb6875af7dcc40d016eae596bf508e9a3ae57 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 20 Jul 2020 14:54:19 -0400 Subject: Don't print assignment results when auto-running code --- md.bqn | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'md.bqn') diff --git a/md.bqn b/md.bqn index bda35610..55a5b236 100644 --- a/md.bqn +++ b/md.bqn @@ -130,8 +130,15 @@ Markdown ← {filename𝕊𝕩: # If every line is indented by at least 4 additional spaces, we will # execute each one and insert the results. addRslt ← ∧´ ' ' = ∾ 4 (⌊⟜≠ ↑ ⊢)¨ 𝕩 + # Don't show assignment results by default + ShowRslt ← { + depth ← +` "(){}⟨⟩" (⊣(≠⊸>ׯ1⋆2|⊢)⊐) 𝕩 + 𝕩 /˜↩ ¬ ∨`⌾⌽ (0=depth) ∧ 𝕩∊"⋄," # Just the last statement + g ← 𝕩∊"←↩" + (⊑g⊐1) (<⟜(≠g))◶⟨1,¬(" "∾∾idChars)∧´∘∊˜↑⟩ 𝕩 + } r‿ri ← addRslt◶(2⥊<⟨⟩)‿{ - ⟨ (⥊∾⟜lf⎉1)∘⍕∘CodeExec⍟(0<≠)¨ 𝕩 + ⟨ (ShowRslt ⊣◶⟨"",(⥊∾⟜lf⎉1)∘⍕∘⊢⟩ CodeExec)⍟(0<≠)¨ 𝕩 1 -˜ +` 1 + ≠¨ 𝕩 ⟩ # Don't forget the trailing newline } 𝕩 @@ -383,13 +390,13 @@ TestSections ← { ################################ # Syntax highlighting +idChars ← ⟨ + •d∾"¯.π∞" + ' '+⌾•UCS•a + •a + "_" +⟩ GetHighlights ← { - idChars ← ⟨ - •d∾"¯.π∞" - ' '+⌾•UCS•a - •a - "_" - ⟩ classes‿chars ← <˘ ⍉ 2⊸(÷˜⟜≠∾⊣)⊸⥊⟨ 0 , " "∾•UCS 9‿10 "Value" , ¯1⊏˘5‿2⥊"𝕨𝕩𝕗𝕘𝕤" -- cgit v1.2.3