store paths are now arrays, because '.' needed to be a valid path ident. more quoting crap. font is done! well.. it's something. probably not 'done'

This commit is contained in:
Dustin Swan 2026-02-23 22:51:16 -07:00
parent 515ad7fc9c
commit 6fe94ddfb2
No known key found for this signature in database
GPG key ID: 30D46587E2100467
6 changed files with 5859 additions and 5537 deletions

View file

@ -80,7 +80,7 @@ export const _rt = {
return String(value);
},
chars: (s: string) => s.split(''),
join: (delim: string) => (xs: string[]) => xs.join(delim),
// join: (delim: string) => (xs: string[]) => xs.join(delim),
split: (delim: string) => (xs: string) => xs.split(delim),
slice: (s: string | any[]) => (start: number) => (end: number) => s.slice(start, end),
"debug!": (label: string) => (value: any) => { console.log(label, value); return value; },
@ -107,12 +107,11 @@ export const _rt = {
.filter(name => _rt.fuzzyMatch(query)(name)._tag === 'True')
.sort((a, b) => a.length - b.length);
},
getAt: (pathStr: string) => {
const parts = pathStr.split('.');
let obj: any = store[parts[0]];
for (let i = 1; i < parts.length; i++) {
getAt: (path: any[]) => {
let obj: any = store[path[0]];
for (let i = 1; i < path.length; i++) {
if (obj === undefined || obj === null) return { _tag: 'None' };
obj = obj[parts[i]];
obj = obj[path[i]];
}
return obj === undefined ? { _tag: 'None' } : { _tag: 'Some', _0: obj };
},
@ -155,12 +154,11 @@ export const _rt = {
}
syncToAst(name);
},
rebindAt: (pathStr: string) => (value: string) => {
const parts = pathStr.split('.');
const name = parts[0];
const path = parts.slice(1);
rebindAt: (path: any[]) => (value: any) => {
const name = path[0];
const rest = path.slice(1);
return { _tag: 'Rebind', _0: name, _1: path, _2: value };
return { _tag: 'Rebind', _0: name, _1: rest, _2: value };
},
"undefine!": (name: string) => {
delete store[name];