fez-lisp 1.5.124 → 1.5.125

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/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.5.124",
5
+ "version": "1.5.125",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
@@ -16,7 +16,7 @@ const deepTransform = (predicate, transform, tree) => {
16
16
  else deepTransform(predicate, transform, leaf)
17
17
  }
18
18
  }
19
- export const enhance = (ast) => {
19
+ const opt = (ast) => {
20
20
  const evaluate = (exp) => {
21
21
  const [first, ...rest] = isLeaf(exp) ? [exp] : exp
22
22
  if (first != undefined) {
@@ -213,11 +213,12 @@ export const enhance = (ast) => {
213
213
  default:
214
214
  break
215
215
  }
216
-
217
216
  for (const r of rest) evaluate(r)
218
217
  }
219
218
  }
220
- evaluate(AST.parse(AST.stringify(ast)))
219
+ evaluate(ast)
221
220
  const shaked = shake(ast[1][1].slice(1), std)
222
221
  return wrapInBlock(shaked)
223
222
  }
223
+
224
+ export const enhance = (ast) => opt(AST.parse(AST.stringify(ast))[0])
package/src/utils.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  deSuggarSource,
16
16
  handleUnbalancedQuotes
17
17
  } from './macros.js'
18
- import { OPTIMIZATIONS } from './enchance.js'
18
+ import { OPTIMIZATIONS } from './enhance.js'
19
19
  export const logError = (error) =>
20
20
  console.log('\x1b[31m', `\n${error}\n`, '\x1b[0m')
21
21
  export const logSuccess = (output) => console.log('\x1b[32m', output, '\x1b[0m')