Skip to content

Commit 53b5082

Browse files
committed
Merge pull request pangloss#144 from pangloss/feature/arrow-function
Adds es6 support for arrow function syntax
2 parents 776b7bc + 3882ae3 commit 53b5082

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

syntax/javascript.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ endif "DOM/HTML/CSS
181181

182182

183183
"" Code blocks
184-
syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise
184+
syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,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
185185
syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException
186186
syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold
187187
syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
@@ -212,6 +212,8 @@ syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=
212212
syntax match jsFuncArgCommas contained ','
213213
syntax keyword jsArgsObj arguments contained containedin=jsFuncBlock
214214

215+
syntax match jsArrowFunction /=>/
216+
215217
" Define the default highlighting.
216218
" For version 5.7 and earlier: only when not done already
217219
" For version 5.8 and later: only when an item doesn't have highlighting yet
@@ -254,6 +256,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
254256
HiLink jsStatement Statement
255257
HiLink jsException Exception
256258
HiLink jsKeyword Keyword
259+
HiLink jsArrowFunction Type
257260
HiLink jsFunction Type
258261
HiLink jsFuncName Function
259262
HiLink jsArgsObj Special

0 commit comments

Comments
 (0)