@codingame/monaco-vscode-rollup-vsix-plugin 5.2.0 → 6.0.0

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.
@@ -79,21 +79,21 @@ function createScanner(text, ignoreTrivia = false) {
79
79
  const len = text.length;
80
80
  let value = '';
81
81
  let tokenOffset = 0;
82
- let token = 16 /* SyntaxKind.Unknown */;
83
- let scanError = 0 /* ScanError.None */;
82
+ let token = SyntaxKind.Unknown;
83
+ let scanError = ScanError.None;
84
84
  function scanHexDigits(count) {
85
85
  let digits = 0;
86
86
  let hexValue = 0;
87
87
  while (digits < count) {
88
88
  const ch = text.charCodeAt(pos);
89
- if (ch >= 48 /* CharacterCodes._0 */ && ch <= 57 /* CharacterCodes._9 */) {
90
- hexValue = hexValue * 16 + ch - 48 /* CharacterCodes._0 */;
89
+ if (ch >= CharacterCodes._0 && ch <= CharacterCodes._9) {
90
+ hexValue = hexValue * 16 + ch - CharacterCodes._0;
91
91
  }
92
- else if (ch >= 65 /* CharacterCodes.A */ && ch <= 70 /* CharacterCodes.F */) {
93
- hexValue = hexValue * 16 + ch - 65 /* CharacterCodes.A */ + 10;
92
+ else if (ch >= CharacterCodes.A && ch <= CharacterCodes.F) {
93
+ hexValue = hexValue * 16 + ch - CharacterCodes.A + 10;
94
94
  }
95
- else if (ch >= 97 /* CharacterCodes.a */ && ch <= 102 /* CharacterCodes.f */) {
96
- hexValue = hexValue * 16 + ch - 97 /* CharacterCodes.a */ + 10;
95
+ else if (ch >= CharacterCodes.a && ch <= CharacterCodes.f) {
96
+ hexValue = hexValue * 16 + ch - CharacterCodes.a + 10;
97
97
  }
98
98
  else {
99
99
  break;
@@ -110,12 +110,12 @@ function createScanner(text, ignoreTrivia = false) {
110
110
  pos = newPosition;
111
111
  value = '';
112
112
  tokenOffset = 0;
113
- token = 16 /* SyntaxKind.Unknown */;
114
- scanError = 0 /* ScanError.None */;
113
+ token = SyntaxKind.Unknown;
114
+ scanError = ScanError.None;
115
115
  }
116
116
  function scanNumber() {
117
117
  const start = pos;
118
- if (text.charCodeAt(pos) === 48 /* CharacterCodes._0 */) {
118
+ if (text.charCodeAt(pos) === CharacterCodes._0) {
119
119
  pos++;
120
120
  }
121
121
  else {
@@ -124,7 +124,7 @@ function createScanner(text, ignoreTrivia = false) {
124
124
  pos++;
125
125
  }
126
126
  }
127
- if (pos < text.length && text.charCodeAt(pos) === 46 /* CharacterCodes.dot */) {
127
+ if (pos < text.length && text.charCodeAt(pos) === CharacterCodes.dot) {
128
128
  pos++;
129
129
  if (pos < text.length && isDigit(text.charCodeAt(pos))) {
130
130
  pos++;
@@ -133,14 +133,14 @@ function createScanner(text, ignoreTrivia = false) {
133
133
  }
134
134
  }
135
135
  else {
136
- scanError = 3 /* ScanError.UnexpectedEndOfNumber */;
136
+ scanError = ScanError.UnexpectedEndOfNumber;
137
137
  return text.substring(start, pos);
138
138
  }
139
139
  }
140
140
  let end = pos;
141
- if (pos < text.length && (text.charCodeAt(pos) === 69 /* CharacterCodes.E */ || text.charCodeAt(pos) === 101 /* CharacterCodes.e */)) {
141
+ if (pos < text.length && (text.charCodeAt(pos) === CharacterCodes.E || text.charCodeAt(pos) === CharacterCodes.e)) {
142
142
  pos++;
143
- if (pos < text.length && text.charCodeAt(pos) === 43 /* CharacterCodes.plus */ || text.charCodeAt(pos) === 45 /* CharacterCodes.minus */) {
143
+ if (pos < text.length && text.charCodeAt(pos) === CharacterCodes.plus || text.charCodeAt(pos) === CharacterCodes.minus) {
144
144
  pos++;
145
145
  }
146
146
  if (pos < text.length && isDigit(text.charCodeAt(pos))) {
@@ -151,7 +151,7 @@ function createScanner(text, ignoreTrivia = false) {
151
151
  end = pos;
152
152
  }
153
153
  else {
154
- scanError = 3 /* ScanError.UnexpectedEndOfNumber */;
154
+ scanError = ScanError.UnexpectedEndOfNumber;
155
155
  }
156
156
  }
157
157
  return text.substring(start, end);
@@ -161,60 +161,60 @@ function createScanner(text, ignoreTrivia = false) {
161
161
  while (true) {
162
162
  if (pos >= len) {
163
163
  result += text.substring(start, pos);
164
- scanError = 2 /* ScanError.UnexpectedEndOfString */;
164
+ scanError = ScanError.UnexpectedEndOfString;
165
165
  break;
166
166
  }
167
167
  const ch = text.charCodeAt(pos);
168
- if (ch === 34 /* CharacterCodes.doubleQuote */) {
168
+ if (ch === CharacterCodes.doubleQuote) {
169
169
  result += text.substring(start, pos);
170
170
  pos++;
171
171
  break;
172
172
  }
173
- if (ch === 92 /* CharacterCodes.backslash */) {
173
+ if (ch === CharacterCodes.backslash) {
174
174
  result += text.substring(start, pos);
175
175
  pos++;
176
176
  if (pos >= len) {
177
- scanError = 2 /* ScanError.UnexpectedEndOfString */;
177
+ scanError = ScanError.UnexpectedEndOfString;
178
178
  break;
179
179
  }
180
180
  const ch2 = text.charCodeAt(pos++);
181
181
  switch (ch2) {
182
- case 34 /* CharacterCodes.doubleQuote */:
182
+ case CharacterCodes.doubleQuote:
183
183
  result += '\"';
184
184
  break;
185
- case 92 /* CharacterCodes.backslash */:
185
+ case CharacterCodes.backslash:
186
186
  result += '\\';
187
187
  break;
188
- case 47 /* CharacterCodes.slash */:
188
+ case CharacterCodes.slash:
189
189
  result += '/';
190
190
  break;
191
- case 98 /* CharacterCodes.b */:
191
+ case CharacterCodes.b:
192
192
  result += '\b';
193
193
  break;
194
- case 102 /* CharacterCodes.f */:
194
+ case CharacterCodes.f:
195
195
  result += '\f';
196
196
  break;
197
- case 110 /* CharacterCodes.n */:
197
+ case CharacterCodes.n:
198
198
  result += '\n';
199
199
  break;
200
- case 114 /* CharacterCodes.r */:
200
+ case CharacterCodes.r:
201
201
  result += '\r';
202
202
  break;
203
- case 116 /* CharacterCodes.t */:
203
+ case CharacterCodes.t:
204
204
  result += '\t';
205
205
  break;
206
- case 117 /* CharacterCodes.u */: {
206
+ case CharacterCodes.u: {
207
207
  const ch3 = scanHexDigits(4);
208
208
  if (ch3 >= 0) {
209
209
  result += String.fromCharCode(ch3);
210
210
  }
211
211
  else {
212
- scanError = 4 /* ScanError.InvalidUnicode */;
212
+ scanError = ScanError.InvalidUnicode;
213
213
  }
214
214
  break;
215
215
  }
216
216
  default:
217
- scanError = 5 /* ScanError.InvalidEscapeCharacter */;
217
+ scanError = ScanError.InvalidEscapeCharacter;
218
218
  }
219
219
  start = pos;
220
220
  continue;
@@ -222,11 +222,11 @@ function createScanner(text, ignoreTrivia = false) {
222
222
  if (ch >= 0 && ch <= 0x1F) {
223
223
  if (isLineBreak(ch)) {
224
224
  result += text.substring(start, pos);
225
- scanError = 2 /* ScanError.UnexpectedEndOfString */;
225
+ scanError = ScanError.UnexpectedEndOfString;
226
226
  break;
227
227
  }
228
228
  else {
229
- scanError = 6 /* ScanError.InvalidCharacter */;
229
+ scanError = ScanError.InvalidCharacter;
230
230
  // mark as error but continue with string
231
231
  }
232
232
  }
@@ -236,12 +236,12 @@ function createScanner(text, ignoreTrivia = false) {
236
236
  }
237
237
  function scanNext() {
238
238
  value = '';
239
- scanError = 0 /* ScanError.None */;
239
+ scanError = ScanError.None;
240
240
  tokenOffset = pos;
241
241
  if (pos >= len) {
242
242
  // at the end
243
243
  tokenOffset = len;
244
- return token = 17 /* SyntaxKind.EOF */;
244
+ return token = SyntaxKind.EOF;
245
245
  }
246
246
  let code = text.charCodeAt(pos);
247
247
  // trivia: whitespace
@@ -251,48 +251,48 @@ function createScanner(text, ignoreTrivia = false) {
251
251
  value += String.fromCharCode(code);
252
252
  code = text.charCodeAt(pos);
253
253
  } while (isWhitespace(code));
254
- return token = 15 /* SyntaxKind.Trivia */;
254
+ return token = SyntaxKind.Trivia;
255
255
  }
256
256
  // trivia: newlines
257
257
  if (isLineBreak(code)) {
258
258
  pos++;
259
259
  value += String.fromCharCode(code);
260
- if (code === 13 /* CharacterCodes.carriageReturn */ && text.charCodeAt(pos) === 10 /* CharacterCodes.lineFeed */) {
260
+ if (code === CharacterCodes.carriageReturn && text.charCodeAt(pos) === CharacterCodes.lineFeed) {
261
261
  pos++;
262
262
  value += '\n';
263
263
  }
264
- return token = 14 /* SyntaxKind.LineBreakTrivia */;
264
+ return token = SyntaxKind.LineBreakTrivia;
265
265
  }
266
266
  switch (code) {
267
267
  // tokens: []{}:,
268
- case 123 /* CharacterCodes.openBrace */:
268
+ case CharacterCodes.openBrace:
269
269
  pos++;
270
- return token = 1 /* SyntaxKind.OpenBraceToken */;
271
- case 125 /* CharacterCodes.closeBrace */:
270
+ return token = SyntaxKind.OpenBraceToken;
271
+ case CharacterCodes.closeBrace:
272
272
  pos++;
273
- return token = 2 /* SyntaxKind.CloseBraceToken */;
274
- case 91 /* CharacterCodes.openBracket */:
273
+ return token = SyntaxKind.CloseBraceToken;
274
+ case CharacterCodes.openBracket:
275
275
  pos++;
276
- return token = 3 /* SyntaxKind.OpenBracketToken */;
277
- case 93 /* CharacterCodes.closeBracket */:
276
+ return token = SyntaxKind.OpenBracketToken;
277
+ case CharacterCodes.closeBracket:
278
278
  pos++;
279
- return token = 4 /* SyntaxKind.CloseBracketToken */;
280
- case 58 /* CharacterCodes.colon */:
279
+ return token = SyntaxKind.CloseBracketToken;
280
+ case CharacterCodes.colon:
281
281
  pos++;
282
- return token = 6 /* SyntaxKind.ColonToken */;
283
- case 44 /* CharacterCodes.comma */:
282
+ return token = SyntaxKind.ColonToken;
283
+ case CharacterCodes.comma:
284
284
  pos++;
285
- return token = 5 /* SyntaxKind.CommaToken */;
285
+ return token = SyntaxKind.CommaToken;
286
286
  // strings
287
- case 34 /* CharacterCodes.doubleQuote */:
287
+ case CharacterCodes.doubleQuote:
288
288
  pos++;
289
289
  value = scanString();
290
- return token = 10 /* SyntaxKind.StringLiteral */;
290
+ return token = SyntaxKind.StringLiteral;
291
291
  // comments
292
- case 47 /* CharacterCodes.slash */: {
292
+ case CharacterCodes.slash: {
293
293
  const start = pos - 1;
294
294
  // Single-line comment
295
- if (text.charCodeAt(pos + 1) === 47 /* CharacterCodes.slash */) {
295
+ if (text.charCodeAt(pos + 1) === CharacterCodes.slash) {
296
296
  pos += 2;
297
297
  while (pos < len) {
298
298
  if (isLineBreak(text.charCodeAt(pos))) {
@@ -301,16 +301,16 @@ function createScanner(text, ignoreTrivia = false) {
301
301
  pos++;
302
302
  }
303
303
  value = text.substring(start, pos);
304
- return token = 12 /* SyntaxKind.LineCommentTrivia */;
304
+ return token = SyntaxKind.LineCommentTrivia;
305
305
  }
306
306
  // Multi-line comment
307
- if (text.charCodeAt(pos + 1) === 42 /* CharacterCodes.asterisk */) {
307
+ if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) {
308
308
  pos += 2;
309
309
  const safeLength = len - 1; // For lookahead.
310
310
  let commentClosed = false;
311
311
  while (pos < safeLength) {
312
312
  const ch = text.charCodeAt(pos);
313
- if (ch === 42 /* CharacterCodes.asterisk */ && text.charCodeAt(pos + 1) === 47 /* CharacterCodes.slash */) {
313
+ if (ch === CharacterCodes.asterisk && text.charCodeAt(pos + 1) === CharacterCodes.slash) {
314
314
  pos += 2;
315
315
  commentClosed = true;
316
316
  break;
@@ -319,38 +319,38 @@ function createScanner(text, ignoreTrivia = false) {
319
319
  }
320
320
  if (!commentClosed) {
321
321
  pos++;
322
- scanError = 1 /* ScanError.UnexpectedEndOfComment */;
322
+ scanError = ScanError.UnexpectedEndOfComment;
323
323
  }
324
324
  value = text.substring(start, pos);
325
- return token = 13 /* SyntaxKind.BlockCommentTrivia */;
325
+ return token = SyntaxKind.BlockCommentTrivia;
326
326
  }
327
327
  // just a single slash
328
328
  value += String.fromCharCode(code);
329
329
  pos++;
330
- return token = 16 /* SyntaxKind.Unknown */;
330
+ return token = SyntaxKind.Unknown;
331
331
  }
332
332
  // numbers
333
- case 45 /* CharacterCodes.minus */:
333
+ case CharacterCodes.minus:
334
334
  value += String.fromCharCode(code);
335
335
  pos++;
336
336
  if (pos === len || !isDigit(text.charCodeAt(pos))) {
337
- return token = 16 /* SyntaxKind.Unknown */;
337
+ return token = SyntaxKind.Unknown;
338
338
  }
339
339
  // found a minus, followed by a number so
340
340
  // we fall through to proceed with scanning
341
341
  // numbers
342
- case 48 /* CharacterCodes._0 */:
343
- case 49 /* CharacterCodes._1 */:
344
- case 50 /* CharacterCodes._2 */:
345
- case 51 /* CharacterCodes._3 */:
346
- case 52 /* CharacterCodes._4 */:
347
- case 53 /* CharacterCodes._5 */:
348
- case 54 /* CharacterCodes._6 */:
349
- case 55 /* CharacterCodes._7 */:
350
- case 56 /* CharacterCodes._8 */:
351
- case 57 /* CharacterCodes._9 */:
342
+ case CharacterCodes._0:
343
+ case CharacterCodes._1:
344
+ case CharacterCodes._2:
345
+ case CharacterCodes._3:
346
+ case CharacterCodes._4:
347
+ case CharacterCodes._5:
348
+ case CharacterCodes._6:
349
+ case CharacterCodes._7:
350
+ case CharacterCodes._8:
351
+ case CharacterCodes._9:
352
352
  value += scanNumber();
353
- return token = 11 /* SyntaxKind.NumericLiteral */;
353
+ return token = SyntaxKind.NumericLiteral;
354
354
  // literals and unknown symbols
355
355
  default:
356
356
  // is a literal? Read the full word.
@@ -362,16 +362,16 @@ function createScanner(text, ignoreTrivia = false) {
362
362
  value = text.substring(tokenOffset, pos);
363
363
  // keywords: true, false, null
364
364
  switch (value) {
365
- case 'true': return token = 8 /* SyntaxKind.TrueKeyword */;
366
- case 'false': return token = 9 /* SyntaxKind.FalseKeyword */;
367
- case 'null': return token = 7 /* SyntaxKind.NullKeyword */;
365
+ case 'true': return token = SyntaxKind.TrueKeyword;
366
+ case 'false': return token = SyntaxKind.FalseKeyword;
367
+ case 'null': return token = SyntaxKind.NullKeyword;
368
368
  }
369
- return token = 16 /* SyntaxKind.Unknown */;
369
+ return token = SyntaxKind.Unknown;
370
370
  }
371
371
  // some
372
372
  value += String.fromCharCode(code);
373
373
  pos++;
374
- return token = 16 /* SyntaxKind.Unknown */;
374
+ return token = SyntaxKind.Unknown;
375
375
  }
376
376
  }
377
377
  function isUnknownContentCharacter(code) {
@@ -379,14 +379,14 @@ function createScanner(text, ignoreTrivia = false) {
379
379
  return false;
380
380
  }
381
381
  switch (code) {
382
- case 125 /* CharacterCodes.closeBrace */:
383
- case 93 /* CharacterCodes.closeBracket */:
384
- case 123 /* CharacterCodes.openBrace */:
385
- case 91 /* CharacterCodes.openBracket */:
386
- case 34 /* CharacterCodes.doubleQuote */:
387
- case 58 /* CharacterCodes.colon */:
388
- case 44 /* CharacterCodes.comma */:
389
- case 47 /* CharacterCodes.slash */:
382
+ case CharacterCodes.closeBrace:
383
+ case CharacterCodes.closeBracket:
384
+ case CharacterCodes.openBrace:
385
+ case CharacterCodes.openBracket:
386
+ case CharacterCodes.doubleQuote:
387
+ case CharacterCodes.colon:
388
+ case CharacterCodes.comma:
389
+ case CharacterCodes.slash:
390
390
  return false;
391
391
  }
392
392
  return true;
@@ -395,7 +395,7 @@ function createScanner(text, ignoreTrivia = false) {
395
395
  let result;
396
396
  do {
397
397
  result = scanNext();
398
- } while (result >= 12 /* SyntaxKind.LineCommentTrivia */ && result <= 15 /* SyntaxKind.Trivia */);
398
+ } while (result >= SyntaxKind.LineCommentTrivia && result <= SyntaxKind.Trivia);
399
399
  return result;
400
400
  }
401
401
  return {
@@ -410,15 +410,15 @@ function createScanner(text, ignoreTrivia = false) {
410
410
  };
411
411
  }
412
412
  function isWhitespace(ch) {
413
- return ch === 32 /* CharacterCodes.space */ || ch === 9 /* CharacterCodes.tab */ || ch === 11 /* CharacterCodes.verticalTab */ || ch === 12 /* CharacterCodes.formFeed */ ||
414
- ch === 160 /* CharacterCodes.nonBreakingSpace */ || ch === 5760 /* CharacterCodes.ogham */ || ch >= 8192 /* CharacterCodes.enQuad */ && ch <= 8203 /* CharacterCodes.zeroWidthSpace */ ||
415
- ch === 8239 /* CharacterCodes.narrowNoBreakSpace */ || ch === 8287 /* CharacterCodes.mathematicalSpace */ || ch === 12288 /* CharacterCodes.ideographicSpace */ || ch === 65279 /* CharacterCodes.byteOrderMark */;
413
+ return ch === CharacterCodes.space || ch === CharacterCodes.tab || ch === CharacterCodes.verticalTab || ch === CharacterCodes.formFeed ||
414
+ ch === CharacterCodes.nonBreakingSpace || ch === CharacterCodes.ogham || ch >= CharacterCodes.enQuad && ch <= CharacterCodes.zeroWidthSpace ||
415
+ ch === CharacterCodes.narrowNoBreakSpace || ch === CharacterCodes.mathematicalSpace || ch === CharacterCodes.ideographicSpace || ch === CharacterCodes.byteOrderMark;
416
416
  }
417
417
  function isLineBreak(ch) {
418
- return ch === 10 /* CharacterCodes.lineFeed */ || ch === 13 /* CharacterCodes.carriageReturn */ || ch === 8232 /* CharacterCodes.lineSeparator */ || ch === 8233 /* CharacterCodes.paragraphSeparator */;
418
+ return ch === CharacterCodes.lineFeed || ch === CharacterCodes.carriageReturn || ch === CharacterCodes.lineSeparator || ch === CharacterCodes.paragraphSeparator;
419
419
  }
420
420
  function isDigit(ch) {
421
- return ch >= 48 /* CharacterCodes._0 */ && ch <= 57 /* CharacterCodes._9 */;
421
+ return ch >= CharacterCodes._0 && ch <= CharacterCodes._9;
422
422
  }
423
423
  var CharacterCodes;
424
424
  (function (CharacterCodes) {
@@ -614,42 +614,42 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
614
614
  while (true) {
615
615
  const token = _scanner.scan();
616
616
  switch (_scanner.getTokenError()) {
617
- case 4 /* ScanError.InvalidUnicode */:
618
- handleError(14 /* ParseErrorCode.InvalidUnicode */);
617
+ case ScanError.InvalidUnicode:
618
+ handleError(ParseErrorCode.InvalidUnicode);
619
619
  break;
620
- case 5 /* ScanError.InvalidEscapeCharacter */:
621
- handleError(15 /* ParseErrorCode.InvalidEscapeCharacter */);
620
+ case ScanError.InvalidEscapeCharacter:
621
+ handleError(ParseErrorCode.InvalidEscapeCharacter);
622
622
  break;
623
- case 3 /* ScanError.UnexpectedEndOfNumber */:
624
- handleError(13 /* ParseErrorCode.UnexpectedEndOfNumber */);
623
+ case ScanError.UnexpectedEndOfNumber:
624
+ handleError(ParseErrorCode.UnexpectedEndOfNumber);
625
625
  break;
626
- case 1 /* ScanError.UnexpectedEndOfComment */:
626
+ case ScanError.UnexpectedEndOfComment:
627
627
  if (!disallowComments) {
628
- handleError(11 /* ParseErrorCode.UnexpectedEndOfComment */);
628
+ handleError(ParseErrorCode.UnexpectedEndOfComment);
629
629
  }
630
630
  break;
631
- case 2 /* ScanError.UnexpectedEndOfString */:
632
- handleError(12 /* ParseErrorCode.UnexpectedEndOfString */);
631
+ case ScanError.UnexpectedEndOfString:
632
+ handleError(ParseErrorCode.UnexpectedEndOfString);
633
633
  break;
634
- case 6 /* ScanError.InvalidCharacter */:
635
- handleError(16 /* ParseErrorCode.InvalidCharacter */);
634
+ case ScanError.InvalidCharacter:
635
+ handleError(ParseErrorCode.InvalidCharacter);
636
636
  break;
637
637
  }
638
638
  switch (token) {
639
- case 12 /* SyntaxKind.LineCommentTrivia */:
640
- case 13 /* SyntaxKind.BlockCommentTrivia */:
639
+ case SyntaxKind.LineCommentTrivia:
640
+ case SyntaxKind.BlockCommentTrivia:
641
641
  if (disallowComments) {
642
- handleError(10 /* ParseErrorCode.InvalidCommentToken */);
642
+ handleError(ParseErrorCode.InvalidCommentToken);
643
643
  }
644
644
  else {
645
645
  onComment();
646
646
  }
647
647
  break;
648
- case 16 /* SyntaxKind.Unknown */:
649
- handleError(1 /* ParseErrorCode.InvalidSymbol */);
648
+ case SyntaxKind.Unknown:
649
+ handleError(ParseErrorCode.InvalidSymbol);
650
650
  break;
651
- case 15 /* SyntaxKind.Trivia */:
652
- case 14 /* SyntaxKind.LineBreakTrivia */:
651
+ case SyntaxKind.Trivia:
652
+ case SyntaxKind.LineBreakTrivia:
653
653
  break;
654
654
  default:
655
655
  return token;
@@ -660,7 +660,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
660
660
  onError(error);
661
661
  if (skipUntilAfter.length + skipUntil.length > 0) {
662
662
  let token = _scanner.getToken();
663
- while (token !== 17 /* SyntaxKind.EOF */) {
663
+ while (token !== SyntaxKind.EOF) {
664
664
  if (skipUntilAfter.indexOf(token) !== -1) {
665
665
  scanNext();
666
666
  break;
@@ -685,28 +685,28 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
685
685
  }
686
686
  function parseLiteral() {
687
687
  switch (_scanner.getToken()) {
688
- case 11 /* SyntaxKind.NumericLiteral */: {
688
+ case SyntaxKind.NumericLiteral: {
689
689
  let value = 0;
690
690
  try {
691
691
  value = JSON.parse(_scanner.getTokenValue());
692
692
  if (typeof value !== 'number') {
693
- handleError(2 /* ParseErrorCode.InvalidNumberFormat */);
693
+ handleError(ParseErrorCode.InvalidNumberFormat);
694
694
  value = 0;
695
695
  }
696
696
  }
697
697
  catch (e) {
698
- handleError(2 /* ParseErrorCode.InvalidNumberFormat */);
698
+ handleError(ParseErrorCode.InvalidNumberFormat);
699
699
  }
700
700
  onLiteralValue(value);
701
701
  break;
702
702
  }
703
- case 7 /* SyntaxKind.NullKeyword */:
703
+ case SyntaxKind.NullKeyword:
704
704
  onLiteralValue(null);
705
705
  break;
706
- case 8 /* SyntaxKind.TrueKeyword */:
706
+ case SyntaxKind.TrueKeyword:
707
707
  onLiteralValue(true);
708
708
  break;
709
- case 9 /* SyntaxKind.FalseKeyword */:
709
+ case SyntaxKind.FalseKeyword:
710
710
  onLiteralValue(false);
711
711
  break;
712
712
  default:
@@ -716,20 +716,20 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
716
716
  return true;
717
717
  }
718
718
  function parseProperty() {
719
- if (_scanner.getToken() !== 10 /* SyntaxKind.StringLiteral */) {
720
- handleError(3 /* ParseErrorCode.PropertyNameExpected */, [], [2 /* SyntaxKind.CloseBraceToken */, 5 /* SyntaxKind.CommaToken */]);
719
+ if (_scanner.getToken() !== SyntaxKind.StringLiteral) {
720
+ handleError(ParseErrorCode.PropertyNameExpected, [], [SyntaxKind.CloseBraceToken, SyntaxKind.CommaToken]);
721
721
  return false;
722
722
  }
723
723
  parseString(false);
724
- if (_scanner.getToken() === 6 /* SyntaxKind.ColonToken */) {
724
+ if (_scanner.getToken() === SyntaxKind.ColonToken) {
725
725
  onSeparator(':');
726
726
  scanNext(); // consume colon
727
727
  if (!parseValue()) {
728
- handleError(4 /* ParseErrorCode.ValueExpected */, [], [2 /* SyntaxKind.CloseBraceToken */, 5 /* SyntaxKind.CommaToken */]);
728
+ handleError(ParseErrorCode.ValueExpected, [], [SyntaxKind.CloseBraceToken, SyntaxKind.CommaToken]);
729
729
  }
730
730
  }
731
731
  else {
732
- handleError(5 /* ParseErrorCode.ColonExpected */, [], [2 /* SyntaxKind.CloseBraceToken */, 5 /* SyntaxKind.CommaToken */]);
732
+ handleError(ParseErrorCode.ColonExpected, [], [SyntaxKind.CloseBraceToken, SyntaxKind.CommaToken]);
733
733
  }
734
734
  return true;
735
735
  }
@@ -737,28 +737,28 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
737
737
  onObjectBegin();
738
738
  scanNext(); // consume open brace
739
739
  let needsComma = false;
740
- while (_scanner.getToken() !== 2 /* SyntaxKind.CloseBraceToken */ && _scanner.getToken() !== 17 /* SyntaxKind.EOF */) {
741
- if (_scanner.getToken() === 5 /* SyntaxKind.CommaToken */) {
740
+ while (_scanner.getToken() !== SyntaxKind.CloseBraceToken && _scanner.getToken() !== SyntaxKind.EOF) {
741
+ if (_scanner.getToken() === SyntaxKind.CommaToken) {
742
742
  if (!needsComma) {
743
- handleError(4 /* ParseErrorCode.ValueExpected */, [], []);
743
+ handleError(ParseErrorCode.ValueExpected, [], []);
744
744
  }
745
745
  onSeparator(',');
746
746
  scanNext(); // consume comma
747
- if (_scanner.getToken() === 2 /* SyntaxKind.CloseBraceToken */ && allowTrailingComma) {
747
+ if (_scanner.getToken() === SyntaxKind.CloseBraceToken && allowTrailingComma) {
748
748
  break;
749
749
  }
750
750
  }
751
751
  else if (needsComma) {
752
- handleError(6 /* ParseErrorCode.CommaExpected */, [], []);
752
+ handleError(ParseErrorCode.CommaExpected, [], []);
753
753
  }
754
754
  if (!parseProperty()) {
755
- handleError(4 /* ParseErrorCode.ValueExpected */, [], [2 /* SyntaxKind.CloseBraceToken */, 5 /* SyntaxKind.CommaToken */]);
755
+ handleError(ParseErrorCode.ValueExpected, [], [SyntaxKind.CloseBraceToken, SyntaxKind.CommaToken]);
756
756
  }
757
757
  needsComma = true;
758
758
  }
759
759
  onObjectEnd();
760
- if (_scanner.getToken() !== 2 /* SyntaxKind.CloseBraceToken */) {
761
- handleError(7 /* ParseErrorCode.CloseBraceExpected */, [2 /* SyntaxKind.CloseBraceToken */], []);
760
+ if (_scanner.getToken() !== SyntaxKind.CloseBraceToken) {
761
+ handleError(ParseErrorCode.CloseBraceExpected, [SyntaxKind.CloseBraceToken], []);
762
762
  }
763
763
  else {
764
764
  scanNext(); // consume close brace
@@ -769,28 +769,28 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
769
769
  onArrayBegin();
770
770
  scanNext(); // consume open bracket
771
771
  let needsComma = false;
772
- while (_scanner.getToken() !== 4 /* SyntaxKind.CloseBracketToken */ && _scanner.getToken() !== 17 /* SyntaxKind.EOF */) {
773
- if (_scanner.getToken() === 5 /* SyntaxKind.CommaToken */) {
772
+ while (_scanner.getToken() !== SyntaxKind.CloseBracketToken && _scanner.getToken() !== SyntaxKind.EOF) {
773
+ if (_scanner.getToken() === SyntaxKind.CommaToken) {
774
774
  if (!needsComma) {
775
- handleError(4 /* ParseErrorCode.ValueExpected */, [], []);
775
+ handleError(ParseErrorCode.ValueExpected, [], []);
776
776
  }
777
777
  onSeparator(',');
778
778
  scanNext(); // consume comma
779
- if (_scanner.getToken() === 4 /* SyntaxKind.CloseBracketToken */ && allowTrailingComma) {
779
+ if (_scanner.getToken() === SyntaxKind.CloseBracketToken && allowTrailingComma) {
780
780
  break;
781
781
  }
782
782
  }
783
783
  else if (needsComma) {
784
- handleError(6 /* ParseErrorCode.CommaExpected */, [], []);
784
+ handleError(ParseErrorCode.CommaExpected, [], []);
785
785
  }
786
786
  if (!parseValue()) {
787
- handleError(4 /* ParseErrorCode.ValueExpected */, [], [4 /* SyntaxKind.CloseBracketToken */, 5 /* SyntaxKind.CommaToken */]);
787
+ handleError(ParseErrorCode.ValueExpected, [], [SyntaxKind.CloseBracketToken, SyntaxKind.CommaToken]);
788
788
  }
789
789
  needsComma = true;
790
790
  }
791
791
  onArrayEnd();
792
- if (_scanner.getToken() !== 4 /* SyntaxKind.CloseBracketToken */) {
793
- handleError(8 /* ParseErrorCode.CloseBracketExpected */, [4 /* SyntaxKind.CloseBracketToken */], []);
792
+ if (_scanner.getToken() !== SyntaxKind.CloseBracketToken) {
793
+ handleError(ParseErrorCode.CloseBracketExpected, [SyntaxKind.CloseBracketToken], []);
794
794
  }
795
795
  else {
796
796
  scanNext(); // consume close bracket
@@ -799,30 +799,30 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
799
799
  }
800
800
  function parseValue() {
801
801
  switch (_scanner.getToken()) {
802
- case 3 /* SyntaxKind.OpenBracketToken */:
802
+ case SyntaxKind.OpenBracketToken:
803
803
  return parseArray();
804
- case 1 /* SyntaxKind.OpenBraceToken */:
804
+ case SyntaxKind.OpenBraceToken:
805
805
  return parseObject();
806
- case 10 /* SyntaxKind.StringLiteral */:
806
+ case SyntaxKind.StringLiteral:
807
807
  return parseString(true);
808
808
  default:
809
809
  return parseLiteral();
810
810
  }
811
811
  }
812
812
  scanNext();
813
- if (_scanner.getToken() === 17 /* SyntaxKind.EOF */) {
813
+ if (_scanner.getToken() === SyntaxKind.EOF) {
814
814
  if (options.allowEmptyContent) {
815
815
  return true;
816
816
  }
817
- handleError(4 /* ParseErrorCode.ValueExpected */, [], []);
817
+ handleError(ParseErrorCode.ValueExpected, [], []);
818
818
  return false;
819
819
  }
820
820
  if (!parseValue()) {
821
- handleError(4 /* ParseErrorCode.ValueExpected */, [], []);
821
+ handleError(ParseErrorCode.ValueExpected, [], []);
822
822
  return false;
823
823
  }
824
- if (_scanner.getToken() !== 17 /* SyntaxKind.EOF */) {
825
- handleError(9 /* ParseErrorCode.EndOfFileExpected */, [], []);
824
+ if (_scanner.getToken() !== SyntaxKind.EOF) {
825
+ handleError(ParseErrorCode.EndOfFileExpected, [], []);
826
826
  }
827
827
  return true;
828
828
  }
@@ -871,15 +871,15 @@ function localizeWithPath(path, data, defaultMessage, ...args) {
871
871
  const _moduleId = "vs/base/common/jsonErrorMessages";
872
872
  function getParseErrorMessage(errorCode) {
873
873
  switch (errorCode) {
874
- case 1 /* ParseErrorCode.InvalidSymbol */: return localizeWithPath(_moduleId, 'error.invalidSymbol', 'Invalid symbol');
875
- case 2 /* ParseErrorCode.InvalidNumberFormat */: return localizeWithPath(_moduleId, 'error.invalidNumberFormat', 'Invalid number format');
876
- case 3 /* ParseErrorCode.PropertyNameExpected */: return localizeWithPath(_moduleId, 'error.propertyNameExpected', 'Property name expected');
877
- case 4 /* ParseErrorCode.ValueExpected */: return localizeWithPath(_moduleId, 'error.valueExpected', 'Value expected');
878
- case 5 /* ParseErrorCode.ColonExpected */: return localizeWithPath(_moduleId, 'error.colonExpected', 'Colon expected');
879
- case 6 /* ParseErrorCode.CommaExpected */: return localizeWithPath(_moduleId, 'error.commaExpected', 'Comma expected');
880
- case 7 /* ParseErrorCode.CloseBraceExpected */: return localizeWithPath(_moduleId, 'error.closeBraceExpected', 'Closing brace expected');
881
- case 8 /* ParseErrorCode.CloseBracketExpected */: return localizeWithPath(_moduleId, 'error.closeBracketExpected', 'Closing bracket expected');
882
- case 9 /* ParseErrorCode.EndOfFileExpected */: return localizeWithPath(_moduleId, 'error.endOfFileExpected', 'End of file expected');
874
+ case ParseErrorCode.InvalidSymbol: return localizeWithPath(_moduleId, 'error.invalidSymbol', 'Invalid symbol');
875
+ case ParseErrorCode.InvalidNumberFormat: return localizeWithPath(_moduleId, 'error.invalidNumberFormat', 'Invalid number format');
876
+ case ParseErrorCode.PropertyNameExpected: return localizeWithPath(_moduleId, 'error.propertyNameExpected', 'Property name expected');
877
+ case ParseErrorCode.ValueExpected: return localizeWithPath(_moduleId, 'error.valueExpected', 'Value expected');
878
+ case ParseErrorCode.ColonExpected: return localizeWithPath(_moduleId, 'error.colonExpected', 'Colon expected');
879
+ case ParseErrorCode.CommaExpected: return localizeWithPath(_moduleId, 'error.commaExpected', 'Comma expected');
880
+ case ParseErrorCode.CloseBraceExpected: return localizeWithPath(_moduleId, 'error.closeBraceExpected', 'Closing brace expected');
881
+ case ParseErrorCode.CloseBracketExpected: return localizeWithPath(_moduleId, 'error.closeBracketExpected', 'Closing bracket expected');
882
+ case ParseErrorCode.EndOfFileExpected: return localizeWithPath(_moduleId, 'error.endOfFileExpected', 'End of file expected');
883
883
  default:
884
884
  return '';
885
885
  }