clarity-pattern-parser 10.0.8 → 10.1.0

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/dist/index.esm.js CHANGED
@@ -279,6 +279,7 @@ class CursorHistory {
279
279
  this._patterns = [];
280
280
  this._nodes = [];
281
281
  this._errors = [];
282
+ this._records = [];
282
283
  }
283
284
  get isRecording() {
284
285
  return this._isRecording;
@@ -301,6 +302,9 @@ class CursorHistory {
301
302
  get error() {
302
303
  return this._currentError;
303
304
  }
305
+ get records() {
306
+ return this._records;
307
+ }
304
308
  get nodes() {
305
309
  return this._nodes;
306
310
  }
@@ -311,6 +315,11 @@ class CursorHistory {
311
315
  if (this._isRecording) {
312
316
  this._patterns.push(pattern);
313
317
  this._nodes.push(node);
318
+ this._records.push({
319
+ pattern,
320
+ ast: node,
321
+ error: null
322
+ });
314
323
  }
315
324
  this._rootMatch.pattern = pattern;
316
325
  this._rootMatch.node = node;
@@ -350,6 +359,11 @@ class CursorHistory {
350
359
  }
351
360
  if (this._isRecording) {
352
361
  this._errors.push(error);
362
+ this.records.push({
363
+ pattern,
364
+ ast: null,
365
+ error
366
+ });
353
367
  }
354
368
  }
355
369
  startRecording() {
@@ -400,6 +414,9 @@ class Cursor {
400
414
  get errors() {
401
415
  return this._history.errors;
402
416
  }
417
+ get records() {
418
+ return this._history.records;
419
+ }
403
420
  get index() {
404
421
  return this._index;
405
422
  }