]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
Keywords 'of' and 'yield' for Javascript. (#7873)
authorYuri Klimov <yuri@klimov.net>
Thu, 17 Aug 2023 22:03:23 +0000 (01:03 +0300)
committerGitHub <noreply@github.com>
Thu, 17 Aug 2023 22:03:23 +0000 (00:03 +0200)
* Keyword 'of' in for...of statement.

* Keyword 'yield' for generator function.

runtime/syntax/javascript.vim

index e513137984ee7791e462418069785e4e8a20d80c..cb2d16e2a772976f5a756def737b84896a087de9 100644 (file)
@@ -52,11 +52,11 @@ syn match   javaScriptNumber           "\<\d\+\(_\d\+\)*\.\(\d\+\(_\d\+\)*\([eE]
 syn region  javaScriptRegexpString     start=+[,(=+]\s*/[^/*]+ms=e-1,me=e-1 skip=+\\\\\|\\/+ end=+/[gimuys]\{0,2\}\s*$+ end=+/[gimuys]\{0,2\}\s*[+;.,)\]}]+me=e-1 end=+/[gimuys]\{0,2\}\s\+\/+me=e-1 contains=@htmlPreproc,javaScriptComment oneline
 
 syn keyword javaScriptConditional      if else switch
-syn keyword javaScriptRepeat           while for do in
+syn keyword javaScriptRepeat           while for do in of
 syn keyword javaScriptBranch           break continue
 syn keyword javaScriptOperator         new delete instanceof typeof
 syn keyword javaScriptType             Array Boolean Date Function Number Object String RegExp
-syn keyword javaScriptStatement                return with await
+syn keyword javaScriptStatement                return with await yield
 syn keyword javaScriptBoolean          true false
 syn keyword javaScriptNull             null undefined
 syn keyword javaScriptIdentifier       arguments this var let