-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitfield.vim
41 lines (30 loc) · 939 Bytes
/
bitfield.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
" Vim syntax file
" Jeremy Kerr <[email protected]>, 2005
" Setup
if version < 600
syntax clear
"elseif exists("b:current_syntax")
" finish
endif
syn match bitfComment /;.*$/
syn match regID /\[\S\+\]/
syn match regParam /^\(name\|width\)/
syn match fieldName /.*/ contained
syn match fieldRange /\d\(\d\|[,\:]\)*/ contained nextgroup=fieldName
syn region fieldDef start=/^field:/ end=/$/ contains=fieldRange keepend
syn match valueName /.*/ contained
syn match valueNo /\d\+/ contained nextgroup=valueName
syn region valueDef start=/^value:/ end=/$/ contains=valueNo keepend
if !exists("did_bitfield_syntax_inits")
let did_bitfield_syntax_inits = 1
hi link bitfComment Comment
hi link regID Type
hi link regParam Keyword
hi link fieldDef Keyword
hi link fieldRange Number
"hi link fieldName Identifier
hi link valueDef Keyword
hi link valueNo Number
hi link valueName Identifier
endif
let b:current_syntax = "bitfield"