fez-lisp 1.4.16 → 1.4.17
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/lib/baked/std.js +1 -1
- package/package.json +1 -1
- package/src/macros.js +14 -21
package/package.json
CHANGED
package/src/macros.js
CHANGED
@@ -403,15 +403,11 @@ export const deSuggarAst = (ast, scope) => {
|
|
403
403
|
if (exp[1][0][VALUE] === SUGGAR.CREATE_LIST) {
|
404
404
|
const lastLeft = left.pop()
|
405
405
|
const vars = left
|
406
|
-
if (
|
407
|
-
!isLeaf(right) &&
|
408
|
-
right[0][TYPE] === APPLY &&
|
409
|
-
right[0][VALUE] === SUGGAR.CREATE_LIST
|
410
|
-
) {
|
406
|
+
if (!isLeaf(right) && right[0][TYPE] !== WORD) {
|
411
407
|
throw new SyntaxError(
|
412
|
-
`Destructuring requires right hand side to be a word but got an apply
|
408
|
+
`Destructuring requires right hand side to be a word but got an apply\n(${stringifyArgs(
|
413
409
|
exp
|
414
|
-
)}`
|
410
|
+
)})`
|
415
411
|
)
|
416
412
|
} else {
|
417
413
|
newScope = vars
|
@@ -451,24 +447,21 @@ export const deSuggarAst = (ast, scope) => {
|
|
451
447
|
vars[0][TYPE] = WORD
|
452
448
|
exp.length = 0
|
453
449
|
} else if (exp[1][0][VALUE] === KEYWORDS.CREATE_ARRAY) {
|
454
|
-
|
455
|
-
// const isList = exp[i][exp[i].length - 2][VALUE] === KEYWORDS.BITWISE_NOT
|
456
|
-
const isSlicing = lastLeft[VALUE] !== PLACEHOLDER
|
457
|
-
const vars = left
|
458
|
-
const indexes = vars.map((x, i) => [i, x])
|
459
|
-
vars[0][TYPE] = WORD
|
460
|
-
exp.length = 0
|
461
|
-
if (
|
462
|
-
!isLeaf(right) &&
|
463
|
-
right[0][TYPE] === APPLY &&
|
464
|
-
right[0][VALUE] === KEYWORDS.CREATE_ARRAY
|
465
|
-
) {
|
450
|
+
if (!isLeaf(right) && right[0][TYPE] !== WORD) {
|
466
451
|
throw new SyntaxError(
|
467
|
-
`Destructuring requires right hand side to be a word but got an apply
|
452
|
+
`Destructuring requires right hand side to be a word but got an apply\n(${stringifyArgs(
|
468
453
|
exp
|
469
|
-
)}`
|
454
|
+
)})`
|
470
455
|
)
|
471
456
|
} else {
|
457
|
+
const lastLeft = left.pop()
|
458
|
+
// const isList = exp[i][exp[i].length - 2][VALUE] === KEYWORDS.BITWISE_NOT
|
459
|
+
const isSlicing = lastLeft[VALUE] !== PLACEHOLDER
|
460
|
+
const vars = left
|
461
|
+
const indexes = vars.map((x, i) => [i, x])
|
462
|
+
|
463
|
+
vars[0][TYPE] = WORD
|
464
|
+
exp.length = 0
|
472
465
|
newScope = indexes
|
473
466
|
.filter((x) => x[1][VALUE] !== PLACEHOLDER)
|
474
467
|
.map(([i]) => [
|