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