diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-08-02 17:08:51 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-08-02 17:08:51 -0400 |
| commit | e1ce7b201e662757b62c480c8ae1c76e41ad8a5f (patch) | |
| tree | eb419f56e2ca2654f4deb945c6b61f0eef1584db /src/cjs.bqn | |
| parent | d2427937164a9f790ec08f9c14412472404d0afe (diff) | |
Add self-hosted Javascript script
Diffstat (limited to 'src/cjs.bqn')
| -rwxr-xr-x | src/cjs.bqn | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cjs.bqn b/src/cjs.bqn new file mode 100755 index 00000000..cb60b7df --- /dev/null +++ b/src/cjs.bqn @@ -0,0 +1,15 @@ +#! /usr/bin/env dbqn + +compile ← ⟨•path∾"../c.bqn"⋄"DGenFn"⟩ •EX •path∾"../dzref" +Symcomp ← ((<"runtime["∾⍕∾"]"˜)¨↕59)⊸Compile +FP ← ∞⊸=◶⟨⍕,"Infinity"⟩ +Str ← "str("""∾∾⟜""")" +Char ← "'"(∾∾⊣)(⟨"\t","\n","\'"⟩∾<)⊑˜("'"∾˜•UCS 9‿10)⊑∘⊐⊢ +Fmt ← ≡◶⟨(⊑⍋)∘(∾⟜∞)◶⟨0⊸≤◶⟨"-"∾FP∘|,FP⟩,Char⟩⋄Str⋄⊑⟩ +L ← "["∾"]"∾˜1↓·∾","⊸∾⟜⍕¨ +G ← ⟨L∾⟜25,L Fmt¨,L⟨⊑"fmd"⊸⊐,⊢,⊢,≠⟩⊸(L{𝕎𝕩}¨)¨⟩ {𝕎𝕩}¨ 0‿1‿3 ⊏ Symcomp +Gen ← L G +GenLong ← ∾ (1‿2/⟨" new Uint8Array("∾∾⟜")"⋄((•UCS 10)∾" ,")⊸∾⟩) {𝕎𝕩}¨ G +• ← ∾∾⟜(•UCS 10)¨ Gen¨ •args +#• ← GenLong •EX •path∾"pr.bqn" +#• ← GenLong ∾∾⟜(•UCS 10)¨ (•LNS •path∾"c.bqn")∾<"Compile" |
