basedpl 0.1.47 → 0.1.49
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 +0 -0
- package/bpl.tmLanguage.json +2 -2
- package/input.js +7 -6
- package/layout.json +1 -1
- package/lb.js +2 -2
- package/package.json +1 -1
package/basedpl_wasm_bg.wasm
CHANGED
|
Binary file
|
package/bpl.tmLanguage.json
CHANGED
|
@@ -89,11 +89,11 @@
|
|
|
89
89
|
"name": "support.function.bpl"
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
|
-
"match": "[
|
|
92
|
+
"match": "[¨遍⍨己换換⊗表⌸组組⇄优優∂导梯導/总總⌿汇匯\\\\累⍀续續⁰¹²³⁴⁵⁶⁷⁸⁹⁻ᵀᵘ]",
|
|
93
93
|
"name": "keyword.operator.monadic.bpl"
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
"match": "[
|
|
96
|
+
"match": "[↣先⍤秩∘承⍠轴軸⍥经經↢后後\\.内內⍣次止⊘兼@于於⍚择擇⌺邻鄰]",
|
|
97
97
|
"name": "keyword.operator.dyadic.bpl"
|
|
98
98
|
},
|
|
99
99
|
{
|
package/input.js
CHANGED
|
@@ -35,14 +35,15 @@
|
|
|
35
35
|
}
|
|
36
36
|
const reset = () => { pending = null; };
|
|
37
37
|
|
|
38
|
-
//
|
|
38
|
+
// Every name ranks alike at each level: exact, prefix, then prefixes of hyphen-separated parts. Each match carries the name it
|
|
39
|
+
// matched by, the glyph name where several of a glyph's names match equally, as in `matches` in `symbols.rs`.
|
|
39
40
|
function matches(query) {
|
|
40
41
|
query = query.toLowerCase();
|
|
41
42
|
const letters = word => word.replaceAll('-', '');
|
|
42
43
|
let best = Infinity, found = [];
|
|
43
|
-
for (const {glyph, name, monad, dyad
|
|
44
|
-
let rank = Infinity;
|
|
45
|
-
[name, monad, dyad
|
|
44
|
+
for (const {glyph, name, monad, dyad} of symbols) {
|
|
45
|
+
let rank = Infinity, matched;
|
|
46
|
+
[name, monad, dyad].filter(Boolean).forEach(word => {
|
|
46
47
|
const level = letters(word) === query ? 0 : letters(word).startsWith(query) ? 1 : 2;
|
|
47
48
|
if (level === 2) {
|
|
48
49
|
let rest = query;
|
|
@@ -55,10 +56,10 @@
|
|
|
55
56
|
}
|
|
56
57
|
if (rest) return;
|
|
57
58
|
}
|
|
58
|
-
rank
|
|
59
|
+
if (level < rank) { rank = level; matched = word; }
|
|
59
60
|
});
|
|
60
61
|
if (rank < best) { best = rank; found = []; }
|
|
61
|
-
if (rank < Infinity && rank === best) found.push([glyph,
|
|
62
|
+
if (rank < Infinity && rank === best) found.push([glyph, matched]);
|
|
62
63
|
}
|
|
63
64
|
// A name that is a prefix of every other match wins: `om gives omega, `omu gives omega-underbar.
|
|
64
65
|
const shortest = found.find(([, a]) => found.every(([, b]) => letters(b).startsWith(letters(a))));
|
package/layout.json
CHANGED
package/lb.js
CHANGED
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
toggle.textContent = overlay ? '▼' : '▲';
|
|
95
95
|
d.body.style.paddingTop = overlay || bar.hidden ? originalPadding : `${bar.offsetHeight}px`;
|
|
96
96
|
}
|
|
97
|
-
const names = new Map(symbols.map(({glyph, name, monad, dyad
|
|
98
|
-
[glyph, [
|
|
97
|
+
const names = new Map(symbols.map(({glyph, name, monad, dyad}) =>
|
|
98
|
+
[glyph, [name, monad, dyad].filter(Boolean).join(' ')]));
|
|
99
99
|
function stateGlyphs(state) {
|
|
100
100
|
const {terminator, keys} = layout.states[state];
|
|
101
101
|
return [terminator, ...Object.values(keys).flatMap(value => typeof value === 'string' ? [value] : stateGlyphs(value.state))];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "basedpl",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.49",
|
|
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": {
|