github-linguist 4.8.3 → 4.8.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,9 +41,6 @@
41
41
  {
42
42
  "include": "#literal-labels"
43
43
  },
44
- {
45
- "include": "#literal-keywords"
46
- },
47
44
  {
48
45
  "include": "#literal-for"
49
46
  },
@@ -53,6 +50,9 @@
53
50
  {
54
51
  "include": "#expression"
55
52
  },
53
+ {
54
+ "include": "#literal-keywords"
55
+ },
56
56
  {
57
57
  "include": "#literal-punctuation"
58
58
  }
@@ -107,6 +107,9 @@
107
107
  {
108
108
  "include": "#literal-language-variable"
109
109
  },
110
+ {
111
+ "include": "#literal-object"
112
+ },
110
113
  {
111
114
  "include": "#literal-module"
112
115
  },
@@ -155,7 +158,7 @@
155
158
  {
156
159
  "comment": "e.g. play: function(arg1, arg2) { }",
157
160
  "name": "meta.function.json.js",
158
- "begin": "\\s*+([_$a-zA-Z][$\\w]*)\\s*+(:)\\s*+(?:(async)\\s+)?\\s*+(\\bfunction\\b)\\s*+(?:(\\*)\\s*)?\\s*(?=\\(|<)",
161
+ "begin": "\\s*+([_$a-zA-Z][$\\w]*)\\s*+(:)\\s*+(?:(async)\\s+)?\\s*+((?<!\\.)\\bfunction\\b)\\s*+(?:(\\*)\\s*)?\\s*(?=\\(|<)",
159
162
  "end": "(?=\\{)",
160
163
  "applyEndPatternLast": 1,
161
164
  "beginCaptures": {
@@ -184,7 +187,7 @@
184
187
  {
185
188
  "comment": "e.g. 'play': function(arg1, arg2) { }",
186
189
  "name": "meta.function.json.js",
187
- "begin": "\\s*+(('|\\\")(\\b[_$a-zA-Z][$\\w]*)(\\k<2>))\\s*+(:)\\s*+(async)?\\s*+(\\bfunction\\b)\\s*(\\*\\s*)?\\s*(?=\\(|<)",
190
+ "begin": "\\s*+(('|\\\")(\\b[_$a-zA-Z][$\\w]*)(\\k<2>))\\s*+(:)\\s*+(async)?\\s*+((?<!\\.)\\bfunction\\b)\\s*(\\*\\s*)?\\s*(?=\\(|<)",
188
191
  "end": "(?=\\{)",
189
192
  "applyEndPatternLast": 1,
190
193
  "beginCaptures": {
@@ -435,7 +438,7 @@
435
438
  },
436
439
  {
437
440
  "name": "keyword.control.flow.js",
438
- "match": "\\s*+(?<!\\.)\\b(yield)\\b(?:\\s*+(\\*))?",
441
+ "match": "\\s*+(?<!\\.)\\b(yield|type|declare)\\b(?:\\s*+(\\*))?",
439
442
  "captures": {
440
443
  "1": {
441
444
  "name": "keyword.control.flow.js"
@@ -578,7 +581,6 @@
578
581
  "patterns": [
579
582
  {
580
583
  "comment": "try to avoid ternary operators which have a '? some chars :'",
581
- "name": "meta.group.braces.round",
582
584
  "begin": "(^|:|;|=|(?<=:|;|=))\\s*+(\\((?=((\"|').*?(?<=[^\\\\])\\k<-1>|[^?:])*(:|\\?\\s*+:)))",
583
585
  "end": "\\s*\\)",
584
586
  "beginCaptures": {
@@ -601,7 +603,6 @@
601
603
  ]
602
604
  },
603
605
  {
604
- "name": "meta.group.braces.round",
605
606
  "begin": "\\s*+\\(",
606
607
  "end": "\\s*\\)",
607
608
  "endCaptures": {
@@ -625,7 +626,6 @@
625
626
  "square-brackets": {
626
627
  "patterns": [
627
628
  {
628
- "name": "meta.group.braces.square",
629
629
  "begin": "\\s*+\\[",
630
630
  "end": "\\s*\\]",
631
631
  "endCaptures": {
@@ -649,7 +649,6 @@
649
649
  "curly-brackets": {
650
650
  "patterns": [
651
651
  {
652
- "name": "meta.group.braces.curly",
653
652
  "begin": "\\s*+\\{",
654
653
  "end": "\\s*\\}",
655
654
  "endCaptures": {
@@ -827,16 +826,16 @@
827
826
  "literal-keyword-storage": {
828
827
  "patterns": [
829
828
  {
830
- "comment": "these statements must end in a ;",
829
+ "comment": "flowtype vars with a : to indicate type",
831
830
  "begin": "\\s*+(?<!\\.)\\b(const|let|var)\\b\\s+(?=[$_\\p{L}](?:[$\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}-]*+\\s*+:))",
832
- "end": "\\s*\\;",
831
+ "end": "\\s*((\\;)|(?=\\b(if|switch|try|var|let|const|static|function|return|class|do|for|while|debugger|export|import|label|yield|type|declare)\\b|^\\s*$|}))",
833
832
  "beginCaptures": {
834
833
  "1": {
835
834
  "name": "storage.type.js"
836
835
  }
837
836
  },
838
837
  "endCaptures": {
839
- "0": {
838
+ "2": {
840
839
  "name": "punctuation.terminator.statement.js"
841
840
  }
842
841
  },
@@ -847,16 +846,16 @@
847
846
  ]
848
847
  },
849
848
  {
850
- "comment": "these statements must end in a ;",
849
+ "comment": "flowtype objects {a,b,{z}} with a : to indicate type",
851
850
  "begin": "\\s*+(?<!\\.)\\b(const|let|var)\\b\\s+(?=(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})\\s*+:)",
852
- "end": "\\s*\\;",
851
+ "end": "\\s*((\\;)|(?=\\b(if|switch|try|var|let|const|static|function|return|class|do|for|while|debugger|export|import|label|yield|type|declare)\\b|^\\s*$|}))",
853
852
  "beginCaptures": {
854
853
  "1": {
855
854
  "name": "storage.type.js"
856
855
  }
857
856
  },
858
857
  "endCaptures": {
859
- "0": {
858
+ "2": {
860
859
  "name": "punctuation.terminator.statement.js"
861
860
  }
862
861
  },
@@ -867,16 +866,16 @@
867
866
  ]
868
867
  },
869
868
  {
870
- "comment": "these statements must end in a ;",
869
+ "comment": "flowtype arrays [a,[b,c]] with a : to indicate type",
871
870
  "begin": "\\s*+(?<!\\.)\\b(const|let|var)\\b\\s+(?=(\\[(?:(?>[^\\[\\]]+)|\\g<-1>)*\\])\\s*+:)",
872
- "end": "\\s*\\;",
871
+ "end": "\\s*((\\;)|(?=\\b(if|switch|try|var|let|const|static|function|return|class|do|for|while|debugger|export|import|label|yield|type|declare)\\b|^\\s*$|}))",
873
872
  "beginCaptures": {
874
873
  "1": {
875
874
  "name": "storage.type.js"
876
875
  }
877
876
  },
878
877
  "endCaptures": {
879
- "0": {
878
+ "2": {
880
879
  "name": "punctuation.terminator.statement.js"
881
880
  }
882
881
  },
@@ -898,7 +897,7 @@
898
897
  {
899
898
  "comment": "e.g. function play<T>(arg1, arg2) { }",
900
899
  "name": "meta.function.js",
901
- "begin": "\\s*+(?:\\b(async)\\b\\s+)?\\s*+(\\bfunction\\b)\\s*+(\\*?)\\s*+([_$a-zA-Z][$\\w]*)?\\s*+(?=\\(|<)",
900
+ "begin": "\\s*+(?:\\b(async)\\b\\s+)?\\s*+(?:(?<=\\.\\.\\.)|(?<!\\.))(\\bfunction\\b)\\s*+(\\*?)\\s*+([_$a-zA-Z][$\\w]*)?\\s*+(?=\\(|<)",
902
901
  "end": "(?=\\s*+\\{)",
903
902
  "applyEndPatternLast": 1,
904
903
  "beginCaptures": {
@@ -924,7 +923,7 @@
924
923
  {
925
924
  "comment": "e.g. play = function(arg1, arg2) { }",
926
925
  "name": "meta.function.js",
927
- "begin": "\\s*+(\\b[_$a-zA-Z][$\\w]*)\\s*+(=)\\s*+(?:(async)\\s+)?\\s*+(\\bfunction\\b)\\s*+(\\*?)\\s*+([_$a-zA-Z][$\\w]*)?\\s*+(?=\\(|<)",
926
+ "begin": "\\s*+(\\b[_$a-zA-Z][$\\w]*)\\s*+(=)\\s*+(?:(async)\\s+)?\\s*+((?<!\\.)\\bfunction\\b)\\s*+(\\*?)\\s*+([_$a-zA-Z][$\\w]*)?\\s*+(?=\\(|<)",
928
927
  "end": "(?=\\s*+\\{)",
929
928
  "applyEndPatternLast": 1,
930
929
  "beginCaptures": {
@@ -956,7 +955,7 @@
956
955
  {
957
956
  "comment": "e.g. Sound.prototype.play = function(arg1, arg2) { }",
958
957
  "name": "meta.prototype.function.js",
959
- "begin": "\\s*+(\\b_?[A-Z][$\\w]*)?(\\.)(prototype)(\\.)([_$a-zA-Z][$\\w]*)\\s*+(=)\\s*+(?:(async)\\s+)?\\s*+(\\bfunction\\b)\\s*+(\\*?)\\s*+([_$a-zA-Z][$\\w]*)?\\s*+(?=\\(|<)",
958
+ "begin": "\\s*+(\\b_?[A-Z][$\\w]*)?(\\.)(prototype)(\\.)([_$a-zA-Z][$\\w]*)\\s*+(=)\\s*+(?:(async)\\s+)?\\s*+((?<!\\.)\\bfunction\\b)\\s*+(\\*?)\\s*+([_$a-zA-Z][$\\w]*)?\\s*+(?=\\(|<)",
960
959
  "end": "(?=\\s*+\\{)",
961
960
  "applyEndPatternLast": 1,
962
961
  "beginCaptures": {
@@ -1000,7 +999,7 @@
1000
999
  {
1001
1000
  "comment": "e.g. Sound.play = function(arg1, arg2) { }",
1002
1001
  "name": "meta.function.static.js",
1003
- "begin": "\\s*+(\\b_?[A-Z][$\\w]*)?(\\.)([_$a-zA-Z][$\\w]*)\\s*+(=)\\s*+(?:(async)\\s+)?\\s*+(\\bfunction\\b)\\s*+(\\*?)\\s*+([_$a-zA-Z][$\\w]*)?\\s*+(?=\\(|<)",
1002
+ "begin": "\\s*+(\\b_?[A-Z][$\\w]*)?(\\.)([_$a-zA-Z][$\\w]*)\\s*+(=)\\s*+(?:(async)\\s+)?\\s*+((?<!\\.)\\bfunction\\b)\\s*+(\\*?)\\s*+([_$a-zA-Z][$\\w]*)?\\s*+(?=\\(|<)",
1004
1003
  "end": "(?=\\s*+\\{)",
1005
1004
  "applyEndPatternLast": 1,
1006
1005
  "beginCaptures": {
@@ -1040,20 +1039,28 @@
1040
1039
  "literal-quasi": {
1041
1040
  "patterns": [
1042
1041
  {
1042
+ "comment": "Use two forms of scopes! fixes some themes",
1043
1043
  "name": "string.quasi.js",
1044
- "begin": "\\s*+([a-zA-Z$_][\\w$_]*)?(`)",
1045
- "end": "\\s*(?<!\\\\)`",
1044
+ "contentName": "string.quoted.template.js",
1045
+ "begin": "\\s*+([a-zA-Z$_][\\w$_]*)?((`))",
1046
+ "end": "\\s*(?<!\\\\)((`))",
1046
1047
  "beginCaptures": {
1047
1048
  "1": {
1048
1049
  "name": "entity.quasi.tag.name.js"
1049
1050
  },
1050
1051
  "2": {
1051
1052
  "name": "punctuation.definition.quasi.begin.js"
1053
+ },
1054
+ "3": {
1055
+ "name": "string.quoted.template.js"
1052
1056
  }
1053
1057
  },
1054
1058
  "endCaptures": {
1055
- "0": {
1059
+ "1": {
1056
1060
  "name": "punctuation.definition.quasi.end.js"
1061
+ },
1062
+ "2": {
1063
+ "name": "string.quoted.template.js"
1057
1064
  }
1058
1065
  },
1059
1066
  "patterns": [
@@ -1084,6 +1091,66 @@
1084
1091
  }
1085
1092
  ]
1086
1093
  },
1094
+ "literal-object": {
1095
+ "patterns": [
1096
+ {
1097
+ "comment": "obj lteral ({ or ,{ or [{ or ={ or return { or default {",
1098
+ "begin": "(?:(?<=\\(|\\[|:)|(?:\\s*(?:(=)|\\b(default)\\b|\\b(return)\\b|(,))))\\s*({)",
1099
+ "end": "\\s*+(})",
1100
+ "beginCaptures": {
1101
+ "1": {
1102
+ "name": "keyword.operator.assignment.js"
1103
+ },
1104
+ "2": {
1105
+ "name": "keyword.control.module.js"
1106
+ },
1107
+ "3": {
1108
+ "name": "keyword.control.flow.js"
1109
+ },
1110
+ "4": {
1111
+ "name": "meta.delimiter.comma.js"
1112
+ },
1113
+ "5": {
1114
+ "name": "meta.brace.curly.js"
1115
+ }
1116
+ },
1117
+ "endCaptures": {
1118
+ "1": {
1119
+ "name": "meta.brace.curly.js"
1120
+ }
1121
+ },
1122
+ "patterns": [
1123
+ {
1124
+ "include": "#literal-object"
1125
+ },
1126
+ {
1127
+ "include": "#literal-keywords"
1128
+ },
1129
+ {
1130
+ "include": "#literal-function-labels"
1131
+ },
1132
+ {
1133
+ "include": "#literal-arrow-function-labels"
1134
+ },
1135
+ {
1136
+ "include": "#literal-arrow-function"
1137
+ },
1138
+ {
1139
+ "include": "#literal-method"
1140
+ },
1141
+ {
1142
+ "include": "#literal-labels"
1143
+ },
1144
+ {
1145
+ "include": "#expression"
1146
+ },
1147
+ {
1148
+ "include": "#literal-punctuation"
1149
+ }
1150
+ ]
1151
+ }
1152
+ ]
1153
+ },
1087
1154
  "literal-operators": {
1088
1155
  "patterns": [
1089
1156
  {
@@ -1151,12 +1218,18 @@
1151
1218
  "literal-function-call": {
1152
1219
  "comment": "maybe in array form e.g. foo[bar]()",
1153
1220
  "patterns": [
1221
+ {
1222
+ "include": "#literal-keywords"
1223
+ },
1154
1224
  {
1155
1225
  "name": "meta.function-call.without-arguments.js",
1156
- "begin": "\\s*+([_$a-zA-Z][$\\w]*)\\s*+(?=\\(\\s*+\\))",
1226
+ "begin": "\\s*+((\\bnew\\b)*)\\s*+([_$a-zA-Z][$\\w]*)\\s*+(?=\\(\\s*+\\))",
1157
1227
  "end": "\\s*(?<=\\))",
1158
1228
  "beginCaptures": {
1159
- "1": {
1229
+ "2": {
1230
+ "name": "keyword.operator.js"
1231
+ },
1232
+ "3": {
1160
1233
  "name": "entity.name.function.js"
1161
1234
  }
1162
1235
  },
@@ -1168,9 +1241,14 @@
1168
1241
  },
1169
1242
  {
1170
1243
  "name": "meta.function-call.without-arguments.js",
1171
- "begin": "\\s*+(?=(\\[(?:(?>[^\\[\\]]+)|\\g<-1>)*\\])\\s*+\\(\\s*+\\))",
1244
+ "begin": "\\s*+((\\bnew\\b)*)\\s*+(?=(\\[(?:(?>[^\\[\\]]+)|\\g<-1>)*\\])\\s*+\\(\\s*+\\))",
1172
1245
  "end": "(?=.)",
1173
1246
  "applyEndPatternLast": 1,
1247
+ "beginCaptures": {
1248
+ "2": {
1249
+ "name": "keyword.operator.js"
1250
+ }
1251
+ },
1174
1252
  "patterns": [
1175
1253
  {
1176
1254
  "include": "#flowtype-parse-array"
@@ -1182,11 +1260,14 @@
1182
1260
  },
1183
1261
  {
1184
1262
  "name": "meta.function-call.with-arguments.js",
1185
- "begin": "\\s*+([_$a-zA-Z][$\\w]*)\\s*+(?=\\()",
1263
+ "begin": "\\s*+((\\bnew\\b)*)\\s*+([_$a-zA-Z][$\\w]*)\\s*+(?=\\()",
1186
1264
  "end": "(?=.)",
1187
1265
  "applyEndPatternLast": 1,
1188
1266
  "beginCaptures": {
1189
- "1": {
1267
+ "2": {
1268
+ "name": "keyword.operator.js"
1269
+ },
1270
+ "3": {
1190
1271
  "name": "entity.name.function.js"
1191
1272
  }
1192
1273
  },
@@ -1198,9 +1279,14 @@
1198
1279
  },
1199
1280
  {
1200
1281
  "name": "meta.function-call.without-arguments.js",
1201
- "begin": "\\s*+(?=(\\[(?:(?>[^\\[\\]]+)|\\g<-1>)*\\])\\s*+\\()",
1282
+ "begin": "\\s*+((\\bnew\\b)*)\\s*+(?=(\\[(?:(?>[^\\[\\]]+)|\\g<-1>)*\\])\\s*+\\()",
1202
1283
  "end": "(?=.)",
1203
1284
  "applyEndPatternLast": 1,
1285
+ "beginCaptures": {
1286
+ "2": {
1287
+ "name": "keyword.operator.js"
1288
+ }
1289
+ },
1204
1290
  "patterns": [
1205
1291
  {
1206
1292
  "include": "#flowtype-parse-array"
@@ -1839,7 +1925,7 @@
1839
1925
  {
1840
1926
  "comment": "e.g. play<T,T>(arg1, arg2): Type<T> { }",
1841
1927
  "name": "meta.function.method.js",
1842
- "begin": "\\s*++(\\bstatic\\b)?\\s*++(\\basync\\b)?\\s*++(\\*?)\\s*++(?<!\\.)([_$a-zA-Z][$\\w]*)\\s*++(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?(\\())",
1928
+ "begin": "\\s*+(\\bstatic\\b)?\\s*+(\\basync\\b)?\\s*+(\\*?)\\s*+(?<!\\.)([_$a-zA-Z][$\\w]*)\\s*+(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?(\\())",
1843
1929
  "end": "\\s*(?=.)",
1844
1930
  "applyEndPatternLast": 1,
1845
1931
  "beginCaptures": {
@@ -1865,7 +1951,7 @@
1865
1951
  {
1866
1952
  "comment": "e.g. [var]<T,T>(arg1, arg2): Type<T> { } or 'var'<T,T>(arg1, arg2)",
1867
1953
  "name": "meta.function.method.js",
1868
- "begin": "\\s*++(\\bstatic\\b)?\\s*++(\\basync\\b)?\\s*++(\\*?)\\s*++(?=((\\[(?:(?>[^\\[\\]]+)|\\g<-1>)*\\])|\\s*+(((')((?:[^']|\\\\')*)('))|\\s*+((\")((?:[^\"]|\\\\\")*)(\"))))\\s*+(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*+(\\())",
1954
+ "begin": "\\s*+(\\bstatic\\b)?\\s*+(\\basync\\b)?\\s*+(\\*?)\\s*+(?=((\\[(?:(?>[^\\[\\]]+)|\\g<-1>)*\\])|\\s*+(((')((?:[^']|\\\\')*)('))|\\s*+((\")((?:[^\"]|\\\\\")*)(\"))))\\s*+(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*+(\\())",
1869
1955
  "end": "\\s*(?=.)",
1870
1956
  "applyEndPatternLast": 1,
1871
1957
  "beginCaptures": {
@@ -2442,7 +2528,7 @@
2442
2528
  "flowtype-variable": {
2443
2529
  "patterns": [
2444
2530
  {
2445
- "comment": "name of variable spread var with flowtype :",
2531
+ "comment": "name of variable spread var with optional ? and optional flowtype :",
2446
2532
  "match": "\\s*+((?<!\\.)\\.\\.\\.)?([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+)\\s*+(\\??)\\s*+(?=:|=>)",
2447
2533
  "captures": {
2448
2534
  "1": {
@@ -2537,7 +2623,7 @@
2537
2623
  {
2538
2624
  "comment": "flowtype optional arg/parameter e.g. protocol? : string",
2539
2625
  "name": "punctuation.type.flowtype",
2540
- "match": "\\?(?=\\s*+:)"
2626
+ "match": "\\s*+\\?"
2541
2627
  },
2542
2628
  {
2543
2629
  "comment": "typed entity :",
@@ -2555,6 +2641,9 @@
2555
2641
  }
2556
2642
  ]
2557
2643
  },
2644
+ {
2645
+ "include": "#literal-object"
2646
+ },
2558
2647
  {
2559
2648
  "include": "#literal-comma"
2560
2649
  },
@@ -2599,16 +2688,22 @@
2599
2688
  }
2600
2689
  ]
2601
2690
  },
2691
+ {
2692
+ "include": "#literal-object"
2693
+ },
2602
2694
  {
2603
2695
  "comment": "some form of default assignment for func args",
2604
2696
  "begin": "\\s*+=(?!>|=|==)",
2605
- "end": "\\s*(?=,|;|\\))",
2697
+ "end": "\\s*(?=,|;|\\)|\\b(if|switch|try|var|let|const|static|function|return|class|do|for|while|debugger|export|import|label|yield|type|declare)\\b)",
2606
2698
  "beginCaptures": {
2607
2699
  "0": {
2608
2700
  "name": "keyword.operator.assignment.js"
2609
2701
  }
2610
2702
  },
2611
2703
  "patterns": [
2704
+ {
2705
+ "include": "#literal-labels"
2706
+ },
2612
2707
  {
2613
2708
  "include": "#expression"
2614
2709
  }
@@ -2629,7 +2724,7 @@
2629
2724
  },
2630
2725
  {
2631
2726
  "comment": "primitive flowtypes",
2632
- "match": "\\s*+\\b((?>any|boolean|mixed|number|string|void))\\b",
2727
+ "match": "(?!^)\\s*+\\b((?>any|boolean|mixed|number|string|void))\\b",
2633
2728
  "captures": {
2634
2729
  "1": {
2635
2730
  "name": "support.type.builtin.primitive.flowtype"
@@ -2638,7 +2733,7 @@
2638
2733
  },
2639
2734
  {
2640
2735
  "comment": "Built-in Class Types",
2641
- "match": "\\s*+\\b((?>ArrayBuffer|ArrayBufferView|Boolean|Date|DataView|Error|EvalError|Float32Array|Float64Array|Function|Int8Array|Int16Array|Int32Array|JSON|Math|Number|Object|RangeError|ReferenceError|RegExp|String|Symbol|TypeError|Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray))\\b",
2736
+ "match": "(?!^)\\s*+\\b((?>ArrayBuffer|ArrayBufferView|Boolean|Date|DataView|Error|EvalError|Float32Array|Float64Array|Function|Int8Array|Int16Array|Int32Array|JSON|Math|Number|Object|RangeError|ReferenceError|RegExp|String|Symbol|TypeError|Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray))\\b",
2642
2737
  "captures": {
2643
2738
  "1": {
2644
2739
  "name": "support.type.builtin.class.flowtype"
@@ -2650,7 +2745,7 @@
2650
2745
  },
2651
2746
  {
2652
2747
  "comment": "custom Class Types e.g. Abc avoid Abc(",
2653
- "match": "\\s*+([$_[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}]][$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}]*+)(?!\\s*+\\()",
2748
+ "match": "(?!^)\\s*+([$_[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}]][$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}]*+)(?!\\s*+\\()",
2654
2749
  "captures": {
2655
2750
  "1": {
2656
2751
  "name": "support.type.class.flowtype"
@@ -2659,9 +2754,9 @@
2659
2754
  },
2660
2755
  {
2661
2756
  "comment": "custom primitive/var Types e.g. abc avoid abc(",
2662
- "match": "\\s*+([$_\\p{L}][$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}]*+)(?!\\s*+\\()",
2757
+ "match": "(?!^)\\s*+(?!\\b(if|switch|try|var|let|const|static|function|return|class|do|for|while|debugger|export|import|label|yield|type|declare)\\b)([$_\\p{L}][$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}]*+)(?!\\s*+\\()",
2663
2758
  "captures": {
2664
- "1": {
2759
+ "2": {
2665
2760
  "name": "support.type.primitive.flowtype"
2666
2761
  }
2667
2762
  }
@@ -2869,7 +2964,7 @@
2869
2964
  {
2870
2965
  "comment": "type aliases for export but avoid type instaceof or type in operators",
2871
2966
  "begin": "\\s*+\\b(type)\\b\\s+(?!(instanceof|in)\\b)(?=[$_\\p{L}])",
2872
- "end": "\\s*;|\\n",
2967
+ "end": "\\s*(\\;|\\n|\\b(?=if|switch|try|var|let|const|static|function|return|class|do|for|while|debugger|export|import|label|yield|type|declare)\\b)",
2873
2968
  "beginCaptures": {
2874
2969
  "1": {
2875
2970
  "name": "support.type.type.flowtype"