@@ -53,7 +53,7 @@ if !exists("javascript_ignore_javaScriptdoc")
5353 " syntax include @javaHtml <sfile>:p:h/html.vim
5454 " unlet b:current_syntax
5555
56- syntax region jsDocComment matchgroup =jsComment start =" /\* \*\s *" end =" \* /" contains =jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
56+ syntax region jsBlockComment matchgroup =jsComment start =" /\*\s *" end =" \* /" contains =jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
5757
5858 " tags containing a param
5959 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
@@ -79,26 +79,26 @@ endif "" JSDoc end
7979syntax case match
8080
8181" " Syntax in the JavaScript code
82- syntax match jsFuncCall / \k\+\% (\s *(\)\@ =/
83- syntax match jsSpecial " \v\\ %(0|\\ x\x\{ 2\}\|\\ u\x\{ 4\}\|\c [A-Z]|.)" contained
84- syntax match jsTemplateVar " \$ {.\{ -}}" contained
85- syntax region jsStringD start =+ "+ skip =+ \\\( "\| $\) + end =+ "\| $+ contains =jsSpecial,@htmlPreproc,@Spell
86- syntax region jsStringS start =+ '+ skip =+ \\\( '\| $\) + end =+ '\| $+ contains =jsSpecial,@htmlPreproc,@Spell
87- syntax region jsTemplateString start =+ `+ skip =+ \\\( `\| $\) + end =+ `\| $+ contains =jsTemplateVar,jsSpecial,@htmlPreproc
88- syntax region jsRegexpCharClass start =+ \[ + skip =+ \\ .+ end =+ \] + contained
82+ syntax match jsFuncCall / \k\+\% (\s *(\)\@ =/
83+ syntax match jsSpecial " \v\\ %(0|\\ x\x\{ 2\}\|\\ u\x\{ 4\}\|\c [A-Z]|.)" contained
84+ syntax match jsTemplateVar " \$ {.\{ -}}" contained
85+ syntax region jsStringD start =+ "+ skip =+ \\\( "\| $\) + end =+ "\| $+ contains =jsSpecial,@htmlPreproc,@Spell
86+ syntax region jsStringS start =+ '+ skip =+ \\\( '\| $\) + end =+ '\| $+ contains =jsSpecial,@htmlPreproc,@Spell
87+ syntax region jsTemplateString start =+ `+ skip =+ \\\( `\| $\) + end =+ `\| $+ contains =jsTemplateVar,jsSpecial,@htmlPreproc
88+ syntax region jsRegexpCharClass start =+ \[ + skip =+ \\ .+ end =+ \] + contained
8989syntax match jsRegexpBoundary " \v %(\< @![\^ $]|\\ [bB])" contained
90- syntax match jsRegexpBackRef " \v\\ [1-9][0-9]*" contained
90+ syntax match jsRegexpBackRef " \v\\ [1-9][0-9]*" contained
9191syntax match jsRegexpQuantifier " \v\\ @<!%([?*+]|\{\d +%(,|,\d +)?})\? ?" contained
92- syntax match jsRegexpOr " \v\< @!\| " contained
93- syntax match jsRegexpMod " \v\( @<=\? [:=!>]" contained
94- syntax cluster jsRegexpSpecial contains =jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
95- syntax region jsRegexpGroup start =" \\\@ <!(" skip =" \\ .\|\[\(\\ .\| [^]]\) *\] " end =" \\\@ <!)" contained contains =jsRegexpCharClass,@jsRegexpSpecial keepend
96- syntax region jsRegexpString start =+ \(\(\( return\| case\)\s\+\)\@ <=\|\(\( [)\] "']\|\d\|\w\)\s *\)\@ <!\) /\(\*\| /\)\@ !+ skip =+ \\ .\|\[\(\\ .\| [^]]\) *\] + end =+ /[gimy]\{ ,4}+ contains =jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend
97- syntax match jsNumber / \< -\=\d\+\( L\| [eE][+-]\=\d\+\)\=\>\|\< 0[xX]\x\+\> /
98- syntax keyword jsNumber Infinity
99- syntax match jsFloat / \< -\=\% (\d\+\.\d\+\|\d\+\.\|\.\d\+\)\% ([eE][+-]\=\d\+\)\=\> /
100- syntax match jsObjectKey / \< [a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s *:\)\@ =/ contains =jsFunctionKey contained
101- syntax match jsFunctionKey / \< [a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s *:\s *function\s *\)\@ =/ contained
92+ syntax match jsRegexpOr " \v\< @!\| " contained
93+ syntax match jsRegexpMod " \v\( @<=\? [:=!>]" contained
94+ syntax cluster jsRegexpSpecial contains =jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
95+ syntax region jsRegexpGroup start =" \\\@ <!(" skip =" \\ .\|\[\(\\ .\| [^]]\) *\] " end =" \\\@ <!)" contained contains =jsRegexpCharClass,@jsRegexpSpecial keepend
96+ syntax region jsRegexpString start =+ \(\(\( return\| case\)\s\+\)\@ <=\|\(\( [)\] "']\|\d\|\w\)\s *\)\@ <!\) /\(\*\| /\)\@ !+ skip =+ \\ .\|\[\(\\ .\| [^]]\) *\] + end =+ /[gimy]\{ ,4}+ contains =jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend
97+ syntax match jsNumber / \< -\=\d\+\( L\| [eE][+-]\=\d\+\)\=\>\|\< 0[xX]\x\+\> /
98+ syntax keyword jsNumber Infinity
99+ syntax match jsFloat / \< -\=\% (\d\+\.\d\+\|\d\+\.\|\.\d\+\)\% ([eE][+-]\=\d\+\)\=\> /
100+ syntax match jsObjectKey / \< [a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s *:\)\@ =/ contains =jsFunctionKey contained
101+ syntax match jsFunctionKey / \< [a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s *:\s *function\s *\)\@ =/ contained
102102
103103syntax match jsAssignmentExpr / \v %([a-zA-Z_$]\k *\. )*[a-zA-Z_$]\k *\s *\= / contains =jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise
104104syntax match jsAssignExpIdent / \v [a-zA-Z_$]\k *\z e%(\s *\= )/ contained
@@ -180,7 +180,7 @@ endif "DOM/HTML/CSS
180180
181181
182182" " Code blocks
183- syntax cluster jsExpression contains =jsComment,jsLineComment,jsDocComment ,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsCommonJS,jsAssignmentExpr
183+ syntax cluster jsExpression contains =jsComment,jsLineComment,jsBlockComment ,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsCommonJS,jsAssignmentExpr
184184syntax cluster jsAll contains =@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException
185185syntax region jsBracket matchgroup =jsBrackets start =" \[ " end =" \] " contains =@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold
186186syntax region jsParen matchgroup =jsParens start =" (" end =" )" contains =@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
@@ -225,7 +225,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
225225 HiLink jsComment Comment
226226 HiLink jsLineComment Comment
227227 HiLink jsEnvComment PreProc
228- HiLink jsDocComment Comment
228+ HiLink jsBlockComment Comment
229229 HiLink jsCommentTodo Todo
230230 HiLink jsCvsTag Function
231231 HiLink jsDocTags Special
@@ -304,10 +304,9 @@ if version >= 508 || !exists("did_javascript_syn_inits")
304304endif
305305
306306" Define the htmlJavaScript for HTML syntax html.vim
307- " syntax clear htmlJavaScript
308- " syntax clear jsExpression
309307syntax cluster htmlJavaScript contains =@jsAll,jsBracket,jsParen,jsBlock
310308syntax cluster javaScriptExpression contains =@jsAll,jsBracket,jsParen,jsBlock,@htmlPreproc
309+
311310" Vim's default html.vim highlights all javascript as 'Special'
312311hi ! def link javaScript NONE
313312
0 commit comments