annotate runtime/syntax/proto.vim @ 9487:69ed2c9d34a6 v7.4.2024

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