codekingpro/portable-devtools
114k
1" This source file is part of the Swift.org open source project2"3" Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors4" Licensed under Apache License v2.0 with Runtime Library Exception5"6" See https://swift.org/LICENSE.txt for license information7" See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors8"9" Vim syntax file10" Language: sil11"12" Vim maintainer: Emir SARI <bitigchi@me.com>13 14if exists("b:current_syntax")15 finish16endif17 18let s:keepcpo = &cpo19set cpo&vim20 21syn keyword silStage skipwhite nextgroup=silStages22 \ sil_stage23syn keyword silStages24 \ canonical25 \ raw26 27syn match silIdentifier skipwhite28 \ /@\<[A-Za-z_0-9]\+\>/29 30syn match silConvention skipwhite31 \ /$\?@convention/32syn region silConvention contained contains=silConventions33 \ start="@convention(" end=")"34syn keyword silConventions35 \ block36 \ c37 \ method38 \ objc_method39 \ sil_differentiability_witness40 \ thick41 \ thin42 \ witness_method43 44syn match silFunctionType skipwhite45 \ /@\(\<autoreleased\>\|\<callee_guaranteed\>\|\<callee_owned\>\|\<error\>\|\<guaranteed\>\|\<in\>\|\<in_constant\>\|\<in_guaranteed\>\|\<inout\>\|\<inout_aliasable\>\|\<noescape\>\|\<out\>\|\<owned\>\)/46syn match silMetatypeType skipwhite47 \ /@\(\<thick\>\|\<thin\>\|\<objc\>\)/48 49" TODO: handle [tail_elems sil-type * sil-operand]50syn region silAttribute contains=silAttributes51 \ start="\[" end="\]"52syn keyword silAttributes contained containedin=silAttribute53 \ abort54 \ deinit55 \ delegatingself56 \ derivedself57 \ derivedselfonly58 \ dynamic59 \ exact60 \ init61 \ modify62 \ mutating63 \ objc64 \ open65 \ read66 \ rootself67 \ stack68 \ static69 \ strict70 \ unknown71 \ unsafe72 \ var73 74syn keyword swiftImport import skipwhite nextgroup=swiftImportModule75syn match swiftImportModule /\<[A-Za-z_][A-Za-z_0-9]*\>/ contained nextgroup=swiftImportComponent76syn match swiftImportComponent /\.\<[A-Za-z_][A-Za-z_0-9]*\>/ contained nextgroup=swiftImportComponent77 78syn region swiftComment start="/\*" end="\*/" contains=swiftComment,swiftTodo79syn region swiftLineComment start="//" end="$" contains=swiftTodo80 81syn match swiftLineComment /^#!.*/82syn match swiftTypeName /\<[A-Z][a-zA-Z_0-9]*\>/83syn match swiftDecimal /\<[-]\?[0-9]\+\>/84syn match swiftDecimal /\<[-+]\?[0-9]\+\>/85 86syn match swiftTypeName /\$\*\<\?[A-Z][a-zA-Z0-9_]*\>/87syn match swiftVarName /%\<[A-z[a-z_0-9]\+\(#[0-9]\+\)\?\>/88 89syn keyword swiftKeyword break case continue default do else for if in static switch repeat return where while skipwhite90 91syn keyword swiftKeyword sil internal thunk skipwhite92syn keyword swiftKeyword public hidden private shared public_external hidden_external skipwhite93syn keyword swiftKeyword getter setter allocator initializer enumelt destroyer globalaccessor objc skipwhite94syn keyword swiftKeyword alloc_global alloc_stack alloc_ref alloc_ref_dynamic alloc_box alloc_existential_box alloc_value_buffer dealloc_stack dealloc_box dealloc_existential_box dealloc_ref dealloc_partial_ref dealloc_value_buffer skipwhite95syn keyword swiftKeyword debug_value debug_value_addr skipwhite96syn keyword swiftKeyword load load_unowned store assign mark_uninitialized mark_function_escape copy_addr destroy_addr index_addr index_raw_pointer bind_memory to skipwhite97syn keyword swiftKeyword strong_retain strong_release strong_retain_unowned ref_to_unowned unowned_to_ref unowned_retain unowned_release load_weak store_unowned store_weak fix_lifetime autorelease_value set_deallocating is_unique is_escaping_closure skipwhite98syn keyword swiftKeyword function_ref integer_literal float_literal string_literal global_addr skipwhite99syn keyword swiftKeyword class_method super_method witness_method objc_method objc_super_method skipwhite100syn keyword swiftKeyword partial_apply builtin skipwhite101syn keyword swiftApplyKeyword apply try_apply skipwhite102syn keyword swiftKeyword metatype value_metatype existential_metatype skipwhite103syn keyword swiftKeyword retain_value release_value retain_value_addr release_value_addr tuple tuple_extract tuple_element_addr struct struct_extract struct_element_addr ref_element_addr skipwhite104syn keyword swiftKeyword init_enum_data_addr unchecked_enum_data unchecked_take_enum_data_addr inject_enum_addr skipwhite105syn keyword swiftKeyword init_existential_addr init_existential_value init_existential_metatype deinit_existential_addr deinit_existential_value open_existential_addr open_existential_box open_existential_box_value open_existential_metatype init_existential_ref open_existential_ref open_existential_value skipwhite106syn keyword swiftKeyword upcast address_to_pointer pointer_to_address pointer_to_thin_function unchecked_addr_cast unchecked_ref_cast unchecked_ref_cast_addr ref_to_raw_pointer ref_to_bridge_object ref_to_unmanaged unmanaged_to_ref raw_pointer_to_ref skipwhite107syn keyword swiftKeyword convert_function thick_to_objc_metatype thin_function_to_pointer objc_to_thick_metatype thin_to_thick_function unchecked_ref_bit_cast unchecked_trivial_bit_cast bridge_object_to_ref bridge_object_to_word unchecked_bitwise_cast skipwhite108syn keyword swiftKeyword objc_existential_metatype_to_object objc_metatype_to_object objc_protocol skipwhite109syn keyword swiftKeyword unconditional_checked_cast unconditional_checked_cast_addr unconditional_checked_cast_value skipwhite110syn keyword swiftKeyword cond_fail skipwhite111syn keyword swiftKeyword unreachable return throw br cond_br switch_value select_enum select_enum_addr select_value switch_enum switch_enum_addr dynamic_method_br checked_cast_br checked_cast_value_br checked_cast_addr_br skipwhite112syn keyword swiftKeyword project_box project_existential_box project_value_buffer project_block_storage init_block_storage_header copy_block mark_dependence skipwhite113 114syn keyword swiftTypeDefinition class extension protocol struct typealias enum skipwhite nextgroup=swiftTypeName115syn region swiftTypeAttributes start="\[" end="\]" skipwhite contained nextgroup=swiftTypeName116syn match swiftTypeName /\<[A-Za-z_][A-Za-z_0-9\.]*\>/ contained nextgroup=swiftTypeParameters117 118syn region swiftTypeParameters start="<" end=">" skipwhite contained119 120syn keyword swiftFuncDefinition func skipwhite nextgroup=swiftFuncAttributes,swiftFuncName,swiftOperator121syn region swiftFuncAttributes start="\[" end="\]" skipwhite contained nextgroup=swiftFuncName,swiftOperator122syn match swiftFuncName /\<[A-Za-z_][A-Za-z_0-9]*\>/ skipwhite contained nextgroup=swiftTypeParameters123syn keyword swiftFuncKeyword subscript init destructor nextgroup=swiftTypeParameters124 125syn keyword swiftVarDefinition var skipwhite nextgroup=swiftVarName126syn keyword swiftVarDefinition let skipwhite nextgroup=swiftVarName127syn match swiftVarName /\<[A-Za-z_][A-Za-z_0-9]*\>/ skipwhite contained128 129syn keyword swiftDefinitionModifier static130 131syn match swiftImplicitVarName /\$\<[A-Za-z_0-9]\+\>/132 133hi def link swiftImport Include134hi def link swiftImportModule Title135hi def link swiftImportComponent Identifier136hi def link swiftApplyKeyword Statement137hi def link swiftKeyword Statement138hi def link swiftTypeDefinition Define139hi def link swiftTypeName Type140hi def link swiftTypeParameters Special141hi def link swiftTypeAttributes PreProc142hi def link swiftFuncDefinition Define143hi def link swiftDefinitionModifier Define144hi def link swiftFuncName Function145hi def link swiftFuncAttributes PreProc146hi def link swiftFuncKeyword Function147hi def link swiftVarDefinition Define148hi def link swiftVarName Identifier149hi def link swiftImplicitVarName Identifier150hi def link swiftIdentifierKeyword Identifier151hi def link swiftTypeDeclaration Delimiter152hi def link swiftBoolean Boolean153hi def link swiftString String154hi def link swiftInterpolation Special155hi def link swiftComment Comment156hi def link swiftLineComment Comment157hi def link swiftDecimal Number158hi def link swiftHex Number159hi def link swiftOct Number160hi def link swiftBin Number161hi def link swiftOperator Function162hi def link swiftChar Character163hi def link swiftLabel Label164hi def link swiftNew Operator165 166hi def link silStage Special167hi def link silStages Type168hi def link silConvention Special169hi def link silConventionParameter Special170hi def link silConventions Type171hi def link silIdentifier Identifier172hi def link silFunctionType Special173hi def link silMetatypeType Special174hi def link silAttribute PreProc175 176let b:current_syntax = "sil"177 178let &cpo = s:keepcpo179unlet s:keepcpo180 