webpipe-js 2.0.56 → 2.0.57

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.cjs CHANGED
@@ -892,10 +892,11 @@ var Parser = class {
892
892
  const comments = [];
893
893
  while (true) {
894
894
  const save = this.pos;
895
- this.skipSpaces();
895
+ this.skipWhitespaceOnly();
896
896
  const comment = this.tryParse(() => this.parseStandaloneComment());
897
897
  if (comment) {
898
898
  comments.push(comment);
899
+ if (this.cur() === "\n") this.pos++;
899
900
  continue;
900
901
  }
901
902
  for (const keyword of stopKeywords) {
@@ -920,15 +921,14 @@ var Parser = class {
920
921
  const steps = [];
921
922
  const comments = [];
922
923
  while (true) {
923
- const save = this.pos;
924
- this.skipSpaces();
924
+ this.skipWhitespaceOnly();
925
925
  const comment = this.tryParse(() => this.parseStandaloneComment());
926
926
  if (comment) {
927
927
  comments.push(comment);
928
+ if (this.cur() === "\n") this.pos++;
928
929
  continue;
929
930
  }
930
931
  if (!this.text.startsWith("|>", this.pos)) {
931
- this.pos = save;
932
932
  break;
933
933
  }
934
934
  const step = this.parsePipelineStep();
@@ -1060,7 +1060,7 @@ var Parser = class {
1060
1060
  this.skipInlineSpaces();
1061
1061
  const path = this.consumeWhile((c) => c !== " " && c !== "\n" && c !== "#");
1062
1062
  const inlineComment = this.parseInlineComment();
1063
- this.skipSpaces();
1063
+ this.skipWhitespaceOnly();
1064
1064
  const pipeline = this.parsePipelineRef();
1065
1065
  const end = this.pos;
1066
1066
  this.skipWhitespaceOnly();
@@ -1265,7 +1265,6 @@ var Parser = class {
1265
1265
  return { conditionType: ct, field, headerName: headerName ?? void 0, jqExpr: jqExpr ?? void 0, comparison, value, start, end };
1266
1266
  }
1267
1267
  parseMockHead(prefixWord) {
1268
- this.skipSpaces();
1269
1268
  const start = this.pos;
1270
1269
  this.expect(prefixWord);
1271
1270
  this.skipInlineSpaces();
@@ -1285,7 +1284,6 @@ var Parser = class {
1285
1284
  this.expect("returning");
1286
1285
  this.skipInlineSpaces();
1287
1286
  const returnValue = this.parseBacktickString();
1288
- this.skipSpaces();
1289
1287
  const end = this.pos;
1290
1288
  return { target, targetStart, returnValue, lineNumber: this.getLineNumber(start), start, end };
1291
1289
  }
@@ -1501,10 +1499,11 @@ var Parser = class {
1501
1499
  const tests = [];
1502
1500
  const comments = [];
1503
1501
  while (true) {
1504
- this.skipSpaces();
1502
+ this.skipWhitespaceOnly();
1505
1503
  const comment = this.tryParse(() => this.parseStandaloneComment());
1506
1504
  if (comment) {
1507
1505
  comments.push(comment);
1506
+ if (this.cur() === "\n") this.pos++;
1508
1507
  continue;
1509
1508
  }
1510
1509
  const letBinding = this.tryParse(() => this.parseLetBinding());
package/dist/index.mjs CHANGED
@@ -839,10 +839,11 @@ var Parser = class {
839
839
  const comments = [];
840
840
  while (true) {
841
841
  const save = this.pos;
842
- this.skipSpaces();
842
+ this.skipWhitespaceOnly();
843
843
  const comment = this.tryParse(() => this.parseStandaloneComment());
844
844
  if (comment) {
845
845
  comments.push(comment);
846
+ if (this.cur() === "\n") this.pos++;
846
847
  continue;
847
848
  }
848
849
  for (const keyword of stopKeywords) {
@@ -867,15 +868,14 @@ var Parser = class {
867
868
  const steps = [];
868
869
  const comments = [];
869
870
  while (true) {
870
- const save = this.pos;
871
- this.skipSpaces();
871
+ this.skipWhitespaceOnly();
872
872
  const comment = this.tryParse(() => this.parseStandaloneComment());
873
873
  if (comment) {
874
874
  comments.push(comment);
875
+ if (this.cur() === "\n") this.pos++;
875
876
  continue;
876
877
  }
877
878
  if (!this.text.startsWith("|>", this.pos)) {
878
- this.pos = save;
879
879
  break;
880
880
  }
881
881
  const step = this.parsePipelineStep();
@@ -1007,7 +1007,7 @@ var Parser = class {
1007
1007
  this.skipInlineSpaces();
1008
1008
  const path = this.consumeWhile((c) => c !== " " && c !== "\n" && c !== "#");
1009
1009
  const inlineComment = this.parseInlineComment();
1010
- this.skipSpaces();
1010
+ this.skipWhitespaceOnly();
1011
1011
  const pipeline = this.parsePipelineRef();
1012
1012
  const end = this.pos;
1013
1013
  this.skipWhitespaceOnly();
@@ -1212,7 +1212,6 @@ var Parser = class {
1212
1212
  return { conditionType: ct, field, headerName: headerName ?? void 0, jqExpr: jqExpr ?? void 0, comparison, value, start, end };
1213
1213
  }
1214
1214
  parseMockHead(prefixWord) {
1215
- this.skipSpaces();
1216
1215
  const start = this.pos;
1217
1216
  this.expect(prefixWord);
1218
1217
  this.skipInlineSpaces();
@@ -1232,7 +1231,6 @@ var Parser = class {
1232
1231
  this.expect("returning");
1233
1232
  this.skipInlineSpaces();
1234
1233
  const returnValue = this.parseBacktickString();
1235
- this.skipSpaces();
1236
1234
  const end = this.pos;
1237
1235
  return { target, targetStart, returnValue, lineNumber: this.getLineNumber(start), start, end };
1238
1236
  }
@@ -1448,10 +1446,11 @@ var Parser = class {
1448
1446
  const tests = [];
1449
1447
  const comments = [];
1450
1448
  while (true) {
1451
- this.skipSpaces();
1449
+ this.skipWhitespaceOnly();
1452
1450
  const comment = this.tryParse(() => this.parseStandaloneComment());
1453
1451
  if (comment) {
1454
1452
  comments.push(comment);
1453
+ if (this.cur() === "\n") this.pos++;
1455
1454
  continue;
1456
1455
  }
1457
1456
  const letBinding = this.tryParse(() => this.parseLetBinding());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpipe-js",
3
- "version": "2.0.56",
3
+ "version": "2.0.57",
4
4
  "description": "Web Pipe parser",
5
5
  "license": "ISC",
6
6
  "author": "William Cotton",