PageRenderTime 36ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

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