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