parseman 0.27.0 → 0.27.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.
@@ -208,7 +208,7 @@ var META = new Set("()[]{}*+?|^$.".split(""));
208
208
  var CAP_RECORD = [
209
209
  ` if (_cap && _e > _pos) {`,
210
210
  ` if (_ctx._triviaLog !== undefined) _ctx._triviaLog.push(_pos, _e)`,
211
- ` if (_ctx._cstTriviaLog !== undefined) _ctx._cstTriviaLog.push(_pos, _e, _ctx._cstRawChildren ? _ctx._cstRawChildren.length : 0)`,
211
+ ` if (_ctx._cstTriviaLog !== undefined && _ctx.captureTrivia) _ctx._cstTriviaLog.push(_pos, _e, _ctx._cstRawChildren ? _ctx._cstRawChildren.length : 0)`,
212
212
  ` }`
213
213
  ].join("\n");
214
214
 
@@ -230,9 +230,11 @@ function cstBuildHost(typeOrOptions, children, _fields, span, rawChildren, trivi
230
230
  }
231
231
  const collapse = normalizeCstCollapse(typeOrOptions?.collapse);
232
232
  const host = (type, children2, fields, span2, rawChildren2, triviaLog2, state2) => buildCstNode(type, children2, fields, span2, rawChildren2, triviaLog2, state2);
233
+ host._parsemanCstOutput = true;
233
234
  if (collapse) host._parsemanCstCollapse = collapse;
234
235
  return host;
235
236
  }
237
+ cstBuildHost._parsemanCstOutput = true;
236
238
 
237
239
  // src/cst/walk.ts
238
240
  function walk(root, visitor, ctx = void 0) {