]> luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/rsl.js
Initial commit.
[flow-web.git] / static / highlight / es / languages / rsl.js
1 /*! `rsl` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar = (function () {
3 'use strict';
4
5 /*
6 Language: RenderMan RSL
7 Author: Konstantin Evdokimenko <qewerty@gmail.com>
8 Contributors: Shuen-Huei Guan <drake.guan@gmail.com>
9 Website: https://renderman.pixar.com/resources/RenderMan_20/shadingLanguage.html
10 Category: graphics
11 */
12
13 function rsl(hljs) {
14 const BUILT_INS = [
15 "abs",
16 "acos",
17 "ambient",
18 "area",
19 "asin",
20 "atan",
21 "atmosphere",
22 "attribute",
23 "calculatenormal",
24 "ceil",
25 "cellnoise",
26 "clamp",
27 "comp",
28 "concat",
29 "cos",
30 "degrees",
31 "depth",
32 "Deriv",
33 "diffuse",
34 "distance",
35 "Du",
36 "Dv",
37 "environment",
38 "exp",
39 "faceforward",
40 "filterstep",
41 "floor",
42 "format",
43 "fresnel",
44 "incident",
45 "length",
46 "lightsource",
47 "log",
48 "match",
49 "max",
50 "min",
51 "mod",
52 "noise",
53 "normalize",
54 "ntransform",
55 "opposite",
56 "option",
57 "phong",
58 "pnoise",
59 "pow",
60 "printf",
61 "ptlined",
62 "radians",
63 "random",
64 "reflect",
65 "refract",
66 "renderinfo",
67 "round",
68 "setcomp",
69 "setxcomp",
70 "setycomp",
71 "setzcomp",
72 "shadow",
73 "sign",
74 "sin",
75 "smoothstep",
76 "specular",
77 "specularbrdf",
78 "spline",
79 "sqrt",
80 "step",
81 "tan",
82 "texture",
83 "textureinfo",
84 "trace",
85 "transform",
86 "vtransform",
87 "xcomp",
88 "ycomp",
89 "zcomp"
90 ];
91
92 const TYPES = [
93 "matrix",
94 "float",
95 "color",
96 "point",
97 "normal",
98 "vector"
99 ];
100
101 const KEYWORDS = [
102 "while",
103 "for",
104 "if",
105 "do",
106 "return",
107 "else",
108 "break",
109 "extern",
110 "continue"
111 ];
112
113 const CLASS_DEFINITION = {
114 match: [
115 /(surface|displacement|light|volume|imager)/,
116 /\s+/,
117 hljs.IDENT_RE,
118 ],
119 scope: {
120 1: "keyword",
121 3: "title.class",
122 }
123 };
124
125 return {
126 name: 'RenderMan RSL',
127 keywords: {
128 keyword: KEYWORDS,
129 built_in: BUILT_INS,
130 type: TYPES
131 },
132 illegal: '</',
133 contains: [
134 hljs.C_LINE_COMMENT_MODE,
135 hljs.C_BLOCK_COMMENT_MODE,
136 hljs.QUOTE_STRING_MODE,
137 hljs.APOS_STRING_MODE,
138 hljs.C_NUMBER_MODE,
139 {
140 className: 'meta',
141 begin: '#',
142 end: '$'
143 },
144 CLASS_DEFINITION,
145 {
146 beginKeywords: 'illuminate illuminance gather',
147 end: '\\('
148 }
149 ]
150 };
151 }
152
153 return rsl;
154
155 })();
156 ;
157 export default hljsGrammar;