@digipair/engine 0.22.2 → 0.23.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.
package/index.cjs.js CHANGED
@@ -20344,6 +20344,7 @@ about the parse state.
20344
20344
  var _a;
20345
20345
  var depth = action >> 19 /* Action.ReduceDepthShift */ , type = action & 65535 /* Action.ValueMask */ ;
20346
20346
  var parser = this.p.parser;
20347
+ if (this.reducePos < this.pos - 25 /* Lookahead.Margin */ ) this.setLookAhead(this.pos);
20347
20348
  var dPrec = parser.dynamicPrecedence(type);
20348
20349
  if (dPrec) this.score += dPrec;
20349
20350
  if (depth == 0) {
@@ -21296,7 +21297,7 @@ function cutAt(tree, pos, side) {
21296
21297
  cursor.moveTo(pos);
21297
21298
  for(;;){
21298
21299
  if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) for(;;){
21299
- if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Safety.Margin */ )) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Safety.Margin */ ));
21300
+ if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Lookahead.Margin */ )) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Lookahead.Margin */ ));
21300
21301
  if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) break;
21301
21302
  if (!cursor.parent()) return side < 0 ? 0 : tree.length;
21302
21303
  }
@@ -21419,7 +21420,7 @@ var TokenCache = /*#__PURE__*/ function() {
21419
21420
  token.mask = mask;
21420
21421
  token.context = context;
21421
21422
  }
21422
- if (token.lookAhead > token.end + 25 /* Safety.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21423
+ if (token.lookAhead > token.end + 25 /* Lookahead.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21423
21424
  if (token.value != 0 /* Term.Err */ ) {
21424
21425
  var startIndex = actionIndex;
21425
21426
  if (token.extended > -1) actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
@@ -23510,14 +23511,14 @@ function indent(str, spaces) {
23510
23511
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23511
23512
  // match is required
23512
23513
  if (!match) {
23513
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23514
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23514
23515
  v: nextMatch1
23515
23516
  };
23516
23517
  }
23517
23518
  var token = match.token, offset = match.offset;
23518
23519
  i1 += offset;
23519
23520
  if (token === " ") {
23520
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23521
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23521
23522
  }
23522
23523
  tokens1 = _to_consumable_array$1(tokens1).concat([
23523
23524
  token
@@ -23536,7 +23537,7 @@ function indent(str, spaces) {
23536
23537
  if (contextKeys.some(function(el) {
23537
23538
  return el.startsWith(name);
23538
23539
  })) {
23539
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23540
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23540
23541
  }
23541
23542
  if (dateTimeIdentifiers.some(function(el) {
23542
23543
  return el === name;
@@ -23555,9 +23556,9 @@ function indent(str, spaces) {
23555
23556
  if (dateTimeIdentifiers.some(function(el) {
23556
23557
  return el.startsWith(name);
23557
23558
  })) {
23558
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23559
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23559
23560
  }
23560
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23561
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23561
23562
  v: nextMatch1
23562
23563
  };
23563
23564
  };
@@ -24360,6 +24361,7 @@ var parser = LRParser.deserialize({
24360
24361
  },
24361
24362
  dynamicPrecedences: {
24362
24363
  "31": -1,
24364
+ "67": 1,
24363
24365
  "71": -1,
24364
24366
  "73": -1
24365
24367
  },
package/index.esm.js CHANGED
@@ -20322,6 +20322,7 @@ about the parse state.
20322
20322
  var _a;
20323
20323
  var depth = action >> 19 /* Action.ReduceDepthShift */ , type = action & 65535 /* Action.ValueMask */ ;
20324
20324
  var parser = this.p.parser;
20325
+ if (this.reducePos < this.pos - 25 /* Lookahead.Margin */ ) this.setLookAhead(this.pos);
20325
20326
  var dPrec = parser.dynamicPrecedence(type);
20326
20327
  if (dPrec) this.score += dPrec;
20327
20328
  if (depth == 0) {
@@ -21274,7 +21275,7 @@ function cutAt(tree, pos, side) {
21274
21275
  cursor.moveTo(pos);
21275
21276
  for(;;){
21276
21277
  if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) for(;;){
21277
- if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Safety.Margin */ )) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Safety.Margin */ ));
21278
+ if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Lookahead.Margin */ )) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Lookahead.Margin */ ));
21278
21279
  if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) break;
21279
21280
  if (!cursor.parent()) return side < 0 ? 0 : tree.length;
21280
21281
  }
@@ -21397,7 +21398,7 @@ var TokenCache = /*#__PURE__*/ function() {
21397
21398
  token.mask = mask;
21398
21399
  token.context = context;
21399
21400
  }
21400
- if (token.lookAhead > token.end + 25 /* Safety.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21401
+ if (token.lookAhead > token.end + 25 /* Lookahead.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21401
21402
  if (token.value != 0 /* Term.Err */ ) {
21402
21403
  var startIndex = actionIndex;
21403
21404
  if (token.extended > -1) actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
@@ -23488,14 +23489,14 @@ function indent(str, spaces) {
23488
23489
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23489
23490
  // match is required
23490
23491
  if (!match) {
23491
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23492
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23492
23493
  v: nextMatch1
23493
23494
  };
23494
23495
  }
23495
23496
  var token = match.token, offset = match.offset;
23496
23497
  i1 += offset;
23497
23498
  if (token === " ") {
23498
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23499
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23499
23500
  }
23500
23501
  tokens1 = _to_consumable_array$1(tokens1).concat([
23501
23502
  token
@@ -23514,7 +23515,7 @@ function indent(str, spaces) {
23514
23515
  if (contextKeys.some(function(el) {
23515
23516
  return el.startsWith(name);
23516
23517
  })) {
23517
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23518
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23518
23519
  }
23519
23520
  if (dateTimeIdentifiers.some(function(el) {
23520
23521
  return el === name;
@@ -23533,9 +23534,9 @@ function indent(str, spaces) {
23533
23534
  if (dateTimeIdentifiers.some(function(el) {
23534
23535
  return el.startsWith(name);
23535
23536
  })) {
23536
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23537
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23537
23538
  }
23538
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23539
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23539
23540
  v: nextMatch1
23540
23541
  };
23541
23542
  };
@@ -24338,6 +24339,7 @@ var parser = LRParser.deserialize({
24338
24339
  },
24339
24340
  dynamicPrecedences: {
24340
24341
  "31": -1,
24342
+ "67": 1,
24341
24343
  "71": -1,
24342
24344
  "73": -1
24343
24345
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/engine",
3
- "version": "0.22.2",
3
+ "version": "0.23.1",
4
4
  "dependencies": {},
5
5
  "typings": "./index.d.ts",
6
6
  "main": "./index.cjs.js",
File without changes
File without changes