slpconf.vim 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. " Vim syntax file
  2. " Language: RFC 2614 - An API for Service Location configuration 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 slpconfTodo contained TODO FIXME XXX NOTE
  11. syn region slpconfComment display oneline start='^[#;]' end='$'
  12. \ contains=slpconfTodo,@Spell
  13. syn match slpconfBegin display '^'
  14. \ nextgroup=slpconfTag,
  15. \ slpconfComment skipwhite
  16. syn keyword slpconfTag contained net
  17. \ nextgroup=slpconfNetTagDot
  18. syn match slpconfNetTagDot contained display '.'
  19. \ nextgroup=slpconfNetTag
  20. syn keyword slpconfNetTag contained slp
  21. \ nextgroup=slpconfNetSlpTagdot
  22. syn match slpconfNetSlpTagDot contained display '.'
  23. \ nextgroup=slpconfNetSlpTag
  24. syn keyword slpconfNetSlpTag contained isDA traceDATraffic traceMsg
  25. \ traceDrop traceReg isBroadcastOnly
  26. \ passiveDADetection securityEnabled
  27. \ nextgroup=slpconfBooleanEq,slpconfBooleanHome
  28. \ skipwhite
  29. syn match slpconfBooleanHome contained display
  30. \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  31. \ nextgroup=slpconfBooleanEq skipwhite
  32. syn match slpconfBooleanEq contained display '='
  33. \ nextgroup=slpconfBoolean skipwhite
  34. syn keyword slpconfBoolean contained true false TRUE FALSE
  35. syn keyword slpconfNetSlpTag contained DAHeartBeat multicastTTL
  36. \ DAActiveDiscoveryInterval
  37. \ multicastMaximumWait multicastTimeouts
  38. \ randomWaitBound MTU maxResults
  39. \ nextgroup=slpconfIntegerEq,slpconfIntegerHome
  40. \ skipwhite
  41. syn match slpconfIntegerHome contained display
  42. \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  43. \ nextgroup=slpconfIntegerEq skipwhite
  44. syn match slpconfIntegerEq contained display '='
  45. \ nextgroup=slpconfInteger skipwhite
  46. syn match slpconfInteger contained display '\<\d\+\>'
  47. syn keyword slpconfNetSlpTag contained DAAttributes SAAttributes
  48. \ nextgroup=slpconfAttrEq,slpconfAttrHome
  49. \ skipwhite
  50. syn match slpconfAttrHome contained display
  51. \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  52. \ nextgroup=slpconfAttrEq skipwhite
  53. syn match slpconfAttrEq contained display '='
  54. \ nextgroup=slpconfAttrBegin skipwhite
  55. syn match slpconfAttrBegin contained display '('
  56. \ nextgroup=slpconfAttrTag skipwhite
  57. syn match slpconfAttrTag contained display
  58. \ '[^* \t_(),\\!<=>~[:cntrl:]]\+'
  59. \ nextgroup=slpconfAttrTagEq skipwhite
  60. syn match slpconfAttrTagEq contained display '='
  61. \ nextgroup=@slpconfAttrValue skipwhite
  62. syn cluster slpconfAttrValueCon contains=slpconfAttrValueSep,slpconfAttrEnd
  63. syn cluster slpconfAttrValue contains=slpconfAttrIValue,slpconfAttrSValue,
  64. \ slpconfAttrBValue,slpconfAttrSSValue
  65. syn match slpconfAttrSValue contained display '[^ (),\\!<=>~[:cntrl:]]\+'
  66. \ nextgroup=@slpconfAttrValueCon skipwhite
  67. syn match slpconfAttrSSValue contained display '\\FF\%(\\\x\x\)\+'
  68. \ nextgroup=@slpconfAttrValueCon skipwhite
  69. syn match slpconfAttrIValue contained display '[-]\=\d\+\>'
  70. \ nextgroup=@slpconfAttrValueCon skipwhite
  71. syn keyword slpconfAttrBValue contained true false
  72. \ nextgroup=@slpconfAttrValueCon skipwhite
  73. syn match slpconfAttrValueSep contained display ','
  74. \ nextgroup=@slpconfAttrValue skipwhite
  75. syn match slpconfAttrEnd contained display ')'
  76. \ nextgroup=slpconfAttrSep skipwhite
  77. syn match slpconfAttrSep contained display ','
  78. \ nextgroup=slpconfAttrBegin skipwhite
  79. syn keyword slpconfNetSlpTag contained useScopes typeHint
  80. \ nextgroup=slpconfStringsEq,slpconfStringsHome
  81. \ skipwhite
  82. syn match slpconfStringsHome contained display
  83. \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  84. \ nextgroup=slpconfStringsEq skipwhite
  85. syn match slpconfStringsEq contained display '='
  86. \ nextgroup=slpconfStrings skipwhite
  87. syn match slpconfStrings contained display
  88. \ '\%([[:digit:][:alpha:]]\|[!-+./:-@[-`{-~-]\|\\\x\x\)\+'
  89. \ nextgroup=slpconfStringsSep skipwhite
  90. syn match slpconfStringsSep contained display ','
  91. \ nextgroup=slpconfStrings skipwhite
  92. syn keyword slpconfNetSlpTag contained DAAddresses
  93. \ nextgroup=slpconfAddressesEq,slpconfAddrsHome
  94. \ skipwhite
  95. syn match slpconfAddrsHome contained display
  96. \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  97. \ nextgroup=slpconfAddressesEq skipwhite
  98. syn match slpconfAddressesEq contained display '='
  99. \ nextgroup=@slpconfAddresses skipwhite
  100. syn cluster slpconfAddresses contains=slpconfFQDNs,slpconfHostnumbers
  101. syn match slpconfFQDNs contained display
  102. \ '\a[[:alnum:]-]*[[:alnum:]]\|\a'
  103. \ nextgroup=slpconfAddressesSep skipwhite
  104. syn match slpconfHostnumbers contained display
  105. \ '\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  106. \ nextgroup=slpconfAddressesSep skipwhite
  107. syn match slpconfAddressesSep contained display ','
  108. \ nextgroup=@slpconfAddresses skipwhite
  109. syn keyword slpconfNetSlpTag contained serializedRegURL
  110. \ nextgroup=slpconfStringEq,slpconfStringHome
  111. \ skipwhite
  112. syn match slpconfStringHome contained display
  113. \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  114. \ nextgroup=slpconfStringEq skipwhite
  115. syn match slpconfStringEq contained display '='
  116. \ nextgroup=slpconfString skipwhite
  117. syn match slpconfString contained display
  118. \ '\%([!-+./:-@[-`{-~-]\|\\\x\x\)\+\|[[:digit:][:alpha:]]'
  119. syn keyword slpconfNetSlpTag contained multicastTimeouts DADiscoveryTimeouts
  120. \ datagramTimeouts
  121. \ nextgroup=slpconfIntegersEq,
  122. \ slpconfIntegersHome skipwhite
  123. syn match slpconfIntegersHome contained display
  124. \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  125. \ nextgroup=slpconfIntegersEq skipwhite
  126. syn match slpconfIntegersEq contained display '='
  127. \ nextgroup=slpconfIntegers skipwhite
  128. syn match slpconfIntegers contained display '\<\d\+\>'
  129. \ nextgroup=slpconfIntegersSep skipwhite
  130. syn match slpconfIntegersSep contained display ','
  131. \ nextgroup=slpconfIntegers skipwhite
  132. syn keyword slpconfNetSlpTag contained interfaces
  133. \ nextgroup=slpconfHostnumsEq,
  134. \ slpconfHostnumsHome skipwhite
  135. syn match slpconfHostnumsHome contained display
  136. \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  137. \ nextgroup=slpconfHostnumsEq skipwhite
  138. syn match slpconfHostnumsEq contained display '='
  139. \ nextgroup=slpconfOHostnumbers skipwhite
  140. syn match slpconfOHostnumbers contained display
  141. \ '\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  142. \ nextgroup=slpconfHostnumsSep skipwhite
  143. syn match slpconfHostnumsSep contained display ','
  144. \ nextgroup=slpconfOHostnumbers skipwhite
  145. syn keyword slpconfNetSlpTag contained locale
  146. \ nextgroup=slpconfLocaleEq,slpconfLocaleHome
  147. \ skipwhite
  148. syn match slpconfLocaleHome contained display
  149. \ '\.\d\{1,3}\%(\.\d\{1,3}\)\{3}'
  150. \ nextgroup=slpconfLocaleEq skipwhite
  151. syn match slpconfLocaleEq contained display '='
  152. \ nextgroup=slpconfLocale skipwhite
  153. syn match slpconfLocale contained display '\a\{1,8}\%(-\a\{1,8}\)\='
  154. hi def link slpconfTodo Todo
  155. hi def link slpconfComment Comment
  156. hi def link slpconfTag Identifier
  157. hi def link slpconfDelimiter Delimiter
  158. hi def link slpconfNetTagDot slpconfDelimiter
  159. hi def link slpconfNetTag slpconfTag
  160. hi def link slpconfNetSlpTagDot slpconfNetTagDot
  161. hi def link slpconfNetSlpTag slpconfTag
  162. hi def link slpconfHome Special
  163. hi def link slpconfBooleanHome slpconfHome
  164. hi def link slpconfEq Operator
  165. hi def link slpconfBooleanEq slpconfEq
  166. hi def link slpconfBoolean Boolean
  167. hi def link slpconfIntegerHome slpconfHome
  168. hi def link slpconfIntegerEq slpconfEq
  169. hi def link slpconfInteger Number
  170. hi def link slpconfAttrHome slpconfHome
  171. hi def link slpconfAttrEq slpconfEq
  172. hi def link slpconfAttrBegin slpconfDelimiter
  173. hi def link slpconfAttrTag slpconfTag
  174. hi def link slpconfAttrTagEq slpconfEq
  175. hi def link slpconfAttrIValue slpconfInteger
  176. hi def link slpconfAttrSValue slpconfString
  177. hi def link slpconfAttrBValue slpconfBoolean
  178. hi def link slpconfAttrSSValue slpconfString
  179. hi def link slpconfSeparator slpconfDelimiter
  180. hi def link slpconfAttrValueSep slpconfSeparator
  181. hi def link slpconfAttrEnd slpconfAttrBegin
  182. hi def link slpconfAttrSep slpconfSeparator
  183. hi def link slpconfStringsHome slpconfHome
  184. hi def link slpconfStringsEq slpconfEq
  185. hi def link slpconfStrings slpconfString
  186. hi def link slpconfStringsSep slpconfSeparator
  187. hi def link slpconfAddrsHome slpconfHome
  188. hi def link slpconfAddressesEq slpconfEq
  189. hi def link slpconfFQDNs String
  190. hi def link slpconfHostnumbers Number
  191. hi def link slpconfAddressesSep slpconfSeparator
  192. hi def link slpconfStringHome slpconfHome
  193. hi def link slpconfStringEq slpconfEq
  194. hi def link slpconfString String
  195. hi def link slpconfIntegersHome slpconfHome
  196. hi def link slpconfIntegersEq slpconfEq
  197. hi def link slpconfIntegers slpconfInteger
  198. hi def link slpconfIntegersSep slpconfSeparator
  199. hi def link slpconfHostnumsHome slpconfHome
  200. hi def link slpconfHostnumsEq slpconfEq
  201. hi def link slpconfOHostnumbers slpconfHostnumbers
  202. hi def link slpconfHostnumsSep slpconfSeparator
  203. hi def link slpconfLocaleHome slpconfHome
  204. hi def link slpconfLocaleEq slpconfEq
  205. hi def link slpconfLocale slpconfString
  206. let b:current_syntax = "slpconf"
  207. let &cpo = s:cpo_save
  208. unlet s:cpo_save