fez-lisp 1.5.100 → 1.5.102
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/lib/baked/std.js +1 -1
- package/logo.svg +5 -5
- package/package.json +1 -1
- package/src/check.js +118 -175
- package/src/types.js +12 -4
package/src/types.js
CHANGED
@@ -23,7 +23,7 @@ export const PREDICATE = 4
|
|
23
23
|
export const ANY = 5
|
24
24
|
export const ANONYMOUS_FUNCTION_TYPE_PREFIX = 'lambda::annonymous::'
|
25
25
|
export const MAX_ARGUMENT_RETRY = 1
|
26
|
-
export const MAX_RETRY_DEFINITION =
|
26
|
+
export const MAX_RETRY_DEFINITION = 100
|
27
27
|
export const toTypeNames = (type) => {
|
28
28
|
switch (type) {
|
29
29
|
case APPLY:
|
@@ -42,6 +42,14 @@ export const toTypeNames = (type) => {
|
|
42
42
|
break
|
43
43
|
}
|
44
44
|
}
|
45
|
+
export const toTypeNamesAnyToUknown = (type) => {
|
46
|
+
switch (type) {
|
47
|
+
case ANY:
|
48
|
+
return toTypeNames(UNKNOWN)
|
49
|
+
default:
|
50
|
+
return toTypeNames(type)
|
51
|
+
}
|
52
|
+
}
|
45
53
|
export const SPECIAL_FORM_TYPES = {
|
46
54
|
[SCOPE_NAME]: ';',
|
47
55
|
// [ORDER]: 0,
|
@@ -1196,15 +1204,15 @@ export const formatType = (name, env) => {
|
|
1196
1204
|
`${
|
1197
1205
|
getType(x[STATS]) === APPLY
|
1198
1206
|
? `${formatType(i, stats[ARGUMENTS])}`
|
1199
|
-
: `${
|
1207
|
+
: `${toTypeNamesAnyToUknown(getType(x[STATS]))}`
|
1200
1208
|
}`
|
1201
1209
|
).join(' ') + ' '
|
1202
1210
|
: ''
|
1203
1211
|
// TODO format returned functions when type support is added
|
1204
|
-
}(${KEYWORDS.BLOCK} ${
|
1212
|
+
}(${KEYWORDS.BLOCK} ${toTypeNamesAnyToUknown(getReturn(stats))})${
|
1205
1213
|
isAnonymous ? '' : ')'
|
1206
1214
|
})`
|
1207
|
-
: `(let ${name} ${
|
1215
|
+
: `(let ${name} ${toTypeNamesAnyToUknown(getType(stats))})`
|
1208
1216
|
: name
|
1209
1217
|
}
|
1210
1218
|
|