slpreg.vim 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. if exists("b:current_syntax")
  6. finish
  7. endif
  8. let s:cpo_save = &cpo
  9. set cpo&vim
  10. syn keyword slpregTodo contained TODO FIXME XXX NOTE
  11. syn region slpregComment display oneline start='^[#;]' end='$'
  12. \ contains=slpregTodo,@Spell
  13. syn match slpregBegin display '^'
  14. \ nextgroup=slpregServiceURL,
  15. \ slpregComment
  16. syn match slpregServiceURL contained display 'service:'
  17. \ nextgroup=slpregServiceType
  18. syn match slpregServiceType contained display '\a[[:alpha:][:digit:]+-]*\%(\.\a[[:alpha:][:digit:]+-]*\)\=\%(:\a[[:alpha:][:digit:]+-]*\)\='
  19. \ nextgroup=slpregServiceSAPCol
  20. syn match slpregServiceSAPCol contained display ':'
  21. \ nextgroup=slpregSAP
  22. syn match slpregSAP contained '[^,]\+'
  23. \ nextgroup=slpregLangSep
  24. "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:] ]\+\)\=\)*'
  25. syn match slpregLangSep contained display ','
  26. \ nextgroup=slpregLang
  27. syn match slpregLang contained display '\a\{1,8}\%(-\a\{1,8\}\)\='
  28. \ nextgroup=slpregLTimeSep
  29. syn match slpregLTimeSep contained display ','
  30. \ nextgroup=slpregLTime
  31. syn match slpregLTime contained display '\d\{1,5}'
  32. \ nextgroup=slpregType,slpregUNewline
  33. syn match slpregType contained display '\a[[:alpha:][:digit:]+-]*'
  34. \ nextgroup=slpregUNewLine
  35. syn match slpregUNewLine contained '\s*\n'
  36. \ nextgroup=slpregScopes,slpregAttrList skipnl
  37. syn keyword slpregScopes contained scopes
  38. \ nextgroup=slpregScopesEq
  39. syn match slpregScopesEq contained '=' nextgroup=slpregScopeName
  40. syn match slpregScopeName contained '[^(),\\!<=>[:cntrl:];*+ ]\+'
  41. \ nextgroup=slpregScopeNameSep,
  42. \ slpregScopeNewline
  43. syn match slpregScopeNameSep contained ','
  44. \ nextgroup=slpregScopeName
  45. syn match slpregScopeNewline contained '\s*\n'
  46. \ nextgroup=slpregAttribute skipnl
  47. syn match slpregAttribute contained '[^(),\\!<=>[:cntrl:]* \t_]\+'
  48. \ nextgroup=slpregAttributeEq,
  49. \ slpregScopeNewline
  50. syn match slpregAttributeEq contained '='
  51. \ nextgroup=@slpregAttrValue
  52. syn cluster slpregAttrValueCon contains=slpregAttribute,slpregAttrValueSep
  53. syn cluster slpregAttrValue contains=slpregAttrIValue,slpregAttrSValue,
  54. \ slpregAttrBValue,slpregAttrSSValue
  55. syn match slpregAttrSValue contained display '[^(),\\!<=>~[:cntrl:]]\+'
  56. \ nextgroup=@slpregAttrValueCon skipwhite skipnl
  57. syn match slpregAttrSSValue contained display '\\FF\%(\\\x\x\)\+'
  58. \ nextgroup=@slpregAttrValueCon skipwhite skipnl
  59. syn match slpregAttrIValue contained display '[-]\=\d\+\>'
  60. \ nextgroup=@slpregAttrValueCon skipwhite skipnl
  61. syn keyword slpregAttrBValue contained true false
  62. \ nextgroup=@slpregAttrValueCon skipwhite skipnl
  63. syn match slpregAttrValueSep contained display ','
  64. \ nextgroup=@slpregAttrValue skipwhite skipnl
  65. hi def link slpregTodo Todo
  66. hi def link slpregComment Comment
  67. hi def link slpregServiceURL Type
  68. hi def link slpregServiceType slpregServiceURL
  69. hi def link slpregServiceSAPCol slpregServiceURL
  70. hi def link slpregSAP slpregServiceURL
  71. hi def link slpregDelimiter Delimiter
  72. hi def link slpregLangSep slpregDelimiter
  73. hi def link slpregLang String
  74. hi def link slpregLTimeSep slpregDelimiter
  75. hi def link slpregLTime Number
  76. hi def link slpregType Type
  77. hi def link slpregScopes Identifier
  78. hi def link slpregScopesEq Operator
  79. hi def link slpregScopeName String
  80. hi def link slpregScopeNameSep slpregDelimiter
  81. hi def link slpregAttribute Identifier
  82. hi def link slpregAttributeEq Operator
  83. hi def link slpregAttrSValue String
  84. hi def link slpregAttrSSValue slpregAttrSValue
  85. hi def link slpregAttrIValue Number
  86. hi def link slpregAttrBValue Boolean
  87. hi def link slpregAttrValueSep slpregDelimiter
  88. let b:current_syntax = "slpreg"
  89. let &cpo = s:cpo_save
  90. unlet s:cpo_save