fez-lisp 1.6.63 → 1.6.64
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/macros.js +6 -9
- package/src/types.js +1 -0
package/package.json
CHANGED
package/src/macros.js
CHANGED
@@ -48,7 +48,8 @@ export const SUGGAR = {
|
|
48
48
|
DECREMENT_BY: '-=',
|
49
49
|
BOOLEAN_VARIABLE: 'boolean',
|
50
50
|
BOOLEAN_VARIABLE_GET: 'boole',
|
51
|
-
BOOLEAN_VARIABLE_SET: 'boole-set'
|
51
|
+
BOOLEAN_VARIABLE_SET: 'boole-set',
|
52
|
+
GET_ARRAY: 'array:get'
|
52
53
|
}
|
53
54
|
export const deSuggarAst = (ast, scope) => {
|
54
55
|
if (scope === undefined) scope = ast
|
@@ -569,7 +570,7 @@ export const deSuggarAst = (ast, scope) => {
|
|
569
570
|
let wrap = right
|
570
571
|
for (let i = 0; i < n; ++i) {
|
571
572
|
wrap = [
|
572
|
-
[APPLY,
|
573
|
+
[APPLY, SUGGAR.GET_ARRAY],
|
573
574
|
wrap,
|
574
575
|
[ATOM, 1]
|
575
576
|
]
|
@@ -577,17 +578,13 @@ export const deSuggarAst = (ast, scope) => {
|
|
577
578
|
return [
|
578
579
|
[APPLY, KEYWORDS.DEFINE_VARIABLE],
|
579
580
|
name,
|
580
|
-
[[APPLY,
|
581
|
+
[[APPLY, SUGGAR.GET_ARRAY], wrap, [ATOM, 0]]
|
581
582
|
]
|
582
583
|
})
|
583
584
|
if (lastLeft[VALUE] !== PLACEHOLDER) {
|
584
585
|
let wrap = right
|
585
586
|
for (let i = 0; i < vars.length; ++i) {
|
586
|
-
wrap = [
|
587
|
-
[APPLY, KEYWORDS.GET_ARRAY],
|
588
|
-
wrap,
|
589
|
-
[ATOM, 1]
|
590
|
-
]
|
587
|
+
wrap = [[APPLY, SUGGAR.GET_ARRAY], wrap, [ATOM, 1]]
|
591
588
|
}
|
592
589
|
newScope.push([
|
593
590
|
[APPLY, KEYWORDS.DEFINE_VARIABLE],
|
@@ -619,7 +616,7 @@ export const deSuggarAst = (ast, scope) => {
|
|
619
616
|
.map(([i]) => [
|
620
617
|
[APPLY, KEYWORDS.DEFINE_VARIABLE],
|
621
618
|
vars[i],
|
622
|
-
[[APPLY,
|
619
|
+
[[APPLY, SUGGAR.GET_ARRAY], right, [ATOM, i]]
|
623
620
|
])
|
624
621
|
if (isSlicing)
|
625
622
|
newScope.push([
|