annotate runtime/syntax/sl.vim @ 1522:710b52d02c4a v7.1.237

updated for version 7.1-237
author vimboss
date Tue, 22 Jan 2008 10:06:48 +0000
parents 3fc0f57ecb91
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Renderman shader language
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Dan Piponi <dan@tanelorn.demon.co.uk>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Last Change: 2001 May 09
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " A bunch of useful Renderman keywords including special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " RenderMan control structures
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn keyword slStatement break return continue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn keyword slConditional if else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn keyword slRepeat while for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn keyword slRepeat illuminance illuminate solar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword slTodo contained TODO FIXME XXX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " String and Character constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " Highlight special characters (those which have a backslash) differently
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match slSpecial contained "\\[0-9][0-9][0-9]\|\\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn region slString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=slSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match slCharacter "'[^\\]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match slSpecialCharacter "'\\.'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match slSpecialCharacter "'\\[0-9][0-9]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match slSpecialCharacter "'\\[0-9][0-9][0-9]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 "catch errors caused by wrong parenthesis
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn region slParen transparent start='(' end=')' contains=ALLBUT,slParenError,slIncluded,slSpecial,slTodo,slUserLabel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match slParenError ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match slInParen contained "[{}]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 "integer number, or floating point number without a dot and with "f".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn match slNumber "\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 "floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match slFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 "floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match slFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 "floating point number, without dot, with exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match slFloat "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 "hex number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match slNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 "syn match slIdentifier "\<[a-z_][a-z0-9_]*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 if exists("sl_comment_strings")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " A comment can contain slString, slCharacter and slNumber.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " But a "*/" inside a slString in a slComment DOES end the comment! So we
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " need to use a special type of slString: slCommentString, which also ends on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " "*/", and sees a "*" at the start of the line as comment again.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " Unfortunately this doesn't very well work for // type of comments :-(
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syntax match slCommentSkip contained "^\s*\*\($\|\s\+\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syntax region slCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=slSpecial,slCommentSkip
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syntax region slComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=slSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syntax region slComment start="/\*" end="\*/" contains=slTodo,slCommentString,slCharacter,slNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn region slComment start="/\*" end="\*/" contains=slTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syntax match slCommentError "\*/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn keyword slOperator sizeof
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword slType float point color string vector normal matrix void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn keyword slStorageClass varying uniform extern
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn keyword slStorageClass light surface volume displacement transformation imager
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword slVariable Cs Os P dPdu dPdv N Ng u v du dv s t
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn keyword slVariable L Cl Ol E I ncomps time Ci Oi
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword slVariable Ps alpha
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn keyword slVariable dtime dPdtime
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn sync ccomment slComment minlines=10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 if version >= 508 || !exists("did_sl_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 let did_sl_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 HiLink slLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 HiLink slUserLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 HiLink slConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 HiLink slRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 HiLink slCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 HiLink slSpecialCharacter slSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 HiLink slNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 HiLink slFloat Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 HiLink slParenError slError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink slInParen slError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink slCommentError slError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 HiLink slOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 HiLink slStorageClass StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 HiLink slError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 HiLink slStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 HiLink slType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 HiLink slCommentError slError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 HiLink slCommentString slString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 HiLink slComment2String slString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 HiLink slCommentSkip slComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 HiLink slString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 HiLink slComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 HiLink slSpecial SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 HiLink slTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 HiLink slVariable Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 "HiLink slIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 let b:current_syntax = "sl"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 " vim: ts=8