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/index.js +1 -1
- package/lib/baked/std.js +1 -1
- package/package.json +1 -1
- package/src/{enchance.js → enhance.js} +4 -3
- package/src/utils.js +1 -1
package/package.json
CHANGED
@@ -16,7 +16,7 @@ const deepTransform = (predicate, transform, tree) => {
|
|
16
16
|
else deepTransform(predicate, transform, leaf)
|
17
17
|
}
|
18
18
|
}
|
19
|
-
|
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(
|
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 './
|
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')
|