@@ -65,7 +65,7 @@ if !exists("javascript_ignore_javaScriptdoc")
65
65
" tags containing a param
66
66
syntax match jsDocTags contained " @\( alias\| api\| augments\| borrows\| class\| constructs\| default\| defaultvalue\| emits\| exception\| exports\| extends\| file\| fires\| kind\| listens\| member\| member[oO]f\| mixes\| module\| name\| namespace\| requires\| template\| throws\| var\| variation\| version\)\> " nextgroup =jsDocParam skipwhite
67
67
" tags containing type and param
68
- syntax match jsDocTags contained " @\( arg\| argument\| param\| property\)\> " nextgroup =jsDocType skipwhite
68
+ syntax match jsDocTags contained " @\( arg\| argument\| param\| property\| prop \ )\>" nextgroup =jsDocType skipwhite
69
69
" tags containing type but no param
70
70
syntax match jsDocTags contained " @\( callback\| define\| enum\| external\| implements\| this\| type\| typedef\| return\| returns\)\> " nextgroup =jsDocTypeNoParam skipwhite
71
71
" tags containing references
@@ -77,7 +77,7 @@ if !exists("javascript_ignore_javaScriptdoc")
77
77
syntax match jsDocType contained " \% (#\|\"\|\w\|\.\| :\|\/\)\+ " nextgroup =jsDocParam skipwhite
78
78
syntax region jsDocTypeNoParam start =" {" end =" }" oneline contained
79
79
syntax match jsDocTypeNoParam contained " \% (#\|\"\|\w\|\.\| :\|\/\)\+ "
80
- syntax match jsDocParam contained " \% (#\|\"\| {\| }\|\w\|\.\| :\|\/\|\[\| ]\| =\)\+ "
80
+ syntax match jsDocParam contained " \% (#\|\$\|\ "\| {\| }\|\w\|\.\| :\|\/\|\[\| ]\| =\)\+ "
81
81
syntax region jsDocSeeTag contained matchgroup =jsDocSeeTag start =" {" end =" }" contains =jsDocTags
82
82
83
83
syntax case match
@@ -88,7 +88,7 @@ syntax case match
88
88
" " Syntax in the JavaScript code
89
89
syntax match jsFuncCall / \k\+\% (\s *(\)\@ =/
90
90
syntax match jsSpecial " \v\\ %(0|\\ x\x\{ 2\}\|\\ u\x\{ 4\}\|\c [A-Z]|.)" contained
91
- syntax match jsTemplateVar " \$ {. \{ -}} " contained
91
+ syntax region jsTemplateVar matchgroup = jsBraces start = + ${ + end = + } + contained contains = @jsExpression
92
92
syntax region jsStringD start =+ "+ skip =+ \\\( "\| $\) + end =+ "\| $+ contains =jsSpecial,@htmlPreproc,@Spell
93
93
syntax region jsStringS start =+ '+ skip =+ \\\( '\| $\) + end =+ '\| $+ contains =jsSpecial,@htmlPreproc,@Spell
94
94
syntax region jsTemplateString start =+ `+ skip =+ \\\( `\| $\) + end =+ `+ contains =jsTemplateVar,jsSpecial,@htmlPreproc
@@ -110,7 +110,7 @@ syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function
110
110
syntax match jsDecorator " @" display contains =jsDecoratorFunction nextgroup =jsDecoratorFunction skipwhite
111
111
syntax match jsDecoratorFunction " [a-zA-Z_][a-zA-Z0-9_.]*" display contained nextgroup =jsFunc skipwhite
112
112
113
- syntax match jsAssignmentExpr / \v %([a-zA-Z_$]\k *\. )*[a-zA-Z_$]\k *\s *\=\( > \)\ @ !/ contains =jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise,jsArgsObj
113
+ syntax match jsAssignmentExpr / \v %([a-zA-Z_$]\k *\. )*[a-zA-Z_$]\k *\s *\=\> @!/ contains =jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise,jsArgsObj
114
114
syntax match jsAssignExpIdent / \v [a-zA-Z_$]\k *\z e%(\s *\= )/ contained
115
115
syntax match jsFuncAssignExpr / \v %(%([a-zA-Z_$]\k *\. )*[a-zA-Z_$]\k *\s *\=\s *){-1,}\z e%(function\s *\* ?\s *\( )/ contains =jsFuncAssignObjChain,jsFuncAssignIdent,jsFunction,jsPrototype,jsOperator,jsThis,jsArgsObj contained
116
116
syntax match jsFuncAssignObjChain / \v %([a-zA-Z_$]\k *\. )+/ contains =jsPrototype,jsNoise contained
@@ -135,7 +135,7 @@ syntax keyword jsClass extends class
135
135
syntax keyword jsException try catch throw finally
136
136
syntax keyword jsAsyncKeyword async await
137
137
138
- syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window
138
+ syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window
139
139
syntax match jsGlobalObjects / \% (Intl\.\)\@ <=\( Collator\| DateTimeFormat\| NumberFormat\) /
140
140
141
141
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
@@ -166,7 +166,7 @@ if exists("javascript_enable_domhtmlcss")
166
166
167
167
" DOM2 things
168
168
syntax match jsDomElemAttrs contained / \% (nodeName\| nodeValue\| nodeType\| parentNode\| childNodes\| firstChild\| lastChild\| previousSibling\| nextSibling\| attributes\| ownerDocument\| namespaceURI\| prefix\| localName\| tagName\)\> /
169
- syntax match jsDomElemFuncs contained / \% (insertBefore\| replaceChild\| removeChild\| appendChild\| hasChildNodes\| cloneNode\| normalize\| isSupported\| hasAttributes\| getAttribute\| setAttribute\| removeAttribute\| getAttributeNode\| setAttributeNode\| removeAttributeNode\| getElementsByTagName\| getAttributeNS\| setAttributeNS\| removeAttributeNS\| getAttributeNodeNS\| setAttributeNodeNS\| getElementsByTagNameNS\| hasAttribute\| hasAttributeNS\)\> / nextgroup =jsParen skipwhite
169
+ syntax match jsDomElemFuncs contained / \% (insertBefore\| replaceChild\| removeChild\| appendChild\| hasChildNodes\| cloneNode\| normalize\| isSupported\| hasAttributes\| getAttribute\| setAttribute\| removeAttribute\| getAttributeNode\| setAttributeNode\| removeAttributeNode\| getElementById \| getElementsByClassName \| getElementsByTagName\| querySelector \| querySelectorAll \| getAttributeNS\| setAttributeNS\| removeAttributeNS\| getAttributeNodeNS\| setAttributeNodeNS\| getElementsByTagNameNS\| hasAttribute\| hasAttributeNS\)\> / nextgroup =jsParen skipwhite
170
170
" HTML things
171
171
syntax match jsHtmlElemAttrs contained / \% (className\| clientHeight\| clientLeft\| clientTop\| clientWidth\| dir\| id\| innerHTML\| lang\| length\| offsetHeight\| offsetLeft\| offsetParent\| offsetTop\| offsetWidth\| scrollHeight\| scrollLeft\| scrollTop\| scrollWidth\| style\| tabIndex\| title\)\> /
172
172
syntax match jsHtmlElemFuncs contained / \% (blur\| click\| focus\| scrollIntoView\| addEventListener\| dispatchEvent\| removeEventListener\| item\)\> / nextgroup =jsParen skipwhite
@@ -217,11 +217,11 @@ exe 'syntax match jsFunction /\<function\>/ nextgroup=jsGenerator,jsFuncName,jsF
217
217
218
218
syntax match jsGenerator contained ' \* ' nextgroup =jsFuncName skipwhite
219
219
syntax match jsFuncName contained / \< [a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup =jsFuncArgs skipwhite
220
- syntax region jsFuncArgs contained matchgroup =jsFuncParens start =' (' end =' )' contains =jsFuncArgCommas,jsFuncArgRest,jsAssignmentExpr nextgroup =jsFuncBlock keepend skipwhite skipempty
220
+ syntax region jsFuncArgs contained matchgroup =jsFuncParens start =' (' end =' )' contains =jsFuncArgCommas,jsFuncArgRest,jsAssignmentExpr,jsComment,jsLineComment nextgroup =jsFuncBlock keepend skipwhite skipempty
221
221
syntax match jsFuncArgCommas contained ' ,'
222
222
syntax match jsFuncArgRest contained / \% (\.\.\. [a-zA-Z_$][0-9a-zA-Z_$]*\) )/
223
223
224
- syntax match jsArrowFunction / =>/
224
+ exe ' syntax match jsArrowFunction /=>/ ' .( exists ( ' g:javascript_conceal_arrow_function ' ) ? ' conceal cchar= ' . g: javascript_conceal_arrow_function : ' ' )
225
225
226
226
" Define the default highlighting.
227
227
" For version 5.7 and earlier: only when not done already
0 commit comments