1
- syntax region jsFlowTypeStatement start =/ type/ end =/ =/ oneline skipwhite skipempty nextgroup =jsFlowTypeObject
2
- syntax region jsFlowDeclareBlock start =/ declare/ end =/ [;\n ]/ oneline contains =jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass
3
- syntax region jsFlow start =/ :/ end =/ \% (\% ([),=;\n ]\| {\% (.*}\)\@ !\|\% ({.*}\)\@ <=\s *{\)\@ =\| void\) / contains =@jsFlowCluster containedin =jsBlock,jsClassBlock,jsFuncBlock,jsBlock,jsTryCatchBlock,jsSwitchBlock,jsParen oneline skipwhite skipempty nextgroup =jsFuncBlock
4
- syntax region jsFlowReturn contained start =/ :/ end =/ \% (\S\s *\% ({\% (.*}\)\@ !\)\@ =\|\n\) / contains =@jsFlowCluster oneline skipwhite skipempty nextgroup =jsFuncBlock keepend
5
- syntax region jsFlowTypeObject contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =jsFlowTypeKey,jsFlowNoise skipwhite skipempty nextgroup =jsFunctionBlock extend
6
- syntax match jsFlowTypeKey contained / \< [0-9a-zA-Z_$?]*\>\(\s *:\)\@ =/ skipwhite skipempty nextgroup =jsFlowTypeValue
7
- syntax region jsFlowTypeValue contained matchgroup =jsFlowNoise start =/ :/ end =/ [,};]\@ =/ contains =@jsFlowCluster
8
- syntax region jsFlowObject contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ oneline contains =@jsFlowCluster
9
- syntax region jsFlowArray contained matchgroup =jsFlowNoise start =/ \[ / end =/ \] / oneline contains =@jsFlowCluster
10
- syntax region jsFlowArrow contained matchgroup =jsFlowNoise start =/ (/ end =/ )\s *=>/ oneline contains =@jsFlowCluster
11
- syntax keyword jsFlowDeclareKeyword contained declare
12
- syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array bool
13
- syntax match jsFlowClassProperty contained / \< [0-9a-zA-Z_$]*\> :\@ =/ skipwhite skipempty nextgroup =jsFlow
1
+ syntax region jsFlowDefinition contained start =/ :/ end =/ \% (\s *[,=;)\n ]\)\@ =/ contains =@jsFlowCluster containedin =jsParen
2
+ syntax region jsFlowArray contained matchgroup =jsFlowNoise start =/ \[ / end =/ \] / contains =@jsFlowCluster
3
+ syntax region jsFlowObject contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =@jsFlowCluster
4
+ syntax region jsFlowParens contained matchgroup =jsFlowNoise start =/ (/ end =/ )/ contains =@jsFlowCluster
14
5
syntax match jsFlowNoise contained / [:;,<>]/
15
- syntax cluster jsFlowCluster contains =jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow
16
- syntax keyword jsFlowStorageClass contained const var let
17
- syntax region jsFlowParenRegion contained start =/ :\s *(/ end =/ )\% (\s *:\)\@ =/ oneline contains =@jsFlowCluster skipwhite skipempty nextgroup =jsObjectValue
18
- syntax region jsFlowClass contained matchgroup =jsFlowNoise start =/ </ end =/ >/ oneline contains =@jsFlowCluster skipwhite skipempty nextgroup =jsClassBlock
6
+ syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object array bool class
7
+ syntax keyword jsFlowTypeof contained typeof skipempty skipempty nextgroup =jsFlowTypeCustom,jsFlowType
8
+ syntax match jsFlowTypeCustom contained / \k */ skipwhite skipempty nextgroup =jsFlowGroup
9
+ syntax region jsFlowGroup contained matchgroup =jsFlowNoise start =/ </ end =/ >/ contains =@jsFlowCluster
10
+ syntax region jsFlowArrow contained matchgroup =jsFlowNoise start =/ (/ end =/ )\s *=>/ oneline contains =@jsFlowCluster
11
+ syntax match jsFlowMaybe contained / ?/
12
+
13
+ syntax match jsFlowReturn contained / :\s */ contains =jsFlowNoise skipwhite skipempty nextgroup =@jsFlowReturnCluster
14
+ syntax region jsFlowReturnObject contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncBlock
15
+ syntax region jsFlowReturnArray contained matchgroup =jsFlowNoise start =/ \[ / end =/ \] / contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncBlock
16
+ syntax region jsFlowReturnParens contained matchgroup =jsFlowNoise start =/ (/ end =/ )/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncBlock
17
+ syntax match jsFlowReturnKeyword contained / \k\+ / contains =jsFlowType,jsFlowTypeCustom skipwhite skipempty nextgroup =jsFlowReturnGroup,jsFuncBlock
18
+ syntax region jsFlowReturnGroup contained matchgroup =jsFlowNoise start =/ </ end =/ >/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncBlock
19
+
20
+ syntax region jsFlowFunctionGroup contained matchgroup =jsFlowNoise start =/ </ end =/ >/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsFuncArgs
21
+ syntax region jsFlowClassGroup contained matchgroup =jsFlowNoise start =/ </ end =/ >/ contains =@jsFlowCluster skipwhite skipempty nextgroup =jsClassBlock
22
+
23
+ syntax region jsFlowTypeStatement start =/ type/ end =/ =\@ =/ contains =jsFlowTypeOperator oneline skipwhite skipempty nextgroup =jsFlowTypeValue keepend
24
+ syntax region jsFlowTypeValue contained start =/ =/ end =/ [;\n ]/ contains =@jsExpression
25
+ syntax match jsFlowTypeOperator contained / =/
26
+ syntax keyword jsFlowTypeKeyword contained type
27
+
28
+ syntax keyword jsFlowDeclare declare skipwhite skipempty nextgroup =jsFlowTypeStatement,jsClassDefinition,jsStorageClass,jsFlowModule,jsFlowInterface
29
+ syntax match jsFlowClassProperty contained / \< [0-9a-zA-Z_$]*\> :\@ =/ skipwhite skipempty nextgroup =jsFlowDefinition containedin =jsClassBlock
30
+
31
+ syntax region jsFlowModule contained start =/ module/ end =/ {\@ =/ skipempty skipempty nextgroup =jsFlowDeclareBlock contains =jsString
32
+ syntax region jsFlowInterface contained start =/ interface/ end =/ {\@ =/ skipempty skipempty nextgroup =jsFlowInterfaceBlock contains =@jsFlowCluster
33
+ syntax region jsFlowDeclareBlock contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =jsFlowDeclare,jsFlowNoise
34
+
35
+ syntax region jsFlowInterfaceBlock contained matchgroup =jsFlowNoise start =/ {/ end =/ }/ contains =jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsFlowNoise keepend
36
+
37
+ syntax cluster jsFlowReturnCluster contains =jsFlowNoise,jsFlowReturnObject,jsFlowReturnArray,jsFlowReturnKeyword,jsFlowReturnGroup
38
+ syntax cluster jsFlowCluster contains =jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowTypeof,jsFlowType,jsFlowGroup,jsFlowArrow,jsFlowMaybe,jsFlowParens
19
39
20
40
if version >= 508 || ! exists (" did_javascript_syn_inits" )
21
41
if version < 508
@@ -24,19 +44,30 @@ if version >= 508 || !exists("did_javascript_syn_inits")
24
44
else
25
45
command -nargs =+ HiLink hi def link <args>
26
46
endif
27
- HiLink jsFlow PreProc
28
- HiLink jsFlowReturn PreProc
47
+ HiLink jsFlowDefinition PreProc
48
+ HiLink jsFlowType Type
49
+ HiLink jsFlowTypeCustom PreProc
50
+ HiLink jsFlowTypeof PreProc
29
51
HiLink jsFlowArray PreProc
30
- HiLink jsFlowDeclareBlock PreProc
31
52
HiLink jsFlowObject PreProc
32
- HiLink jsFlowParenRegion PreProc
33
- HiLink jsFlowClass PreProc
34
- HiLink jsFlowTypeObject PreProc
35
- HiLink jsFlowTypeKey PreProc
36
- HiLink jsFlowTypeValue PreProc
53
+ HiLink jsFlowParens PreProc
54
+ HiLink jsFlowGroup PreProc
55
+ HiLink jsFlowReturn PreProc
56
+ HiLink jsFlowReturnObject jsFlowReturn
57
+ HiLink jsFlowReturnArray jsFlowArray
58
+ HiLink jsFlowReturnParens jsFlowParens
59
+ HiLink jsFlowReturnGroup jsFlowGroup
60
+ HiLink jsFlowFunctionGroup PreProc
61
+ HiLink jsFlowClassGroup PreProc
62
+ HiLink jsFlowArrow PreProc
63
+ HiLink jsFlowTypeStatement PreProc
64
+ HiLink jsFlowTypeKeyword PreProc
65
+ HiLink jsFlowTypeOperator PreProc
66
+ HiLink jsFlowMaybe PreProc
37
67
HiLink jsFlowClassProperty jsClassProperty
38
- HiLink jsFlowType Type
39
- HiLink jsFlowDeclareKeyword Type
68
+ HiLink jsFlowDeclare PreProc
69
+ HiLink jsFlowModule PreProc
70
+ HiLink jsFlowInterface PreProc
40
71
HiLink jsFlowNoise Noise
41
72
delcommand HiLink
42
73
endif
0 commit comments