File: pov.vim

package info (click to toggle)
vim-rt 5.3-12
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,172 kB
  • ctags: 815
  • sloc: makefile: 857; awk: 778; ansic: 379; perl: 192; sh: 167
file content (129 lines) | stat: -rw-r--r-- 5,355 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
" Vim syntax file
" Language:	povray screen description language
" Maintainer:	T. Scott Urban <urban@blarg.net>
" Last change:	1998 Mar 29

" Remove any old syntax stuff hanging around
syn clear

" A bunch of useful Pov keywords
syn keyword povCommands		background camera global_settings light_source
syn keyword povObjects		atmosphere bicubic_patch blob box cone cylinder difference height_field intersection lathe merge mesh object plane polygon prism sor sphere superellipsoid text torus triangle union
syn keyword povTypes		x y z hf_gray_16
syn keyword povModifiers	rotate scale translate
syn keyword povDescriptors	adaptive ambient ambient_settings angle aperture area_light assumed_gamma blue blur_samples brick checker color color_map conic_sweep cubic_spline diffuse fade_distance fade_power falloff finish focal_point frequency green hexagon linear_spline linear_sweep location look_at looks_like max_trace_level metallic no_shadow normal open orthographic phong pigment quadratic_spline radius red reflection rgb roughness shadowless specular spotlight texture tga threshold tightness ttf turbulence u_step v_step wrinkles

syn keyword povConditional	if ifdef else switch

syn keyword povTodo contained	TODO FIXME XXX

" comments
syn region povComment	start="/\*" end="\*/" contains=povTodo
syn match  povComment	"//.*" contains=povTodo
syn match  povCommentError	"\*/"
syn sync ccomment povComment

" include statements
syn region povIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
syn match povIncluded contained "<[^>]*>"
syn match povInclude	"^#[ 	]*include\>[ 	]*["<]" contains=povIncluded

syn keyword povLabel		case default
syn keyword povRepeat		while for do

" String and Character constants
" Highlight special characters (those which have a backslash) differently
syn match   povSpecial contained "\\\d\d\d\|\\."
syn region  povString		  start=+"+  skip=+\\\\\|\\"+  end=+"+  contains=povSpecial
syn match   povCharacter	  "'[^\\]'"
syn match   povSpecialCharacter  "'\\.'"

"catch errors caused by wrong parenthesis
syn region	povParen		transparent start='(' end=')' contains=ALLBUT,povParenError,povIncluded,povSpecial,povTodo,povUserLabel
syn match	povParenError	")"
syn match	povInParen	contained "[{}]"
hi link povParenError povError
hi link povInParen povError

"integer number, or floating point number without a dot and with "f".
syn case ignore
syn match  povNumber		"\<\d\+\(u\=l\=\|lu\|f\)\>"
"floating point number, with dot, optional exponent
syn match  povFloat		"\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
"floating point number, starting with a dot, optional exponent
syn match  povFloat		"\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
"floating point number, without dot, with exponent
syn match  povFloat		"\<\d\+e[-+]\=\d\+[fl]\=\>"
"hex number
syn match  povNumber		"0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
"syn match  cIdentifier	"\<[a-z_][a-z0-9_]*\>"
syn case match

syn keyword povType		int long short char void size_t
syn keyword povType		signed unsigned float double
syn keyword povStructure	struct union enum typedef
syn keyword povStorageClass	static register auto volatile extern const

syn region povPreCondit	start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)"  skip="\\$"  end="$" contains=povComment,povString,povCharacter,povNumber,povCommentError
"syn match  cLineSkip	"\\$"
syn region povDefine		start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,povPreCondit,povIncluded,povInclude,povDefine,povInParen
syn region povPreProc		start="^[ \t]*#[ \t]*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,povPreCondit,povIncluded,povInclude,povDefine,povInParen

" Highlight User Labels
syn region	povMulti		transparent start='?' end=':' contains=ALLBUT,povIncluded,povSpecial,povTodo,povUserLabel
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
syn match	povUserLabel	"^[ \t]*[a-zA-Z0-9_]\+[ \t]*:$"
syn match	povUserLabel	";[ \t]*[a-zA-Z0-9_]\+[ \t]*:$"
syn match	povUserLabel	"^[ \t]*[a-zA-Z0-9_]\+[ \t]*:[^:]"me=e-1
syn match	povUserLabel	";[ \t]*[a-zA-Z0-9_]\+[ \t]*:[^:]"me=e-1

syn sync ccomment povComment minlines=10

if !exists("did_pov_syntax_inits")
  let did_pov_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later

  " comment
  hi link povComment		Comment
  " constants
  hi link povFloat		Float
  hi link povNumber		Number
  hi link povString		String
  hi link povCharacter		Character
  hi link povSpecialCharacter	povSpecial
  " identifier
  hi link povCommands		Function
  " statements
  hi link povStatement		Statement
  hi link povConditional	Conditional
  hi link povRepeat		Repeat
  hi link povLabel		Label
  hi link povUserLabel		Label
  hi link povOperator		Operator
  " preproc
  hi link povPreProc		PreProc
  hi link povInclude		Include
  hi link povIncluded		povString
  hi link povDefine		Define
  hi link povPreCondit		PreCondit
  " type
  hi link povType		Type
  hi link povStorageClass	StorageClass
  hi link povStructure		Structure
  hi link povDescriptors	Type
  " special
  hi link povSpecial		Special
  " error
  hi link povError		Error
  hi link povCommentError	povError
  " todo
  hi link povTodo		Todo

  hi link povObjects		Function
  hi link povModifiers		Operator
  hi link povTypes		Type
endif

let b:current_syntax = "pov"

" vim: ts=8