Be a little more flexible with order strings
[bitfield] / bitfield.vim
1 " Vim syntax file
2 "   Jeremy Kerr <jk@ozlabs.org>, 2005
3
4
5 " Setup
6 if version < 600
7         syntax clear
8 "elseif exists("b:current_syntax")
9 "       finish
10 endif
11
12 syn match bitfComment   /;.*$/
13
14 syn match regID         /\[\S\+\]/
15 syn match regParam      /^\(name\|width\)/
16
17 syn match fieldName     /.*/                    contained
18 syn match fieldRange    /\d\(\d\|[,\:]\)*/      contained nextgroup=fieldName
19 syn region fieldDef     start=/^field:/ end=/$/ contains=fieldRange keepend
20
21 syn match valueName     /.*/                    contained
22 syn match valueNo       /\d\+/                  contained nextgroup=valueName
23 syn region valueDef     start=/^value:/ end=/$/ contains=valueNo keepend
24
25 if !exists("did_bitfield_syntax_inits")
26 let did_bitfield_syntax_inits = 1
27 hi link bitfComment     Comment
28
29 hi link regID           Type
30 hi link regParam        Keyword
31
32 hi link fieldDef        Keyword
33 hi link fieldRange      Number
34 "hi link fieldName      Identifier
35
36 hi link valueDef        Keyword
37 hi link valueNo         Number
38 hi link valueName       Identifier
39 endif
40
41 let b:current_syntax = "bitfield"