Improve guard to support concatenated files

This commit is contained in:
Adam Stankiewicz
2019-09-06 15:54:31 +02:00
parent c8897c9c18
commit 48e07bc501
565 changed files with 1137 additions and 2284 deletions

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
"don't add typescriptMembers to nextgroup, let outer scope match it
" so we won't match abstract method outside abstract class
syntax keyword typescriptAbstract abstract
@@ -67,3 +64,4 @@ syntax region typescriptInterfaceTypeArguments matchgroup=typescriptTypeBrackets
\ contained skipwhite
syntax match typescriptInterfaceComma /,/ contained nextgroup=typescriptInterfaceHeritage skipwhite skipnl
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
"Block VariableStatement EmptyStatement ExpressionStatement IfStatement IterationStatement ContinueStatement BreakStatement ReturnStatement WithStatement LabelledStatement SwitchStatement ThrowStatement TryStatement DebuggerStatement
syntax cluster typescriptStatement
\ contains=typescriptBlock,typescriptVariable,
@@ -40,3 +37,4 @@ syntax cluster typescriptValue
\ contains=@typescriptExpression,typescriptObjectLiteral
syntax cluster typescriptEventExpression contains=typescriptArrowFuncDef,typescriptParenExp,@typescriptValue,typescriptRegexpString,@typescriptEventTypes,typescriptOperator,typescriptGlobal,jsxRegion
endif

View File

@@ -1,7 +1,5 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
syntax match typescriptDecorator /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/
\ nextgroup=typescriptArgumentList,typescriptTypeArguments
\ contains=@_semantic,typescriptDotNotation
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
"Syntax coloring for Node.js shebang line
syntax match shellbang "^#!.*node\>"
syntax match shellbang "^#!.*iojs\>"
@@ -85,3 +82,4 @@ if main_syntax == "typescript"
endif
syntax case match
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
syntax keyword typescriptAsyncFuncKeyword async
\ nextgroup=typescriptFuncKeyword,typescriptArrowFuncDef
\ skipwhite
@@ -69,3 +66,4 @@ syntax region typescriptParamImpl matchgroup=typescriptParens
\ contains=typescriptDecorator,@typescriptParameterList,@typescriptComments
\ nextgroup=typescriptReturnAnnotation,typescriptBlock
\ contained skipwhite skipnl
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
syntax cluster afterIdentifier contains=
\ typescriptDotNotation,
\ typescriptFuncCallArg,
@@ -31,3 +28,4 @@ syntax region typescriptParenExp matchgroup=typescriptParens start
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
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
"Import
syntax keyword typescriptImport from as import
syntax keyword typescriptExport export
@@ -93,3 +90,4 @@ syntax cluster typescriptAmbients contains=
\ typescriptAbstract,
\ typescriptEnumKeyword,typescriptEnum,
\ typescriptModule
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
"Syntax in the JavaScript code
" String
@@ -45,3 +42,4 @@ 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
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
syntax keyword typescriptConstructor contained constructor
\ nextgroup=@typescriptCallSignature
\ skipwhite skipempty
@@ -48,3 +45,4 @@ syntax region typescriptComputedMember contained matchgroup=typescriptPropert
\ contains=@typescriptValue,typescriptMember,typescriptMappedIn
\ nextgroup=@memberNextGroup
\ skipwhite skipempty
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
syntax region typescriptObjectLiteral matchgroup=typescriptBraces
\ start=/{/ end=/}/
\ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName
@@ -30,3 +27,4 @@ syntax match typescriptRestOrSpread /\.\.\./ contained
syntax match typescriptObjectSpread /\.\.\./ contained containedin=typescriptObjectLiteral,typescriptArray nextgroup=@typescriptValue
syntax match typescriptObjectColon contained /:/ nextgroup=@typescriptValue skipwhite skipempty
endif

View File

@@ -1,9 +1,7 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
" patch for generated code
syntax keyword typescriptGlobal Promise
\ nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg,typescriptTypeArguments oneline
syntax keyword typescriptGlobal Map WeakMap
\ nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg,typescriptTypeArguments oneline
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
syntax cluster typescriptStrings contains=typescriptProp,typescriptString,typescriptTemplate,@typescriptComments,typescriptDocComment,typescriptRegexpString,typescriptPropertyName
syntax cluster typescriptNoReserved contains=
@@ -33,3 +30,4 @@ syntax keyword typescriptReserved containedin=ALLBUT,@typescriptNoReserved volat
syntax keyword typescriptReserved containedin=ALLBUT,@typescriptNoReserved class
syntax keyword typescriptReserved containedin=ALLBUT,@typescriptNoReserved var
syntax keyword typescriptReserved containedin=ALLBUT,@typescriptNoReserved function
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
" + - ^ ~
syntax match typescriptUnaryOp /[+\-~!]/
\ nextgroup=@typescriptValue
@@ -40,3 +37,4 @@ syntax match typescriptBinaryOp contained /-\(-\|=\)\?/ nextgroup=@typescriptV
syntax match typescriptBinaryOp contained /\*\*=\?/ nextgroup=@typescriptValue
syntax cluster typescriptSymbols contains=typescriptBinaryOp,typescriptKeywordOp,typescriptTernary,typescriptAssign,typescriptCastKeyword
endif

View File

@@ -1,7 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'typescript') != -1
finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
" Types
syntax match typescriptOptionalMark /?/ contained
@@ -189,3 +186,4 @@ syntax region typescriptAliasDeclaration matchgroup=typescriptUnion
syntax keyword typescriptReadonlyArrayKeyword readonly
\ nextgroup=@typescriptPrimaryType
\ skipwhite
endif