@digipair/engine 0.22.1 → 0.22.2

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,7 +20344,6 @@ 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);
20348
20347
  var dPrec = parser.dynamicPrecedence(type);
20349
20348
  if (dPrec) this.score += dPrec;
20350
20349
  if (depth == 0) {
@@ -21297,7 +21296,7 @@ function cutAt(tree, pos, side) {
21297
21296
  cursor.moveTo(pos);
21298
21297
  for(;;){
21299
21298
  if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) for(;;){
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 */ ));
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 */ ));
21301
21300
  if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) break;
21302
21301
  if (!cursor.parent()) return side < 0 ? 0 : tree.length;
21303
21302
  }
@@ -21420,7 +21419,7 @@ var TokenCache = /*#__PURE__*/ function() {
21420
21419
  token.mask = mask;
21421
21420
  token.context = context;
21422
21421
  }
21423
- if (token.lookAhead > token.end + 25 /* Lookahead.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21422
+ if (token.lookAhead > token.end + 25 /* Safety.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21424
21423
  if (token.value != 0 /* Term.Err */ ) {
21425
21424
  var startIndex = actionIndex;
21426
21425
  if (token.extended > -1) actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
@@ -24361,7 +24360,6 @@ var parser = LRParser.deserialize({
24361
24360
  },
24362
24361
  dynamicPrecedences: {
24363
24362
  "31": -1,
24364
- "67": 1,
24365
24363
  "71": -1,
24366
24364
  "73": -1
24367
24365
  },
@@ -27370,6 +27368,7 @@ const applyTemplate = (value, context)=>{
27370
27368
  const path = result.replace(/^EVALUATE:/, '');
27371
27369
  result = evaluate(path, _extends({}, context, {
27372
27370
  getTime: (time)=>new Date(time).getTime(),
27371
+ fromTime: (time)=>new Date(time).toISOString(),
27373
27372
  atob: (value)=>atob(value),
27374
27373
  btoa: (value)=>btoa(value),
27375
27374
  encodeURIComponent: (value)=>encodeURIComponent(value),
package/index.esm.js CHANGED
@@ -20322,7 +20322,6 @@ 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);
20326
20325
  var dPrec = parser.dynamicPrecedence(type);
20327
20326
  if (dPrec) this.score += dPrec;
20328
20327
  if (depth == 0) {
@@ -21275,7 +21274,7 @@ function cutAt(tree, pos, side) {
21275
21274
  cursor.moveTo(pos);
21276
21275
  for(;;){
21277
21276
  if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) for(;;){
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 */ ));
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 */ ));
21279
21278
  if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) break;
21280
21279
  if (!cursor.parent()) return side < 0 ? 0 : tree.length;
21281
21280
  }
@@ -21398,7 +21397,7 @@ var TokenCache = /*#__PURE__*/ function() {
21398
21397
  token.mask = mask;
21399
21398
  token.context = context;
21400
21399
  }
21401
- if (token.lookAhead > token.end + 25 /* Lookahead.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21400
+ if (token.lookAhead > token.end + 25 /* Safety.Margin */ ) lookAhead = Math.max(token.lookAhead, lookAhead);
21402
21401
  if (token.value != 0 /* Term.Err */ ) {
21403
21402
  var startIndex = actionIndex;
21404
21403
  if (token.extended > -1) actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
@@ -23489,14 +23488,14 @@ function indent(str, spaces) {
23489
23488
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23490
23489
  // match is required
23491
23490
  if (!match) {
23492
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23491
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23493
23492
  v: nextMatch1
23494
23493
  };
23495
23494
  }
23496
23495
  var token = match.token, offset = match.offset;
23497
23496
  i1 += offset;
23498
23497
  if (token === " ") {
23499
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23498
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23500
23499
  }
23501
23500
  tokens1 = _to_consumable_array$1(tokens1).concat([
23502
23501
  token
@@ -23515,7 +23514,7 @@ function indent(str, spaces) {
23515
23514
  if (contextKeys.some(function(el) {
23516
23515
  return el.startsWith(name);
23517
23516
  })) {
23518
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23517
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23519
23518
  }
23520
23519
  if (dateTimeIdentifiers.some(function(el) {
23521
23520
  return el === name;
@@ -23534,9 +23533,9 @@ function indent(str, spaces) {
23534
23533
  if (dateTimeIdentifiers.some(function(el) {
23535
23534
  return el.startsWith(name);
23536
23535
  })) {
23537
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23536
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23538
23537
  }
23539
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23538
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23540
23539
  v: nextMatch1
23541
23540
  };
23542
23541
  };
@@ -24339,7 +24338,6 @@ var parser = LRParser.deserialize({
24339
24338
  },
24340
24339
  dynamicPrecedences: {
24341
24340
  "31": -1,
24342
- "67": 1,
24343
24341
  "71": -1,
24344
24342
  "73": -1
24345
24343
  },
@@ -27348,6 +27346,7 @@ const applyTemplate = (value, context)=>{
27348
27346
  const path = result.replace(/^EVALUATE:/, '');
27349
27347
  result = evaluate(path, _extends({}, context, {
27350
27348
  getTime: (time)=>new Date(time).getTime(),
27349
+ fromTime: (time)=>new Date(time).toISOString(),
27351
27350
  atob: (value)=>atob(value),
27352
27351
  btoa: (value)=>btoa(value),
27353
27352
  encodeURIComponent: (value)=>encodeURIComponent(value),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/engine",
3
- "version": "0.22.1",
3
+ "version": "0.22.2",
4
4
  "dependencies": {},
5
5
  "typings": "./index.d.ts",
6
6
  "main": "./index.cjs.js",