| 1 |
filetype: proto |
| 2 |
|
| 3 |
detect: |
| 4 |
filename: "(\\.(proto)$$)" |
| 5 |
|
| 6 |
rules: |
| 7 |
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b" |
| 8 |
- type: "\\b(int(8|16|32|64))|string|bytes|repeated|bool|required|map|optional|oneof|union\\b" |
| 9 |
- statement: "\\b(import|service|enum|syntax|package|option|message|rpc|returns|extensions|to)\\b" |
| 10 |
- constant: "'\\\\(([0-3]?[0-7]{1,2}))'" |
| 11 |
- constant: "'\\\\x[0-9A-Fa-f]{1,2}'" |
| 12 |
- symbol.brackets: "[(){}]|\\[|\\]" |
| 13 |
- constant.number: "(\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b)" |
| 14 |
|
| 15 |
- constant.string: |
| 16 |
start: "\"" |
| 17 |
end: "\"" |
| 18 |
skip: "\\\\." |
| 19 |
rules: |
| 20 |
- constant.specialChar: "\\\\." |
| 21 |
|
| 22 |
- constant.string: |
| 23 |
start: "'" |
| 24 |
end: "'" |
| 25 |
skip: "\\\\." |
| 26 |
rules: |
| 27 |
- preproc: "..+" |
| 28 |
- constant.specialChar: "\\\\." |
| 29 |
|
| 30 |
- comment: |
| 31 |
start: "//" |
| 32 |
end: "$" |
| 33 |
rules: |
| 34 |
- todo: "(TODO|XXX|FIXME):?" |
| 35 |
|
| 36 |
- comment: |
| 37 |
start: "/\\*" |
| 38 |
end: "\\*/" |
| 39 |
rules: |
| 40 |
- todo: "(TODO|XXX|FIXME):?" |