fez-lisp 1.6.67 → 1.6.68
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 +1 -1
- package/src/check.js +2 -0
- package/src/macros.js +11 -0
package/package.json
CHANGED
package/src/check.js
CHANGED
@@ -617,6 +617,8 @@ const resolveGetter = ({ rem, prop, name, env, caller, exp }) => {
|
|
617
617
|
if (!env[array[VALUE]] || !env[name]) return true
|
618
618
|
switch (array[TYPE]) {
|
619
619
|
case APPLY:
|
620
|
+
// TODO: figure out recursively what is the inner type of all nested getters
|
621
|
+
if (GET_ARRAY_INFERENCE_SET.has(array[VALUE])) return true
|
620
622
|
if (
|
621
623
|
getReturn(env[array[VALUE]][STATS]) === UNKNOWN ||
|
622
624
|
getReturn(env[array[VALUE]][STATS]) === ANY
|
package/src/macros.js
CHANGED
@@ -118,6 +118,17 @@ export const deSuggarAst = (ast, scope) => {
|
|
118
118
|
if (rest.length === 1) {
|
119
119
|
exp[0][VALUE] = 'math:var-get'
|
120
120
|
// exp.push([ATOM, 0])
|
121
|
+
} else if (rest.length > 2) {
|
122
|
+
exp.length = 0
|
123
|
+
rest.reverse()
|
124
|
+
let temp = exp
|
125
|
+
for (let i = 0; i < rest.length; i += 1) {
|
126
|
+
if (i < rest.length - 1) {
|
127
|
+
temp.push([APPLY, SUGGAR.GET_ARRAY], [], rest[i])
|
128
|
+
temp = temp.at(-2)
|
129
|
+
} else temp.push(...rest[i])
|
130
|
+
}
|
131
|
+
deSuggarAst(exp, scope)
|
121
132
|
}
|
122
133
|
break
|
123
134
|
case SUGGAR.INCREMENT:
|