fez-lisp 1.6.22 → 1.6.25
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/README.md +27 -28
- package/lib/baked/std-T.js +1 -1
- package/lib/baked/std.js +1 -1
- package/package.json +1 -1
- package/src/macros.js +52 -1
package/package.json
CHANGED
package/src/macros.js
CHANGED
@@ -37,7 +37,16 @@ export const SUGGAR = {
|
|
37
37
|
BIG_INT_DIVISION: 'Idiv',
|
38
38
|
BIG_INT_MULTIPLICATION: 'Imul',
|
39
39
|
NEW_BIG_INTEGER: 'new:big-integer',
|
40
|
-
PROMISES: '*DATA*'
|
40
|
+
PROMISES: '*DATA*',
|
41
|
+
VARIABLE: 'variable',
|
42
|
+
SET_VARIABLE: 'set',
|
43
|
+
INCREMENT: '++',
|
44
|
+
DECREMENT: '--',
|
45
|
+
INCREMENT_BY: '+=',
|
46
|
+
DECREMENT_BY: '-=',
|
47
|
+
BOOLEAN_VARIABLE: 'boolean',
|
48
|
+
BOOLEAN_VARIABLE_GET: 'boole',
|
49
|
+
BOOLEAN_VARIABLE_SET: 'boole-set'
|
41
50
|
}
|
42
51
|
export const deSuggarAst = (ast, scope) => {
|
43
52
|
if (scope === undefined) scope = ast
|
@@ -98,6 +107,48 @@ export const deSuggarAst = (ast, scope) => {
|
|
98
107
|
// }
|
99
108
|
// }
|
100
109
|
// break
|
110
|
+
case KEYWORDS.GET_ARRAY:
|
111
|
+
if (rest.length === 1) {
|
112
|
+
exp[0][VALUE] = 'math:var-get'
|
113
|
+
// exp.push([ATOM, 0])
|
114
|
+
}
|
115
|
+
break
|
116
|
+
case SUGGAR.INCREMENT:
|
117
|
+
exp[0][VALUE] = 'math:var-increment!'
|
118
|
+
break
|
119
|
+
case SUGGAR.DECREMENT:
|
120
|
+
exp[0][VALUE] = 'math:var-decrement!'
|
121
|
+
break
|
122
|
+
case SUGGAR.INCREMENT_BY:
|
123
|
+
exp[0][VALUE] = 'math:var-add!'
|
124
|
+
deSuggarAst(exp.at(-1))
|
125
|
+
break
|
126
|
+
case SUGGAR.DECREMENT_BY:
|
127
|
+
exp[0][VALUE] = 'math:var-subtract!'
|
128
|
+
deSuggarAst(exp.at(-1))
|
129
|
+
break
|
130
|
+
case SUGGAR.VARIABLE:
|
131
|
+
exp[0][VALUE] = 'let'
|
132
|
+
exp.push([[APPLY, 'math:var-def'], exp.pop()])
|
133
|
+
deSuggarAst(exp.at(-1))
|
134
|
+
break
|
135
|
+
case SUGGAR.SET_VARIABLE:
|
136
|
+
exp[0][VALUE] = 'math:var-set!'
|
137
|
+
deSuggarAst(exp.at(-1))
|
138
|
+
break
|
139
|
+
case SUGGAR.BOOLEAN_VARIABLE:
|
140
|
+
exp[0][VALUE] = 'let'
|
141
|
+
exp.push([[APPLY, 'boole:def-strict'], exp.pop()])
|
142
|
+
deSuggarAst(exp.at(-1))
|
143
|
+
break
|
144
|
+
case SUGGAR.BOOLEAN_VARIABLE_SET:
|
145
|
+
exp[0][VALUE] = 'boole:set!'
|
146
|
+
deSuggarAst(exp.at(-1))
|
147
|
+
break
|
148
|
+
case SUGGAR.BOOLEAN_VARIABLE_GET:
|
149
|
+
exp[0][VALUE] = 'boole:get'
|
150
|
+
deSuggarAst(exp.at(-1))
|
151
|
+
break
|
101
152
|
case KEYWORDS.BLOCK:
|
102
153
|
{
|
103
154
|
if (rest.length === 0)
|