@@ -277,6 +277,13 @@ testTokenization('kotlin', [
277
277
}
278
278
] ,
279
279
280
+ [
281
+ {
282
+ line : '.123' ,
283
+ tokens : [ { startIndex : 0 , type : 'number.float.kt' } ]
284
+ }
285
+ ] ,
286
+
280
287
[
281
288
{
282
289
line : '0x' ,
@@ -301,24 +308,62 @@ testTokenization('kotlin', [
301
308
}
302
309
] ,
303
310
311
+ [
312
+ {
313
+ line : '0Xff_81_00L' ,
314
+ tokens : [ { startIndex : 0 , type : 'number.hex.kt' } ]
315
+ }
316
+ ] ,
317
+
318
+ [
319
+ {
320
+ line : '0x123u' ,
321
+ tokens : [ { startIndex : 0 , type : 'number.hex.kt' } ]
322
+ }
323
+ ] ,
324
+
325
+ [
326
+ {
327
+ line : '0x123U' ,
328
+ tokens : [ { startIndex : 0 , type : 'number.hex.kt' } ]
329
+ }
330
+ ] ,
331
+
332
+ [
333
+ {
334
+ line : '0x123uL' ,
335
+ tokens : [ { startIndex : 0 , type : 'number.hex.kt' } ]
336
+ }
337
+ ] ,
338
+
339
+ [
340
+ {
341
+ line : '0x123UL' ,
342
+ tokens : [ { startIndex : 0 , type : 'number.hex.kt' } ]
343
+ }
344
+ ] ,
345
+
304
346
[
305
347
{
306
348
line : '023L' ,
307
- tokens : [ { startIndex : 0 , type : 'number.octal. kt' } ]
349
+ tokens : [ { startIndex : 0 , type : 'number.kt' } ]
308
350
}
309
351
] ,
310
352
311
353
[
312
354
{
313
355
line : '0123l' ,
314
- tokens : [ { startIndex : 0 , type : 'number.octal.kt' } ]
356
+ tokens : [
357
+ { startIndex : 0 , type : 'number.kt' } ,
358
+ { startIndex : 4 , type : 'identifier.kt' }
359
+ ]
315
360
}
316
361
] ,
317
362
318
363
[
319
364
{
320
365
line : '05_2' ,
321
- tokens : [ { startIndex : 0 , type : 'number.octal. kt' } ]
366
+ tokens : [ { startIndex : 0 , type : 'number.kt' } ]
322
367
}
323
368
] ,
324
369
@@ -336,6 +381,41 @@ testTokenization('kotlin', [
336
381
}
337
382
] ,
338
383
384
+ [
385
+ {
386
+ line : '0b0101L' ,
387
+ tokens : [ { startIndex : 0 , type : 'number.binary.kt' } ]
388
+ }
389
+ ] ,
390
+
391
+ [
392
+ {
393
+ line : '0B0101u' ,
394
+ tokens : [ { startIndex : 0 , type : 'number.binary.kt' } ]
395
+ }
396
+ ] ,
397
+
398
+ [
399
+ {
400
+ line : '0B1__0U' ,
401
+ tokens : [ { startIndex : 0 , type : 'number.binary.kt' } ]
402
+ }
403
+ ] ,
404
+
405
+ [
406
+ {
407
+ line : '0B0101uL' ,
408
+ tokens : [ { startIndex : 0 , type : 'number.binary.kt' } ]
409
+ }
410
+ ] ,
411
+
412
+ [
413
+ {
414
+ line : '0B1__0UL' ,
415
+ tokens : [ { startIndex : 0 , type : 'number.binary.kt' } ]
416
+ }
417
+ ] ,
418
+
339
419
[
340
420
{
341
421
line : '10e3' ,
@@ -401,57 +481,88 @@ testTokenization('kotlin', [
401
481
402
482
[
403
483
{
404
- line : '23.5D ' ,
484
+ line : '.001f ' ,
405
485
tokens : [ { startIndex : 0 , type : 'number.float.kt' } ]
406
486
}
407
487
] ,
408
488
489
+ [
490
+ {
491
+ line : '23.5D' ,
492
+ tokens : [
493
+ { startIndex : 0 , type : 'number.float.kt' } ,
494
+ { startIndex : 4 , type : 'type.identifier.kt' }
495
+ ]
496
+ }
497
+ ] ,
498
+
409
499
[
410
500
{
411
501
line : '23.5d' ,
412
- tokens : [ { startIndex : 0 , type : 'number.float.kt' } ]
502
+ tokens : [
503
+ { startIndex : 0 , type : 'number.float.kt' } ,
504
+ { startIndex : 4 , type : 'identifier.kt' }
505
+ ]
413
506
}
414
507
] ,
415
508
416
509
[
417
510
{
418
511
line : '1.72E3D' ,
419
- tokens : [ { startIndex : 0 , type : 'number.float.kt' } ]
512
+ tokens : [
513
+ { startIndex : 0 , type : 'number.float.kt' } ,
514
+ { startIndex : 6 , type : 'type.identifier.kt' }
515
+ ]
420
516
}
421
517
] ,
422
518
423
519
[
424
520
{
425
521
line : '1.72E3d' ,
426
- tokens : [ { startIndex : 0 , type : 'number.float.kt' } ]
522
+ tokens : [
523
+ { startIndex : 0 , type : 'number.float.kt' } ,
524
+ { startIndex : 6 , type : 'identifier.kt' }
525
+ ]
427
526
}
428
527
] ,
429
528
430
529
[
431
530
{
432
531
line : '1.72E-3d' ,
433
- tokens : [ { startIndex : 0 , type : 'number.float.kt' } ]
532
+ tokens : [
533
+ { startIndex : 0 , type : 'number.float.kt' } ,
534
+ { startIndex : 7 , type : 'identifier.kt' }
535
+ ]
434
536
}
435
537
] ,
436
538
437
539
[
438
540
{
439
541
line : '1.72e3D' ,
440
- tokens : [ { startIndex : 0 , type : 'number.float.kt' } ]
542
+ tokens : [
543
+ { startIndex : 0 , type : 'number.float.kt' } ,
544
+ { startIndex : 6 , type : 'type.identifier.kt' }
545
+ ]
441
546
}
442
547
] ,
443
548
444
549
[
445
550
{
446
551
line : '1.72e3d' ,
447
- tokens : [ { startIndex : 0 , type : 'number.float.kt' } ]
552
+ tokens : [
553
+ { startIndex : 0 , type : 'number.float.kt' } ,
554
+ { startIndex : 6 , type : 'identifier.kt' }
555
+ ]
448
556
}
449
557
] ,
450
558
451
559
[
452
560
{
453
561
line : '1.72e-3d' ,
454
- tokens : [ { startIndex : 0 , type : 'number.float.kt' } ]
562
+ tokens : [
563
+ { startIndex : 0 , type : 'number.float.kt' } ,
564
+ { startIndex : 7 , type : 'identifier.kt' }
565
+ ]
455
566
}
456
567
] ,
457
568
@@ -465,6 +576,37 @@ testTokenization('kotlin', [
465
576
[
466
577
{
467
578
line : '23l' ,
579
+ tokens : [
580
+ { startIndex : 0 , type : 'number.kt' } ,
581
+ { startIndex : 2 , type : 'identifier.kt' }
582
+ ]
583
+ }
584
+ ] ,
585
+
586
+ [
587
+ {
588
+ line : '23u' ,
589
+ tokens : [ { startIndex : 0 , type : 'number.kt' } ]
590
+ }
591
+ ] ,
592
+
593
+ [
594
+ {
595
+ line : '23U' ,
596
+ tokens : [ { startIndex : 0 , type : 'number.kt' } ]
597
+ }
598
+ ] ,
599
+
600
+ [
601
+ {
602
+ line : '23uL' ,
603
+ tokens : [ { startIndex : 0 , type : 'number.kt' } ]
604
+ }
605
+ ] ,
606
+
607
+ [
608
+ {
609
+ line : '23UL' ,
468
610
tokens : [ { startIndex : 0 , type : 'number.kt' } ]
469
611
}
470
612
] ,
@@ -496,8 +638,7 @@ testTokenization('kotlin', [
496
638
tokens : [
497
639
{ startIndex : 0 , type : 'number.kt' } ,
498
640
{ startIndex : 1 , type : 'identifier.kt' } ,
499
- { startIndex : 2 , type : 'delimiter.kt' } ,
500
- { startIndex : 3 , type : 'number.float.kt' }
641
+ { startIndex : 2 , type : 'number.float.kt' }
501
642
]
502
643
}
503
644
] ,
@@ -567,7 +708,7 @@ testTokenization('kotlin', [
567
708
{
568
709
line : '052_' ,
569
710
tokens : [
570
- { startIndex : 0 , type : 'number.octal. kt' } ,
711
+ { startIndex : 0 , type : 'number.kt' } ,
571
712
{ startIndex : 3 , type : 'identifier.kt' }
572
713
]
573
714
}
0 commit comments