neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

slpreg.vim (5346B)


      1 " Vim syntax file
      2 " Language:             RFC 2614 - An API for Service Location registration file
      3 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
      4 " Latest Revision:      2006-04-19
      5 
      6 if exists("b:current_syntax")
      7  finish
      8 endif
      9 
     10 let s:cpo_save = &cpo
     11 set cpo&vim
     12 
     13 syn keyword slpregTodo          contained TODO FIXME XXX NOTE
     14 
     15 syn region  slpregComment       display oneline start='^[#;]' end='$'
     16                                \ contains=slpregTodo,@Spell
     17 
     18 syn match   slpregBegin         display '^'
     19                                \ nextgroup=slpregServiceURL,
     20                                \ slpregComment
     21 
     22 syn match   slpregServiceURL    contained display 'service:'
     23                                \ nextgroup=slpregServiceType
     24 
     25 syn match   slpregServiceType   contained display '\a[[:alpha:][:digit:]+-]*\%(\.\a[[:alpha:][:digit:]+-]*\)\=\%(:\a[[:alpha:][:digit:]+-]*\)\='
     26                                \ nextgroup=slpregServiceSAPCol
     27 
     28 syn match   slpregServiceSAPCol contained display ':'
     29                                \ nextgroup=slpregSAP
     30 
     31 syn match   slpregSAP           contained '[^,]\+'
     32                                \ nextgroup=slpregLangSep
     33 "syn match   slpregSAP           contained display '\%(//\%(\%([[:alpha:][:digit:]$-_.~!*\'(),+;&=]*@\)\=\%([[:alnum:]][[:alnum:]-]*[[:alnum:]]\|[[:alnum:]]\.\)*\%(\a[[:alnum:]-]*[[:alnum:]]\|\a\)\%(:\d\+\)\=\)\=\|/at/\%([[:alpha:][:digit:]$-_.~]\|\\\x\x\)\{1,31}:\%([[:alpha:][:digit:]$-_.~]\|\\\x\x\)\{1,31}\%([[:alpha:][:digit:]$-_.~]\|\\\x\x\)\{1,31}\|/ipx/\x\{8}:\x\{12}:\x\{4}\)\%(/\%([[:alpha:][:digit:]$-_.~!*\'()+;?:@&=+]\|\\\x\x\)*\)*\%(;[^()\\!<=>~[:cntrl:]* \t_]\+\%(=[^()\\!<=>~[:cntrl:] ]\+\)\=\)*'
     34 
     35 syn match   slpregLangSep       contained display ','
     36                                \ nextgroup=slpregLang
     37 
     38 syn match   slpregLang          contained display '\a\{1,8}\%(-\a\{1,8\}\)\='
     39                                \ nextgroup=slpregLTimeSep
     40 
     41 syn match   slpregLTimeSep      contained display ','
     42                                \ nextgroup=slpregLTime
     43 
     44 syn match   slpregLTime         contained display '\d\{1,5}'
     45                                \ nextgroup=slpregType,slpregUNewline
     46 
     47 syn match   slpregType          contained display '\a[[:alpha:][:digit:]+-]*'
     48                                \ nextgroup=slpregUNewLine
     49 
     50 syn match   slpregUNewLine      contained '\s*\n'
     51                                \ nextgroup=slpregScopes,slpregAttrList skipnl
     52 
     53 syn keyword slpregScopes        contained scopes
     54                                \ nextgroup=slpregScopesEq
     55 
     56 syn match   slpregScopesEq      contained '=' nextgroup=slpregScopeName
     57 
     58 syn match   slpregScopeName     contained '[^(),\\!<=>[:cntrl:];*+ ]\+'
     59                                \ nextgroup=slpregScopeNameSep,
     60                                \ slpregScopeNewline
     61 
     62 syn match   slpregScopeNameSep  contained ','
     63                                \ nextgroup=slpregScopeName
     64 
     65 syn match   slpregScopeNewline  contained '\s*\n'
     66                                \ nextgroup=slpregAttribute skipnl
     67 
     68 syn match   slpregAttribute     contained '[^(),\\!<=>[:cntrl:]* \t_]\+'
     69                                \ nextgroup=slpregAttributeEq,
     70                                \ slpregScopeNewline
     71 
     72 syn match   slpregAttributeEq   contained '='
     73                                \ nextgroup=@slpregAttrValue
     74 
     75 syn cluster slpregAttrValueCon  contains=slpregAttribute,slpregAttrValueSep
     76 
     77 syn cluster slpregAttrValue     contains=slpregAttrIValue,slpregAttrSValue,
     78                                \ slpregAttrBValue,slpregAttrSSValue
     79 
     80 syn match   slpregAttrSValue    contained display '[^(),\\!<=>~[:cntrl:]]\+'
     81                                \ nextgroup=@slpregAttrValueCon skipwhite skipnl
     82 
     83 syn match   slpregAttrSSValue   contained display '\\FF\%(\\\x\x\)\+'
     84                                \ nextgroup=@slpregAttrValueCon skipwhite skipnl
     85 
     86 syn match   slpregAttrIValue    contained display '[-]\=\d\+\>'
     87                                \ nextgroup=@slpregAttrValueCon skipwhite skipnl
     88 
     89 syn keyword slpregAttrBValue    contained true false
     90                                \ nextgroup=@slpregAttrValueCon skipwhite skipnl
     91 
     92 syn match   slpregAttrValueSep  contained display ','
     93                                \ nextgroup=@slpregAttrValue skipwhite skipnl
     94 
     95 hi def link slpregTodo          Todo
     96 hi def link slpregComment       Comment
     97 hi def link slpregServiceURL    Type
     98 hi def link slpregServiceType   slpregServiceURL
     99 hi def link slpregServiceSAPCol slpregServiceURL
    100 hi def link slpregSAP           slpregServiceURL
    101 hi def link slpregDelimiter     Delimiter
    102 hi def link slpregLangSep       slpregDelimiter
    103 hi def link slpregLang          String
    104 hi def link slpregLTimeSep      slpregDelimiter
    105 hi def link slpregLTime         Number
    106 hi def link slpregType          Type
    107 hi def link slpregScopes        Identifier
    108 hi def link slpregScopesEq      Operator
    109 hi def link slpregScopeName     String
    110 hi def link slpregScopeNameSep  slpregDelimiter
    111 hi def link slpregAttribute     Identifier
    112 hi def link slpregAttributeEq   Operator
    113 hi def link slpregAttrSValue    String
    114 hi def link slpregAttrSSValue   slpregAttrSValue
    115 hi def link slpregAttrIValue    Number
    116 hi def link slpregAttrBValue    Boolean
    117 hi def link slpregAttrValueSep  slpregDelimiter
    118 
    119 let b:current_syntax = "slpreg"
    120 
    121 let &cpo = s:cpo_save
    122 unlet s:cpo_save