mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 02:17:09 +10:00
vim-patch:86b4816766d9 (#21314)
Update runtime files86b4816766vim-patch:9.0.1029: autoload directory missing from distribution Problem: Autoload directory missing from distribution. Solution: Add the autoload/zig directory to the list of distributed files.84dbf855fbCo-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Nick Jensen <nickspoon@gmail.com>
|
||||
" Former Maintainers: Anduin Withers <awithers@anduin.com>
|
||||
" Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: 2022-03-01
|
||||
" Last Change: 2022-11-16
|
||||
" Filenames: *.cs
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/nickspoons/vim-cs
|
||||
@@ -25,6 +25,9 @@ syn keyword csType bool byte char decimal double float int long object sbyte sho
|
||||
syn keyword csType nint nuint " contextual
|
||||
|
||||
syn keyword csStorage enum interface namespace struct
|
||||
syn match csStorage "\<record\ze\_s\+@\=\h\w*\_s*[<(:{;]"
|
||||
syn match csStorage "\%(\<\%(partial\|new\|public\|protected\|internal\|private\|abstract\|sealed\|static\|unsafe\|readonly\)\)\@9<=\_s\+record\>"
|
||||
syn match csStorage "\<record\ze\_s\+\%(class\|struct\)"
|
||||
syn match csStorage "\<delegate\>"
|
||||
syn keyword csRepeat break continue do for foreach goto return while
|
||||
syn keyword csConditional else if switch
|
||||
@@ -44,6 +47,9 @@ syn keyword csManagedModifier managed unmanaged contained
|
||||
" Modifiers
|
||||
syn match csUsingModifier "\<global\ze\_s\+using\>"
|
||||
syn keyword csAccessModifier internal private protected public
|
||||
syn keyword csModifier operator nextgroup=csCheckedModifier skipwhite skipempty
|
||||
syn keyword csCheckedModifier checked contained
|
||||
|
||||
" TODO: in new out
|
||||
syn keyword csModifier abstract const event override readonly sealed static virtual volatile
|
||||
syn match csModifier "\<\%(extern\|fixed\|unsafe\)\>"
|
||||
@@ -76,7 +82,7 @@ syn match csAccess "\<this\>"
|
||||
" Extension method parameter modifier
|
||||
syn match csModifier "\<this\ze\_s\+@\=\h"
|
||||
|
||||
syn keyword csUnspecifiedStatement as in is nameof operator out params ref sizeof stackalloc using
|
||||
syn keyword csUnspecifiedStatement as in is nameof out params ref sizeof stackalloc using
|
||||
syn keyword csUnsupportedStatement value
|
||||
syn keyword csUnspecifiedKeyword explicit implicit
|
||||
|
||||
@@ -183,7 +189,7 @@ syn match csUnicodeNumber +\\u\x\{4}+ contained contains=csUnicodeSpecifier disp
|
||||
syn match csUnicodeNumber +\\U00\x\{6}+ contained contains=csUnicodeSpecifier display
|
||||
syn match csUnicodeSpecifier +\\[uUx]+ contained display
|
||||
|
||||
syn region csString matchgroup=csQuote start=+"+ end=+"+ end=+$+ extend contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell
|
||||
syn region csString matchgroup=csQuote start=+"+ end=+"\%(u8\)\=+ end=+$+ extend contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell
|
||||
syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError,csUnicodeNumber display
|
||||
syn match csCharacter "'\\''" contains=csSpecialChar display
|
||||
syn match csCharacter "'[^\\]'" display
|
||||
@@ -200,7 +206,7 @@ syn match csReal "\<\d\+\%(_\+\d\+\)*[fdm]\>" display
|
||||
syn case match
|
||||
syn cluster csNumber contains=csInteger,csReal
|
||||
|
||||
syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell
|
||||
syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"\%(u8\)\=+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell
|
||||
|
||||
syn region csInterpolation matchgroup=csInterpolationDelimiter start=+{+ end=+}+ keepend contained contains=@csAll,csBraced,csBracketed,csInterpolationAlign,csInterpolationFormat
|
||||
syn match csEscapedInterpolation "{{" transparent contains=NONE display
|
||||
@@ -210,10 +216,10 @@ syn match csInterpolationFormat +:[^}]\+}+ contained contains=csInterpolationFor
|
||||
syn match csInterpolationAlignDel +,+ contained display
|
||||
syn match csInterpolationFormatDel +:+ contained display
|
||||
|
||||
syn region csVerbatimString matchgroup=csQuote start=+@"+ end=+"+ skip=+""+ extend contains=csVerbatimQuote,@Spell
|
||||
syn region csVerbatimString matchgroup=csQuote start=+@"+ end=+"\%(u8\)\=+ skip=+""+ extend contains=csVerbatimQuote,@Spell
|
||||
syn match csVerbatimQuote +""+ contained
|
||||
|
||||
syn region csInterVerbString matchgroup=csQuote start=+$@"+ start=+@$"+ end=+"+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell
|
||||
syn region csInterVerbString matchgroup=csQuote start=+$@"+ start=+@$"+ end=+"\%(u8\)\=+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell
|
||||
|
||||
syn cluster csString contains=csString,csInterpolatedString,csVerbatimString,csInterVerbString
|
||||
|
||||
@@ -256,6 +262,7 @@ hi def link csException Exception
|
||||
hi def link csModifier StorageClass
|
||||
hi def link csAccessModifier csModifier
|
||||
hi def link csAsyncModifier csModifier
|
||||
hi def link csCheckedModifier csModifier
|
||||
hi def link csManagedModifier csModifier
|
||||
hi def link csUsingModifier csModifier
|
||||
|
||||
|
||||
210
runtime/syntax/nix.vim
Normal file
210
runtime/syntax/nix.vim
Normal file
@@ -0,0 +1,210 @@
|
||||
" Vim syntax file
|
||||
" Language: Nix
|
||||
" Maintainer: James Fleming <james@electronic-quill.net>
|
||||
" Original Author: Daiderd Jordan <daiderd@gmail.com>
|
||||
" Acknowledgement: Based on vim-nix maintained by Daiderd Jordan <daiderd@gmail.com>
|
||||
" https://github.com/LnL7/vim-nix
|
||||
" License: MIT
|
||||
" Last Change: 2022 Dec 06
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn keyword nixBoolean true false
|
||||
syn keyword nixNull null
|
||||
syn keyword nixRecKeyword rec
|
||||
|
||||
syn keyword nixOperator or
|
||||
syn match nixOperator '!=\|!'
|
||||
syn match nixOperator '<=\?'
|
||||
syn match nixOperator '>=\?'
|
||||
syn match nixOperator '&&'
|
||||
syn match nixOperator '//\='
|
||||
syn match nixOperator '=='
|
||||
syn match nixOperator '?'
|
||||
syn match nixOperator '||'
|
||||
syn match nixOperator '++\='
|
||||
syn match nixOperator '-'
|
||||
syn match nixOperator '\*'
|
||||
syn match nixOperator '->'
|
||||
|
||||
syn match nixParen '[()]'
|
||||
syn match nixInteger '\d\+'
|
||||
|
||||
syn keyword nixTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
||||
syn match nixComment '#.*' contains=nixTodo,@Spell
|
||||
syn region nixComment start=+/\*+ end=+\*/+ contains=nixTodo,@Spell
|
||||
|
||||
syn region nixInterpolation matchgroup=nixInterpolationDelimiter start="\${" end="}" contained contains=@nixExpr,nixInterpolationParam
|
||||
|
||||
syn match nixSimpleStringSpecial /\\\%([nrt"\\$]\|$\)/ contained
|
||||
syn match nixStringSpecial /''['$]/ contained
|
||||
syn match nixStringSpecial /\$\$/ contained
|
||||
syn match nixStringSpecial /''\\[nrt]/ contained
|
||||
|
||||
syn match nixSimpleStringSpecial /\$\$/ contained
|
||||
|
||||
syn match nixInvalidSimpleStringEscape /\\[^nrt"\\$]/ contained
|
||||
syn match nixInvalidStringEscape /''\\[^nrt]/ contained
|
||||
|
||||
syn region nixSimpleString matchgroup=nixStringDelimiter start=+"+ skip=+\\"+ end=+"+ contains=nixInterpolation,nixSimpleStringSpecial,nixInvalidSimpleStringEscape
|
||||
syn region nixString matchgroup=nixStringDelimiter start=+''+ skip=+''['$\\]+ end=+''+ contains=nixInterpolation,nixStringSpecial,nixInvalidStringEscape
|
||||
|
||||
syn match nixFunctionCall "[a-zA-Z_][a-zA-Z0-9_'-]*"
|
||||
|
||||
syn match nixPath "[a-zA-Z0-9._+-]*\%(/[a-zA-Z0-9._+-]\+\)\+"
|
||||
syn match nixHomePath "\~\%(/[a-zA-Z0-9._+-]\+\)\+"
|
||||
syn match nixSearchPath "[a-zA-Z0-9._+-]\+\%(\/[a-zA-Z0-9._+-]\+\)*" contained
|
||||
syn match nixPathDelimiter "[<>]" contained
|
||||
syn match nixSearchPathRef "<[a-zA-Z0-9._+-]\+\%(\/[a-zA-Z0-9._+-]\+\)*>" contains=nixSearchPath,nixPathDelimiter
|
||||
syn match nixURI "[a-zA-Z][a-zA-Z0-9.+-]*:[a-zA-Z0-9%/?:@&=$,_.!~*'+-]\+"
|
||||
|
||||
syn match nixAttributeDot "\." contained
|
||||
syn match nixAttribute "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%([^a-zA-Z0-9_'.-]\|$\)" contained
|
||||
syn region nixAttributeAssignment start="=" end="\ze;" contained contains=@nixExpr
|
||||
syn region nixAttributeDefinition start=/\ze[a-zA-Z_"$]/ end=";" contained contains=nixComment,nixAttribute,nixInterpolation,nixSimpleString,nixAttributeDot,nixAttributeAssignment
|
||||
|
||||
syn region nixInheritAttributeScope start="(" end="\ze)" contained contains=@nixExpr
|
||||
syn region nixAttributeDefinition matchgroup=nixInherit start="\<inherit\>" end=";" contained contains=nixComment,nixInheritAttributeScope,nixAttribute
|
||||
|
||||
syn region nixAttributeSet start="{" end="}" contains=nixComment,nixAttributeDefinition
|
||||
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn region nixArgumentDefinitionWithDefault matchgroup=nixArgumentDefinition start="[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*?\@=" matchgroup=NONE end="[,}]\@=" transparent contained contains=@nixExpr
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn match nixArgumentDefinition "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[,}]\@=" contained
|
||||
syn match nixArgumentEllipsis "\.\.\." contained
|
||||
syn match nixArgumentSeparator "," contained
|
||||
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn match nixArgOperator '@\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[a-zA-Z_][a-zA-Z0-9_'-]*\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:'he=s+1 contained contains=nixAttribute
|
||||
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn match nixArgOperator '[a-zA-Z_][a-zA-Z0-9_'-]*\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*@'hs=e-1 contains=nixAttribute nextgroup=nixFunctionArgument
|
||||
|
||||
" This is a bit more complicated, because function arguments can be passed in a
|
||||
" very similar form on how attribute sets are defined and two regions with the
|
||||
" same start patterns will shadow each other. Instead of a region we could use a
|
||||
" match on {\_.\{-\}}, which unfortunately doesn't take nesting into account.
|
||||
"
|
||||
" So what we do instead is that we look forward until we are sure that it's a
|
||||
" function argument. Unfortunately, we need to catch comments and both vertical
|
||||
" and horizontal white space, which the following regex should hopefully do:
|
||||
"
|
||||
" "\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*"
|
||||
"
|
||||
" It is also used throught the whole file and is marked with 'v's as well.
|
||||
"
|
||||
" Fortunately the matching rules for function arguments are much simpler than
|
||||
" for real attribute sets, because we can stop when we hit the first ellipsis or
|
||||
" default value operator, but we also need to paste the "whitespace & comments
|
||||
" eating" regex all over the place (marked with 'v's):
|
||||
"
|
||||
" Region match 1: { foo ? ... } or { foo, ... } or { ... } (ellipsis)
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv {----- identifier -----}vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn region nixFunctionArgument start="{\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*\%([a-zA-Z_][a-zA-Z0-9_'-]*\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[,?}]\|\.\.\.\)" end="}" contains=nixComment,nixArgumentDefinitionWithDefault,nixArgumentDefinition,nixArgumentEllipsis,nixArgumentSeparator nextgroup=nixArgOperator
|
||||
|
||||
" Now it gets more tricky, because we need to look forward for the colon, but
|
||||
" there could be something like "{}@foo:", even though it's highly unlikely.
|
||||
"
|
||||
" Region match 2: {}
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv@vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv{----- identifier -----} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn region nixFunctionArgument start="{\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*}\%(\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*@\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[a-zA-Z_][a-zA-Z0-9_'-]*\)\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:" end="}" contains=nixComment nextgroup=nixArgOperator
|
||||
|
||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
syn match nixSimpleFunctionArgument "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:\([\n ]\)\@="
|
||||
|
||||
syn region nixList matchgroup=nixListBracket start="\[" end="\]" contains=@nixExpr
|
||||
|
||||
syn region nixLetExpr matchgroup=nixLetExprKeyword start="\<let\>" end="\<in\>" contains=nixComment,nixAttributeDefinition
|
||||
|
||||
syn keyword nixIfExprKeyword then contained
|
||||
syn region nixIfExpr matchgroup=nixIfExprKeyword start="\<if\>" end="\<else\>" contains=@nixExpr,nixIfExprKeyword
|
||||
|
||||
syn region nixWithExpr matchgroup=nixWithExprKeyword start="\<with\>" matchgroup=NONE end=";" contains=@nixExpr
|
||||
|
||||
syn region nixAssertExpr matchgroup=nixAssertKeyword start="\<assert\>" matchgroup=NONE end=";" contains=@nixExpr
|
||||
|
||||
syn cluster nixExpr contains=nixBoolean,nixNull,nixOperator,nixParen,nixInteger,nixRecKeyword,nixConditional,nixBuiltin,nixSimpleBuiltin,nixComment,nixFunctionCall,nixFunctionArgument,nixArgOperator,nixSimpleFunctionArgument,nixPath,nixHomePath,nixSearchPathRef,nixURI,nixAttributeSet,nixList,nixSimpleString,nixString,nixLetExpr,nixIfExpr,nixWithExpr,nixAssertExpr,nixInterpolation
|
||||
|
||||
" These definitions override @nixExpr and have to come afterwards:
|
||||
|
||||
syn match nixInterpolationParam "[a-zA-Z_][a-zA-Z0-9_'-]*\%(\.[a-zA-Z_][a-zA-Z0-9_'-]*\)*" contained
|
||||
|
||||
" Non-namespaced Nix builtins as of version 2.0:
|
||||
syn keyword nixSimpleBuiltin
|
||||
\ abort baseNameOf derivation derivationStrict dirOf fetchGit
|
||||
\ fetchMercurial fetchTarball import isNull map mapAttrs placeholder removeAttrs
|
||||
\ scopedImport throw toString
|
||||
|
||||
|
||||
" Namespaced and non-namespaced Nix builtins as of version 2.0:
|
||||
syn keyword nixNamespacedBuiltin contained
|
||||
\ abort add addErrorContext all any attrNames attrValues baseNameOf
|
||||
\ catAttrs compareVersions concatLists concatStringsSep currentSystem
|
||||
\ currentTime deepSeq derivation derivationStrict dirOf div elem elemAt
|
||||
\ fetchGit fetchMercurial fetchTarball fetchurl filter \ filterSource
|
||||
\ findFile foldl' fromJSON functionArgs genList \ genericClosure getAttr
|
||||
\ getEnv hasAttr hasContext hashString head import intersectAttrs isAttrs
|
||||
\ isBool isFloat isFunction isInt isList isNull isString langVersion
|
||||
\ length lessThan listToAttrs map mapAttrs match mul nixPath nixVersion
|
||||
\ parseDrvName partition path pathExists placeholder readDir readFile
|
||||
\ removeAttrs replaceStrings scopedImport seq sort split splitVersion
|
||||
\ storeDir storePath stringLength sub substring tail throw toFile toJSON
|
||||
\ toPath toString toXML trace tryEval typeOf unsafeDiscardOutputDependency
|
||||
\ unsafeDiscardStringContext unsafeGetAttrPos valueSize fromTOML bitAnd
|
||||
\ bitOr bitXor floor ceil
|
||||
|
||||
syn match nixBuiltin "builtins\.[a-zA-Z']\+"he=s+9 contains=nixComment,nixNamespacedBuiltin
|
||||
|
||||
hi def link nixArgOperator Operator
|
||||
hi def link nixArgumentDefinition Identifier
|
||||
hi def link nixArgumentEllipsis Operator
|
||||
hi def link nixAssertKeyword Keyword
|
||||
hi def link nixAttribute Identifier
|
||||
hi def link nixAttributeDot Operator
|
||||
hi def link nixBoolean Boolean
|
||||
hi def link nixBuiltin Special
|
||||
hi def link nixComment Comment
|
||||
hi def link nixConditional Conditional
|
||||
hi def link nixHomePath Include
|
||||
hi def link nixIfExprKeyword Keyword
|
||||
hi def link nixInherit Keyword
|
||||
hi def link nixInteger Integer
|
||||
hi def link nixInterpolation Macro
|
||||
hi def link nixInterpolationDelimiter Delimiter
|
||||
hi def link nixInterpolationParam Macro
|
||||
hi def link nixInvalidSimpleStringEscape Error
|
||||
hi def link nixInvalidStringEscape Error
|
||||
hi def link nixLetExprKeyword Keyword
|
||||
hi def link nixNamespacedBuiltin Special
|
||||
hi def link nixNull Constant
|
||||
hi def link nixOperator Operator
|
||||
hi def link nixPath Include
|
||||
hi def link nixPathDelimiter Delimiter
|
||||
hi def link nixRecKeyword Keyword
|
||||
hi def link nixSearchPath Include
|
||||
hi def link nixSimpleBuiltin Keyword
|
||||
hi def link nixSimpleFunctionArgument Identifier
|
||||
hi def link nixSimpleString String
|
||||
hi def link nixSimpleStringSpecial SpecialChar
|
||||
hi def link nixString String
|
||||
hi def link nixStringDelimiter Delimiter
|
||||
hi def link nixStringSpecial Special
|
||||
hi def link nixTodo Todo
|
||||
hi def link nixURI Include
|
||||
hi def link nixWithExprKeyword Keyword
|
||||
|
||||
" This could lead up to slow syntax highlighting for large files, but usually
|
||||
" large files such as all-packages.nix are one large attribute set, so if we'd
|
||||
" use sync patterns we'd have to go back to the start of the file anyway
|
||||
syn sync fromstart
|
||||
|
||||
let b:current_syntax = "nix"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: rego policy language
|
||||
" Maintainer: Matt Dunford (zenmatic@gmail.com)
|
||||
" URL: https://github.com/zenmatic/vim-syntax-rego
|
||||
" Last Change: 2019 Dec 12
|
||||
" Last Change: 2022 Dec 4
|
||||
|
||||
" https://www.openpolicyagent.org/docs/latest/policy-language/
|
||||
|
||||
@@ -14,36 +14,56 @@ endif
|
||||
syn case match
|
||||
|
||||
syn keyword regoDirective package import allow deny
|
||||
syn keyword regoKeywords as default else false not null true with some
|
||||
syn keyword regoKeywords as default else every false if import package not null true with some in print
|
||||
|
||||
syn keyword regoFuncAggregates count sum product max min sort all any
|
||||
syn match regoFuncArrays "\<array\.\(concat\|slice\)\>"
|
||||
syn match regoFuncArrays "\<array\.\(concat\|slice\|reverse\)\>"
|
||||
syn keyword regoFuncSets intersection union
|
||||
|
||||
syn keyword regoFuncStrings concat /\<contains\>/ endswith format_int indexof lower replace split sprintf startswith substring trim trim_left trim_prefix trim_right trim_suffix trim_space upper
|
||||
syn match regoFuncStrings2 "\<strings\.replace_n\>"
|
||||
syn keyword regoFuncStrings concat /\<contains\>/ endswith format_int indexof indexof_n lower replace split sprintf startswith substring trim trim_left trim_prefix trim_right trim_suffix trim_space upper
|
||||
syn match regoFuncStrings2 "\<strings\.\(replace_n\|reverse\|any_prefix_match\|any_suffix_match\)\>"
|
||||
syn match regoFuncStrings3 "\<contains\>"
|
||||
|
||||
syn keyword regoFuncRegex re_match
|
||||
syn match regoFuncRegex2 "\<regex\.\(split\|globs_match\|template_match\|find_n\|find_all_string_submatch_n\)\>"
|
||||
syn match regoFuncRegex2 "\<regex\.\(is_valid\|split\|globs_match\|template_match\|find_n\|find_all_string_submatch_n\|replace\)\>"
|
||||
|
||||
syn match regoFuncUuid "\<uuid.rfc4122\>"
|
||||
syn match regoFuncBits "\<bits\.\(or\|and\|negate\|xor\|lsh\|rsh\)\>"
|
||||
syn match regoFuncObject "\<object\.\(get\|remove\|subset\|union\|union_n\|filter\)\>"
|
||||
syn match regoFuncGlob "\<glob\.\(match\|quote_meta\)\>"
|
||||
syn match regoFuncUnits "\<units\.parse_bytes\>"
|
||||
syn match regoFuncUnits "\<units\.parse\(_bytes\)\=\>"
|
||||
syn keyword regoFuncTypes is_number is_string is_boolean is_array is_set is_object is_null type_name
|
||||
syn match regoFuncEncoding1 "\<\(base64\|base64url\)\.\(encode\|decode\)\>"
|
||||
syn match regoFuncEncoding2 "\<urlquery\.\(encode\|decode\|encode_object\)\>"
|
||||
syn match regoFuncEncoding3 "\<\(json\|yaml\)\.\(marshal\|unmarshal\)\>"
|
||||
syn match regoFuncEncoding1 "\<base64\.\(encode\|decode\|is_valid\)\>"
|
||||
syn match regoFuncEncoding2 "\<base64url\.\(encode\(_no_pad\)\=\|decode\)\>"
|
||||
syn match regoFuncEncoding3 "\<urlquery\.\(encode\|decode\|\(en\|de\)code_object\)\>"
|
||||
syn match regoFuncEncoding4 "\<\(json\|yaml\)\.\(is_valid\|marshal\|unmarshal\)\>"
|
||||
syn match regoFuncEncoding5 "\<json\.\(filter\|patch\|remove\)\>"
|
||||
syn match regoFuncTokenSigning "\<io\.jwt\.\(encode_sign_raw\|encode_sign\)\>"
|
||||
syn match regoFuncTokenVerification "\<io\.jwt\.\(verify_rs256\|verify_ps256\|verify_es256\|verify_hs256\|decode\|decode_verify\)\>"
|
||||
syn match regoFuncTime "\<time\.\(now_ns\|parse_ns\|parse_rfc3339_ns\|parse_duration_ns\|date\|clock\|weekday\)\>"
|
||||
syn match regoFuncCryptography "\<crypto\.x509\.parse_certificates\>"
|
||||
syn match regoFuncTokenVerification1 "\<io\.jwt\.\(decode\|decode_verify\)\>"
|
||||
syn match regoFuncTokenVerification2 "\<io\.jwt\.verify_\(rs\|ps\|es\|hs\)\(256\|384\|512\)\>"
|
||||
syn match regoFuncTime "\<time\.\(now_ns\|parse_ns\|parse_rfc3339_ns\|parse_duration_ns\|date\|clock\|weekday\|diff\|add_date\)\>"
|
||||
syn match regoFuncCryptography "\<crypto\.x509\.\(parse_certificates\|parse_certificate_request\|parse_and_verify_certificates\|parse_rsa_private_key\)\>"
|
||||
syn match regoFuncCryptography "\<crypto\.\(md5\|sha1\|sha256\)"
|
||||
syn match regoFuncCryptography "\<crypto\.hmac\.\(md5\|sha1\|sha256\|sha512\)"
|
||||
syn keyword regoFuncGraphs walk
|
||||
syn match regoFuncGraphs2 "\<graph\.reachable\(_paths\)\=\>"
|
||||
syn match regoFuncGraphQl "\<graphql\.\(\(schema_\)\=is_valid\|parse\(_\(and_verify\|query\|schema\)\)\=\)\>"
|
||||
syn match regoFuncHttp "\<http\.send\>"
|
||||
syn match regoFuncNet "\<net\.\(cidr_contains\|cidr_intersects\)\>"
|
||||
syn match regoFuncRego "\<rego\.parse_module\>"
|
||||
syn match regoFuncNet "\<net\.\(cidr_merge\|cidr_contains\|cidr_contains_matches\|cidr_intersects\|cidr_expand\|lookup_ip_addr\|cidr_is_valid\)\>"
|
||||
syn match regoFuncRego "\<rego\.\(parse_module\|metadata\.\(rule\|chain\)\)\>"
|
||||
syn match regoFuncOpa "\<opa\.runtime\>"
|
||||
syn keyword regoFuncDebugging trace
|
||||
syn match regoFuncRand "\<rand\.intn\>"
|
||||
|
||||
syn match regoFuncNumbers "\<numbers\.\(range\|intn\)\>"
|
||||
syn keyword regoFuncNumbers round ceil floor abs
|
||||
|
||||
syn match regoFuncSemver "\<semver\.\(is_valid\|compare\)\>"
|
||||
syn keyword regoFuncConversions to_number
|
||||
syn match regoFuncHex "\<hex\.\(encode\|decode\)\>"
|
||||
|
||||
hi def link regoFuncUuid Statement
|
||||
hi def link regoFuncBits Statement
|
||||
hi def link regoDirective Statement
|
||||
hi def link regoKeywords Statement
|
||||
hi def link regoFuncAggregates Statement
|
||||
@@ -60,16 +80,27 @@ hi def link regoFuncTypes Statement
|
||||
hi def link regoFuncEncoding1 Statement
|
||||
hi def link regoFuncEncoding2 Statement
|
||||
hi def link regoFuncEncoding3 Statement
|
||||
hi def link regoFuncEncoding4 Statement
|
||||
hi def link regoFuncEncoding5 Statement
|
||||
hi def link regoFuncTokenSigning Statement
|
||||
hi def link regoFuncTokenVerification Statement
|
||||
hi def link regoFuncTokenVerification1 Statement
|
||||
hi def link regoFuncTokenVerification2 Statement
|
||||
hi def link regoFuncTime Statement
|
||||
hi def link regoFuncCryptography Statement
|
||||
hi def link regoFuncGraphs Statement
|
||||
hi def link regoFuncGraphQl Statement
|
||||
hi def link regoFuncGraphs2 Statement
|
||||
hi def link regoFuncHttp Statement
|
||||
hi def link regoFuncNet Statement
|
||||
hi def link regoFuncRego Statement
|
||||
hi def link regoFuncOpa Statement
|
||||
hi def link regoFuncDebugging Statement
|
||||
hi def link regoFuncObject Statement
|
||||
hi def link regoFuncNumbers Statement
|
||||
hi def link regoFuncSemver Statement
|
||||
hi def link regoFuncConversions Statement
|
||||
hi def link regoFuncHex Statement
|
||||
hi def link regoFuncRand Statement
|
||||
|
||||
" https://www.openpolicyagent.org/docs/latest/policy-language/#strings
|
||||
syn region regoString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Jul 08, 2022
|
||||
" Version: 203
|
||||
" Last Change: Nov 25, 2022
|
||||
" Version: 204
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
||||
" For options and settings, please use: :help ft-sh-syntax
|
||||
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras
|
||||
@@ -84,15 +84,9 @@ elseif g:sh_fold_enabled != 0 && !has("folding")
|
||||
let g:sh_fold_enabled= 0
|
||||
echomsg "Ignoring g:sh_fold_enabled=".g:sh_fold_enabled."; need to re-compile vim for +fold support"
|
||||
endif
|
||||
if !exists("s:sh_fold_functions")
|
||||
let s:sh_fold_functions= and(g:sh_fold_enabled,1)
|
||||
endif
|
||||
if !exists("s:sh_fold_heredoc")
|
||||
let s:sh_fold_heredoc = and(g:sh_fold_enabled,2)
|
||||
endif
|
||||
if !exists("s:sh_fold_ifdofor")
|
||||
let s:sh_fold_ifdofor = and(g:sh_fold_enabled,4)
|
||||
endif
|
||||
let s:sh_fold_functions= and(g:sh_fold_enabled,1)
|
||||
let s:sh_fold_heredoc = and(g:sh_fold_enabled,2)
|
||||
let s:sh_fold_ifdofor = and(g:sh_fold_enabled,4)
|
||||
if g:sh_fold_enabled && &fdm == "manual"
|
||||
" Given that the user provided g:sh_fold_enabled
|
||||
" AND g:sh_fold_enabled is manual (usual default)
|
||||
@@ -113,6 +107,9 @@ endif
|
||||
|
||||
" Set up folding commands for shell {{{1
|
||||
" =================================
|
||||
sil! delc ShFoldFunctions
|
||||
sil! delc ShFoldHereDoc
|
||||
sil! delc ShFoldIfDoFor
|
||||
if s:sh_fold_functions
|
||||
com! -nargs=* ShFoldFunctions <args> fold
|
||||
else
|
||||
@@ -415,22 +412,22 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup
|
||||
" Here Documents: {{{1
|
||||
" (modified by Felipe Contreras)
|
||||
" =========================================
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc02 end="^\s*\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc07 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc08 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc09 end="^\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc13 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc14 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc15 end="^\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc16 end="^\s*\z1\s*$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc02 end="^\s*\z1$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc04 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc06 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc07 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc08 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc09 end="^\z1$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1$" contains=@shDblQuoteList
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc12 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc13 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc14 end="^\s*\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc15 end="^\z1$"
|
||||
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc16 end="^\s*\z1$"
|
||||
|
||||
|
||||
" Here Strings: {{{1
|
||||
|
||||
41
runtime/syntax/wdl.vim
Normal file
41
runtime/syntax/wdl.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
" Vim syntax file
|
||||
" Language: wdl
|
||||
" Maintainer: Matt Dunford (zenmatic@gmail.com)
|
||||
" URL: https://github.com/zenmatic/vim-syntax-wdl
|
||||
" Last Change: 2022 Nov 24
|
||||
|
||||
" https://github.com/openwdl/wdl
|
||||
|
||||
" quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case match
|
||||
|
||||
syn keyword wdlStatement alias task input command runtime input output workflow call scatter import as meta parameter_meta in version
|
||||
syn keyword wdlConditional if then else
|
||||
syn keyword wdlType struct Array String File Int Float Boolean Map Pair Object
|
||||
|
||||
syn keyword wdlFunctions stdout stderr read_lines read_tsv read_map read_object read_objects read_json read_int read_string read_float read_boolean write_lines write_tsv write_map write_object write_objects write_json size sub range transpose zip cross length flatten prefix select_first defined basename floor ceil round
|
||||
|
||||
syn region wdlCommandSection start="<<<" end=">>>"
|
||||
|
||||
syn region wdlString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn region wdlString start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||
|
||||
" Comments; their contents
|
||||
syn keyword wdlTodo contained TODO FIXME XXX BUG
|
||||
syn cluster wdlCommentGroup contains=wdlTodo
|
||||
syn region wdlComment start="#" end="$" contains=@wdlCommentGroup
|
||||
|
||||
hi def link wdlStatement Statement
|
||||
hi def link wdlConditional Conditional
|
||||
hi def link wdlType Type
|
||||
hi def link wdlFunctions Function
|
||||
hi def link wdlString String
|
||||
hi def link wdlCommandSection String
|
||||
hi def link wdlComment Comment
|
||||
hi def link wdlTodo Todo
|
||||
|
||||
let b:current_syntax = 'wdl'
|
||||
292
runtime/syntax/zig.vim
Normal file
292
runtime/syntax/zig.vim
Normal file
@@ -0,0 +1,292 @@
|
||||
" Vim syntax file
|
||||
" Language: Zig
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:zig_syntax_keywords = {
|
||||
\ 'zigBoolean': ["true"
|
||||
\ , "false"]
|
||||
\ , 'zigNull': ["null"]
|
||||
\ , 'zigType': ["bool"
|
||||
\ , "f16"
|
||||
\ , "f32"
|
||||
\ , "f64"
|
||||
\ , "f80"
|
||||
\ , "f128"
|
||||
\ , "void"
|
||||
\ , "type"
|
||||
\ , "anytype"
|
||||
\ , "anyerror"
|
||||
\ , "anyframe"
|
||||
\ , "volatile"
|
||||
\ , "linksection"
|
||||
\ , "noreturn"
|
||||
\ , "allowzero"
|
||||
\ , "i0"
|
||||
\ , "u0"
|
||||
\ , "isize"
|
||||
\ , "usize"
|
||||
\ , "comptime_int"
|
||||
\ , "comptime_float"
|
||||
\ , "c_short"
|
||||
\ , "c_ushort"
|
||||
\ , "c_int"
|
||||
\ , "c_uint"
|
||||
\ , "c_long"
|
||||
\ , "c_ulong"
|
||||
\ , "c_longlong"
|
||||
\ , "c_ulonglong"
|
||||
\ , "c_longdouble"
|
||||
\ , "anyopaque"]
|
||||
\ , 'zigConstant': ["undefined"
|
||||
\ , "unreachable"]
|
||||
\ , 'zigConditional': ["if"
|
||||
\ , "else"
|
||||
\ , "switch"]
|
||||
\ , 'zigRepeat': ["while"
|
||||
\ , "for"]
|
||||
\ , 'zigComparatorWord': ["and"
|
||||
\ , "or"
|
||||
\ , "orelse"]
|
||||
\ , 'zigStructure': ["struct"
|
||||
\ , "enum"
|
||||
\ , "union"
|
||||
\ , "error"
|
||||
\ , "packed"
|
||||
\ , "opaque"]
|
||||
\ , 'zigException': ["error"]
|
||||
\ , 'zigVarDecl': ["var"
|
||||
\ , "const"
|
||||
\ , "comptime"
|
||||
\ , "threadlocal"]
|
||||
\ , 'zigDummyVariable': ["_"]
|
||||
\ , 'zigKeyword': ["fn"
|
||||
\ , "try"
|
||||
\ , "test"
|
||||
\ , "pub"
|
||||
\ , "usingnamespace"]
|
||||
\ , 'zigExecution': ["return"
|
||||
\ , "break"
|
||||
\ , "continue"]
|
||||
\ , 'zigMacro': ["defer"
|
||||
\ , "errdefer"
|
||||
\ , "async"
|
||||
\ , "nosuspend"
|
||||
\ , "await"
|
||||
\ , "suspend"
|
||||
\ , "resume"
|
||||
\ , "export"
|
||||
\ , "extern"]
|
||||
\ , 'zigPreProc': ["catch"
|
||||
\ , "inline"
|
||||
\ , "noinline"
|
||||
\ , "asm"
|
||||
\ , "callconv"
|
||||
\ , "noalias"]
|
||||
\ , 'zigBuiltinFn': ["align"
|
||||
\ , "@addWithOverflow"
|
||||
\ , "@as"
|
||||
\ , "@atomicLoad"
|
||||
\ , "@atomicStore"
|
||||
\ , "@bitCast"
|
||||
\ , "@breakpoint"
|
||||
\ , "@alignCast"
|
||||
\ , "@alignOf"
|
||||
\ , "@cDefine"
|
||||
\ , "@cImport"
|
||||
\ , "@cInclude"
|
||||
\ , "@cUndef"
|
||||
\ , "@clz"
|
||||
\ , "@cmpxchgWeak"
|
||||
\ , "@cmpxchgStrong"
|
||||
\ , "@compileError"
|
||||
\ , "@compileLog"
|
||||
\ , "@ctz"
|
||||
\ , "@popCount"
|
||||
\ , "@divExact"
|
||||
\ , "@divFloor"
|
||||
\ , "@divTrunc"
|
||||
\ , "@embedFile"
|
||||
\ , "@export"
|
||||
\ , "@extern"
|
||||
\ , "@tagName"
|
||||
\ , "@TagType"
|
||||
\ , "@errorName"
|
||||
\ , "@call"
|
||||
\ , "@errorReturnTrace"
|
||||
\ , "@fence"
|
||||
\ , "@fieldParentPtr"
|
||||
\ , "@field"
|
||||
\ , "@unionInit"
|
||||
\ , "@frameAddress"
|
||||
\ , "@import"
|
||||
\ , "@newStackCall"
|
||||
\ , "@asyncCall"
|
||||
\ , "@intToPtr"
|
||||
\ , "@max"
|
||||
\ , "@min"
|
||||
\ , "@memcpy"
|
||||
\ , "@memset"
|
||||
\ , "@mod"
|
||||
\ , "@mulAdd"
|
||||
\ , "@mulWithOverflow"
|
||||
\ , "@splat"
|
||||
\ , "@src"
|
||||
\ , "@bitOffsetOf"
|
||||
\ , "@byteOffsetOf"
|
||||
\ , "@offsetOf"
|
||||
\ , "@OpaqueType"
|
||||
\ , "@panic"
|
||||
\ , "@prefetch"
|
||||
\ , "@ptrCast"
|
||||
\ , "@ptrToInt"
|
||||
\ , "@rem"
|
||||
\ , "@returnAddress"
|
||||
\ , "@setCold"
|
||||
\ , "@Type"
|
||||
\ , "@shuffle"
|
||||
\ , "@reduce"
|
||||
\ , "@select"
|
||||
\ , "@setRuntimeSafety"
|
||||
\ , "@setEvalBranchQuota"
|
||||
\ , "@setFloatMode"
|
||||
\ , "@shlExact"
|
||||
\ , "@This"
|
||||
\ , "@hasDecl"
|
||||
\ , "@hasField"
|
||||
\ , "@shlWithOverflow"
|
||||
\ , "@shrExact"
|
||||
\ , "@sizeOf"
|
||||
\ , "@bitSizeOf"
|
||||
\ , "@sqrt"
|
||||
\ , "@byteSwap"
|
||||
\ , "@subWithOverflow"
|
||||
\ , "@intCast"
|
||||
\ , "@floatCast"
|
||||
\ , "@intToFloat"
|
||||
\ , "@floatToInt"
|
||||
\ , "@boolToInt"
|
||||
\ , "@errSetCast"
|
||||
\ , "@truncate"
|
||||
\ , "@typeInfo"
|
||||
\ , "@typeName"
|
||||
\ , "@TypeOf"
|
||||
\ , "@atomicRmw"
|
||||
\ , "@intToError"
|
||||
\ , "@errorToInt"
|
||||
\ , "@intToEnum"
|
||||
\ , "@enumToInt"
|
||||
\ , "@setAlignStack"
|
||||
\ , "@frame"
|
||||
\ , "@Frame"
|
||||
\ , "@frameSize"
|
||||
\ , "@bitReverse"
|
||||
\ , "@Vector"
|
||||
\ , "@sin"
|
||||
\ , "@cos"
|
||||
\ , "@tan"
|
||||
\ , "@exp"
|
||||
\ , "@exp2"
|
||||
\ , "@log"
|
||||
\ , "@log2"
|
||||
\ , "@log10"
|
||||
\ , "@fabs"
|
||||
\ , "@floor"
|
||||
\ , "@ceil"
|
||||
\ , "@trunc"
|
||||
\ , "@wasmMemorySize"
|
||||
\ , "@wasmMemoryGrow"
|
||||
\ , "@round"]
|
||||
\ }
|
||||
|
||||
function! s:syntax_keyword(dict)
|
||||
for key in keys(a:dict)
|
||||
execute 'syntax keyword' key join(a:dict[key], ' ')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
call s:syntax_keyword(s:zig_syntax_keywords)
|
||||
|
||||
syntax match zigType "\v<[iu][1-9]\d*>"
|
||||
syntax match zigOperator display "\V\[-+/*=^&?|!><%~]"
|
||||
syntax match zigArrowCharacter display "\V->"
|
||||
|
||||
" 12_34 (. but not ..)? (12_34)? (exponent 12_34)?
|
||||
syntax match zigDecNumber display "\v<\d%(_?\d)*%(\.\.@!)?%(\d%(_?\d)*)?%([eE][+-]?\d%(_?\d)*)?"
|
||||
syntax match zigHexNumber display "\v<0x\x%(_?\x)*%(\.\.@!)?%(\x%(_?\x)*)?%([pP][+-]?\d%(_?\d)*)?"
|
||||
syntax match zigOctNumber display "\v<0o\o%(_?\o)*"
|
||||
syntax match zigBinNumber display "\v<0b[01]%(_?[01])*"
|
||||
|
||||
syntax match zigCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
||||
syntax match zigCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||
syntax match zigCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=zigEscape,zigEscapeError,zigCharacterInvalid,zigCharacterInvalidUnicode
|
||||
syntax match zigCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{6}\)\)'/ contains=zigEscape,zigEscapeUnicode,zigEscapeError,zigCharacterInvalid
|
||||
|
||||
syntax region zigBlock start="{" end="}" transparent fold
|
||||
|
||||
syntax region zigCommentLine start="//" end="$" contains=zigTodo,@Spell
|
||||
syntax region zigCommentLineDoc start="//[/!]/\@!" end="$" contains=zigTodo,@Spell
|
||||
|
||||
syntax match zigMultilineStringPrefix /c\?\\\\/ contained containedin=zigMultilineString
|
||||
syntax region zigMultilineString matchgroup=zigMultilineStringDelimiter start="c\?\\\\" end="$" contains=zigMultilineStringPrefix display
|
||||
|
||||
syntax keyword zigTodo contained TODO
|
||||
|
||||
syntax region zigString matchgroup=zigStringDelimiter start=+c\?"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=zigEscape,zigEscapeUnicode,zigEscapeError,@Spell
|
||||
syntax match zigEscapeError display contained /\\./
|
||||
syntax match zigEscape display contained /\\\([nrt\\'"]\|x\x\{2}\)/
|
||||
syntax match zigEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{6}\)/
|
||||
|
||||
highlight default link zigDecNumber zigNumber
|
||||
highlight default link zigHexNumber zigNumber
|
||||
highlight default link zigOctNumber zigNumber
|
||||
highlight default link zigBinNumber zigNumber
|
||||
|
||||
highlight default link zigBuiltinFn Statement
|
||||
highlight default link zigKeyword Keyword
|
||||
highlight default link zigType Type
|
||||
highlight default link zigCommentLine Comment
|
||||
highlight default link zigCommentLineDoc Comment
|
||||
highlight default link zigDummyVariable Comment
|
||||
highlight default link zigTodo Todo
|
||||
highlight default link zigString String
|
||||
highlight default link zigStringDelimiter String
|
||||
highlight default link zigMultilineString String
|
||||
highlight default link zigMultilineStringContent String
|
||||
highlight default link zigMultilineStringPrefix String
|
||||
highlight default link zigMultilineStringDelimiter Delimiter
|
||||
highlight default link zigCharacterInvalid Error
|
||||
highlight default link zigCharacterInvalidUnicode zigCharacterInvalid
|
||||
highlight default link zigCharacter Character
|
||||
highlight default link zigEscape Special
|
||||
highlight default link zigEscapeUnicode zigEscape
|
||||
highlight default link zigEscapeError Error
|
||||
highlight default link zigBoolean Boolean
|
||||
highlight default link zigNull Boolean
|
||||
highlight default link zigConstant Constant
|
||||
highlight default link zigNumber Number
|
||||
highlight default link zigArrowCharacter zigOperator
|
||||
highlight default link zigOperator Operator
|
||||
highlight default link zigStructure Structure
|
||||
highlight default link zigExecution Special
|
||||
highlight default link zigMacro Macro
|
||||
highlight default link zigConditional Conditional
|
||||
highlight default link zigComparatorWord Keyword
|
||||
highlight default link zigRepeat Repeat
|
||||
highlight default link zigSpecial Special
|
||||
highlight default link zigVarDecl Function
|
||||
highlight default link zigPreProc PreProc
|
||||
highlight default link zigException Exception
|
||||
|
||||
delfunction s:syntax_keyword
|
||||
|
||||
let b:current_syntax = "zig"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet! s:cpo_save
|
||||
49
runtime/syntax/zir.vim
Normal file
49
runtime/syntax/zir.vim
Normal file
@@ -0,0 +1,49 @@
|
||||
" Vim syntax file
|
||||
" Language: Zir
|
||||
" Upstream: https://github.com/ziglang/zig.vim
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let b:current_syntax = "zir"
|
||||
|
||||
syn region zirCommentLine start=";" end="$" contains=zirTodo,@Spell
|
||||
|
||||
syn region zirBlock start="{" end="}" transparent fold
|
||||
|
||||
syn keyword zirKeyword primitive fntype int str as ptrtoint fieldptr deref asm unreachable export ref fn
|
||||
|
||||
syn keyword zirTodo contained TODO
|
||||
|
||||
syn region zirString start=+c\?"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=zirEscape,zirEscapeUnicode,zirEscapeError,@Spell
|
||||
|
||||
syn match zirEscapeError display contained /\\./
|
||||
syn match zirEscape display contained /\\\([nrt\\'"]\|x\x\{2}\)/
|
||||
syn match zirEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{6}\)/
|
||||
|
||||
syn match zirDecNumber display "\<[0-9]\+\%(.[0-9]\+\)\=\%([eE][+-]\?[0-9]\+\)\="
|
||||
syn match zirHexNumber display "\<0x[a-fA-F0-9]\+\%([a-fA-F0-9]\+\%([pP][+-]\?[0-9]\+\)\?\)\="
|
||||
syn match zirOctNumber display "\<0o[0-7]\+"
|
||||
syn match zirBinNumber display "\<0b[01]\+\%(.[01]\+\%([eE][+-]\?[0-9]\+\)\?\)\="
|
||||
|
||||
syn match zirGlobal display "[^a-zA-Z0-9_]\?\zs@[a-zA-Z0-9_]\+"
|
||||
syn match zirLocal display "[^a-zA-Z0-9_]\?\zs%[a-zA-Z0-9_]\+"
|
||||
|
||||
hi def link zirCommentLine Comment
|
||||
hi def link zirTodo Todo
|
||||
|
||||
hi def link zirKeyword Keyword
|
||||
|
||||
hi def link zirString Constant
|
||||
|
||||
hi def link zirEscape Special
|
||||
hi def link zirEscapeUnicode zirEscape
|
||||
hi def link zirEscapeError Error
|
||||
|
||||
hi def link zirDecNumber Constant
|
||||
hi def link zirHexNumber Constant
|
||||
hi def link zirOctNumber Constant
|
||||
hi def link zirBinNumber Constant
|
||||
|
||||
hi def link zirGlobal Identifier
|
||||
hi def link zirLocal Identifier
|
||||
Reference in New Issue
Block a user