fez-lisp 1.5.122 → 1.5.124
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/check.js +9 -1
- package/src/compiler.js +5 -1
- package/src/enchance.js +2 -10
package/package.json
CHANGED
package/src/check.js
CHANGED
@@ -299,7 +299,9 @@ const checkPredicateName = (exp, rest) => {
|
|
299
299
|
)
|
300
300
|
} else if (last[0][0] === APPLY) {
|
301
301
|
const application = last[0]
|
302
|
-
if (application[VALUE]
|
302
|
+
if (application[VALUE] === KEYWORDS.CALL_FUNCTION)
|
303
|
+
return checkPredicateName(exp, [rest[0], last.at(-1)])
|
304
|
+
else if (application[VALUE] !== KEYWORDS.IF && !IsPredicate(application))
|
303
305
|
throw new TypeError(
|
304
306
|
`Assigning predicate (ending in ?) variable (${
|
305
307
|
application[VALUE]
|
@@ -307,6 +309,12 @@ const checkPredicateName = (exp, rest) => {
|
|
307
309
|
exp
|
308
310
|
)}) (check #101)`
|
309
311
|
)
|
312
|
+
else if (application[VALUE] === KEYWORDS.IF) {
|
313
|
+
return (
|
314
|
+
checkPredicateName(exp, [rest[0], last[2]]) &&
|
315
|
+
checkPredicateName(exp, [rest[0], last[3]])
|
316
|
+
)
|
317
|
+
}
|
310
318
|
}
|
311
319
|
return true
|
312
320
|
}
|
package/src/compiler.js
CHANGED
@@ -6,7 +6,8 @@ import {
|
|
6
6
|
TYPE,
|
7
7
|
VALUE,
|
8
8
|
WORD,
|
9
|
-
STATIC_TYPES
|
9
|
+
STATIC_TYPES,
|
10
|
+
DEBUG
|
10
11
|
} from './keywords.js'
|
11
12
|
import { leaf, isLeaf, AST } from './parser.js'
|
12
13
|
import { FALSE_WORD, TRUE_WORD } from './types.js'
|
@@ -274,6 +275,9 @@ const comp = (tree, Drill) => {
|
|
274
275
|
case STATIC_TYPES.ATOM:
|
275
276
|
case STATIC_TYPES.PREDICATE:
|
276
277
|
case STATIC_TYPES.ANY:
|
278
|
+
case DEBUG.ASSERT:
|
279
|
+
case DEBUG.LOG:
|
280
|
+
case DEBUG.STRING:
|
277
281
|
return compile(tail[0], Drill)
|
278
282
|
|
279
283
|
default: {
|
package/src/enchance.js
CHANGED
@@ -1,14 +1,6 @@
|
|
1
1
|
import { AST, isLeaf } from './parser.js'
|
2
|
-
import {
|
3
|
-
|
4
|
-
ATOM,
|
5
|
-
KEYWORDS,
|
6
|
-
PREDICATE_SUFFIX,
|
7
|
-
TYPE,
|
8
|
-
VALUE,
|
9
|
-
WORD
|
10
|
-
} from './keywords.js'
|
11
|
-
import { getPrefix, getSuffix, shake, wrapInBlock } from './utils.js'
|
2
|
+
import { APPLY, ATOM, KEYWORDS, TYPE, VALUE, WORD } from './keywords.js'
|
3
|
+
import { getPrefix, shake, wrapInBlock } from './utils.js'
|
12
4
|
import std from '../lib/baked/std.js'
|
13
5
|
export const OPTIMIZATIONS = {
|
14
6
|
RECURSION: 'recursive',
|