basedpl 0.1.76 → 0.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/basedpl_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by basedpl.editors.browser
|
|
1
|
+
// Generated by basedpl.editors.browser.
|
|
2
2
|
export const grammar = {"name": "bpl", "displayName": "BPL", "scopeName": "source.bpl", "fileTypes": ["bpl"], "patterns": [{"begin": "[⍝]", "beginCaptures": {"0": {"name": "comment.line.bpl"}}, "end": "$", "contentName": "comment.line.bpl", "patterns": [], "applyEndPatternLast": true}, {"begin": "\"", "beginCaptures": {"0": {"name": "string.quoted.double.bpl"}}, "end": "\"|$", "contentName": "string.quoted.double.bpl", "patterns": [{"match": "\"\"", "name": "string.quoted.double.bpl"}], "applyEndPatternLast": true, "endCaptures": {"0": {"name": "string.quoted.double.bpl"}}}, {"match": "'.?'", "name": "string.quoted.single.bpl"}, {"match": "(?:_\\d+|_\\S|_|[^\\s\\p{Cc}0-9←⎕•⍺⍵⍶⍹∇⍢⍝⋄⁝\\?¯∞⍬\\+\\-×÷⌈⌊\\|\\*⍟○π√!∧∨⊼⊽\\~=≠<≤>≥⍳↦:⍴≢≡,⍪⊂⊃⊆∊∪∩⍋⍒↑↓⌽⊖⍉⊤⊥⍎⍕⌷⌹\\#↕⍭⨸⌻⍸⍷⊢⊣¿¨ᵇ⍨↣⍤∘⍠⍥↢\\.⊗⌸⍣⇄⊘@∂⍚⌺/⌿\\\\⍀⁰¹²³⁴⁵⁶⁷⁸⁹⁻ᵀᵘₓ₀₁₂₃₄₅₆₇₈₉₋ₓ₁ₓ₂ₓ₄ₓ₈ₓₕₛₚ\\(\\)\\[\\]\\{\\}'\";\\$_ₑⱼᵣ])+", "name": "variable.other.bpl"}, {"match": "[•][A-Za-z_∆⍙][A-Za-z0-9_∆⍙]*", "name": "support.function.bpl"}, {"match": "(?:[¯]?[∞]|[¯]?(\\d+([.]\\d+)?|[.]\\d+)([eEₑ][¯]?\\d+)?([jJⱼ][¯]?(\\d+([.]\\d+)?|[.]\\d+)([eEₑ][¯]?\\d+)?|[rᵣ][¯]?\\d+)?)(?:ₓ₁|ₓ₂|ₓ₄|ₓ₈|ₓ|ₕ|ₛ|ₚ)?|[ₑⱼᵣ]", "name": "constant.numeric.bpl"}, {"match": "[⍬](?:ₓ₁|ₓ₂|ₓ₄|ₓ₈|ₓ|ₕ|ₛ|ₚ)?", "name": "constant.numeric.bpl"}, {"match": "\\$[tfn]", "name": "constant.numeric.bpl"}, {"match": "\\$[ad]", "name": "string.quoted.double.bpl"}, {"begin": "[\\])](?=(?:ₓ₁|ₓ₂|ₓ₄|ₓ₈|ₓ|ₕ|ₛ|ₚ))", "beginCaptures": {"0": {"name": "source.bpl"}}, "end": "(?:ₓ₁|ₓ₂|ₓ₄|ₓ₈|ₓ|ₕ|ₛ|ₚ)|$", "contentName": "constant.numeric.bpl", "patterns": [], "applyEndPatternLast": true, "endCaptures": {"0": {"name": "constant.numeric.bpl"}}}, {"match": "[\\+\\-×÷⌈⌊\\|\\*⍟○π√!∧∨⊼⊽\\~=≠<≤>≥⍳↦:⍴≢≡,⍪⊂⊃⊆∊∪∩⍋⍒↑↓⌽⊖⍉⊤⊥⍎⍕⌷⌹\\#↕⍭⨸⌻⍸⍷⊢⊣¿]", "name": "support.function.bpl"}, {"match": "(?:ₓ₁|ₓ₂|ₓ₄|ₓ₈|ₓ|ₕ|ₛ|ₚ)", "name": "keyword.operator.monadic.bpl"}, {"match": "[¨ᵇ⍨⊗⌸⇄∂/⌿\\\\⍀⁰¹²³⁴⁵⁶⁷⁸⁹⁻ᵀᵘₓ]", "name": "keyword.operator.monadic.bpl"}, {"match": "[↣⍤∘⍠⍥↢\\.⍣⊘@⍚⌺]", "name": "keyword.operator.dyadic.bpl"}, {"match": "[⍺⍵⍶⍹∇⍢]", "name": "variable.parameter.bpl"}, {"match": "[←⎕⋄⁝\\?₀₁₂₃₄₅₆₇₈₉₋]", "name": "keyword.control.bpl"}]};
|
|
3
3
|
export const configuration = {"comments": {"lineComment": "⍝"}, "brackets": [["(", ")"], ["[", "]"], ["{", "}"]], "autoClosingPairs": [{"open": "(", "close": ")", "notIn": ["string", "comment"]}, {"open": "[", "close": "]", "notIn": ["string", "comment"]}, {"open": "{", "close": "}", "notIn": ["string", "comment"]}, {"open": "\"", "close": "\"", "notIn": ["string", "comment"]}, {"open": "'", "close": "'", "notIn": ["string", "comment"]}], "surroundingPairs": [{"open": "(", "close": ")"}, {"open": "[", "close": "]"}, {"open": "{", "close": "}"}, {"open": "\"", "close": "\""}, {"open": "'", "close": "'"}]};
|
|
4
4
|
export const editorOptions = {"fontFamily": "SAX2B, monospace", "unicodeHighlight": {"ambiguousCharacters": false}};
|
|
@@ -90,7 +90,7 @@ const bar = // Based on Adám Brudzewsky's APL language bar: https://abrudz.gith
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const host = d.createElement('div');
|
|
93
|
-
host.innerHTML = `<div class="ngn_lb" aria-label="BPL symbols"></div>
|
|
93
|
+
host.innerHTML = `<div class="ngn_lb" aria-label="BPL symbols"><button type="button" class="ngn_x" style="float:right" title="Close symbol bar">×</button></div>
|
|
94
94
|
<div class="bpl_choices" role="group" aria-label="BPL symbol completions" hidden></div>
|
|
95
95
|
<style>
|
|
96
96
|
.ngn_lb,.bpl_choices{background:var(--bpl-bar-background,#eee);color:var(--bpl-bar-color,#111);font:15px var(--bpl-font,SAX2B),monospace}
|
|
@@ -106,6 +106,7 @@ const bar = // Based on Adám Brudzewsky's APL language bar: https://abrudz.gith
|
|
|
106
106
|
</style>`;
|
|
107
107
|
container.append(host);
|
|
108
108
|
const bar = host.querySelector('.ngn_lb'), tip = host.querySelector('.bpl_choices');
|
|
109
|
+
bar.querySelector('.ngn_x').onclick = () => { bar.hidden = true; };
|
|
109
110
|
let active, lastEditor, choice, keyInput = false;
|
|
110
111
|
const names = new Map(symbols.map(({glyph, name, monad, dyad}) =>
|
|
111
112
|
[glyph, [name, monad, dyad].filter(Boolean).join(' ')]));
|
|
@@ -251,15 +252,14 @@ const bar = // Based on Adám Brudzewsky's APL language bar: https://abrudz.gith
|
|
|
251
252
|
container.style.cssText = 'position:fixed;top:0;left:0;right:0;z-index:2147483647';
|
|
252
253
|
d.body.append(container);
|
|
253
254
|
const input = attach(monaco, container, true), bar = container.querySelector('.ngn_lb');
|
|
254
|
-
bar.insertAdjacentHTML('afterbegin', '<button class="
|
|
255
|
+
bar.insertAdjacentHTML('afterbegin', '<button class="ngn_o" style="float:right" title="Toggle overlay/push-down"></button>');
|
|
255
256
|
let overlay = false;
|
|
256
257
|
const padding = d.body.style.paddingTop, toggle = bar.querySelector('.ngn_o');
|
|
257
258
|
try { overlay = localStorage.getItem('ngn_lb_overlay') === '1'; } catch {}
|
|
258
259
|
function reflow() {
|
|
259
260
|
toggle.textContent = overlay ? '▼' : '▲';
|
|
260
|
-
d.body.style.paddingTop = overlay ||
|
|
261
|
+
d.body.style.paddingTop = overlay || bar.hidden ? padding : `${bar.offsetHeight}px`;
|
|
261
262
|
}
|
|
262
|
-
bar.querySelector('.ngn_x').onclick = () => { container.hidden = true; reflow(); };
|
|
263
263
|
toggle.onclick = () => {
|
|
264
264
|
overlay = !overlay;
|
|
265
265
|
try { localStorage.setItem('ngn_lb_overlay', overlay ? '1' : '0'); } catch {}
|
|
@@ -462,10 +462,15 @@ const bar = // Based on Adám Brudzewsky's APL language bar: https://abrudz.gith
|
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
);
|
|
465
|
-
const font = new URL("SAX2B
|
|
466
|
-
export function
|
|
467
|
-
|
|
465
|
+
const font = new URL("SAX2B.woff2", import.meta.url);
|
|
466
|
+
export function installFont(doc = document) {
|
|
467
|
+
if (doc.getElementById('bpl-font')) return;
|
|
468
|
+
const style = doc.createElement('style');
|
|
469
|
+
style.id = 'bpl-font';
|
|
468
470
|
style.textContent = `@font-face{font-family:SAX2B;src:url("${font}") format("woff2")}`;
|
|
469
|
-
|
|
470
|
-
|
|
471
|
+
doc.head.append(style);
|
|
472
|
+
}
|
|
473
|
+
export function attach(monaco, container) {
|
|
474
|
+
installFont(container.ownerDocument);
|
|
475
|
+
return bar.attach(monaco, container);
|
|
471
476
|
}
|
package/lb.js
CHANGED
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
const host = d.createElement('div');
|
|
89
|
-
host.innerHTML = `<div class="ngn_lb" aria-label="BPL symbols"></div>
|
|
89
|
+
host.innerHTML = `<div class="ngn_lb" aria-label="BPL symbols"><button type="button" class="ngn_x" style="float:right" title="Close symbol bar">×</button></div>
|
|
90
90
|
<div class="bpl_choices" role="group" aria-label="BPL symbol completions" hidden></div>
|
|
91
91
|
<style>
|
|
92
92
|
.ngn_lb,.bpl_choices{background:var(--bpl-bar-background,#eee);color:var(--bpl-bar-color,#111);font:15px var(--bpl-font,SAX2B),monospace}
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
</style>`;
|
|
103
103
|
container.append(host);
|
|
104
104
|
const bar = host.querySelector('.ngn_lb'), tip = host.querySelector('.bpl_choices');
|
|
105
|
+
bar.querySelector('.ngn_x').onclick = () => { bar.hidden = true; };
|
|
105
106
|
let active, lastEditor, choice, keyInput = false;
|
|
106
107
|
const names = new Map(symbols.map(({glyph, name, monad, dyad}) =>
|
|
107
108
|
[glyph, [name, monad, dyad].filter(Boolean).join(' ')]));
|
|
@@ -247,15 +248,14 @@
|
|
|
247
248
|
container.style.cssText = 'position:fixed;top:0;left:0;right:0;z-index:2147483647';
|
|
248
249
|
d.body.append(container);
|
|
249
250
|
const input = attach(monaco, container, true), bar = container.querySelector('.ngn_lb');
|
|
250
|
-
bar.insertAdjacentHTML('afterbegin', '<button class="
|
|
251
|
+
bar.insertAdjacentHTML('afterbegin', '<button class="ngn_o" style="float:right" title="Toggle overlay/push-down"></button>');
|
|
251
252
|
let overlay = false;
|
|
252
253
|
const padding = d.body.style.paddingTop, toggle = bar.querySelector('.ngn_o');
|
|
253
254
|
try { overlay = localStorage.getItem('ngn_lb_overlay') === '1'; } catch {}
|
|
254
255
|
function reflow() {
|
|
255
256
|
toggle.textContent = overlay ? '▼' : '▲';
|
|
256
|
-
d.body.style.paddingTop = overlay ||
|
|
257
|
+
d.body.style.paddingTop = overlay || bar.hidden ? padding : `${bar.offsetHeight}px`;
|
|
257
258
|
}
|
|
258
|
-
bar.querySelector('.ngn_x').onclick = () => { container.hidden = true; reflow(); };
|
|
259
259
|
toggle.onclick = () => {
|
|
260
260
|
overlay = !overlay;
|
|
261
261
|
try { localStorage.setItem('ngn_lb_overlay', overlay ? '1' : '0'); } catch {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "basedpl",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.78",
|
|
4
4
|
"description": "BasedPL, the Based-array Programming Language, is an APL-derived array language, borrowing ideas from J and BQN, with an emphasis on simple, consistent notation.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
File without changes
|