fez-lisp 1.6.24 → 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 +14 -14
- package/lib/baked/std-T.js +1 -1
- package/lib/baked/std.js +1 -1
- package/package.json +1 -1
- package/src/macros.js +40 -8
package/package.json
CHANGED
package/src/macros.js
CHANGED
@@ -39,7 +39,14 @@ export const SUGGAR = {
|
|
39
39
|
NEW_BIG_INTEGER: 'new:big-integer',
|
40
40
|
PROMISES: '*DATA*',
|
41
41
|
VARIABLE: 'variable',
|
42
|
-
SET_VARIABLE: 'set'
|
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'
|
43
50
|
}
|
44
51
|
export const deSuggarAst = (ast, scope) => {
|
45
52
|
if (scope === undefined) scope = ast
|
@@ -102,19 +109,44 @@ export const deSuggarAst = (ast, scope) => {
|
|
102
109
|
// break
|
103
110
|
case KEYWORDS.GET_ARRAY:
|
104
111
|
if (rest.length === 1) {
|
105
|
-
exp
|
112
|
+
exp[0][VALUE] = 'math:var-get'
|
113
|
+
// exp.push([ATOM, 0])
|
106
114
|
}
|
107
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
|
108
130
|
case SUGGAR.VARIABLE:
|
109
|
-
|
110
|
-
|
111
|
-
const temp = exp.pop()
|
112
|
-
exp.push([[APPLY, 'var:def'], temp])
|
113
|
-
}
|
131
|
+
exp[0][VALUE] = 'let'
|
132
|
+
exp.push([[APPLY, 'math:var-def'], exp.pop()])
|
114
133
|
deSuggarAst(exp.at(-1))
|
115
134
|
break
|
116
135
|
case SUGGAR.SET_VARIABLE:
|
117
|
-
exp[0][VALUE] = 'var
|
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'
|
118
150
|
deSuggarAst(exp.at(-1))
|
119
151
|
break
|
120
152
|
case KEYWORDS.BLOCK:
|