1
- // SYNTAX TEST "Packages/Babel /JavaScript (Babel).sublime-syntax"
1
+ // SYNTAX TEST "Packages/babel-sublime /JavaScript (Babel).sublime-syntax"
2
2
3
3
// comment
4
4
// <- comment.line.double-slash.js punctuation.definition.comment.js
@@ -296,7 +296,7 @@ a = test ? a + b : c;
296
296
// ^ meta.block meta.block variable.other.readwrite
297
297
298
298
var obj = {
299
- // ^ meta.mapping punctuation.section.block .begin - meta.block
299
+ // ^ meta.mapping punctuation.section.mapping .begin - meta.block
300
300
key : bar ,
301
301
// <- meta.mapping.key
302
302
$key2 : "string value" ,
@@ -476,7 +476,7 @@ var obj = {
476
476
// ^ keyword.operator
477
477
// ^ constant.language
478
478
} ;
479
- // <- meta.mapping punctuation.section.block .end
479
+ // <- meta.mapping punctuation.section.mapping .end
480
480
481
481
( {
482
482
// <- meta.mapping
@@ -488,10 +488,10 @@ var obj = {
488
488
} ) ;
489
489
490
490
[ a , b , c ] ;
491
- // <- meta.sequence punctuation.section.brackets .begin
491
+ // <- meta.sequence punctuation.section.sequence .begin
492
492
// ^ meta.sequence punctuation.separator.comma
493
493
// ^^^^^^^^ meta.sequence
494
- // ^ meta.sequence punctuation.section.brackets .end
494
+ // ^ meta.sequence punctuation.section.sequence .end
495
495
496
496
function x ( ) { }
497
497
[ a , b , c ] ;
@@ -723,9 +723,83 @@ class MyClass extends TheirClass {
723
723
// ^^^^^^^^^^ meta.group
724
724
// ^^^ entity.name.function
725
725
726
- [ 'foo' ] ( ) { }
726
+ @foo `bar ` bar() {}
727
+ // ^^^^^^^^^^ meta.annotation
728
+ // ^ punctuation.definition.annotation
729
+ // ^^^ variable.function.tagged-template
730
+ // ^^^^^ meta.string string.quoted.other
731
+ // ^ punctuation.definition.string.begin
732
+ // ^ punctuation.definition.string.end
733
+ // ^^^ meta.function entity.name.function
734
+
735
+ @foo['bar']() {}
736
+ // ^^^^ meta.annotation
737
+ // ^ punctuation.definition.annotation
738
+ // ^^^ variable.annotation
739
+ // ^^^^^^^^^^^^ meta.function - meta.annotation
740
+
741
+ @foo
742
+ // ^^^^ meta.annotation
743
+ // ^ - meta.annotation
744
+ bar() {}
745
+ // ^^^^^^^^ meta.function
746
+
747
+ @foo
748
+ // ^^^^ meta.annotation
749
+ // ^ - meta.annotation
750
+ ['bar']() {}
727
751
// ^^^^^^^^^^^^ meta.function
728
752
753
+ @foo()
754
+ // ^^^^^^ meta.annotation
755
+ // ^ - meta.annotation
756
+ bar() {}
757
+
758
+ @(foo)
759
+ // ^^^^^^ meta.annotation
760
+ // ^ - meta.annotation
761
+ bar() {}
762
+
763
+ @foo // comment
764
+ // ^^^^ meta.annotation - comment
765
+ // ^ - comment - meta.annotation.js
766
+ // ^^^^^^^^^^^ comment.line - meta.annotation
767
+ bar() {}
768
+ //^^ - meta.annotation
769
+ // ^^^^^^^^ meta.function - meta.annotation
770
+
771
+ @foo /* comment
772
+ // ^^^^ meta.annotation - comment
773
+ // ^ - comment - meta.annotation.js
774
+ // ^^^^^^^^^^^ comment.block.js - meta.annotation
775
+ */bar() {}
776
+ //^^^^ comment.block.js - meta.annotation
777
+ // ^^^^^^^^ meta.function - meta.annotation
778
+
779
+ @foo /* block */ /* comment
780
+ // ^^^^ meta.annotation - comment
781
+ // ^ - comment - meta.annotation.js
782
+ // ^^^^^^^^^^^^^^^^^^^^^^^ - meta.annotation
783
+ // ^^^^^^^^^^^ comment.block.js
784
+ // ^^^^^^^^^^^ comment.block.js
785
+ bar() {}
786
+ // ^^^^^^^^^ comment.block.js
787
+ */bar() {}
788
+ //^^^^ comment.block.js - meta.annotation
789
+ // ^^^^^^^^ meta.function - meta.annotation
790
+
791
+ @foo /* block */ /* comment
792
+ // ^^^^^ meta.annotation.js - comment
793
+ // ^^^^^^^^^^^ meta.annotation.js comment.block.js
794
+ // ^ meta.annotation.js - comment
795
+ // ^^^^^^^^^^^ meta.annotation.js comment.block.js
796
+ bar() {}
797
+ // ^^^^^^^^^meta.annotation.js comment.block.js
798
+ */ . bar baz() {}
799
+ //^^^^ meta.annotation.js comment.block.js
800
+ // ^^^^^^ meta.annotation.js - comment
801
+ // ^^^^^^^^ meta.function - meta.annotation
802
+
729
803
static ['foo']() {}
730
804
// ^^^^^^^^^^^^ meta.function
731
805
@@ -854,7 +928,7 @@ const test = ({a, b, c=()=>({active:false}) }) => {};
854
928
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function
855
929
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters
856
930
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.binding.destructuring
857
- // ^ punctuation.section.block .begin
931
+ // ^ punctuation.section.mapping .begin
858
932
// ^ variable.parameter
859
933
// ^ variable.parameter
860
934
// ^ variable.parameter
@@ -864,7 +938,7 @@ const test = ({a, b, c=()=>({active:false}) }) => {};
864
938
// ^ punctuation.section.group.end
865
939
// ^^^^^^^^^^^^^^^^ meta.group
866
940
// ^ constant.language
867
- // ^ punctuation.section.block .end
941
+ // ^ punctuation.section.mapping .end
868
942
869
943
([a,
870
944
b]) => { return x; }
@@ -883,7 +957,7 @@ const test = ({a, b, c=()=>({active:false}) }) => {};
883
957
({
884
958
a = {},
885
959
// ^ keyword.operator.assignment
886
- // ^^ punctuation.section.block
960
+ // ^^ punctuation.section.mapping
887
961
// ^ punctuation.separator.parameter - keyword.operator.comma
888
962
b,
889
963
// ^ punctuation.separator.parameter - keyword.operator.comma
@@ -955,6 +1029,7 @@ sources.DOM
955
1029
// <- variable.other.readwrite
956
1030
.status()
957
1031
// ^ meta.function-call.method variable.function
1032
+ // ^ - meta.function-call
958
1033
959
1034
foo.#bar();
960
1035
// ^^^^^^^^^^ meta.function-call.method.js
@@ -987,7 +1062,7 @@ var foo = ~{a:function(){}.a()}
987
1062
// ^^^ variable.other.readwrite
988
1063
// ^ keyword.operator.assignment
989
1064
// ^ keyword.operator.bitwise
990
- // ^ punctuation.section.block .begin
1065
+ // ^ punctuation.section.mapping .begin
991
1066
// ^^^^^^^^^^^^^^^^^^^^ meta.mapping
992
1067
// ^^^^^^^^^^^^ meta.function
993
1068
// ^ entity.name.function
@@ -1002,14 +1077,14 @@ var foo = ~{a:function(){}.a()}
1002
1077
// ^ variable.function - entity.name.function
1003
1078
// ^ punctuation.section.group.begin
1004
1079
// ^ punctuation.section.group.end
1005
- // ^ punctuation.section.block .end
1080
+ // ^ punctuation.section.mapping .end
1006
1081
// ^ - meta
1007
1082
1008
1083
baz(foo(x => x('bar')));
1009
1084
// ^ meta.function-call meta.function-call punctuation.section.group.end
1010
1085
// ^ meta.function-call punctuation.section.group.end
1011
1086
1012
- func ( a , b ) ;
1087
+ func(a, b) ;
1013
1088
//^^^^^^^^ meta.function-call
1014
1089
// ^ variable.function
1015
1090
// ^^^^^^ meta.group
@@ -1018,6 +1093,7 @@ func(a, b);
1018
1093
// ^ punctuation.separator.comma
1019
1094
// ^ variable.other.readwrite
1020
1095
// ^ punctuation.section.group.end
1096
+ // ^ - meta.function-call
1021
1097
1022
1098
var instance = new Constructor(param1, param2)
1023
1099
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.constructor
@@ -1105,7 +1181,7 @@ void {
1105
1181
// ^ meta.brackets
1106
1182
'test3': "asdf"
1107
1183
}
1108
- // <- meta.mapping punctuation.section.block .end
1184
+ // <- meta.mapping punctuation.section.mapping .end
1109
1185
1110
1186
// This tests parsing semi-broken object literals, which should help while a
1111
1187
// user is in the middle of typing code
@@ -1299,7 +1375,7 @@ new FooBar(function(){
1299
1375
1300
1376
var test =
1301
1377
{a: 1}
1302
- // <- meta.mapping punctuation.section.block .begin
1378
+ // <- meta.mapping punctuation.section.mapping .begin
1303
1379
1304
1380
var arrowFuncBraceNextLine = () => /* comments! */
1305
1381
// ^ entity.name.function
@@ -1351,7 +1427,7 @@ $var.fn.name = () => {}
1351
1427
// ^ variable.other.dollar - punctuation.dollar
1352
1428
1353
1429
someFunction(() => [() => 'X']);
1354
- // ^ punctuation.section.brackets .end
1430
+ // ^ punctuation.section.sequence .end
1355
1431
1356
1432
string = 'invalid
1357
1433
// ^ invalid.illegal.newline
@@ -1431,10 +1507,10 @@ var query = {
1431
1507
// ^ keyword.operator.ternary
1432
1508
// ^^^^ constant.language.null
1433
1509
// ^ keyword.operator.ternary
1434
- // ^ punctuation.section.block .begin
1510
+ // ^ punctuation.section.mapping .begin
1435
1511
// ^^ meta.mapping.key.js
1436
1512
// ^ punctuation.separator.key-value.js
1437
- // ^ punctuation.section.block .end
1513
+ // ^ punctuation.section.mapping .end
1438
1514
};
1439
1515
1440
1516
var str = ` Hello , $ { name } ! ` ;
@@ -1597,7 +1673,7 @@ debugger
1597
1673
// <- meta.sequence
1598
1674
1599
1675
a ?? b ;
1600
- // ^^ keyword.operator.logical
1676
+ // ^^ keyword.operator.null-coalescing
1601
1677
1602
1678
a &&= b ;
1603
1679
// ^^^ keyword.operator.assignment.augmented
0 commit comments