PageRenderTime 29ms CodeModel.GetById 11ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 1ms

/samples/scalate-presentation/src/highlight/languages/renderman.js

http://github.com/scalate/scalate
JavaScript | 239 lines | 231 code | 2 blank | 6 comment | 0 complexity | 3fa9cb6d83570cd5dbfc446ebec7bfeb MD5 | raw file
  1/*
  2Language: RenderMan
  3Description: RenderMan Languages RIB and RSL
  4Author: Konstantin Evdokimenko <qewerty@gmail.com>
  5Contributors: Shuen-Huei Guan <drake.guan@gmail.com>
  6*/
  7
  8hljs.LANGUAGES.rib  = {
  9  defaultMode: {
 10    lexems: [hljs.UNDERSCORE_IDENT_RE],
 11    illegal: '</',
 12    contains: ['comment', 'string', 'number'],
 13    keywords: {
 14      'keyword': {
 15            'ArchiveRecord': 1,
 16            'AreaLightSource': 1,
 17            'Atmosphere': 1,
 18            'Attribute': 1,
 19            'AttributeBegin': 1,
 20            'AttributeEnd': 1,
 21            'Basis': 1,
 22            'Begin': 1,
 23            'Blobby': 1,
 24            'Bound': 1,
 25            'Clipping': 1,
 26            'ClippingPlane': 1,
 27            'Color': 1,
 28            'ColorSamples': 1,
 29            'ConcatTransform': 1,
 30            'Cone': 1,
 31            'CoordinateSystem': 1,
 32            'CoordSysTransform': 1,
 33            'CropWindow': 1,
 34            'Curves': 1,
 35            'Cylinder': 1,
 36            'DepthOfField': 1,
 37            'Detail': 1,
 38            'DetailRange': 1,
 39            'Disk': 1,
 40            'Displacement': 1,
 41            'Display': 1,
 42            'End': 1,
 43            'ErrorHandler': 1,
 44            'Exposure': 1,
 45            'Exterior': 1,
 46            'Format': 1,
 47            'FrameAspectRatio': 1,
 48            'FrameBegin': 1,
 49            'FrameEnd': 1,
 50            'GeneralPolygon': 1,
 51            'GeometricApproximation': 1,
 52            'Geometry': 1,
 53            'Hider': 1,
 54            'Hyperboloid': 1,
 55            'Identity': 1,
 56            'Illuminate': 1,
 57            'Imager': 1,
 58            'Interior': 1,
 59            'LightSource': 1,
 60            'MakeCubeFaceEnvironment': 1,
 61            'MakeLatLongEnvironment': 1,
 62            'MakeShadow': 1,
 63            'MakeTexture': 1,
 64            'Matte': 1,
 65            'MotionBegin': 1,
 66            'MotionEnd': 1,
 67            'NuPatch': 1,
 68            'ObjectBegin': 1,
 69            'ObjectEnd': 1,
 70            'ObjectInstance': 1,
 71            'Opacity': 1,
 72            'Option': 1,
 73            'Orientation': 1,
 74            'Paraboloid': 1,
 75            'Patch': 1,
 76            'PatchMesh': 1,
 77            'Perspective': 1,
 78            'PixelFilter': 1,
 79            'PixelSamples': 1,
 80            'PixelVariance': 1,
 81            'Points': 1,
 82            'PointsGeneralPolygons': 1,
 83            'PointsPolygons': 1,
 84            'Polygon': 1,
 85            'Procedural': 1,
 86            'Projection': 1,
 87            'Quantize': 1,
 88            'ReadArchive': 1,
 89            'RelativeDetail': 1,
 90            'ReverseOrientation': 1,
 91            'Rotate': 1,
 92            'Scale': 1,
 93            'ScreenWindow': 1,
 94            'ShadingInterpolation': 1,
 95            'ShadingRate': 1,
 96            'Shutter': 1,
 97            'Sides': 1,
 98            'Skew': 1,
 99            'SolidBegin': 1,
100            'SolidEnd': 1,
101            'Sphere': 1,
102            'SubdivisionMesh': 1,
103            'Surface': 1,
104            'TextureCoordinates': 1,
105            'Torus': 1,
106            'Transform': 1,
107            'TransformBegin': 1,
108            'TransformEnd': 1,
109            'TransformPoints': 1,
110            'Translate': 1,
111            'TrimCurve': 1,
112            'WorldBegin': 1,
113            'WorldEnd': 1
114            }
115    }
116  },
117  modes: [
118    hljs.HASH_COMMENT_MODE,
119    hljs.C_NUMBER_MODE,
120    hljs.APOS_STRING_MODE,
121    hljs.QUOTE_STRING_MODE,
122    hljs.BACKSLASH_ESCAPE
123  ]
124};
125
126hljs.LANGUAGES.rsl  = {
127  defaultMode: {
128    lexems: [hljs.UNDERSCORE_IDENT_RE],
129    illegal: '</',
130    contains: ['comment', 'string', 'number', 'preprocessor',
131               'shader', 'shading'],
132    keywords: {
133      'keyword': {'float': 1, 'color': 1, 'point': 1, 'normal': 1, 'vector': 1,
134                  'matrix': 1, 'while': 1, 'for': 1, 'if': 1, 'do': 1,
135                  'return': 1, 'else': 1, 'break': 1, 'extern': 1, 'continue': 1},
136      'built_in': {
137                    'abs': 1,
138                    'acos': 1,
139                    'ambient': 1,
140                    'area': 1,
141                    'asin': 1,
142                    'atan': 1,
143                    'atmosphere': 1,
144                    'attribute': 1,
145                    'calculatenormal': 1,
146                    'ceil': 1,
147                    'cellnoise': 1,
148                    'clamp': 1,
149                    'comp': 1,
150                    'concat': 1,
151                    'cos': 1,
152                    'degrees': 1,
153                    'depth': 1,
154                    'Deriv': 1,
155                    'diffuse': 1,
156                    'distance': 1,
157                    'Du': 1,
158                    'Dv': 1,
159                    'environment': 1,
160                    'exp': 1,
161                    'faceforward': 1,
162                    'filterstep': 1,
163                    'floor': 1,
164                    'format': 1,
165                    'fresnel': 1,
166                    'incident': 1,
167                    'length': 1,
168                    'lightsource': 1,
169                    'log': 1,
170                    'match': 1,
171                    'max': 1,
172                    'min': 1,
173                    'mod': 1,
174                    'noise': 1,
175                    'normalize': 1,
176                    'ntransform': 1,
177                    'opposite': 1,
178                    'option': 1,
179                    'phong': 1,
180                    'pnoise': 1,
181                    'pow': 1,
182                    'printf': 1,
183                    'ptlined': 1,
184                    'radians': 1,
185                    'random': 1,
186                    'reflect': 1,
187                    'refract': 1,
188                    'renderinfo': 1,
189                    'round': 1,
190                    'setcomp': 1,
191                    'setxcomp': 1,
192                    'setycomp': 1,
193                    'setzcomp': 1,
194                    'shadow': 1,
195                    'sign': 1,
196                    'sin': 1,
197                    'smoothstep': 1,
198                    'specular': 1,
199                    'specularbrdf': 1,
200                    'spline': 1,
201                    'sqrt': 1,
202                    'step': 1,
203                    'tan': 1,
204                    'texture': 1,
205                    'textureinfo': 1,
206                    'trace': 1,
207                    'transform': 1,
208                    'vtransform': 1,
209                    'xcomp': 1,
210                    'ycomp': 1,
211                    'zcomp': 1
212                    }
213    }
214  },
215  modes: [
216    {
217      className: 'shader',
218      begin: 'surface |displacement |light |volume |imager ', end: '\\(',
219      lexems: [hljs.IDENT_RE],
220      keywords: {'surface': 1, 'displacement': 1, 'light': 1, 'volume': 1, 'imager': 1}
221    },
222    {
223      className: 'shading',
224      begin: 'illuminate|illuminance|gather', end: '\\(',
225      lexems: [hljs.IDENT_RE],
226      keywords: {'illuminate': 1, 'illuminance': 1, 'gather': 1}
227    },
228    hljs.C_LINE_COMMENT_MODE,
229    hljs.C_BLOCK_COMMENT_MODE,
230    hljs.C_NUMBER_MODE,
231    hljs.QUOTE_STRING_MODE,
232    hljs.APOS_STRING_MODE,
233    hljs.BACKSLASH_ESCAPE,
234    {
235      className: 'preprocessor',
236      begin: '#', end: '$'
237    }
238  ]
239};