summaryrefslogtreecommitdiffstats
path: root/runtime/syntax
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-17 15:55:14 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-17 15:55:14 +0100
commit09c6f265b21065ffa9437837b1d0955137175e45 (patch)
tree1db4dee0b77304a32d29fa58b799a64390b3eaf8 /runtime/syntax
parent0324f9ea0aa5a0b983c21199a83e788d5863375d (diff)
Update runtime files.
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/j.vim10
-rw-r--r--runtime/syntax/javascriptreact.vim3
-rw-r--r--runtime/syntax/typescript.vim2045
-rw-r--r--runtime/syntax/typescriptcommon.vim2057
-rw-r--r--runtime/syntax/typescriptreact.vim160
5 files changed, 2230 insertions, 2045 deletions
diff --git a/runtime/syntax/j.vim b/runtime/syntax/j.vim
index 4912942e8b..a694cb2f1a 100644
--- a/runtime/syntax/j.vim
+++ b/runtime/syntax/j.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: J
-" Maintainer: David Bürgin <676c7473@gmail.com>
-" URL: https://github.com/glts/vim-j
-" Last Change: 2015-01-11
+" Maintainer: David Bürgin <dbuergin@gluet.ch>
+" URL: https://gitlab.com/glts/vim-j
+" Last Change: 2019-11-12
if exists('b:current_syntax')
finish
@@ -23,10 +23,10 @@ syntax match jControl /\<\%(for\|goto\|label\)_\a\k*\./
" Standard library names. A few names need to be defined with ":syntax match"
" because they would otherwise take precedence over the corresponding jControl
" and jDefineExpression items.
-syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB dbhelp libjqt
+syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFBE IFIOS IFJA IFJHS IFJNET IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCHAR2 JCHAR4 JCMPX JFL JINT JLIB JPTR JSB JSIZES JSTR JSTR2 JSTR4 JTYPES JVERSION LF LF2 LIBFILE TAB UNAME UNXLIB dbhelp libjqt
syntax keyword jStdlibAdverb define each every fapplylines inv inverse items leaf rows rxapply rxmerge table
syntax keyword jStdlibConjunction bind cuts def on
-syntax keyword jStdlibVerb AND Endian IFDEF OR XOR anddf android_exec_am android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring cleartags clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert compare coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcompare fcompares fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getalpha getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpath jpathsep jsystemdefs launch list ljust load loadd loadtags mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc rxE rxall rxcomp rxcut rxeq rxerror rxfirst rxfree rxfrom rxhandles rxin rxindex rxinfo rxmatch rxmatches rxrplc rxutf8 script scriptd scripts setalpha setbreak shell show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset ta tagcp tagopen tagselect take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep xedit
+syntax keyword jStdlibVerb AND Endian IFDEF OR XOR abspath anddf android_exec_am android_exec_host android_getdisplaymetrics andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert compare coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dbcut dberm dberr dbg dbinto dbjmp dblocals dblxq dblxs dbnxt dbout dbover dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcompare fcompares fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getalpha getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf16 isutf8 jcwdpath joinstring jpath jpathsep jsystemdefs launch list ljust load loadd mema memf memr memu memw nameclass namelist names nc nl pick quote require rjust rplc rxE rxall rxcomp rxcut rxeq rxerror rxfirst rxfree rxfrom rxhandles rxin rxindex rxinfo rxmatch rxmatches rxrplc rxutf8 script scriptd scripts setalpha setbreak shell show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid stderr stdin stdout stringreplace symdat symget symset take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolist tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount undquote unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep xedit
syntax match jStdlibNoun /\<\%(adverb\|conjunction\|dyad\|monad\|noun\|verb\)\>/
syntax match jStdlibVerb /\<\%(Note\|\%(assert\|break\|do\)\.\@!\)\>/
diff --git a/runtime/syntax/javascriptreact.vim b/runtime/syntax/javascriptreact.vim
index fc49691cb0..0067a0b352 100644
--- a/runtime/syntax/javascriptreact.vim
+++ b/runtime/syntax/javascriptreact.vim
@@ -1,2 +1,3 @@
-" Placeholder for backwards compatilibity: .jsx used to stand for JavaScript.
+" Placeholder for backwards compatilibity: .jsx used to be associated with the
+" filetpye JavaScript.
runtime! syntax/javascript.vim
diff --git a/runtime/syntax/typescript.vim b/runtime/syntax/typescript.vim
index bc382610a9..475cb8dae4 100644
--- a/runtime/syntax/typescript.vim
+++ b/runtime/syntax/typescript.vim
@@ -1,10 +1,10 @@
" Vim syntax file
" Language: TypeScript
" Maintainer: Bram Moolenaar
-" Last Change: 2019 Jun 07
+" Last Change: 2019 Nov 17
" Based On: Herrington Darkholme's yats.vim
" Changes: See https:github.com/HerringtonDarkholme/yats.vim
-" Credits: See yats.vim
+" Credits: See yats.vim on github
" This is the same syntax that is in yats.vim, but:
" - flattened into one file
@@ -21,6 +21,7 @@ endif
let s:cpo_save = &cpo
set cpo&vim
+" this region is NOT used in TypeScriptReact
" nextgroup doesn't contain objectLiteral, let outer region contains it
syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets
\ start=/< \@!/ end=/>/
@@ -28,2045 +29,11 @@ syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets
\ nextgroup=@typescriptExpression
\ contained skipwhite oneline
-" runtime syntax/common.vim
-" NOTE: this results in accurate highlighting, but can be slow.
-syntax sync fromstart
+"""""""""""""""""""""""""""""""""""""""""""""""""""
+" Source the part common with typescriptreact.vim
+source <sfile>:h/typescriptcommon.vim
-"Dollar sign is permitted anywhere in an identifier
-setlocal iskeyword-=$
-if main_syntax == 'typescript' || main_syntax == 'typescript.tsx'
- setlocal iskeyword+=$
- " syntax cluster htmlJavaScript contains=TOP
-endif
-
-" lowest priority on least used feature
-syntax match typescriptLabel /[a-zA-Z_$]\k*:/he=e-1 contains=typescriptReserved nextgroup=@typescriptStatement skipwhite skipempty
-
-" other keywords like return,case,yield uses containedin
-syntax region typescriptBlock matchgroup=typescriptBraces start=/{/ end=/}/ contains=@typescriptStatement,@typescriptComments fold
-
-
-"runtime syntax/basic/identifiers.vim
-syntax cluster afterIdentifier contains=
- \ typescriptDotNotation,
- \ typescriptFuncCallArg,
- \ typescriptTemplate,
- \ typescriptIndexExpr,
- \ @typescriptSymbols,
- \ typescriptTypeArguments
-
-syntax match typescriptIdentifierName /\<\K\k*/
- \ nextgroup=@afterIdentifier
- \ transparent
- \ contains=@_semantic
- \ skipnl skipwhite
-
-syntax match typescriptProp contained /\K\k*!\?/
- \ transparent
- \ contains=@props
- \ nextgroup=@afterIdentifier
- \ skipwhite skipempty
-
-syntax region typescriptIndexExpr contained matchgroup=typescriptProperty start=/\[/rs=s+1 end=/]/he=e-1 contains=@typescriptValue nextgroup=@typescriptSymbols,typescriptDotNotation,typescriptFuncCallArg skipwhite skipempty
-
-syntax match typescriptDotNotation /\./ nextgroup=typescriptProp skipnl
-syntax match typescriptDotStyleNotation /\.style\./ nextgroup=typescriptDOMStyle transparent
-" syntax match typescriptFuncCall contained /[a-zA-Z]\k*\ze(/ nextgroup=typescriptFuncCallArg
-syntax region typescriptParenExp matchgroup=typescriptParens start=/(/ end=/)/ contains=@typescriptComments,@typescriptValue,typescriptCastKeyword nextgroup=@typescriptSymbols skipwhite skipempty
-syntax region typescriptFuncCallArg contained matchgroup=typescriptParens start=/(/ end=/)/ contains=@typescriptValue,@typescriptComments nextgroup=@typescriptSymbols,typescriptDotNotation skipwhite skipempty skipnl
-syntax region typescriptEventFuncCallArg contained matchgroup=typescriptParens start=/(/ end=/)/ contains=@typescriptEventExpression
-syntax region typescriptEventString contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ contains=typescriptASCII,@events
-
-"runtime syntax/basic/literal.vim
-"Syntax in the JavaScript code
-
-" String
-syntax match typescriptASCII contained /\\\d\d\d/
-
-syntax region typescriptTemplateSubstitution matchgroup=typescriptTemplateSB
- \ start=/\${/ end=/}/
- \ contains=@typescriptValue
- \ contained
-
-
-syntax region typescriptString
- \ start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ end=+$+
- \ contains=typescriptSpecial,@Spell
- \ extend
-
-syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{4,5}})|c\u|.)"
-
-" From vim runtime
-" <https://github.com/vim/vim/blob/master/runtime/syntax/javascript.vim#L48>
-syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimuy]\{0,5\}\s*$+ end=+/[gimuy]\{0,5\}\s*[;.,)\]}]+me=e-1 nextgroup=typescriptDotNotation oneline
-
-syntax region typescriptTemplate
- \ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
- \ contains=typescriptTemplateSubstitution
- \ nextgroup=@typescriptSymbols
- \ skipwhite skipempty
-
-"Array
-syntax region typescriptArray matchgroup=typescriptBraces
- \ start=/\[/ end=/]/
- \ contains=@typescriptValue,@typescriptComments
- \ nextgroup=@typescriptSymbols,typescriptDotNotation
- \ skipwhite skipempty fold
-
-" Number
-syntax match typescriptNumber /\<0[bB][01][01_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
-syntax match typescriptNumber /\<0[oO][0-7][0-7_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
-syntax match typescriptNumber /\<0[xX][0-9a-fA-F][0-9a-fA-F_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
-syntax match typescriptNumber /\d[0-9_]*\.\d[0-9_]*\|\d[0-9_]*\|\.\d[0-9]*/
- \ nextgroup=typescriptExponent,@typescriptSymbols skipwhite skipempty
-syntax match typescriptExponent /[eE][+-]\=\d[0-9]*\>/
- \ nextgroup=@typescriptSymbols skipwhite skipempty contained
-
-
-" runtime syntax/basic/object.vim
-syntax region typescriptObjectLiteral matchgroup=typescriptBraces
- \ start=/{/ end=/}/
- \ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName
- \ fold contained
-
-syntax match typescriptObjectLabel contained /\k\+\_s*/
- \ nextgroup=typescriptObjectColon,@typescriptCallImpl
- \ skipwhite skipempty
-
-syntax region typescriptStringProperty contained
- \ start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1/
- \ nextgroup=typescriptObjectColon,@typescriptCallImpl
- \ skipwhite skipempty
-
-" syntax region typescriptPropertyName contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1(/me=e-1 nextgroup=@typescriptCallSignature skipwhite skipempty oneline
-syntax region typescriptComputedPropertyName contained matchgroup=typescriptBraces
- \ start=/\[/rs=s+1 end=/]/
- \ contains=@typescriptValue
- \ nextgroup=typescriptObjectColon,@typescriptCallImpl
- \ skipwhite skipempty
-
-" syntax region typescriptComputedPropertyName contained matchgroup=typescriptPropertyName start=/\[/rs=s+1 end=/]\_s*:/he=e-1 contains=@typescriptValue nextgroup=@typescriptValue skipwhite skipempty
-" syntax region typescriptComputedPropertyName contained matchgroup=typescriptPropertyName start=/\[/rs=s+1 end=/]\_s*(/me=e-1 contains=@typescriptValue nextgroup=@typescriptCallSignature skipwhite skipempty
-" Value for object, statement for label statement
-syntax match typescriptRestOrSpread /\.\.\./ contained
-syntax match typescriptObjectSpread /\.\.\./ contained containedin=typescriptObjectLiteral,typescriptArray nextgroup=@typescriptValue
-
-syntax match typescriptObjectColon contained /:/ nextgroup=@typescriptValue skipwhite skipempty
-
-"runtime syntax/basic/symbols.vim
-" + - ^ ~
-syntax match typescriptUnaryOp /[+\-~!]/
- \ nextgroup=@typescriptValue
- \ skipwhite
-
-syntax region typescriptTernary matchgroup=typescriptTernaryOp start=/?/ end=/:/ contained contains=@typescriptValue,@typescriptComments nextgroup=@typescriptValue skipwhite skipempty
-
-syntax match typescriptAssign /=/ nextgroup=@typescriptValue
- \ skipwhite skipempty
-
-" 2: ==, ===
-syntax match typescriptBinaryOp contained /===\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 6: >>>=, >>>, >>=, >>, >=, >
-syntax match typescriptBinaryOp contained />\(>>=\|>>\|>=\|>\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 4: <<=, <<, <=, <
-syntax match typescriptBinaryOp contained /<\(<=\|<\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 3: ||, |=, |
-syntax match typescriptBinaryOp contained /|\(|\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 3: &&, &=, &
-syntax match typescriptBinaryOp contained /&\(&\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 2: *=, *
-syntax match typescriptBinaryOp contained /\*=\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 2: %=, %
-syntax match typescriptBinaryOp contained /%=\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 2: /=, /
-syntax match typescriptBinaryOp contained +/\(=\|[^\*/]\@=\)+ nextgroup=@typescriptValue skipwhite skipempty
-syntax match typescriptBinaryOp contained /!==\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 2: !=, !==
-syntax match typescriptBinaryOp contained /+\(+\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 3: +, ++, +=
-syntax match typescriptBinaryOp contained /-\(-\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
-" 3: -, --, -=
-
-" exponentiation operator
-" 2: **, **=
-syntax match typescriptBinaryOp contained /\*\*=\?/ nextgroup=@typescriptValue
-
-syntax cluster typescriptSymbols contains=typescriptBinaryOp,typescriptKeywordOp,typescriptTernary,typescriptAssign,typescriptCastKeyword
-
-"" runtime syntax/basic/reserved.vim
-
-"runtime syntax/basic/keyword.vim
-"Import
-syntax keyword typescriptImport from as import
-syntax keyword typescriptExport export
-syntax keyword typescriptModule namespace module
-
-"this
-
-"JavaScript Prototype
-syntax keyword typescriptPrototype prototype
- \ nextgroup=@afterIdentifier
-
-syntax keyword typescriptCastKeyword as
- \ nextgroup=@typescriptType
- \ skipwhite
-
-"Program Keywords
-syntax keyword typescriptIdentifier arguments this super
- \ nextgroup=@afterIdentifier
-
-syntax keyword typescriptVariable let var
- \ nextgroup=typescriptVariableDeclaration
- \ skipwhite skipempty skipnl
-
-syntax keyword typescriptVariable const
- \ nextgroup=typescriptEnum,typescriptVariableDeclaration
- \ skipwhite
-
-syntax match typescriptVariableDeclaration /[A-Za-z_$]\k*/
- \ nextgroup=typescriptTypeAnnotation,typescriptAssign
- \ contained skipwhite skipempty skipnl
-
-syntax region typescriptEnum matchgroup=typescriptEnumKeyword start=/enum / end=/\ze{/
- \ nextgroup=typescriptBlock
- \ skipwhite
-
-syntax keyword typescriptKeywordOp
- \ contained in instanceof nextgroup=@typescriptValue
-syntax keyword typescriptOperator delete new typeof void
- \ nextgroup=@typescriptValue
- \ skipwhite skipempty
-
-syntax keyword typescriptForOperator contained in of
-syntax keyword typescriptBoolean true false nextgroup=@typescriptSymbols skipwhite skipempty
-syntax keyword typescriptNull null undefined nextgroup=@typescriptSymbols skipwhite skipempty
-syntax keyword typescriptMessage alert confirm prompt status
- \ nextgroup=typescriptDotNotation,typescriptFuncCallArg
-syntax keyword typescriptGlobal self top parent
- \ nextgroup=@afterIdentifier
-
-"Statement Keywords
-syntax keyword typescriptConditional if else switch
- \ nextgroup=typescriptConditionalParen
- \ skipwhite skipempty skipnl
-syntax keyword typescriptConditionalElse else
-syntax keyword typescriptRepeat do while for nextgroup=typescriptLoopParen skipwhite skipempty
-syntax keyword typescriptRepeat for nextgroup=typescriptLoopParen,typescriptAsyncFor skipwhite skipempty
-syntax keyword typescriptBranch break continue containedin=typescriptBlock
-syntax keyword typescriptCase case nextgroup=@typescriptPrimitive skipwhite containedin=typescriptBlock
-syntax keyword typescriptDefault default containedin=typescriptBlock nextgroup=@typescriptValue,typescriptClassKeyword,typescriptInterfaceKeyword skipwhite oneline
-syntax keyword typescriptStatementKeyword with
-syntax keyword typescriptStatementKeyword yield skipwhite nextgroup=@typescriptValue containedin=typescriptBlock
-syntax keyword typescriptStatementKeyword return skipwhite contained nextgroup=@typescriptValue containedin=typescriptBlock
-
-syntax keyword typescriptTry try
-syntax keyword typescriptExceptions catch throw finally
-syntax keyword typescriptDebugger debugger
-
-syntax keyword typescriptAsyncFor await nextgroup=typescriptLoopParen skipwhite skipempty contained
-
-syntax region typescriptLoopParen contained matchgroup=typescriptParens
- \ start=/(/ end=/)/
- \ contains=typescriptVariable,typescriptForOperator,typescriptEndColons,@typescriptValue,@typescriptComments
- \ nextgroup=typescriptBlock
- \ skipwhite skipempty
-syntax region typescriptConditionalParen contained matchgroup=typescriptParens
- \ start=/(/ end=/)/
- \ contains=@typescriptValue,@typescriptComments
- \ nextgroup=typescriptBlock
- \ skipwhite skipempty
-syntax match typescriptEndColons /[;,]/ contained
-
-syntax keyword typescriptAmbientDeclaration declare nextgroup=@typescriptAmbients
- \ skipwhite skipempty
-
-syntax cluster typescriptAmbients contains=
- \ typescriptVariable,
- \ typescriptFuncKeyword,
- \ typescriptClassKeyword,
- \ typescriptAbstract,
- \ typescriptEnumKeyword,typescriptEnum,
- \ typescriptModule
-
-"runtime syntax/basic/doc.vim
-"Syntax coloring for Node.js shebang line
-syntax match shellbang "^#!.*node\>"
-syntax match shellbang "^#!.*iojs\>"
-
-
-"JavaScript comments
-syntax keyword typescriptCommentTodo TODO FIXME XXX TBD
-syntax match typescriptLineComment "//.*"
- \ contains=@Spell,typescriptCommentTodo,typescriptRef
-syntax region typescriptComment
- \ start="/\*" end="\*/"
- \ contains=@Spell,typescriptCommentTodo extend
-syntax cluster typescriptComments
- \ contains=typescriptDocComment,typescriptComment,typescriptLineComment
-
-syntax match typescriptRef +///\s*<reference\s\+.*\/>$+
- \ contains=typescriptString
-syntax match typescriptRef +///\s*<amd-dependency\s\+.*\/>$+
- \ contains=typescriptString
-syntax match typescriptRef +///\s*<amd-module\s\+.*\/>$+
- \ contains=typescriptString
-
-"JSDoc
-syntax case ignore
-
-syntax region typescriptDocComment matchgroup=typescriptComment
- \ start="/\*\*" end="\*/"
- \ contains=typescriptDocNotation,typescriptCommentTodo,@Spell
- \ fold keepend
-syntax match typescriptDocNotation contained /@/ nextgroup=typescriptDocTags
-
-syntax keyword typescriptDocTags contained constant constructor constructs function ignore inner private public readonly static
-syntax keyword typescriptDocTags contained const dict expose inheritDoc interface nosideeffects override protected struct internal
-syntax keyword typescriptDocTags contained example global
-
-" syntax keyword typescriptDocTags contained ngdoc nextgroup=typescriptDocNGDirective
-syntax keyword typescriptDocTags contained ngdoc scope priority animations
-syntax keyword typescriptDocTags contained ngdoc restrict methodOf propertyOf eventOf eventType nextgroup=typescriptDocParam skipwhite
-syntax keyword typescriptDocNGDirective contained overview service object function method property event directive filter inputType error
-
-syntax keyword typescriptDocTags contained abstract virtual access augments
-
-syntax keyword typescriptDocTags contained arguments callback lends memberOf name type kind link mixes mixin tutorial nextgroup=typescriptDocParam skipwhite
-syntax keyword typescriptDocTags contained variation nextgroup=typescriptDocNumParam skipwhite
-
-syntax keyword typescriptDocTags contained author class classdesc copyright default defaultvalue nextgroup=typescriptDocDesc skipwhite
-syntax keyword typescriptDocTags contained deprecated description external host nextgroup=typescriptDocDesc skipwhite
-syntax keyword typescriptDocTags contained file fileOverview overview namespace requires since version nextgroup=typescriptDocDesc skipwhite
-syntax keyword typescriptDocTags contained summary todo license preserve nextgroup=typescriptDocDesc skipwhite
-
-syntax keyword typescriptDocTags contained borrows exports nextgroup=typescriptDocA skipwhite
-syntax keyword typescriptDocTags contained param arg argument property prop module nextgroup=typescriptDocNamedParamType,typescriptDocParamName skipwhite
-syntax keyword typescriptDocTags contained define enum extends implements this typedef nextgroup=typescriptDocParamType skipwhite
-syntax keyword typescriptDocTags contained return returns throws exception nextgroup=typescriptDocParamType,typescriptDocParamName skipwhite
-syntax keyword typescriptDocTags contained see nextgroup=typescriptDocRef skipwhite
-
-syntax keyword typescriptDocTags contained function func method nextgroup=typescriptDocName skipwhite
-syntax match typescriptDocName contained /\h\w*/
-
-syntax keyword typescriptDocTags contained fires event nextgroup=typescriptDocEventRef skipwhite
-syntax match typescriptDocEventRef contained /\h\w*#\(\h\w*\:\)\?\h\w*/
-
-syntax match typescriptDocNamedParamType contained /{.\+}/ nextgroup=typescriptDocParamName skipwhite
-syntax match typescriptDocParamName contained /\[\?0-9a-zA-Z_\.]\+\]\?/ nextgroup=typescriptDocDesc skipwhite
-syntax match typescriptDocParamType contained /{.\+}/ nextgroup=typescriptDocDesc skipwhite
-syntax match typescriptDocA contained /\%(#\|\w\|\.\|:\|\/\)\+/ nextgroup=typescriptDocAs skipwhite
-syntax match typescriptDocAs contained /\s*as\s*/ nextgroup=typescriptDocB skipwhite
-syntax match typescriptDocB contained /\%(#\|\w\|\.\|:\|\/\)\+/
-syntax match typescriptDocParam contained /\%(#\|\w\|\.\|:\|\/\|-\)\+/
-syntax match typescriptDocNumParam contained /\d\+/
-syntax match typescriptDocRef contained /\%(#\|\w\|\.\|:\|\/\)\+/
-syntax region typescriptDocLinkTag contained matchgroup=typescriptDocLinkTag start=/{/ end=/}/ contains=typescriptDocTags
-
-syntax cluster typescriptDocs contains=typescriptDocParamType,typescriptDocNamedParamType,typescriptDocParam
-
-if main_syntax == "typescript"
- syntax sync clear
- syntax sync ccomment typescriptComment minlines=200
-endif
-
-syntax case match
-
-"runtime syntax/basic/type.vim
-" Types
-syntax match typescriptOptionalMark /?/ contained
-
-syntax region typescriptTypeParameters matchgroup=typescriptTypeBrackets
- \ start=/</ end=/>/
- \ contains=typescriptTypeParameter
- \ contained
-
-syntax match typescriptTypeParameter /\K\k*/
- \ nextgroup=typescriptConstraint,typescriptGenericDefault
- \ contained skipwhite skipnl
-
-syntax keyword typescriptConstraint extends
- \ nextgroup=@typescriptType
- \ contained skipwhite skipnl
-
-syntax match typescriptGenericDefault /=/
- \ nextgroup=@typescriptType
- \ contained skipwhite
-
-"><
-" class A extend B<T> {} // ClassBlock
-" func<T>() // FuncCallArg
-syntax region typescriptTypeArguments matchgroup=typescriptTypeBrackets
- \ start=/\></ end=/>/
- \ contains=@typescriptType
- \ nextgroup=typescriptFuncCallArg,@typescriptTypeOperator
- \ contained skipwhite
-
-
-syntax cluster typescriptType contains=
- \ @typescriptPrimaryType,
- \ typescriptUnion,
- \ @typescriptFunctionType,
- \ typescriptConstructorType
-
-" array type: A[]
-" type indexing A['key']
-syntax region typescriptTypeBracket contained
- \ start=/\[/ end=/\]/
- \ contains=typescriptString,typescriptNumber
- \ nextgroup=@typescriptTypeOperator
- \ skipwhite skipempty
-
-syntax cluster typescriptPrimaryType contains=
- \ typescriptParenthesizedType,
- \ typescriptPredefinedType,
- \ typescriptTypeReference,
- \ typescriptObjectType,
- \ typescriptTupleType,
- \ typescriptTypeQuery,
- \ typescriptStringLiteralType,
- \ typescriptReadonlyArrayKeyword
-
-syntax region typescriptStringLiteralType contained
- \ start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/
- \ nextgroup=typescriptUnion
- \ skipwhite skipempty
-
-syntax region typescriptParenthesizedType matchgroup=typescriptParens
- \ start=/(/ end=/)/
- \ contains=@typescriptType
- \ nextgroup=@typescriptTypeOperator
- \ contained skipwhite skipempty fold
-
-syntax match typescriptTypeReference /\K\k*\(\.\K\k*\)*/
- \ nextgroup=typescriptTypeArguments,@typescriptTypeOperator,typescriptUserDefinedType
- \ skipwhite contained skipempty
-
-syntax keyword typescriptPredefinedType any number boolean string void never undefined null object unknown
- \ nextgroup=@typescriptTypeOperator
- \ contained skipwhite skipempty
-
-syntax match typescriptPredefinedType /unique symbol/
- \ nextgroup=@typescriptTypeOperator
- \ contained skipwhite skipempty
-
-syntax region typescriptObjectType matchgroup=typescriptBraces
- \ start=/{/ end=/}/
- \ contains=@typescriptTypeMember,typescriptEndColons,@typescriptComments,typescriptAccessibilityModifier,typescriptReadonlyModifier
- \ nextgroup=@typescriptTypeOperator
- \ contained skipwhite fold
-
-syntax cluster typescriptTypeMember contains=
- \ @typescriptCallSignature,
- \ typescriptConstructSignature,
- \ typescriptIndexSignature,
- \ @typescriptMembers
-
-syntax region typescriptTupleType matchgroup=typescriptBraces
- \ start=/\[/ end=/\]/
- \ contains=@typescriptType
- \ contained skipwhite oneline
-
-syntax cluster typescriptTypeOperator
- \ contains=typescriptUnion,typescriptTypeBracket
-
-syntax match typescriptUnion /|\|&/ contained nextgroup=@typescriptPrimaryType skipwhite skipempty
-
-syntax cluster typescriptFunctionType contains=typescriptGenericFunc,typescriptFuncType
-syntax region typescriptGenericFunc matchgroup=typescriptTypeBrackets
- \ start=/</ end=/>/
- \ contains=typescriptTypeParameter
- \ nextgroup=typescriptFuncType
- \ containedin=typescriptFunctionType
- \ contained skipwhite skipnl
-
-syntax region typescriptFuncType matchgroup=typescriptParens
- \ start=/(/ end=/)\s*=>/me=e-2
- \ contains=@typescriptParameterList
- \ nextgroup=typescriptFuncTypeArrow
- \ contained skipwhite skipnl oneline
-
-syntax match typescriptFuncTypeArrow /=>/
- \ nextgroup=@typescriptType
- \ containedin=typescriptFuncType
- \ contained skipwhite skipnl
-
-
-syntax keyword typescriptConstructorType new
- \ nextgroup=@typescriptFunctionType
- \ contained skipwhite skipnl
-
-syntax keyword typescriptUserDefinedType is
- \ contained nextgroup=@typescriptType skipwhite skipempty
-
-syntax keyword typescriptTypeQuery typeof keyof
- \ nextgroup=typescriptTypeReference
- \ contained skipwhite skipnl
-
-syntax cluster typescriptCallSignature contains=typescriptGenericCall,typescriptCall
-syntax region typescriptGenericCall matchgroup=typescriptTypeBrackets
- \ start=/</ end=/>/
- \ contains=typescriptTypeParameter
- \ nextgroup=typescriptCall
- \ contained skipwhite skipnl
-syntax region typescriptCall matchgroup=typescriptParens
- \ start=/(/ end=/)/
- \ contains=typescriptDecorator,@typescriptParameterList,@typescriptComments
- \ nextgroup=typescriptTypeAnnotation,typescriptBlock
- \ contained skipwhite skipnl
-
-syntax match typescriptTypeAnnotation /:/
- \ nextgroup=@typescriptType
- \ contained skipwhite skipnl
-
-syntax cluster typescriptParameterList contains=
- \ typescriptTypeAnnotation,
- \ typescriptAccessibilityModifier,
- \ typescriptOptionalMark,
- \ typescriptRestOrSpread,
- \ typescriptFuncComma,
- \ typescriptDefaultParam
-
-syntax match typescriptFuncComma /,/ contained
-
-syntax match typescriptDefaultParam /=/
- \ nextgroup=@typescriptValue
- \ contained skipwhite
-
-syntax keyword typescriptConstructSignature new
- \ nextgroup=@typescriptCallSignature
- \ contained skipwhite
-
-syntax region typescriptIndexSignature matchgroup=typescriptBraces
- \ start=/\[/ end=/\]/
- \ contains=typescriptPredefinedType,typescriptMappedIn,typescriptString
- \ nextgroup=typescriptTypeAnnotation
- \ contained skipwhite oneline
-
-syntax keyword typescriptMappedIn in
- \ nextgroup=@typescriptType
- \ contained skipwhite skipnl skipempty
-
-syntax keyword typescriptAliasKeyword type
- \ nextgroup=typescriptAliasDeclaration
- \ skipwhite skipnl skipempty
-
-syntax region typescriptAliasDeclaration matchgroup=typescriptUnion
- \ start=/ / end=/=/
- \ nextgroup=@typescriptType
- \ contains=typescriptConstraint,typescriptTypeParameters
- \ contained skipwhite skipempty
-
-syntax keyword typescriptReadonlyArrayKeyword readonly
- \ nextgroup=@typescriptPrimaryType
- \ skipwhite
-
-" extension
-if get(g:, 'yats_host_keyword', 1)
- "runtime syntax/yats.vim
- "runtime syntax/yats/typescript.vim
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function Boolean
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Error EvalError
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName InternalError
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName RangeError ReferenceError
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName StopIteration
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName SyntaxError TypeError
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName URIError Date
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Float32Array
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Float64Array
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Int16Array Int32Array
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Int8Array Uint16Array
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Uint32Array Uint8Array
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Uint8ClampedArray
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName ParallelArray
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName ArrayBuffer DataView
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Iterator Generator
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Reflect Proxy
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName arguments
- hi def link typescriptGlobal Structure
- syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName eval uneval nextgroup=typescriptFuncCallArg
- syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName isFinite nextgroup=typescriptFuncCallArg
- syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName isNaN parseFloat nextgroup=typescriptFuncCallArg
- syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName parseInt nextgroup=typescriptFuncCallArg
- syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName decodeURI nextgroup=typescriptFuncCallArg
- syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName decodeURIComponent nextgroup=typescriptFuncCallArg
- syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName encodeURI nextgroup=typescriptFuncCallArg
- syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName encodeURIComponent nextgroup=typescriptFuncCallArg
- syntax cluster props add=typescriptGlobalMethod
- hi def link typescriptGlobalMethod Structure
-
- "runtime syntax/yats/es6-number.vim
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Number nextgroup=typescriptGlobalNumberDot,typescriptFuncCallArg
- syntax match typescriptGlobalNumberDot /\./ contained nextgroup=typescriptNumberStaticProp,typescriptNumberStaticMethod,typescriptProp
- syntax keyword typescriptNumberStaticProp contained EPSILON MAX_SAFE_INTEGER MAX_VALUE
- syntax keyword typescriptNumberStaticProp contained MIN_SAFE_INTEGER MIN_VALUE NEGATIVE_INFINITY
- syntax keyword typescriptNumberStaticProp contained NaN POSITIVE_INFINITY
- hi def link typescriptNumberStaticProp Keyword
- syntax keyword typescriptNumberStaticMethod contained isFinite isInteger isNaN isSafeInteger nextgroup=typescriptFuncCallArg
- syntax keyword typescriptNumberStaticMethod contained parseFloat parseInt nextgroup=typescriptFuncCallArg
- hi def link typescriptNumberStaticMethod Keyword
- syntax keyword typescriptNumberMethod contained toExponential toFixed toLocaleString nextgroup=typescriptFuncCallArg
- syntax keyword typescriptNumberMethod contained toPrecision toSource toString valueOf nextgroup=typescriptFuncCallArg
- syntax cluster props add=typescriptNumberMethod
- hi def link typescriptNumberMethod Keyword
-
- "runtime syntax/yats/es6-string.vim
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName String nextgroup=typescriptGlobalStringDot,typescriptFuncCallArg
- syntax match typescriptGlobalStringDot /\./ contained nextgroup=typescriptStringStaticMethod,typescriptProp
- syntax keyword typescriptStringStaticMethod contained fromCharCode fromCodePoint raw nextgroup=typescriptFuncCallArg
- hi def link typescriptStringStaticMethod Keyword
- syntax keyword typescriptStringMethod contained anchor charAt charCodeAt codePointAt nextgroup=typescriptFuncCallArg
- syntax keyword typescriptStringMethod contained concat endsWith includes indexOf lastIndexOf nextgroup=typescriptFuncCallArg
- syntax keyword typescriptStringMethod contained link localeCompare match normalize nextgroup=typescriptFuncCallArg
- syntax keyword typescriptStringMethod contained padStart padEnd repeat replace search nextgroup=typescriptFuncCallArg
- syntax keyword typescriptStringMethod contained slice split startsWith substr substring nextgroup=typescriptFuncCallArg
- syntax keyword typescriptStringMethod contained toLocaleLowerCase toLocaleUpperCase nextgroup=typescriptFuncCallArg
- syntax keyword typescriptStringMethod contained toLowerCase toString toUpperCase trim nextgroup=typescriptFuncCallArg
- syntax keyword typescriptStringMethod contained valueOf nextgroup=typescriptFuncCallArg
- syntax cluster props add=typescriptStringMethod
- hi def link typescriptStringMethod Keyword
-
- "runtime syntax/yats/es6-array.vim
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Array nextgroup=typescriptGlobalArrayDot,typescriptFuncCallArg
- syntax match typescriptGlobalArrayDot /\./ contained nextgroup=typescriptArrayStaticMethod,typescriptProp
- syntax keyword typescriptArrayStaticMethod contained from isArray of nextgroup=typescriptFuncCallArg
- hi def link typescriptArrayStaticMethod Keyword
- syntax keyword typescriptArrayMethod contained concat copyWithin entries every fill nextgroup=typescriptFuncCallArg
- syntax keyword typescriptArrayMethod contained filter find findIndex forEach indexOf nextgroup=typescriptFuncCallArg
- syntax keyword typescriptArrayMethod contained includes join keys lastIndexOf map nextgroup=typescriptFuncCallArg
- syntax keyword typescriptArrayMethod contained pop push reduce reduceRight reverse nextgroup=typescriptFuncCallArg
- syntax keyword typescriptArrayMethod contained shift slice some sort splice toLocaleString nextgroup=typescriptFuncCallArg
- syntax keyword typescriptArrayMethod contained toSource toString unshift nextgroup=typescriptFuncCallArg
- syntax cluster props add=typescriptArrayMethod
- hi def link typescriptArrayMethod Keyword
-
- "runtime syntax/yats/es6-object.vim
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Object nextgroup=typescriptGlobalObjectDot,typescriptFuncCallArg
- syntax match typescriptGlobalObjectDot /\./ contained nextgroup=typescriptObjectStaticMethod,typescriptProp
- syntax keyword typescriptObjectStaticMethod contained create defineProperties defineProperty nextgroup=typescriptFuncCallArg
- syntax keyword typescriptObjectStaticMethod contained entries freeze getOwnPropertyDescriptors nextgroup=typescriptFuncCallArg
- syntax keyword typescriptObjectStaticMethod contained getOwnPropertyDescriptor getOwnPropertyNames nextgroup=typescriptFuncCallArg
- syntax keyword typescriptObjectStaticMethod contained getOwnPropertySymbols getPrototypeOf nextgroup=typescriptFuncCallArg
- syntax keyword typescriptObjectStaticMethod contained is isExtensible isFrozen isSealed nextgroup=typescriptFuncCallArg
- syntax keyword typescriptObjectStaticMethod contained keys preventExtensions values nextgroup=typescriptFuncCallArg
- hi def link typescriptObjectStaticMethod Keyword
- syntax keyword typescriptObjectMethod contained getOwnPropertyDescriptors hasOwnProperty nextgroup=typescriptFuncCallArg
- syntax keyword typescriptObjectMethod contained isPrototypeOf propertyIsEnumerable nextgroup=typescriptFuncCallArg
- syntax keyword typescriptObjectMethod contained toLocaleString toString valueOf seal nextgroup=typescriptFuncCallArg
- syntax keyword typescriptObjectMethod contained setPrototypeOf nextgroup=typescriptFuncCallArg
- syntax cluster props add=typescriptObjectMethod
- hi def link typescriptObjectMethod Keyword
-
- "runtime syntax/yats/es6-symbol.vim
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Symbol nextgroup=typescriptGlobalSymbolDot,typescriptFuncCallArg
- syntax match typescriptGlobalSymbolDot /\./ contained nextgroup=typescriptSymbolStaticProp,typescriptSymbolStaticMethod,typescriptProp
- syntax keyword typescriptSymbolStaticProp contained length iterator match replace
- syntax keyword typescriptSymbolStaticProp contained search split hasInstance isConcatSpreadable
- syntax keyword typescriptSymbolStaticProp contained unscopables species toPrimitive
- syntax keyword typescriptSymbolStaticProp contained toStringTag
- hi def link typescriptSymbolStaticProp Keyword
- syntax keyword typescriptSymbolStaticMethod contained for keyFor nextgroup=typescriptFuncCallArg
- hi def link typescriptSymbolStaticMethod Keyword
-
- "runtime syntax/yats/es6-function.vim
- syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function
- syntax keyword typescriptFunctionMethod con