Auto call functions in kabel; clean up end behavior of worklet; move kabel first in chain; write docstring

This commit is contained in:
Aria 2026-01-08 12:31:26 -06:00
parent fd2ff255e5
commit d4b3a3b972
5 changed files with 81 additions and 14 deletions

View file

@ -32,6 +32,11 @@ describe('transpiler', () => {
it('treats K(...) as kabelsalat', () => {
expect(transpiler('K(1+2)', simple).output).toEqual("worklet('1 + 2');");
});
it('automatically calls functions in K(...)', () => {
expect(transpiler('K(() => { return 1 + 2 })', simple).output).toEqual(
"worklet('(() => {\\n return 1 + 2\\n})()');",
);
});
it('handles strudel S(...) inside kabelsalat K(...)', () => {
expect(transpiler('K(S("bd".fast(4)))', simple).output).toEqual("worklet('pat[0]', m('bd', 4).fast(4));");
});