Skip to content

Commit 5d204c9

Browse files
committed
Add syntax support for ES6 generators
1 parent 7f5c2d8 commit 5d204c9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

syntax/javascript.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ if main_syntax == "javascript"
194194
syntax sync match jsHighlight grouphere jsBlock /{/
195195
endif
196196

197-
exe 'syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
197+
exe 'syntax match jsFunction /\<function\>/ nextgroup=jsGenerator,jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
198198

199+
syntax match jsGenerator contained '\*' nextgroup=jsFuncName skipwhite
199200
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite
200201
syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest nextgroup=jsFuncBlock keepend skipwhite skipempty
201202
syntax match jsFuncArgCommas contained ','
@@ -250,6 +251,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
250251
HiLink jsKeyword Keyword
251252
HiLink jsArrowFunction Type
252253
HiLink jsFunction Type
254+
HiLink jsGenerator jsFunction
253255
HiLink jsFuncName Function
254256
HiLink jsArgsObj Special
255257
HiLink jsError Error

0 commit comments

Comments
 (0)