asn.vim (2578B)
1 " Vim syntax file 2 " Language: ASN.1 3 " Maintainer: Claudio Fleiner <claudio@fleiner.com> 4 " URL: http://www.fleiner.com/vim/syntax/asn.vim 5 " Last Change: 2012 Oct 05 6 7 " quit when a syntax file was already loaded 8 if exists("b:current_syntax") 9 finish 10 endif 11 12 let s:cpo_save = &cpo 13 set cpo&vim 14 15 " keyword definitions 16 syn keyword asnExternal DEFINITIONS BEGIN END IMPORTS EXPORTS FROM 17 syn match asnExternal "\<IMPLICIT\s\+TAGS\>" 18 syn match asnExternal "\<EXPLICIT\s\+TAGS\>" 19 syn keyword asnFieldOption DEFAULT OPTIONAL 20 syn keyword asnTagModifier IMPLICIT EXPLICIT 21 syn keyword asnTypeInfo ABSENT PRESENT SIZE UNIVERSAL APPLICATION PRIVATE 22 syn keyword asnBoolValue TRUE FALSE 23 syn keyword asnNumber MIN MAX 24 syn match asnNumber "\<PLUS-INFINITY\>" 25 syn match asnNumber "\<MINUS-INFINITY\>" 26 syn keyword asnType INTEGER REAL STRING BIT BOOLEAN OCTET NULL EMBEDDED PDV 27 syn keyword asnType BMPString IA5String TeletexString GeneralString GraphicString ISO646String NumericString PrintableString T61String UniversalString VideotexString VisibleString 28 syn keyword asnType ANY DEFINED 29 syn match asnType "\.\.\." 30 syn match asnType "OBJECT\s\+IDENTIFIER" 31 syn match asnType "TYPE-IDENTIFIER" 32 syn keyword asnType UTF8String 33 syn keyword asnStructure CHOICE SEQUENCE SET OF ENUMERATED CONSTRAINED BY WITH COMPONENTS CLASS 34 35 " Strings and constants 36 syn match asnSpecial contained "\\\d\d\d\|\\." 37 syn region asnString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=asnSpecial 38 syn match asnCharacter "'[^\\]'" 39 syn match asnSpecialCharacter "'\\.'" 40 syn match asnNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" 41 syn match asnLineComment "--.*" 42 syn match asnLineComment "--.*--" 43 44 syn match asnDefinition "^\s*[a-zA-Z][-a-zA-Z0-9_.\[\] \t{}]* *::="me=e-3 contains=asnType 45 syn match asnBraces "[{}]" 46 47 syn sync ccomment asnComment 48 49 " Define the default highlighting. 50 " Only when an item doesn't have highlighting yet 51 hi def link asnDefinition Function 52 hi def link asnBraces Function 53 hi def link asnStructure Statement 54 hi def link asnBoolValue Boolean 55 hi def link asnSpecial Special 56 hi def link asnString String 57 hi def link asnCharacter Character 58 hi def link asnSpecialCharacter asnSpecial 59 hi def link asnNumber asnValue 60 hi def link asnComment Comment 61 hi def link asnLineComment asnComment 62 hi def link asnType Type 63 hi def link asnTypeInfo PreProc 64 hi def link asnValue Number 65 hi def link asnExternal Include 66 hi def link asnTagModifier Function 67 hi def link asnFieldOption Type 68 69 let &cpo = s:cpo_save 70 unlet s:cpo_save 71 let b:current_syntax = "asn" 72 73 " vim: ts=8