pacc 8.9.1 → 8.9.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,11 +1,11 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "8.9.1",
3
+ "version": "8.9.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
7
7
  },
8
- "packageManager": "npm@11.9.0+sha512.04166853ddba142ca98f86fb57b1258a7c6c59ccb82acb3cf141b77a315898acaaed47395e74f7e0c7b69c486008e68be6a6381ef1aee5a23dd82e0e61decd68",
8
+ "packageManager": "npm@11.10.0+sha512.8bc844e37892200305b98562f13c6c10849d10b3387c8cdaeb4d1a2e32746a79063cba9dd284cf28c26a01c3bf4169b7d3b31b4a5586cc970d6749463108073c",
9
9
  "types": "./types/module.d.mts",
10
10
  "exports": {
11
11
  ".": {
package/src/ast.mjs CHANGED
@@ -1,18 +1,3 @@
1
- import {
2
- DOUBLE_BAR,
3
- DOUBLE_AMPERSAND,
4
- EQUAL,
5
- NOT_EQUAL,
6
- LESS,
7
- LESS_EQUAL,
8
- GREATER,
9
- GREATER_EQUAL,
10
- STAR,
11
- DIVIDE,
12
- PLUS,
13
- MINUS
14
- } from "./tokens.mjs";
15
-
16
1
  /**
17
2
  * @typedef {Object} AST
18
3
  * @property {Function} [eval]
@@ -18,7 +18,7 @@ export function parseOnly(input, context = {}) {
18
18
 
19
19
  let node, token, value;
20
20
 
21
- const advance = () => {
21
+ function advance() {
22
22
  const next = input.next();
23
23
  if (next.done) {
24
24
  token = EOF;
@@ -28,9 +28,9 @@ export function parseOnly(input, context = {}) {
28
28
  value = next.value[1];
29
29
  }
30
30
  }
31
- };
31
+ }
32
32
 
33
- const expect = expected => {
33
+ function expect(expected) {
34
34
  if (token !== expected) {
35
35
  throw new Error(
36
36
  `unexpected '${token?.str || token}' expecting '${expected.str}'`,
@@ -38,9 +38,9 @@ export function parseOnly(input, context = {}) {
38
38
  );
39
39
  }
40
40
  advance();
41
- };
41
+ }
42
42
 
43
- const nud = (last, left) => {
43
+ function nud(last, left) {
44
44
  switch (last) {
45
45
  case OPEN_ROUND: {
46
46
  const sequence = [];
@@ -86,9 +86,9 @@ export function parseOnly(input, context = {}) {
86
86
  }
87
87
 
88
88
  return last;
89
- };
89
+ }
90
90
 
91
- const led = (last, left) => {
91
+ function led(last, left) {
92
92
  switch (last.type) {
93
93
  case "infixr":
94
94
  return ASTBinop(last, left, expression(last.precedence - 1));
@@ -134,9 +134,9 @@ export function parseOnly(input, context = {}) {
134
134
  }
135
135
 
136
136
  return { token };
137
- };
137
+ }
138
138
 
139
- const expression = precedence => {
139
+ function expression(precedence) {
140
140
  const last = token;
141
141
  advance();
142
142
  node = nud(last, node);
@@ -148,7 +148,7 @@ export function parseOnly(input, context = {}) {
148
148
  }
149
149
 
150
150
  return node;
151
- };
151
+ }
152
152
 
153
153
  advance();
154
154