1" Vim syntax file
2" Language:     TypeScript
3" Maintainer:   Bram Moolenaar
4" Last Change:	2019 Nov 17
5" Based On:     Herrington Darkholme's yats.vim
6" Changes:      See https:github.com/HerringtonDarkholme/yats.vim
7" Credits:      See yats.vim on github
8
9" This is the same syntax that is in yats.vim, but:
10" - flattened into one file
11" - HiLink commands changed to "hi def link"
12" - Setting 'cpo' to the Vim value
13
14if !exists("main_syntax")
15  if exists("b:current_syntax")
16    finish
17  endif
18  let main_syntax = 'typescript'
19endif
20
21let s:cpo_save = &cpo
22set cpo&vim
23
24" this region is NOT used in TypeScriptReact
25" nextgroup doesn't contain objectLiteral, let outer region contains it
26syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets
27  \ start=/< \@!/ end=/>/
28  \ contains=@typescriptType
29  \ nextgroup=@typescriptExpression
30  \ contained skipwhite oneline
31
32
33"""""""""""""""""""""""""""""""""""""""""""""""""""
34" Source the part common with typescriptreact.vim
35source <sfile>:h/typescriptcommon.vim
36
37
38let b:current_syntax = "typescript"
39if main_syntax == 'typescript'
40  unlet main_syntax
41endif
42
43let &cpo = s:cpo_save
44unlet s:cpo_save
45