Skip to content

Commit

Permalink
Elaborate engine
Browse files Browse the repository at this point in the history
  • Loading branch information
dy committed Sep 30, 2024
1 parent 3f59024 commit 61a5f67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export let idx, cur,
prev = lookup[c],
word = op.toUpperCase() !== op // make sure word boundary comes after word operator
) => lookup[c] = (a, curPrec, from = idx) =>
(curPrec < prec &&
(l < 2 || cur.substr(idx, l) == op) &&
(!word || !parse.id(cur.charCodeAt(idx + l))) &&
(curPrec < prec && // matches precedence
(l < 2 || cur.substr(idx, l) == op) && // matches operator
!(word && parse.id(cur.charCodeAt(idx + l))) && // finished word, not part of bigger word
(idx += l, (map(a) || (idx = from, !prev && err()))) // throw if operator didn't detect usage pattern: (a;^b) etc
) ||
prev?.(a, curPrec),
Expand Down
2 changes: 0 additions & 2 deletions test/subscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,6 @@ test('stdlib cases', t => {
})

test.skip('ext: collect args', async t => {
const { lookup, default: script } = await import('../justin.js')

let args = [], id = parse.id
parse.id = (a, b) => (a = id(), a && args.push(a), a)

Expand Down

0 comments on commit 61a5f67

Please sign in to comment.