OLD | NEW |
(Empty) | |
| 1 " Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 " Use of this source code is governed by a BSD-style license that can be |
| 3 " found in the LICENSE file. |
| 4 " Vim syntax file " Language: Mojom |
| 5 " To get syntax highlighting for .mojom files, add the following to your .vimrc |
| 6 " file: |
| 7 " set runtimepath^=/path/to/src/tools/vim/mojom |
| 8 syn case match |
| 9 |
| 10 syntax region mojomFold start="{" end="}" transparent fold |
| 11 |
| 12 " keyword definitions |
| 13 syntax keyword mojomType bool int8 int16 int32 int64 uint8 uint16 uint32
uint64 float double array |
| 14 syntax keyword mojomType handle map string |
| 15 syntax match mojomImport "^\(import\)\s" |
| 16 syntax keyword mojomKeyword const module interface enum struct union |
| 17 syntax match mojomOperator /=>/ |
| 18 syntax match mojomOperator /?/ |
| 19 |
| 20 " Comments |
| 21 syntax keyword mojomTodo contained TODO FIXME XXX |
| 22 syntax region mojomComment start="/\*" end="\*/" contains=mojomTodo,moj
omDocLink,@Spell |
| 23 syntax match mojomLineComment "//.*" contains=mojomTodo,@Spell |
| 24 syntax match mojomLineDocComment "///.*" contains=mojomTodo,mojomDocLink,@Spel
l |
| 25 syntax region mojomDocLink contained start=+\[+ end=+\]+ |
| 26 |
| 27 " Strings |
| 28 syn region mojomString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell |
| 29 hi def link mojomString String |
| 30 |
| 31 " Numbers |
| 32 syntax match mojomFloat '-\?\d*\.\d\+\>' |
| 33 syntax match mojomHex '\<0x[0-9a-fA-F]\+\>' |
| 34 syntax match mojomInt '-\?\<\(0\>\|[1-9]\d*\)' |
| 35 |
| 36 " syntax match mojomNumber '\<0\>' |
| 37 |
| 38 " Literals |
| 39 syntax keyword mojomLiteral true false |
| 40 syntax keyword mojomLiteral float.INFINITY float.NEGATIVE_INFINITY float.NAN |
| 41 syntax keyword mojomLiteral double.INFINITY double.NEGATIVE_INFINITY double.NAN |
| 42 |
| 43 " The default highlighting. |
| 44 highlight default link mojomTodo Todo |
| 45 highlight default link mojomComment Comment |
| 46 highlight default link mojomLineComment Comment |
| 47 highlight default link mojomLineDocComment Comment |
| 48 highlight default link mojomDocLink SpecialComment |
| 49 highlight default link mojomType Type |
| 50 highlight default link mojomImport Include |
| 51 highlight default link mojomKeyword Keyword |
| 52 highlight default link mojomOperator Operator |
| 53 highlight default link mojomLiteral Constant |
| 54 highlight default link mojomFloat Float |
| 55 highlight default link mojomHex Number |
| 56 highlight default link mojomInt Number |
| 57 |
| 58 |
| 59 let b:current_syntax = "mojom" |
| 60 let b:spell_options = "contained" |
| 61 |
| 62 syn sync minlines=500 |
| 63 |
| 64 let b:current_syntax = "mojom" |
OLD | NEW |