fez-lisp 1.3.20 → 1.3.21

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/macros.js +4 -3
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "fez-lisp",
3
3
  "description": "Lisp interpreted & compiled to JavaScript",
4
4
  "author": "AT290690",
5
- "version": "1.3.20",
5
+ "version": "1.3.21",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/macros.js CHANGED
@@ -497,8 +497,7 @@ export const deSuggarAst = (ast, scope) => {
497
497
  break
498
498
  case KEYWORDS.ANONYMOUS_FUNCTION:
499
499
  {
500
- const body = exp.at(-1)
501
- const block = hasBlock(body) ? body[1] : body
500
+ const block = exp.at(-1)
502
501
  const newBlock = [[APPLY, KEYWORDS.BLOCK]]
503
502
  for (let i = 1; i < exp.length - 1; ++i) {
504
503
  if (!isLeaf(exp[i]) && exp[i][0][TYPE] === APPLY) {
@@ -587,7 +586,9 @@ export const deSuggarAst = (ast, scope) => {
587
586
  exp[i].length = 2
588
587
  }
589
588
  }
590
- exp[exp.length - 1] = newBlock.concat([block])
589
+ exp[exp.length - 1] = newBlock.concat(
590
+ hasBlock(block) ? block.slice(1) : [block]
591
+ )
591
592
  deSuggarAst(block)
592
593
  }
593
594
  }