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.
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
@@ -2,7 +2,7 @@
2
2
  "name": "fez-lisp",
3
3
  "description": "Lisp interpreted & compiled to JavaScript",
4
4
  "author": "AT290690",
5
- "version": "1.1.20",
5
+ "version": "1.1.21",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
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
- let name,
161
- out = '(('
162
- if (Arguments[0][TYPE] === WORD) {
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
- let name,
223
- newName,
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
- out += `${name}=(__tco(${newName}=(${parseArgs(
229
+ return `(${name}=(__tco(${newName}=(${parseArgs(
239
230
  functionArgs,
240
231
  Drill
241
- )})=>{${vars}return ${evaluatedBody.toString().trimStart()}};`
242
- out += `, ${newName}))), ${name});`
243
- return out
232
+ )})=>{${vars}return ${evaluatedBody
233
+ .toString()
234
+ .trimStart()}}, ${newName})));`
244
235
  } else
245
236
  return compile(
246
237
  [[APPLY, KEYWORDS.DEFINE_VARIABLE], ...Arguments],