fez-lisp 1.5.80 → 1.5.81
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/package.json +1 -1
- package/src/check.js +12 -5
- package/src/types.js +1 -1
package/package.json
CHANGED
package/src/check.js
CHANGED
@@ -83,9 +83,10 @@ const fillUknownArgs = (n) =>
|
|
83
83
|
}))
|
84
84
|
export const formatType = (name, env) => {
|
85
85
|
const stats = env[name][STATS]
|
86
|
+
const isAnonymous = typeof name === 'number'
|
86
87
|
return stats
|
87
88
|
? stats[TYPE_PROP][0] === APPLY
|
88
|
-
? `${
|
89
|
+
? `${isAnonymous ? '' : `(let ${name} `}(lambda ${
|
89
90
|
stats[ARG_COUNT] === VARIADIC
|
90
91
|
? '... ' + STATIC_TYPES.UNKNOWN
|
91
92
|
: (stats[ARGUMENTS] ?? [])
|
@@ -94,12 +95,18 @@ export const formatType = (name, env) => {
|
|
94
95
|
`${
|
95
96
|
x[STATS][TYPE_PROP][0] === APPLY
|
96
97
|
? `${formatType(i, stats[ARGUMENTS])}`
|
97
|
-
: `${
|
98
|
+
: `${toTypeNames(
|
99
|
+
x[STATS][TYPE_PROP][1] ?? x[STATS][TYPE_PROP][0]
|
100
|
+
)}`
|
98
101
|
}`
|
99
102
|
)
|
100
103
|
.join(' ')
|
101
|
-
}
|
102
|
-
|
104
|
+
} (${KEYWORDS.BLOCK} ${toTypeNames(
|
105
|
+
stats[RETURNS][1] ?? stats[RETURNS][0]
|
106
|
+
)})${isAnonymous ? '' : ')'})`
|
107
|
+
: `(let ${name} ${toTypeNames(
|
108
|
+
stats[TYPE_PROP][1] ?? stats[TYPE_PROP][0]
|
109
|
+
)})`
|
103
110
|
: name
|
104
111
|
}
|
105
112
|
const formatTypes = (env) => {
|
@@ -122,7 +129,7 @@ const getScopeNames = (scope) => {
|
|
122
129
|
}
|
123
130
|
const withScope = (name, scope) => {
|
124
131
|
const chain = getScopeNames(scope)
|
125
|
-
return `${chain.length === 1 ? '
|
132
|
+
return `${chain.length === 1 ? '; ' : ''}${chain
|
126
133
|
.map((x) => (Number.isInteger(+x) ? '::' : x))
|
127
134
|
.join(' ')} ${name}`
|
128
135
|
}
|