fez-lisp 1.5.27 → 1.5.29

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.27",
5
+ "version": "1.5.29",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -502,7 +502,14 @@ export const typeCheck = (ast) => {
502
502
  const isSpecial = SPECIAL_FORMS_SET.has(first[VALUE])
503
503
 
504
504
  if (first[TYPE] === APPLY && !isSpecial) {
505
- if (!env[first[VALUE]][STATS][ARGS_COUNT]) {
505
+ if (env[first[VALUE]][STATS].type === ATOM) {
506
+ errorStack.set(
507
+ key,
508
+ `(${first[VALUE]}) is not a (lambda) (${stringifyArgs(
509
+ exp
510
+ )})`
511
+ )
512
+ } else if (!env[first[VALUE]][STATS][ARGS_COUNT]) {
506
513
  env[first[VALUE]][STATS][RETURNS] = UNKNOWN
507
514
  env[first[VALUE]][STATS].type = APPLY
508
515
  env[first[VALUE]][STATS][ARGS_COUNT] = rest.length
package/src/macros.js CHANGED
@@ -851,12 +851,6 @@ export const replaceQuotes = (source) =>
851
851
  .replaceAll(/\{/g, `(${SUGGAR.CREATE_LIST} `)
852
852
  .replaceAll(/\}/g, ')')
853
853
 
854
- export const replaceParens = (source) =>
855
- source
856
- .replaceAll(/\[/g, '(')
857
- .replaceAll(/\]/g, ')')
858
- .replaceAll(/\{/g, '(')
859
- .replaceAll(/\}/g, ')')
860
854
  export const deSuggarSource = (source) => replaceQuotes(replaceStrings(source))
861
855
  export const handleUnbalancedQuotes = (source) => {
862
856
  const diff = (source.match(/\"/g) ?? []).length % 2
package/src/parser.js CHANGED
@@ -48,7 +48,7 @@ export const LISP = {
48
48
  const dfs = (exp) => {
49
49
  let out = ''
50
50
  const [head, ...tail] = isLeaf(exp) ? [exp] : exp
51
- if (head == undefined) return (out += '()')
51
+ if (head == undefined) return (out += '(array)')
52
52
  switch (head[TYPE]) {
53
53
  case WORD:
54
54
  out += head[VALUE]