update devDependencies and regenerate with updated peggy
[squeep-web-linking] / lib / rfc8288-web-linking.js
index 5da4bab5343d6f3987041a5cb7821be41a1cd682..b2b66bd74225359c9088808e3a008d5a9f9bba23 100644 (file)
@@ -1,4 +1,4 @@
-// Generated by Peggy 2.0.1.
+// Generated by Peggy 3.0.2.
 //
 // https://peggyjs.org/
 
@@ -69,16 +69,19 @@ peg$SyntaxError.prototype.format = function(sources) {
       }
     }
     var s = this.location.start;
-    var loc = this.location.source + ":" + s.line + ":" + s.column;
+    var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
+      ? this.location.source.offset(s)
+      : s;
+    var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
     if (src) {
       var e = this.location.end;
-      var filler = peg$padEnd("", s.line.toString().length, ' ');
+      var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
       var line = src[s.line - 1];
       var last = s.line === e.line ? e.column : line.length + 1;
       var hatLen = (last - s.column) || 1;
       str += "\n --> " + loc + "\n"
           + filler + " |\n"
-          + s.line + " | " + line + "\n"
+          + offset_s.line + " | " + line + "\n"
           + filler + " | " + peg$padEnd("", s.column - 1, ' ')
           + peg$padEnd("", hatLen, "^");
     } else {
@@ -420,11 +423,11 @@ function peg$parse(input, options) {
     }
   }
 
-  function peg$computeLocation(startPos, endPos) {
+  function peg$computeLocation(startPos, endPos, offset) {
     var startPosDetails = peg$computePosDetails(startPos);
     var endPosDetails = peg$computePosDetails(endPos);
 
-    return {
+    var res = {
       source: peg$source,
       start: {
         offset: startPos,
@@ -437,6 +440,11 @@ function peg$parse(input, options) {
         column: endPosDetails.column
       }
     };
+    if (offset && peg$source && (typeof peg$source.offset === "function")) {
+      res.start = peg$source.offset(res.start);
+      res.end = peg$source.offset(res.end);
+    }
+    return res;
   }
 
   function peg$fail(expected) {