4869
|
1 " syntax file for Protocol Buffers - Google's data interchange format
|
|
2 "
|
|
3 " Copyright 2008 Google Inc. All rights reserved.
|
|
4 "
|
|
5 " Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6 " of this software and associated documentation files (the "Software"), to deal
|
|
7 " in the Software without restriction, including without limitation the rights
|
|
8 " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9 " copies of the Software, and to permit persons to whom the Software is
|
|
10 " furnished to do so, subject to the following conditions:
|
|
11 "
|
|
12 " The above copyright notice and this permission notice shall be included in
|
|
13 " all copies or substantial portions of the Software.
|
|
14 "
|
|
15 " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16 " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17 " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18 " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19 " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20 " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21 " THE SOFTWARE.
|
|
22 "
|
|
23 " http://code.google.com/p/protobuf/
|
|
24
|
|
25 if version < 600
|
|
26 syntax clear
|
|
27 elseif exists("b:current_syntax")
|
|
28 finish
|
|
29 endif
|
|
30
|
|
31 syn case match
|
|
32
|
|
33 syn keyword protoTodo contained TODO FIXME XXX
|
|
34 syn cluster protoCommentGrp contains=protoTodo
|
|
35
|
|
36 syn keyword protoSyntax syntax import option
|
|
37 syn keyword protoStructure package message group
|
|
38 syn keyword protoRepeat optional required repeated
|
|
39 syn keyword protoDefault default
|
|
40 syn keyword protoExtend extend extensions to max
|
|
41 syn keyword protoRPC service rpc returns
|
|
42
|
|
43 syn keyword protoType int32 int64 uint32 uint64 sint32 sint64
|
|
44 syn keyword protoType fixed32 fixed64 sfixed32 sfixed64
|
|
45 syn keyword protoType float double bool string bytes
|
|
46 syn keyword protoTypedef enum
|
|
47 syn keyword protoBool true false
|
|
48
|
|
49 syn match protoInt /-\?\<\d\+\>/
|
|
50 syn match protoInt /\<0[xX]\x+\>/
|
|
51 syn match protoFloat /\<-\?\d*\(\.\d*\)\?/
|
|
52 syn region protoComment start="\/\*" end="\*\/" contains=@protoCommentGrp
|
|
53 syn region protoComment start="//" skip="\\$" end="$" keepend contains=@protoCommentGrp
|
|
54 syn region protoString start=/"/ skip=/\\./ end=/"/
|
|
55 syn region protoString start=/'/ skip=/\\./ end=/'/
|
|
56
|
|
57 hi def link protoTodo Todo
|
|
58
|
|
59 hi def link protoSyntax Include
|
|
60 hi def link protoStructure Structure
|
|
61 hi def link protoRepeat Repeat
|
|
62 hi def link protoDefault Keyword
|
|
63 hi def link protoExtend Keyword
|
|
64 hi def link protoRPC Keyword
|
|
65 hi def link protoType Type
|
|
66 hi def link protoTypedef Typedef
|
|
67 hi def link protoBool Boolean
|
|
68
|
|
69 hi def link protoInt Number
|
|
70 hi def link protoFloat Float
|
|
71 hi def link protoComment Comment
|
|
72 hi def link protoString String
|
|
73
|
|
74 let b:current_syntax = "proto"
|