fez-lisp 1.1.20 → 1.1.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.
- package/.clj-kondo/.cache/v1/lock +0 -0
- package/.lsp/.cache/db.transit.json +1 -0
- package/package.json +1 -1
- package/src/compiler.js +9 -18
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
["^ ","~:classpath",["~#set",[]],"~:project-hash","","~:project-root","/Users/anthony/projects/personal/fez","~:kondo-config-hash","bda025eb1f6784bca737743f67546eb707569d9461b178b11732b8dd63dfc0a0","~:dependency-scheme","jar","~:analysis",null,"~:analysis-checksums",["^ "],"~:project-analysis-type","~:project-and-full-dependencies","~:version",12,"~:stubs-generation-namespaces",["^1",[]]]
|
package/package.json
CHANGED
package/src/compiler.js
CHANGED
@@ -157,15 +157,9 @@ const compile = (tree, Drill) => {
|
|
157
157
|
}(${parseArgs(rest, Drill)})`
|
158
158
|
}
|
159
159
|
case KEYWORDS.DEFINE_VARIABLE: {
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
name = lispToJavaScriptVariableName(Arguments[0][VALUE])
|
164
|
-
Drill.Variables.add(name)
|
165
|
-
}
|
166
|
-
out += `${name}=${compile(Arguments[1], Drill)}`
|
167
|
-
out += `),${name});`
|
168
|
-
return out
|
160
|
+
const name = lispToJavaScriptVariableName(Arguments[0][VALUE])
|
161
|
+
Drill.Variables.add(name)
|
162
|
+
return `(${name}=${compile(Arguments[1], Drill)});`
|
169
163
|
}
|
170
164
|
case KEYWORDS.IS_ATOM:
|
171
165
|
Drill.Helpers.add('atomPredicate')
|
@@ -219,11 +213,8 @@ const compile = (tree, Drill) => {
|
|
219
213
|
const arg = Arguments[0]
|
220
214
|
const val = Arguments[1]
|
221
215
|
if (val[0][0] === APPLY && val[0][1] === KEYWORDS.ANONYMOUS_FUNCTION) {
|
222
|
-
|
223
|
-
|
224
|
-
out = '(('
|
225
|
-
name = lispToJavaScriptVariableName(arg[VALUE])
|
226
|
-
newName = `rec_${performance.now().toString().replace('.', 7)}`
|
216
|
+
const name = lispToJavaScriptVariableName(arg[VALUE])
|
217
|
+
const newName = `rec_${performance.now().toString().replace('.', 7)}`
|
227
218
|
Drill.Variables.add(name)
|
228
219
|
Drill.Variables.add(newName)
|
229
220
|
Drill.Helpers.add('__tco')
|
@@ -235,12 +226,12 @@ const compile = (tree, Drill) => {
|
|
235
226
|
const vars = FunctionDrill.Variables.size
|
236
227
|
? `var ${[...FunctionDrill.Variables].join(',')};`
|
237
228
|
: ''
|
238
|
-
|
229
|
+
return `(${name}=(__tco(${newName}=(${parseArgs(
|
239
230
|
functionArgs,
|
240
231
|
Drill
|
241
|
-
)})=>{${vars}return ${evaluatedBody
|
242
|
-
|
243
|
-
|
232
|
+
)})=>{${vars}return ${evaluatedBody
|
233
|
+
.toString()
|
234
|
+
.trimStart()}}, ${newName})));`
|
244
235
|
} else
|
245
236
|
return compile(
|
246
237
|
[[APPLY, KEYWORDS.DEFINE_VARIABLE], ...Arguments],
|