fez-lisp 1.4.18 → 1.4.19
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/lib/baked/std.js +1 -1
- package/package.json +1 -1
- package/src/keywords.js +1 -0
- package/src/utils.js +17 -0
package/package.json
CHANGED
package/src/keywords.js
CHANGED
package/src/utils.js
CHANGED
@@ -290,6 +290,23 @@ export const debug = (ast, onSuccess = compile) => {
|
|
290
290
|
const debugEnv = {
|
291
291
|
...keywords,
|
292
292
|
[DEBUG.CALLSTACK]: [KEYWORDS.BLOCK],
|
293
|
+
[DEBUG.SIGNATURE]: (args, env) => {
|
294
|
+
if (args.length !== 1)
|
295
|
+
throw new RangeError(
|
296
|
+
`Invalid number of arguments to (${DEBUG.SIGNATURE}) (= 1) (${
|
297
|
+
DEBUG.SIGNATURE
|
298
|
+
} ${stringifyArgs(args)})`
|
299
|
+
)
|
300
|
+
const name = args[0][VALUE]
|
301
|
+
const signatures = std[0][1][1].filter(
|
302
|
+
(x) =>
|
303
|
+
x[0][TYPE] === APPLY &&
|
304
|
+
x[0][VALUE] === KEYWORDS.DEFINE_VARIABLE &&
|
305
|
+
x[1][TYPE] === WORD &&
|
306
|
+
x[1][VALUE].toString().includes(name)
|
307
|
+
)
|
308
|
+
return signatures.map(LISP.source).join('\n\n')
|
309
|
+
},
|
293
310
|
[DEBUG.LOG]: (args, env) => {
|
294
311
|
if (args.length !== 1 && args.length !== 2)
|
295
312
|
throw new RangeError(
|