fez-lisp 1.3.11 → 1.3.13
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/index.js +2 -19
- package/lib/baked/macros.js +62 -0
- package/lib/baked/std.js +1 -1
- package/package.json +1 -1
- package/src/macros.js +500 -406
- package/src/utils.js +4 -3
package/index.js
CHANGED
@@ -1,22 +1,5 @@
|
|
1
1
|
import { evaluate } from './src/evaluator.js'
|
2
2
|
import { LISP, AST } from './src/parser.js'
|
3
|
-
import { fez,
|
3
|
+
import { fez, prep } from './src/utils.js'
|
4
4
|
import std from './lib/baked/std.js'
|
5
|
-
|
6
|
-
import { WORD, APPLY, ATOM, VALUE, TYPE } from './src/keywords.js'
|
7
|
-
const types = { WORD, APPLY, ATOM, VALUE, TYPE }
|
8
|
-
export {
|
9
|
-
fez,
|
10
|
-
keywords,
|
11
|
-
evaluate,
|
12
|
-
std,
|
13
|
-
types,
|
14
|
-
tree,
|
15
|
-
ast,
|
16
|
-
src,
|
17
|
-
js,
|
18
|
-
prep,
|
19
|
-
dependencies,
|
20
|
-
LISP,
|
21
|
-
AST
|
22
|
-
}
|
5
|
+
export { fez, evaluate, std, prep, LISP, AST }
|
package/lib/baked/macros.js
CHANGED
@@ -128,3 +128,65 @@ export const NOT_EQUAL = [
|
|
128
128
|
]
|
129
129
|
]
|
130
130
|
]
|
131
|
+
export const SLICE = [
|
132
|
+
[0, 'lambda'],
|
133
|
+
[1, 'arr'],
|
134
|
+
[1, 'start'],
|
135
|
+
[1, 'end'],
|
136
|
+
[
|
137
|
+
[0, 'do'],
|
138
|
+
[
|
139
|
+
[0, 'let'],
|
140
|
+
[1, 'bounds'],
|
141
|
+
[
|
142
|
+
[0, '-'],
|
143
|
+
[1, 'end'],
|
144
|
+
[1, 'start']
|
145
|
+
]
|
146
|
+
],
|
147
|
+
[
|
148
|
+
[0, 'let'],
|
149
|
+
[1, 'recursive:iterate'],
|
150
|
+
[
|
151
|
+
[0, 'lambda'],
|
152
|
+
[1, 'i'],
|
153
|
+
[1, 'out'],
|
154
|
+
[
|
155
|
+
[0, 'if'],
|
156
|
+
[
|
157
|
+
[0, '<'],
|
158
|
+
[1, 'i'],
|
159
|
+
[1, 'bounds']
|
160
|
+
],
|
161
|
+
[
|
162
|
+
[0, 'recursive:iterate'],
|
163
|
+
[
|
164
|
+
[0, '+'],
|
165
|
+
[1, 'i'],
|
166
|
+
[2, 1]
|
167
|
+
],
|
168
|
+
[
|
169
|
+
[0, 'set!'],
|
170
|
+
[1, 'out'],
|
171
|
+
[
|
172
|
+
[0, 'length'],
|
173
|
+
[1, 'out']
|
174
|
+
],
|
175
|
+
[
|
176
|
+
[0, 'get'],
|
177
|
+
[1, 'arr'],
|
178
|
+
[
|
179
|
+
[0, '+'],
|
180
|
+
[1, 'start'],
|
181
|
+
[1, 'i']
|
182
|
+
]
|
183
|
+
]
|
184
|
+
]
|
185
|
+
],
|
186
|
+
[1, 'out']
|
187
|
+
]
|
188
|
+
]
|
189
|
+
],
|
190
|
+
[[0, 'recursive:iterate'], [2, 0], []]
|
191
|
+
]
|
192
|
+
]
|