fez-lisp 1.3.11 → 1.3.13

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/src/utils.js CHANGED
@@ -149,7 +149,7 @@ export const handleUnbalancedParens = (source) => {
149
149
  export const removeMutation = (source) => source.replace(new RegExp(/!/g), 'ǃ')
150
150
  const isDefinition = (x) =>
151
151
  x[TYPE] === APPLY && x[VALUE] === KEYWORDS.DEFINE_VARIABLE
152
- const toDeps = (libs) =>
152
+ const toDeps = ([[,[,libs]]]) =>
153
153
  libs.reduce(
154
154
  (a, x, i) => a.set(x.at(1)[VALUE], { value: x, index: i }),
155
155
  new Map()
@@ -232,8 +232,9 @@ export const fez = (source, options = {}) => {
232
232
  )
233
233
  const code = !options.mutation ? removeMutation(valid) : valid
234
234
  if (!code.length && options.throw) throw new Error('Nothing to parse!')
235
- const parsed = deSuggarAst(LISP.parse(code))
236
- const ast = wrapInBlock(shake(parsed, std))
235
+ const parsed = LISP.parse(code)
236
+ const scope = deSuggarAst(parsed)
237
+ const ast = wrapInBlock(shake(scope, std))
237
238
  // if (options.check) typeCheck(ast)
238
239
  if (options.compile) return comp(ast)
239
240
  return evaluate(ast, env)