fez-lisp 1.6.82 → 1.6.84

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.6.82",
5
+ "version": "1.6.84",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -662,7 +662,12 @@ const resolveGetter = ({ rem, prop, name, env, caller, exp }) => {
662
662
  if (times === level - 1) {
663
663
  setPropToType(env[name][STATS], prop, {
664
664
  [TYPE_PROP]: types.length
665
- ? [type, new SubType([types.at(-1)])]
665
+ ? [
666
+ type,
667
+ new SubType([
668
+ types.at(-1) === COLLECTION ? UNKNOWN : types.at(-1)
669
+ ])
670
+ ]
666
671
  : [UNKNOWN]
667
672
  })
668
673
  } else {
@@ -924,15 +929,12 @@ const initArrayType = ({ rem, env }) => {
924
929
  subT.add(head[1].types[0])
925
930
  }
926
931
  const [main, sub] = ret[0]
927
- if (isSubType(sub) && sub.types.at(-1) === COLLECTION) sub.types.pop()
928
932
  return {
929
933
  [TYPE_PROP]: [APPLY],
930
934
  [RETURNS]: [
931
935
  COLLECTION,
932
936
  isCollection
933
- ? new SubType(
934
- isSubType(sub) ? [COLLECTION, ...sub] : [COLLECTION, main]
935
- )
937
+ ? new SubType(isSubType(sub) ? [COLLECTION, ...sub] : [COLLECTION])
936
938
  : new SubType(isSubType(sub) ? [...sub] : [main])
937
939
  ]
938
940
  }
@@ -1310,6 +1312,8 @@ export const typeCheck = (
1310
1312
  for (let j = 0; j < args[i][STATS][ARGUMENTS].length; ++j) {
1311
1313
  const actual = local[lambdaName][STATS][ARGUMENTS][j]
1312
1314
  const expected = args[i][STATS][ARGUMENTS][j]
1315
+ // TODO: after refactoring the generic nesting and unnesting logic
1316
+ // apply it here to judge lambda arguments based on the signature
1313
1317
  // if (
1314
1318
  // isGenericType(expected[STATS]) &&
1315
1319
  // !isUnknownType(actual[STATS]) &&
package/src/debugger.js CHANGED
@@ -971,9 +971,8 @@ export const debug = (ast, checkTypes = true, userDefinedTypes) => {
971
971
  return t ? t() : ''
972
972
  } else if (option === 'Search') {
973
973
  return [...types.entries()]
974
- .filter((x) => x[0].split(' ').length === 3 && !x[0].includes('.'))
974
+ .filter((x) => !x[0].includes('.'))
975
975
  .filter((x) => x[0].includes(name))
976
- .sort((a, b) => a[0].localeCompare(b[0]))
977
976
  .map(([k, v]) => `${k}\n${v()}`)
978
977
  .join('\n\n')
979
978
  } else if (option === 'Special') {
package/src/types.js CHANGED
@@ -1519,7 +1519,7 @@ export const toArgType = (A, i) => {
1519
1519
  argIndex: i,
1520
1520
  retried: Infinity,
1521
1521
  [IS_ARGUMENT]: true,
1522
- [SIGNATURE]: PLACEHOLDER,
1522
+ [SIGNATURE]: arg[VALUE].replaceAll('[', '').replaceAll(']', ''),
1523
1523
  [TYPE_PROP]: toTypeCodes(arg[VALUE], i),
1524
1524
  [RETURNS]: toTypeCodes(arg[VALUE], i),
1525
1525
  [ARGUMENTS]: [],