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