@wireweave/core 3.0.0 → 3.0.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/dist/parser.cjs CHANGED
@@ -72,10 +72,14 @@ var peg$SyntaxError = class extends SyntaxError {
72
72
  return s;
73
73
  }
74
74
  function literalEscape(s) {
75
- return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
75
+ return unicodeEscape(
76
+ s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch))
77
+ );
76
78
  }
77
79
  function classEscape(s) {
78
- return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
80
+ return unicodeEscape(
81
+ s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch))
82
+ );
79
83
  }
80
84
  const DESCRIBE_EXPECTATION_FNS = {
81
85
  literal(expectation) {
@@ -284,7 +288,12 @@ function peg$parse(input, options) {
284
288
  const peg$e61 = peg$literalExpectation("//", false);
285
289
  const peg$e62 = peg$literalExpectation("/*", false);
286
290
  const peg$e63 = peg$anyExpectation();
287
- const peg$e64 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "-"], false, false, false);
291
+ const peg$e64 = peg$classExpectation(
292
+ [["a", "z"], ["A", "Z"], ["0", "9"], "_", "-"],
293
+ false,
294
+ false,
295
+ false
296
+ );
288
297
  const peg$e65 = peg$otherExpectation("string");
289
298
  const peg$e66 = peg$literalExpectation('"', false);
290
299
  const peg$e67 = peg$literalExpectation("'", false);
@@ -4925,7 +4934,10 @@ function peg$parse(input, options) {
4925
4934
  }
4926
4935
  }
4927
4936
  if (s1 === peg$FAILED) {
4928
- if (input.substr(peg$currPos, 5) === peg$c40) {
4937
+ if (input.substr(
4938
+ peg$currPos,
4939
+ 5
4940
+ ) === peg$c40) {
4929
4941
  s1 = peg$c40;
4930
4942
  peg$currPos += 5;
4931
4943
  } else {
@@ -4935,7 +4947,10 @@ function peg$parse(input, options) {
4935
4947
  }
4936
4948
  }
4937
4949
  if (s1 === peg$FAILED) {
4938
- if (input.substr(peg$currPos, 8) === peg$c41) {
4950
+ if (input.substr(
4951
+ peg$currPos,
4952
+ 8
4953
+ ) === peg$c41) {
4939
4954
  s1 = peg$c41;
4940
4955
  peg$currPos += 8;
4941
4956
  } else {
@@ -4945,7 +4960,10 @@ function peg$parse(input, options) {
4945
4960
  }
4946
4961
  }
4947
4962
  if (s1 === peg$FAILED) {
4948
- if (input.substr(peg$currPos, 7) === peg$c42) {
4963
+ if (input.substr(
4964
+ peg$currPos,
4965
+ 7
4966
+ ) === peg$c42) {
4949
4967
  s1 = peg$c42;
4950
4968
  peg$currPos += 7;
4951
4969
  } else {
@@ -4955,7 +4973,10 @@ function peg$parse(input, options) {
4955
4973
  }
4956
4974
  }
4957
4975
  if (s1 === peg$FAILED) {
4958
- if (input.substr(peg$currPos, 7) === peg$c43) {
4976
+ if (input.substr(
4977
+ peg$currPos,
4978
+ 7
4979
+ ) === peg$c43) {
4959
4980
  s1 = peg$c43;
4960
4981
  peg$currPos += 7;
4961
4982
  } else {
@@ -4965,7 +4986,10 @@ function peg$parse(input, options) {
4965
4986
  }
4966
4987
  }
4967
4988
  if (s1 === peg$FAILED) {
4968
- if (input.substr(peg$currPos, 7) === peg$c44) {
4989
+ if (input.substr(
4990
+ peg$currPos,
4991
+ 7
4992
+ ) === peg$c44) {
4969
4993
  s1 = peg$c44;
4970
4994
  peg$currPos += 7;
4971
4995
  } else {
@@ -4975,7 +4999,10 @@ function peg$parse(input, options) {
4975
4999
  }
4976
5000
  }
4977
5001
  if (s1 === peg$FAILED) {
4978
- if (input.substr(peg$currPos, 8) === peg$c45) {
5002
+ if (input.substr(
5003
+ peg$currPos,
5004
+ 8
5005
+ ) === peg$c45) {
4979
5006
  s1 = peg$c45;
4980
5007
  peg$currPos += 8;
4981
5008
  } else {
@@ -4985,83 +5012,123 @@ function peg$parse(input, options) {
4985
5012
  }
4986
5013
  }
4987
5014
  if (s1 === peg$FAILED) {
4988
- if (input.substr(peg$currPos, 7) === peg$c46) {
5015
+ if (input.substr(
5016
+ peg$currPos,
5017
+ 7
5018
+ ) === peg$c46) {
4989
5019
  s1 = peg$c46;
4990
5020
  peg$currPos += 7;
4991
5021
  } else {
4992
5022
  s1 = peg$FAILED;
4993
5023
  if (peg$silentFails === 0) {
4994
- peg$fail(peg$e46);
5024
+ peg$fail(
5025
+ peg$e46
5026
+ );
4995
5027
  }
4996
5028
  }
4997
5029
  if (s1 === peg$FAILED) {
4998
- if (input.substr(peg$currPos, 3) === peg$c47) {
5030
+ if (input.substr(
5031
+ peg$currPos,
5032
+ 3
5033
+ ) === peg$c47) {
4999
5034
  s1 = peg$c47;
5000
5035
  peg$currPos += 3;
5001
5036
  } else {
5002
5037
  s1 = peg$FAILED;
5003
5038
  if (peg$silentFails === 0) {
5004
- peg$fail(peg$e47);
5039
+ peg$fail(
5040
+ peg$e47
5041
+ );
5005
5042
  }
5006
5043
  }
5007
5044
  if (s1 === peg$FAILED) {
5008
- if (input.substr(peg$currPos, 4) === peg$c49) {
5045
+ if (input.substr(
5046
+ peg$currPos,
5047
+ 4
5048
+ ) === peg$c49) {
5009
5049
  s1 = peg$c49;
5010
5050
  peg$currPos += 4;
5011
5051
  } else {
5012
5052
  s1 = peg$FAILED;
5013
5053
  if (peg$silentFails === 0) {
5014
- peg$fail(peg$e49);
5054
+ peg$fail(
5055
+ peg$e49
5056
+ );
5015
5057
  }
5016
5058
  }
5017
5059
  if (s1 === peg$FAILED) {
5018
- if (input.substr(peg$currPos, 3) === peg$c50) {
5060
+ if (input.substr(
5061
+ peg$currPos,
5062
+ 3
5063
+ ) === peg$c50) {
5019
5064
  s1 = peg$c50;
5020
5065
  peg$currPos += 3;
5021
5066
  } else {
5022
5067
  s1 = peg$FAILED;
5023
5068
  if (peg$silentFails === 0) {
5024
- peg$fail(peg$e50);
5069
+ peg$fail(
5070
+ peg$e50
5071
+ );
5025
5072
  }
5026
5073
  }
5027
5074
  if (s1 === peg$FAILED) {
5028
- if (input.substr(peg$currPos, 10) === peg$c51) {
5075
+ if (input.substr(
5076
+ peg$currPos,
5077
+ 10
5078
+ ) === peg$c51) {
5029
5079
  s1 = peg$c51;
5030
5080
  peg$currPos += 10;
5031
5081
  } else {
5032
5082
  s1 = peg$FAILED;
5033
5083
  if (peg$silentFails === 0) {
5034
- peg$fail(peg$e51);
5084
+ peg$fail(
5085
+ peg$e51
5086
+ );
5035
5087
  }
5036
5088
  }
5037
5089
  if (s1 === peg$FAILED) {
5038
- if (input.substr(peg$currPos, 5) === peg$c48) {
5090
+ if (input.substr(
5091
+ peg$currPos,
5092
+ 5
5093
+ ) === peg$c48) {
5039
5094
  s1 = peg$c48;
5040
5095
  peg$currPos += 5;
5041
5096
  } else {
5042
5097
  s1 = peg$FAILED;
5043
5098
  if (peg$silentFails === 0) {
5044
- peg$fail(peg$e48);
5099
+ peg$fail(
5100
+ peg$e48
5101
+ );
5045
5102
  }
5046
5103
  }
5047
5104
  if (s1 === peg$FAILED) {
5048
- if (input.substr(peg$currPos, 6) === peg$c52) {
5105
+ if (input.substr(
5106
+ peg$currPos,
5107
+ 6
5108
+ ) === peg$c52) {
5049
5109
  s1 = peg$c52;
5050
5110
  peg$currPos += 6;
5051
5111
  } else {
5052
5112
  s1 = peg$FAILED;
5053
5113
  if (peg$silentFails === 0) {
5054
- peg$fail(peg$e52);
5114
+ peg$fail(
5115
+ peg$e52
5116
+ );
5055
5117
  }
5056
5118
  }
5057
5119
  if (s1 === peg$FAILED) {
5058
- if (input.substr(peg$currPos, 11) === peg$c53) {
5120
+ if (input.substr(
5121
+ peg$currPos,
5122
+ 11
5123
+ ) === peg$c53) {
5059
5124
  s1 = peg$c53;
5060
5125
  peg$currPos += 11;
5061
5126
  } else {
5062
5127
  s1 = peg$FAILED;
5063
5128
  if (peg$silentFails === 0) {
5064
- peg$fail(peg$e53);
5129
+ peg$fail(
5130
+ peg$e53
5131
+ );
5065
5132
  }
5066
5133
  }
5067
5134
  }
@@ -6526,9 +6593,10 @@ function peg$parse(input, options) {
6526
6593
  }
6527
6594
 
6528
6595
  // src/parser/index.ts
6596
+ var peggyParse = peg$parse;
6529
6597
  function parse(source, options) {
6530
6598
  try {
6531
- return peg$parse(source, options);
6599
+ return peggyParse(source, options);
6532
6600
  } catch (error) {
6533
6601
  throw enhanceError(error);
6534
6602
  }
@@ -6550,7 +6618,7 @@ function tryParse(source, options) {
6550
6618
  column: parseError.location.start.column,
6551
6619
  offset: parseError.location.start.offset
6552
6620
  } : null,
6553
- expected: parseError.expected?.map((e) => e.description || e.text || String(e)),
6621
+ expected: parseError.expected?.map((e) => e.description || e.text || JSON.stringify(e)),
6554
6622
  found: parseError.found
6555
6623
  }
6556
6624
  ]
@@ -6575,7 +6643,7 @@ function formatErrorMessage(error) {
6575
6643
  const column = location?.start?.column ?? "?";
6576
6644
  let expectedDesc = "something";
6577
6645
  if (expected && expected.length > 0) {
6578
- const descriptions = expected.map((e) => e.description || e.text || String(e)).filter((d, i, arr) => arr.indexOf(d) === i).slice(0, 5);
6646
+ const descriptions = expected.map((e) => e.description || e.text || JSON.stringify(e)).filter((d, i, arr) => arr.indexOf(d) === i).slice(0, 5);
6579
6647
  if (descriptions.length === 1) {
6580
6648
  expectedDesc = descriptions[0];
6581
6649
  } else if (descriptions.length === 2) {
package/dist/parser.js CHANGED
@@ -43,10 +43,14 @@ var peg$SyntaxError = class extends SyntaxError {
43
43
  return s;
44
44
  }
45
45
  function literalEscape(s) {
46
- return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
46
+ return unicodeEscape(
47
+ s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch))
48
+ );
47
49
  }
48
50
  function classEscape(s) {
49
- return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
51
+ return unicodeEscape(
52
+ s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch))
53
+ );
50
54
  }
51
55
  const DESCRIBE_EXPECTATION_FNS = {
52
56
  literal(expectation) {
@@ -255,7 +259,12 @@ function peg$parse(input, options) {
255
259
  const peg$e61 = peg$literalExpectation("//", false);
256
260
  const peg$e62 = peg$literalExpectation("/*", false);
257
261
  const peg$e63 = peg$anyExpectation();
258
- const peg$e64 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "-"], false, false, false);
262
+ const peg$e64 = peg$classExpectation(
263
+ [["a", "z"], ["A", "Z"], ["0", "9"], "_", "-"],
264
+ false,
265
+ false,
266
+ false
267
+ );
259
268
  const peg$e65 = peg$otherExpectation("string");
260
269
  const peg$e66 = peg$literalExpectation('"', false);
261
270
  const peg$e67 = peg$literalExpectation("'", false);
@@ -4896,7 +4905,10 @@ function peg$parse(input, options) {
4896
4905
  }
4897
4906
  }
4898
4907
  if (s1 === peg$FAILED) {
4899
- if (input.substr(peg$currPos, 5) === peg$c40) {
4908
+ if (input.substr(
4909
+ peg$currPos,
4910
+ 5
4911
+ ) === peg$c40) {
4900
4912
  s1 = peg$c40;
4901
4913
  peg$currPos += 5;
4902
4914
  } else {
@@ -4906,7 +4918,10 @@ function peg$parse(input, options) {
4906
4918
  }
4907
4919
  }
4908
4920
  if (s1 === peg$FAILED) {
4909
- if (input.substr(peg$currPos, 8) === peg$c41) {
4921
+ if (input.substr(
4922
+ peg$currPos,
4923
+ 8
4924
+ ) === peg$c41) {
4910
4925
  s1 = peg$c41;
4911
4926
  peg$currPos += 8;
4912
4927
  } else {
@@ -4916,7 +4931,10 @@ function peg$parse(input, options) {
4916
4931
  }
4917
4932
  }
4918
4933
  if (s1 === peg$FAILED) {
4919
- if (input.substr(peg$currPos, 7) === peg$c42) {
4934
+ if (input.substr(
4935
+ peg$currPos,
4936
+ 7
4937
+ ) === peg$c42) {
4920
4938
  s1 = peg$c42;
4921
4939
  peg$currPos += 7;
4922
4940
  } else {
@@ -4926,7 +4944,10 @@ function peg$parse(input, options) {
4926
4944
  }
4927
4945
  }
4928
4946
  if (s1 === peg$FAILED) {
4929
- if (input.substr(peg$currPos, 7) === peg$c43) {
4947
+ if (input.substr(
4948
+ peg$currPos,
4949
+ 7
4950
+ ) === peg$c43) {
4930
4951
  s1 = peg$c43;
4931
4952
  peg$currPos += 7;
4932
4953
  } else {
@@ -4936,7 +4957,10 @@ function peg$parse(input, options) {
4936
4957
  }
4937
4958
  }
4938
4959
  if (s1 === peg$FAILED) {
4939
- if (input.substr(peg$currPos, 7) === peg$c44) {
4960
+ if (input.substr(
4961
+ peg$currPos,
4962
+ 7
4963
+ ) === peg$c44) {
4940
4964
  s1 = peg$c44;
4941
4965
  peg$currPos += 7;
4942
4966
  } else {
@@ -4946,7 +4970,10 @@ function peg$parse(input, options) {
4946
4970
  }
4947
4971
  }
4948
4972
  if (s1 === peg$FAILED) {
4949
- if (input.substr(peg$currPos, 8) === peg$c45) {
4973
+ if (input.substr(
4974
+ peg$currPos,
4975
+ 8
4976
+ ) === peg$c45) {
4950
4977
  s1 = peg$c45;
4951
4978
  peg$currPos += 8;
4952
4979
  } else {
@@ -4956,83 +4983,123 @@ function peg$parse(input, options) {
4956
4983
  }
4957
4984
  }
4958
4985
  if (s1 === peg$FAILED) {
4959
- if (input.substr(peg$currPos, 7) === peg$c46) {
4986
+ if (input.substr(
4987
+ peg$currPos,
4988
+ 7
4989
+ ) === peg$c46) {
4960
4990
  s1 = peg$c46;
4961
4991
  peg$currPos += 7;
4962
4992
  } else {
4963
4993
  s1 = peg$FAILED;
4964
4994
  if (peg$silentFails === 0) {
4965
- peg$fail(peg$e46);
4995
+ peg$fail(
4996
+ peg$e46
4997
+ );
4966
4998
  }
4967
4999
  }
4968
5000
  if (s1 === peg$FAILED) {
4969
- if (input.substr(peg$currPos, 3) === peg$c47) {
5001
+ if (input.substr(
5002
+ peg$currPos,
5003
+ 3
5004
+ ) === peg$c47) {
4970
5005
  s1 = peg$c47;
4971
5006
  peg$currPos += 3;
4972
5007
  } else {
4973
5008
  s1 = peg$FAILED;
4974
5009
  if (peg$silentFails === 0) {
4975
- peg$fail(peg$e47);
5010
+ peg$fail(
5011
+ peg$e47
5012
+ );
4976
5013
  }
4977
5014
  }
4978
5015
  if (s1 === peg$FAILED) {
4979
- if (input.substr(peg$currPos, 4) === peg$c49) {
5016
+ if (input.substr(
5017
+ peg$currPos,
5018
+ 4
5019
+ ) === peg$c49) {
4980
5020
  s1 = peg$c49;
4981
5021
  peg$currPos += 4;
4982
5022
  } else {
4983
5023
  s1 = peg$FAILED;
4984
5024
  if (peg$silentFails === 0) {
4985
- peg$fail(peg$e49);
5025
+ peg$fail(
5026
+ peg$e49
5027
+ );
4986
5028
  }
4987
5029
  }
4988
5030
  if (s1 === peg$FAILED) {
4989
- if (input.substr(peg$currPos, 3) === peg$c50) {
5031
+ if (input.substr(
5032
+ peg$currPos,
5033
+ 3
5034
+ ) === peg$c50) {
4990
5035
  s1 = peg$c50;
4991
5036
  peg$currPos += 3;
4992
5037
  } else {
4993
5038
  s1 = peg$FAILED;
4994
5039
  if (peg$silentFails === 0) {
4995
- peg$fail(peg$e50);
5040
+ peg$fail(
5041
+ peg$e50
5042
+ );
4996
5043
  }
4997
5044
  }
4998
5045
  if (s1 === peg$FAILED) {
4999
- if (input.substr(peg$currPos, 10) === peg$c51) {
5046
+ if (input.substr(
5047
+ peg$currPos,
5048
+ 10
5049
+ ) === peg$c51) {
5000
5050
  s1 = peg$c51;
5001
5051
  peg$currPos += 10;
5002
5052
  } else {
5003
5053
  s1 = peg$FAILED;
5004
5054
  if (peg$silentFails === 0) {
5005
- peg$fail(peg$e51);
5055
+ peg$fail(
5056
+ peg$e51
5057
+ );
5006
5058
  }
5007
5059
  }
5008
5060
  if (s1 === peg$FAILED) {
5009
- if (input.substr(peg$currPos, 5) === peg$c48) {
5061
+ if (input.substr(
5062
+ peg$currPos,
5063
+ 5
5064
+ ) === peg$c48) {
5010
5065
  s1 = peg$c48;
5011
5066
  peg$currPos += 5;
5012
5067
  } else {
5013
5068
  s1 = peg$FAILED;
5014
5069
  if (peg$silentFails === 0) {
5015
- peg$fail(peg$e48);
5070
+ peg$fail(
5071
+ peg$e48
5072
+ );
5016
5073
  }
5017
5074
  }
5018
5075
  if (s1 === peg$FAILED) {
5019
- if (input.substr(peg$currPos, 6) === peg$c52) {
5076
+ if (input.substr(
5077
+ peg$currPos,
5078
+ 6
5079
+ ) === peg$c52) {
5020
5080
  s1 = peg$c52;
5021
5081
  peg$currPos += 6;
5022
5082
  } else {
5023
5083
  s1 = peg$FAILED;
5024
5084
  if (peg$silentFails === 0) {
5025
- peg$fail(peg$e52);
5085
+ peg$fail(
5086
+ peg$e52
5087
+ );
5026
5088
  }
5027
5089
  }
5028
5090
  if (s1 === peg$FAILED) {
5029
- if (input.substr(peg$currPos, 11) === peg$c53) {
5091
+ if (input.substr(
5092
+ peg$currPos,
5093
+ 11
5094
+ ) === peg$c53) {
5030
5095
  s1 = peg$c53;
5031
5096
  peg$currPos += 11;
5032
5097
  } else {
5033
5098
  s1 = peg$FAILED;
5034
5099
  if (peg$silentFails === 0) {
5035
- peg$fail(peg$e53);
5100
+ peg$fail(
5101
+ peg$e53
5102
+ );
5036
5103
  }
5037
5104
  }
5038
5105
  }
@@ -6497,9 +6564,10 @@ function peg$parse(input, options) {
6497
6564
  }
6498
6565
 
6499
6566
  // src/parser/index.ts
6567
+ var peggyParse = peg$parse;
6500
6568
  function parse(source, options) {
6501
6569
  try {
6502
- return peg$parse(source, options);
6570
+ return peggyParse(source, options);
6503
6571
  } catch (error) {
6504
6572
  throw enhanceError(error);
6505
6573
  }
@@ -6521,7 +6589,7 @@ function tryParse(source, options) {
6521
6589
  column: parseError.location.start.column,
6522
6590
  offset: parseError.location.start.offset
6523
6591
  } : null,
6524
- expected: parseError.expected?.map((e) => e.description || e.text || String(e)),
6592
+ expected: parseError.expected?.map((e) => e.description || e.text || JSON.stringify(e)),
6525
6593
  found: parseError.found
6526
6594
  }
6527
6595
  ]
@@ -6546,7 +6614,7 @@ function formatErrorMessage(error) {
6546
6614
  const column = location?.start?.column ?? "?";
6547
6615
  let expectedDesc = "something";
6548
6616
  if (expected && expected.length > 0) {
6549
- const descriptions = expected.map((e) => e.description || e.text || String(e)).filter((d, i, arr) => arr.indexOf(d) === i).slice(0, 5);
6617
+ const descriptions = expected.map((e) => e.description || e.text || JSON.stringify(e)).filter((d, i, arr) => arr.indexOf(d) === i).slice(0, 5);
6550
6618
  if (descriptions.length === 1) {
6551
6619
  expectedDesc = descriptions[0];
6552
6620
  } else if (descriptions.length === 2) {