Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Renderman Interface Bytestream |
| 3 | " Maintainer: Andrew Bromage <ajb@spamcop.net> |
| 4 | " Last Change: 2003 May 11 |
| 5 | " |
| 6 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 7 | " quit when a syntax file was already loaded |
| 8 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9 | finish |
| 10 | endif |
| 11 | |
| 12 | syn case match |
| 13 | |
| 14 | " Comments |
| 15 | syn match ribLineComment "#.*$" |
| 16 | syn match ribStructureComment "##.*$" |
| 17 | |
| 18 | syn case ignore |
| 19 | syn match ribCommand /[A-Z][a-zA-Z]*/ |
| 20 | syn case match |
| 21 | |
| 22 | syn region ribString start=/"/ skip=/\\"/ end=/"/ |
| 23 | |
| 24 | syn match ribStructure "[A-Z][a-zA-Z]*Begin\>\|[A-Z][a-zA-Z]*End" |
| 25 | syn region ribSectionFold start="FrameBegin" end="FrameEnd" fold transparent keepend extend |
| 26 | syn region ribSectionFold start="WorldBegin" end="WorldEnd" fold transparent keepend extend |
| 27 | syn region ribSectionFold start="TransformBegin" end="TransformEnd" fold transparent keepend extend |
| 28 | syn region ribSectionFold start="AttributeBegin" end="AttributeEnd" fold transparent keepend extend |
| 29 | syn region ribSectionFold start="MotionBegin" end="MotionEnd" fold transparent keepend extend |
| 30 | syn region ribSectionFold start="SolidBegin" end="SolidEnd" fold transparent keepend extend |
| 31 | syn region ribSectionFold start="ObjectBegin" end="ObjectEnd" fold transparent keepend extend |
| 32 | |
| 33 | syn sync fromstart |
| 34 | |
| 35 | "integer number, or floating point number without a dot and with "f". |
| 36 | syn case ignore |
| 37 | syn match ribNumbers display transparent "[-]\=\<\d\|\.\d" contains=ribNumber,ribFloat |
| 38 | syn match ribNumber display contained "[-]\=\d\+\>" |
| 39 | "floating point number, with dot, optional exponent |
| 40 | syn match ribFloat display contained "[-]\=\d\+\.\d*\(e[-+]\=\d\+\)\=" |
| 41 | "floating point number, starting with a dot, optional exponent |
| 42 | syn match ribFloat display contained "[-]\=\.\d\+\(e[-+]\=\d\+\)\=\>" |
| 43 | "floating point number, without dot, with exponent |
| 44 | syn match ribFloat display contained "[-]\=\d\+e[-+]\d\+\>" |
| 45 | syn case match |
| 46 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 47 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 48 | hi def link ribStructure Structure |
| 49 | hi def link ribCommand Statement |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 50 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 51 | hi def link ribStructureComment SpecialComment |
| 52 | hi def link ribLineComment Comment |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 53 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 54 | hi def link ribString String |
| 55 | hi def link ribNumber Number |
| 56 | hi def link ribFloat Float |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 57 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 58 | |
| 59 | |
| 60 | let b:current_syntax = "rib" |
| 61 | |
| 62 | " Options for vi: ts=8 sw=2 sts=2 nowrap noexpandtab ft=vim |