fez-lisp 1.5.81 → 1.5.82

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.81",
5
+ "version": "1.5.82",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -228,6 +228,7 @@ export const typeCheck = (ast) => {
228
228
  getSuffix(re[1][VALUE]) === PREDICATE_SUFFIX
229
229
  ) {
230
230
  // ATOM ASSIGMENT PREDICATE ASSIGMENT
231
+ env[name][STATS][TYPE_PROP][1] = [PREDICATE]
231
232
  env[name][STATS][RETURNS] = [ATOM, PREDICATE]
232
233
  }
233
234
  } else if (
@@ -645,6 +646,17 @@ export const typeCheck = (ast) => {
645
646
  )
646
647
  if (isLeaf(returns)) {
647
648
  // TODO figure out what we do here
649
+ // this here is a variable WORD
650
+ // so return type of that function is that varible type
651
+ if (copy[returns[VALUE]])
652
+ ref[STATS][RETURNS] =
653
+ copy[returns[VALUE]][STATS][TYPE_PROP]
654
+ else
655
+ stack.push(() => {
656
+ if (copy[returns[VALUE]])
657
+ ref[STATS][RETURNS] =
658
+ copy[returns[VALUE]][STATS][TYPE_PROP]
659
+ })
648
660
  } else {
649
661
  const ret = returns[0]
650
662
  switch (ret[VALUE]) {
@@ -658,6 +670,7 @@ export const typeCheck = (ast) => {
658
670
  getSuffix(re[0][VALUE]) === PREDICATE_SUFFIX ||
659
671
  getSuffix(re[1][VALUE]) === PREDICATE_SUFFIX
660
672
  ) {
673
+ ref[STATS][TYPE_PROP][1] = PREDICATE
661
674
  ref[STATS][RETURNS][1] = PREDICATE
662
675
  }
663
676
  } else {
@@ -694,6 +707,7 @@ export const typeCheck = (ast) => {
694
707
  ref[STATS][RETURNS] =
695
708
  copy[ret[VALUE]][STATS][RETURNS]
696
709
  })
710
+
697
711
  break
698
712
  }
699
713
  }
package/src/types.js CHANGED
@@ -10,8 +10,8 @@ export const TYPE_PROP = 'type'
10
10
  export const SIGNATURE = 'name'
11
11
  export const ORDER = '__order__'
12
12
  export const VARIABLE_ORDER_INDEX = 'index'
13
- export const PREDICATE = 3
14
- export const COLLECTION = 4
13
+ export const PREDICATE = 4
14
+ export const COLLECTION = 3
15
15
  export const MAX_ARGUMENT_RETRY = 1
16
16
  export const MAX_RETRY_DEFINITION = 10
17
17
  export const toTypeNames = (type) => {