@bablr/language_enhancer-debug-log 0.8.1 → 0.9.1

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.
Files changed (2) hide show
  1. package/lib/index.js +7 -6
  2. package/package.json +3 -2
package/lib/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  /* global console */
2
2
 
3
- import { buildEmbeddedObject, printCall } from '@bablr/agast-helpers/tree';
3
+ import { buildEmbeddedObject } from '@bablr/agast-vm-helpers/builders';
4
4
 
5
5
  import { printType as printType_ } from '@bablr/agast-helpers/print';
6
+ import { printCall } from '@bablr/agast-vm-helpers/print';
6
7
 
7
8
  const { getOwnPropertyNames, getOwnPropertySymbols, hasOwn } = Object;
8
9
 
@@ -37,8 +38,8 @@ const writeError = (text) => {
37
38
 
38
39
  const mapProduction = (production, type, indentation) => {
39
40
  return {
40
- *[type](props) {
41
- const { grammar } = props;
41
+ *[type](args) {
42
+ const { grammar } = args;
42
43
  const indent = (strings, ...args) => {
43
44
  return `${indentation}${String.raw(strings, ...args)}`;
44
45
  };
@@ -47,7 +48,7 @@ const mapProduction = (production, type, indentation) => {
47
48
 
48
49
  let earlyReturn = true;
49
50
  try {
50
- const generator = production(props);
51
+ const generator = production(args);
51
52
  let current = generator.next();
52
53
 
53
54
  let anyResult = false;
@@ -66,9 +67,9 @@ const mapProduction = (production, type, indentation) => {
66
67
  current = generator.next(result);
67
68
  }
68
69
 
69
- const allowEmpty = grammar.emptyables?.has(type);
70
+ const { allowEmpty } = args;
70
71
 
71
- if ((anyResult || allowEmpty) && props.s.status === 'active') {
72
+ if ((anyResult || allowEmpty) && args.s.status === 'active') {
72
73
  yield writeError(`<-- ${printType(type)}`);
73
74
  } else {
74
75
  yield writeError(`x-- ${printType(type)}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bablr/language_enhancer-debug-log",
3
3
  "description": "A BABLR language enhancer that logs production execution",
4
- "version": "0.8.1",
4
+ "version": "0.9.1",
5
5
  "author": "Conrad Buck<conartist6@gmail.com>",
6
6
  "type": "module",
7
7
  "files": [
@@ -12,7 +12,8 @@
12
12
  },
13
13
  "sideEffects": false,
14
14
  "dependencies": {
15
- "@bablr/agast-helpers": "0.6.1"
15
+ "@bablr/agast-helpers": "0.7.1",
16
+ "@bablr/agast-vm-helpers": "0.7.1"
16
17
  },
17
18
  "devDependencies": {
18
19
  "@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#49f5952efed27f94ee9b94340eb1563c440bf64e",