Improve guard so it works for no eof new line

This commit is contained in:
Adam Stankiewicz
2019-09-12 14:33:21 +02:00
parent 26790941f6
commit 4f3df59be7
563 changed files with 1131 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
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
@@ -64,4 +65,5 @@ syntax region typescriptInterfaceTypeArguments matchgroup=typescriptTypeBrackets
\ contained skipwhite
syntax match typescriptInterfaceComma /,/ contained nextgroup=typescriptInterfaceHeritage skipwhite skipnl
endif

View File

@@ -1,4 +1,5 @@
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,
@@ -37,4 +38,5 @@ syntax cluster typescriptValue
\ contains=@typescriptExpression,typescriptObjectLiteral
syntax cluster typescriptEventExpression contains=typescriptArrowFuncDef,typescriptParenExp,@typescriptValue,typescriptRegexpString,@typescriptEventTypes,typescriptOperator,typescriptGlobal,jsxRegion
endif

View File

@@ -1,5 +1,7 @@
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,4 +1,5 @@
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\>"
@@ -82,4 +83,5 @@ if main_syntax == "typescript"
endif
syntax case match
endif

View File

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

View File

@@ -1,4 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
syntax cluster afterIdentifier contains=
\ typescriptDotNotation,
\ typescriptFuncCallArg,
@@ -28,4 +29,5 @@ 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,4 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
"Import
syntax keyword typescriptImport from as import
syntax keyword typescriptExport export
@@ -90,4 +91,5 @@ syntax cluster typescriptAmbients contains=
\ typescriptAbstract,
\ typescriptEnumKeyword,typescriptEnum,
\ typescriptModule
endif

View File

@@ -1,4 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
"Syntax in the JavaScript code
" String
@@ -42,4 +43,5 @@ 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,4 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
syntax keyword typescriptConstructor contained constructor
\ nextgroup=@typescriptCallSignature
\ skipwhite skipempty
@@ -45,4 +46,5 @@ syntax region typescriptComputedMember contained matchgroup=typescriptPropert
\ contains=@typescriptValue,typescriptMember,typescriptMappedIn
\ nextgroup=@memberNextGroup
\ skipwhite skipempty
endif

View File

@@ -1,4 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
syntax region typescriptObjectLiteral matchgroup=typescriptBraces
\ start=/{/ end=/}/
\ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName
@@ -27,4 +28,5 @@ 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,7 +1,9 @@
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,4 +1,5 @@
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=
@@ -30,4 +31,5 @@ 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,4 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
" + - ^ ~
syntax match typescriptUnaryOp /[+\-~!]/
\ nextgroup=@typescriptValue
@@ -37,4 +38,5 @@ 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,4 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
" Types
syntax match typescriptOptionalMark /?/ contained
@@ -186,4 +187,5 @@ syntax region typescriptAliasDeclaration matchgroup=typescriptUnion
syntax keyword typescriptReadonlyArrayKeyword readonly
\ nextgroup=@typescriptPrimaryType
\ skipwhite
endif