File tree Expand file tree Collapse file tree 5 files changed +65
-24
lines changed Expand file tree Collapse file tree 5 files changed +65
-24
lines changed Original file line number Diff line number Diff line change @@ -860,17 +860,14 @@ repository:
860
860
import-export-clause :
861
861
patterns :
862
862
- include : ' #comment'
863
- - comment : (default|*|name) as alias
864
- match : |-
865
- (?x) (?: \b(default)\b | (\*) | ({{identifier}})) \s+
866
- (as) \s+ (?: (\b default \b | \*) | ({{identifier}}))
863
+ # (default|*|name) as alias
864
+ - match : (?<!\.|\$)(?:(\bdefault)|(\*)|(\b{{identifier}}))\s+(as)\s+(\b{{identifier}})
867
865
captures :
868
866
' 1 ' : { name: keyword.control.default.ts }
869
867
' 2 ' : { name: constant.language.import-export-all.ts }
870
868
' 3 ' : { name: variable.other.readwrite.ts }
871
869
' 4 ' : { name: keyword.control.as.ts }
872
- ' 5 ' : { name: invalid.illegal.ts }
873
- ' 6 ' : { name: variable.other.readwrite.alias.ts }
870
+ ' 5 ' : { name: variable.other.readwrite.alias.ts }
874
871
- include : ' #punctuation-comma'
875
872
- name : constant.language.import-export-all.ts
876
873
match : \*
Original file line number Diff line number Diff line change 2703
2703
<string >#comment </string >
2704
2704
</dict >
2705
2705
<dict >
2706
- <key >comment </key >
2707
- <string >(default|*|name) as alias </string >
2708
2706
<key >match </key >
2709
- <string >(?x) (?: \b(default)\b | (\*) | ([_$[:alpha:]][_$[:alnum:]]*)) \s+
2710
- (as) \s+ (?: (\b default \b | \*) | ([_$[:alpha:]][_$[:alnum:]]*)) </string >
2707
+ <string >(?< !\.|\$)(?:(\bdefault)|(\*)|(\b[_$[:alpha:]][_$[:alnum:]]*))\s+(as)\s+(\b[_$[:alpha:]][_$[:alnum:]]*) </string >
2711
2708
<key >captures </key >
2712
2709
<dict >
2713
2710
<key >1 </key >
2731
2728
<string >keyword.control.as.ts </string >
2732
2729
</dict >
2733
2730
<key >5 </key >
2734
- <dict >
2735
- <key >name </key >
2736
- <string >invalid.illegal.ts </string >
2737
- </dict >
2738
- <key >6 </key >
2739
2731
<dict >
2740
2732
<key >name </key >
2741
2733
<string >variable.other.readwrite.alias.ts </string >
Original file line number Diff line number Diff line change 2707
2707
<string >#comment </string >
2708
2708
</dict >
2709
2709
<dict >
2710
- <key >comment </key >
2711
- <string >(default|*|name) as alias </string >
2712
2710
<key >match </key >
2713
- <string >(?x) (?: \b(default)\b | (\*) | ([_$[:alpha:]][_$[:alnum:]]*)) \s+
2714
- (as) \s+ (?: (\b default \b | \*) | ([_$[:alpha:]][_$[:alnum:]]*)) </string >
2711
+ <string >(?< !\.|\$)(?:(\bdefault)|(\*)|(\b[_$[:alpha:]][_$[:alnum:]]*))\s+(as)\s+(\b[_$[:alpha:]][_$[:alnum:]]*) </string >
2715
2712
<key >captures </key >
2716
2713
<dict >
2717
2714
<key >1 </key >
2735
2732
<string >keyword.control.as.tsx </string >
2736
2733
</dict >
2737
2734
<key >5 </key >
2738
- <dict >
2739
- <key >name </key >
2740
- <string >invalid.illegal.tsx </string >
2741
- </dict >
2742
- <key >6 </key >
2743
2735
<dict >
2744
2736
<key >name </key >
2745
2737
<string >variable.other.readwrite.alias.tsx </string >
Original file line number Diff line number Diff line change
1
+ original file
2
+ -----------------------------------
3
+ class Test { }
4
+ export {
5
+ Test as default
6
+ };
7
+ -----------------------------------
8
+
9
+ Grammar: TypeScript.tmLanguage
10
+ -----------------------------------
11
+ >class Test { }
12
+ ^^^^^
13
+ source.ts meta.class.ts storage.type.class.ts
14
+ ^
15
+ source.ts meta.class.ts
16
+ ^^^^
17
+ source.ts meta.class.ts entity.name.type.class.ts
18
+ ^
19
+ source.ts meta.class.ts
20
+ ^
21
+ source.ts meta.class.ts punctuation.definition.block.ts
22
+ ^
23
+ source.ts meta.class.ts
24
+ ^
25
+ source.ts meta.class.ts punctuation.definition.block.ts
26
+ ^^
27
+ source.ts
28
+ >export {
29
+ ^^^^^^
30
+ source.ts meta.export.ts keyword.control.export.ts
31
+ ^
32
+ source.ts meta.export.ts
33
+ ^
34
+ source.ts meta.export.ts meta.block.ts punctuation.definition.block.ts
35
+ ^^
36
+ source.ts meta.export.ts meta.block.ts
37
+ > Test as default
38
+ ^
39
+ source.ts meta.export.ts meta.block.ts
40
+ ^^^^
41
+ source.ts meta.export.ts meta.block.ts variable.other.readwrite.ts
42
+ ^
43
+ source.ts meta.export.ts meta.block.ts
44
+ ^^
45
+ source.ts meta.export.ts meta.block.ts keyword.control.as.ts
46
+ ^
47
+ source.ts meta.export.ts meta.block.ts
48
+ ^^^^^^^
49
+ source.ts meta.export.ts meta.block.ts variable.other.readwrite.alias.ts
50
+ ^^
51
+ source.ts meta.export.ts meta.block.ts
52
+ >};
53
+ ^
54
+ source.ts meta.export.ts meta.block.ts punctuation.definition.block.ts
55
+ ^
56
+ source.ts punctuation.terminator.statement.ts
Original file line number Diff line number Diff line change
1
+ class Test { }
2
+ export {
3
+ Test as default
4
+ } ;
You can’t perform that action at this time.
0 commit comments