7
|
1 " Vim syntax file
|
|
2 " Language: Renderman Interface Bytestream
|
|
3 " Maintainer: Andrew Bromage <ajb@spamcop.net>
|
|
4 " Last Change: 2003 May 11
|
|
5 "
|
|
6
|
|
7 " Remove any old syntax stuff hanging around
|
|
8 if version < 600
|
|
9 syn clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
|
14 syn case match
|
|
15
|
|
16 " Comments
|
|
17 syn match ribLineComment "#.*$"
|
|
18 syn match ribStructureComment "##.*$"
|
|
19
|
|
20 syn case ignore
|
|
21 syn match ribCommand /[A-Z][a-zA-Z]*/
|
|
22 syn case match
|
|
23
|
|
24 syn region ribString start=/"/ skip=/\\"/ end=/"/
|
|
25
|
|
26 syn match ribStructure "[A-Z][a-zA-Z]*Begin\>\|[A-Z][a-zA-Z]*End"
|
|
27 syn region ribSectionFold start="FrameBegin" end="FrameEnd" fold transparent keepend extend
|
|
28 syn region ribSectionFold start="WorldBegin" end="WorldEnd" fold transparent keepend extend
|
|
29 syn region ribSectionFold start="TransformBegin" end="TransformEnd" fold transparent keepend extend
|
|
30 syn region ribSectionFold start="AttributeBegin" end="AttributeEnd" fold transparent keepend extend
|
|
31 syn region ribSectionFold start="MotionBegin" end="MotionEnd" fold transparent keepend extend
|
|
32 syn region ribSectionFold start="SolidBegin" end="SolidEnd" fold transparent keepend extend
|
|
33 syn region ribSectionFold start="ObjectBegin" end="ObjectEnd" fold transparent keepend extend
|
|
34
|
|
35 syn sync fromstart
|
|
36
|
|
37 "integer number, or floating point number without a dot and with "f".
|
|
38 syn case ignore
|
|
39 syn match ribNumbers display transparent "[-]\=\<\d\|\.\d" contains=ribNumber,ribFloat
|
|
40 syn match ribNumber display contained "[-]\=\d\+\>"
|
|
41 "floating point number, with dot, optional exponent
|
|
42 syn match ribFloat display contained "[-]\=\d\+\.\d*\(e[-+]\=\d\+\)\="
|
|
43 "floating point number, starting with a dot, optional exponent
|
|
44 syn match ribFloat display contained "[-]\=\.\d\+\(e[-+]\=\d\+\)\=\>"
|
|
45 "floating point number, without dot, with exponent
|
|
46 syn match ribFloat display contained "[-]\=\d\+e[-+]\d\+\>"
|
|
47 syn case match
|
|
48
|
|
49 if version >= 508 || !exists("did_rib_syntax_inits")
|
|
50 if version < 508
|
|
51 let did_rib_syntax_inits = 1
|
|
52 command -nargs=+ HiLink hi link <args>
|
|
53 else
|
|
54 command -nargs=+ HiLink hi def link <args>
|
|
55 endif
|
|
56
|
|
57 HiLink ribStructure Structure
|
|
58 HiLink ribCommand Statement
|
|
59
|
|
60 HiLink ribStructureComment SpecialComment
|
|
61 HiLink ribLineComment Comment
|
|
62
|
|
63 HiLink ribString String
|
|
64 HiLink ribNumber Number
|
|
65 HiLink ribFloat Float
|
|
66
|
|
67 delcommand HiLink
|
|
68 end
|
|
69
|
|
70
|
|
71 let b:current_syntax = "rib"
|
|
72
|
|
73 " Options for vi: ts=8 sw=2 sts=2 nowrap noexpandtab ft=vim
|