webpipe-js 2.0.53 → 2.0.56

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
@@ -127,27 +127,21 @@ var Parser = class {
127
127
  const originalPos = this.pos;
128
128
  this.pos++;
129
129
  const restOfLine = this.consumeWhile((ch) => ch !== "\n");
130
- const end = this.pos;
131
130
  return {
132
131
  type: "standalone",
133
132
  text: restOfLine,
134
133
  style: "#",
135
- lineNumber: this.getLineNumber(start),
136
- start,
137
- end
134
+ lineNumber: this.getLineNumber(start)
138
135
  };
139
136
  }
140
137
  if (this.text.startsWith("//", this.pos)) {
141
138
  this.pos += 2;
142
139
  const text = this.consumeWhile((ch) => ch !== "\n");
143
- const end = this.pos;
144
140
  return {
145
141
  type: "standalone",
146
142
  text,
147
143
  style: "//",
148
- lineNumber: this.getLineNumber(start),
149
- start,
150
- end
144
+ lineNumber: this.getLineNumber(start)
151
145
  };
152
146
  }
153
147
  return null;
@@ -898,11 +892,10 @@ var Parser = class {
898
892
  const comments = [];
899
893
  while (true) {
900
894
  const save = this.pos;
901
- this.skipWhitespaceOnly();
895
+ this.skipSpaces();
902
896
  const comment = this.tryParse(() => this.parseStandaloneComment());
903
897
  if (comment) {
904
898
  comments.push(comment);
905
- if (this.cur() === "\n") this.pos++;
906
899
  continue;
907
900
  }
908
901
  for (const keyword of stopKeywords) {
@@ -928,11 +921,10 @@ var Parser = class {
928
921
  const comments = [];
929
922
  while (true) {
930
923
  const save = this.pos;
931
- this.skipWhitespaceOnly();
924
+ this.skipSpaces();
932
925
  const comment = this.tryParse(() => this.parseStandaloneComment());
933
926
  if (comment) {
934
927
  comments.push(comment);
935
- if (this.cur() === "\n") this.pos++;
936
928
  continue;
937
929
  }
938
930
  if (!this.text.startsWith("|>", this.pos)) {
@@ -1509,11 +1501,10 @@ var Parser = class {
1509
1501
  const tests = [];
1510
1502
  const comments = [];
1511
1503
  while (true) {
1512
- this.skipWhitespaceOnly();
1504
+ this.skipSpaces();
1513
1505
  const comment = this.tryParse(() => this.parseStandaloneComment());
1514
1506
  if (comment) {
1515
1507
  comments.push(comment);
1516
- if (this.cur() === "\n") this.pos++;
1517
1508
  continue;
1518
1509
  }
1519
1510
  const letBinding = this.tryParse(() => this.parseLetBinding());
@@ -1623,9 +1614,7 @@ function printPipeline(pipeline) {
1623
1614
  items.push({ type: "step", item: step, position: step.start });
1624
1615
  });
1625
1616
  pipeline.pipeline.comments.forEach((comment) => {
1626
- if (comment.start !== void 0) {
1627
- items.push({ type: "comment", item: comment, position: comment.start });
1628
- }
1617
+ items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
1629
1618
  });
1630
1619
  items.sort((a, b) => a.position - b.position);
1631
1620
  items.forEach((entry) => {
@@ -2037,9 +2026,7 @@ function formatPipelineRef(ref) {
2037
2026
  items.push({ type: "step", item: step, position: step.start });
2038
2027
  });
2039
2028
  ref.pipeline.comments.forEach((comment) => {
2040
- if (comment.start !== void 0) {
2041
- items.push({ type: "comment", item: comment, position: comment.start });
2042
- }
2029
+ items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
2043
2030
  });
2044
2031
  items.sort((a, b) => a.position - b.position);
2045
2032
  items.forEach((entry) => {
package/dist/index.d.cts CHANGED
@@ -16,8 +16,6 @@ interface Comment {
16
16
  text: string;
17
17
  style: '#' | '//';
18
18
  lineNumber?: number;
19
- start?: number;
20
- end?: number;
21
19
  }
22
20
  interface Config {
23
21
  name: string;
package/dist/index.d.ts CHANGED
@@ -16,8 +16,6 @@ interface Comment {
16
16
  text: string;
17
17
  style: '#' | '//';
18
18
  lineNumber?: number;
19
- start?: number;
20
- end?: number;
21
19
  }
22
20
  interface Config {
23
21
  name: string;
package/dist/index.mjs CHANGED
@@ -74,27 +74,21 @@ var Parser = class {
74
74
  const originalPos = this.pos;
75
75
  this.pos++;
76
76
  const restOfLine = this.consumeWhile((ch) => ch !== "\n");
77
- const end = this.pos;
78
77
  return {
79
78
  type: "standalone",
80
79
  text: restOfLine,
81
80
  style: "#",
82
- lineNumber: this.getLineNumber(start),
83
- start,
84
- end
81
+ lineNumber: this.getLineNumber(start)
85
82
  };
86
83
  }
87
84
  if (this.text.startsWith("//", this.pos)) {
88
85
  this.pos += 2;
89
86
  const text = this.consumeWhile((ch) => ch !== "\n");
90
- const end = this.pos;
91
87
  return {
92
88
  type: "standalone",
93
89
  text,
94
90
  style: "//",
95
- lineNumber: this.getLineNumber(start),
96
- start,
97
- end
91
+ lineNumber: this.getLineNumber(start)
98
92
  };
99
93
  }
100
94
  return null;
@@ -845,11 +839,10 @@ var Parser = class {
845
839
  const comments = [];
846
840
  while (true) {
847
841
  const save = this.pos;
848
- this.skipWhitespaceOnly();
842
+ this.skipSpaces();
849
843
  const comment = this.tryParse(() => this.parseStandaloneComment());
850
844
  if (comment) {
851
845
  comments.push(comment);
852
- if (this.cur() === "\n") this.pos++;
853
846
  continue;
854
847
  }
855
848
  for (const keyword of stopKeywords) {
@@ -875,11 +868,10 @@ var Parser = class {
875
868
  const comments = [];
876
869
  while (true) {
877
870
  const save = this.pos;
878
- this.skipWhitespaceOnly();
871
+ this.skipSpaces();
879
872
  const comment = this.tryParse(() => this.parseStandaloneComment());
880
873
  if (comment) {
881
874
  comments.push(comment);
882
- if (this.cur() === "\n") this.pos++;
883
875
  continue;
884
876
  }
885
877
  if (!this.text.startsWith("|>", this.pos)) {
@@ -1456,11 +1448,10 @@ var Parser = class {
1456
1448
  const tests = [];
1457
1449
  const comments = [];
1458
1450
  while (true) {
1459
- this.skipWhitespaceOnly();
1451
+ this.skipSpaces();
1460
1452
  const comment = this.tryParse(() => this.parseStandaloneComment());
1461
1453
  if (comment) {
1462
1454
  comments.push(comment);
1463
- if (this.cur() === "\n") this.pos++;
1464
1455
  continue;
1465
1456
  }
1466
1457
  const letBinding = this.tryParse(() => this.parseLetBinding());
@@ -1570,9 +1561,7 @@ function printPipeline(pipeline) {
1570
1561
  items.push({ type: "step", item: step, position: step.start });
1571
1562
  });
1572
1563
  pipeline.pipeline.comments.forEach((comment) => {
1573
- if (comment.start !== void 0) {
1574
- items.push({ type: "comment", item: comment, position: comment.start });
1575
- }
1564
+ items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
1576
1565
  });
1577
1566
  items.sort((a, b) => a.position - b.position);
1578
1567
  items.forEach((entry) => {
@@ -1984,9 +1973,7 @@ function formatPipelineRef(ref) {
1984
1973
  items.push({ type: "step", item: step, position: step.start });
1985
1974
  });
1986
1975
  ref.pipeline.comments.forEach((comment) => {
1987
- if (comment.start !== void 0) {
1988
- items.push({ type: "comment", item: comment, position: comment.start });
1989
- }
1976
+ items.push({ type: "comment", item: comment, position: comment.lineNumber || 0 });
1990
1977
  });
1991
1978
  items.sort((a, b) => a.position - b.position);
1992
1979
  items.forEach((entry) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpipe-js",
3
- "version": "2.0.53",
3
+ "version": "2.0.56",
4
4
  "description": "Web Pipe parser",
5
5
  "license": "ISC",
6
6
  "author": "William Cotton",