pacc 8.1.2 → 8.1.3
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/package.json +1 -1
- package/src/ast.mjs +4 -0
- package/src/expression.mjs +4 -2
- package/types/ast.d.mts +3 -0
package/package.json
CHANGED
package/src/ast.mjs
CHANGED
package/src/expression.mjs
CHANGED
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
binopEval,
|
|
17
17
|
predicateIteratorEval,
|
|
18
18
|
pathEval,
|
|
19
|
-
functionEval
|
|
19
|
+
functionEval,
|
|
20
|
+
ASTNodeTrue
|
|
20
21
|
} from "./ast.mjs";
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -65,7 +66,7 @@ export function parse(input, context = {}) {
|
|
|
65
66
|
case OPEN_BRACKET: {
|
|
66
67
|
if(token === CLOSE_BRACKET) {
|
|
67
68
|
advance();
|
|
68
|
-
return
|
|
69
|
+
return ASTNodeTrue;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
const node = expression(0);
|
|
@@ -129,6 +130,7 @@ export function parse(input, context = {}) {
|
|
|
129
130
|
case "string":
|
|
130
131
|
case "number":
|
|
131
132
|
case "bigint":
|
|
133
|
+
case "boolean":
|
|
132
134
|
return binop(last, left, right, binopError);
|
|
133
135
|
}
|
|
134
136
|
}
|
package/types/ast.d.mts
CHANGED
|
@@ -15,6 +15,9 @@ export function binopEval(node: any, current: any, context: any): any;
|
|
|
15
15
|
export function predicateIteratorEval(node: any, current: any, context: any): any;
|
|
16
16
|
export function pathEval(node: any, current: any, context: any): any;
|
|
17
17
|
export function functionEval(node: any, current: any, context: any): any;
|
|
18
|
+
export namespace ASTNodeTrue {
|
|
19
|
+
function eval(): boolean;
|
|
20
|
+
}
|
|
18
21
|
export type AST = {
|
|
19
22
|
eval?: Function;
|
|
20
23
|
};
|