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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "8.1.2",
3
+ "version": "8.1.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
package/src/ast.mjs CHANGED
@@ -60,6 +60,10 @@ export function binop(op, left, right, fallback) {
60
60
  return fallback(op, left, right);
61
61
  }
62
62
 
63
+ export const ASTNodeTrue = {
64
+ eval: () => true
65
+ };
66
+
63
67
  export function binopEval(node, current, context) {
64
68
  return binop(
65
69
  node.token,
@@ -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 { eval: () => true };
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
  };