KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
8.3KB

  1. <?php
  2. /*************************************************************************************
  3. * glsl.php
  4. * -----
  5. * Author: Benny Baumann (BenBE@omorphia.de)
  6. * Copyright: (c) 2008 Benny Baumann (BenBE@omorphia.de)
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2008/03/20
  9. *
  10. * glSlang language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2008/03/20 (1.0.7.21)
  15. * - First Release
  16. *
  17. * TODO
  18. * ----
  19. *
  20. *************************************************************************************
  21. *
  22. * This file is part of GeSHi.
  23. *
  24. * GeSHi is free software; you can redistribute it and/or modify
  25. * it under the terms of the GNU General Public License as published by
  26. * the Free Software Foundation; either version 2 of the License, or
  27. * (at your option) any later version.
  28. *
  29. * GeSHi is distributed in the hope that it will be useful,
  30. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  31. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  32. * GNU General Public License for more details.
  33. *
  34. * You should have received a copy of the GNU General Public License
  35. * along with GeSHi; if not, write to the Free Software
  36. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  37. *
  38. ************************************************************************************/
  39. $language_data = array (
  40. 'LANG_NAME' => 'glSlang',
  41. 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
  42. 'COMMENT_MULTI' => array('/*' => '*/'),
  43. 'COMMENT_REGEXP' => array(
  44. //Multiline-continued single-line comments
  45. 1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m',
  46. //Multiline-continued preprocessor define
  47. 2 => '/#(?:\\\\\\\\|\\\\\\n|.)*$/m'
  48. ),
  49. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  50. 'QUOTEMARKS' => array("'", '"'),
  51. 'ESCAPE_CHAR' => '\\',
  52. 'KEYWORDS' => array(
  53. 1 => array(
  54. 'if', 'else', 'for', 'while', 'do', 'break', 'continue', 'asm',
  55. 'switch', 'case', 'default', 'return', 'discard',
  56. 'namespace', 'using', 'sizeof', 'cast'
  57. ),
  58. 2 => array(
  59. 'const', 'uniform', 'attribute', 'centroid', 'varying', 'invariant',
  60. 'in', 'out', 'inout', 'input', 'output', 'typedef', 'volatile',
  61. 'public', 'static', 'extern', 'external', 'packed',
  62. 'inline', 'noinline', 'noperspective', 'flat'
  63. ),
  64. 3 => array(
  65. 'void', 'bool', 'int', 'long', 'short', 'float', 'half', 'fixed',
  66. 'unsigned', 'lowp', 'mediump', 'highp', 'precision',
  67. 'vec2', 'vec3', 'vec4', 'bvec2', 'bvec3', 'bvec4',
  68. 'dvec2', 'dvec3', 'dvec4', 'fvec2', 'fvec3', 'fvec4',
  69. 'hvec2', 'hvec3', 'hvec4', 'ivec2', 'ivec3', 'ivec4',
  70. 'mat2', 'mat3', 'mat4', 'mat2x2', 'mat3x2', 'mat4x2',
  71. 'mat2x3', 'mat3x3', 'mat4x3', 'mat2x4', 'mat3x4', 'mat4x4',
  72. 'sampler1D', 'sampler2D', 'sampler3D', 'samplerCube',
  73. 'sampler1DShadow', 'sampler2DShadow',
  74. 'struct', 'class', 'union', 'enum', 'interface', 'template'
  75. ),
  76. 4 => array(
  77. 'this', 'false', 'true'
  78. ),
  79. 5 => array(
  80. 'radians', 'degrees', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan',
  81. 'pow', 'exp2', 'log2', 'sqrt', 'inversesqrt', 'abs', 'sign', 'ceil',
  82. 'floor', 'fract', 'mod', 'min', 'max', 'clamp', 'mix', 'step',
  83. 'smoothstep', 'length', 'distance', 'dot', 'cross', 'normalize',
  84. 'ftransform', 'faceforward', 'reflect', 'matrixCompMult', 'equal',
  85. 'lessThan', 'lessThanEqual', 'greaterThan', 'greaterThanEqual',
  86. 'notEqual', 'any', 'all', 'not', 'texture1D', 'texture1DProj',
  87. 'texture1DLod', 'texture1DProjLod', 'texture2D', 'texture2DProj',
  88. 'texture2DLod', 'texture2DProjLod', 'texture3D', 'texture3DProj',
  89. 'texture3DLod', 'texture3DProjLod', 'textureCube', 'textureCubeLod',
  90. 'shadow1D', 'shadow1DProj', 'shadow1DLod', 'shadow1DProjLod',
  91. 'shadow2D', 'shadow2DProj', 'shadow2DLod', 'shadow2DProjLod',
  92. 'noise1', 'noise2', 'noise3', 'noise4'
  93. ),
  94. 6 => array(
  95. 'gl_Position', 'gl_PointSize', 'gl_ClipVertex', 'gl_FragColor',
  96. 'gl_FragData', 'gl_FragDepth', 'gl_FragCoord', 'gl_FrontFacing',
  97. 'gl_Color', 'gl_SecondaryColor', 'gl_Normal', 'gl_Vertex',
  98. 'gl_MultiTexCoord0', 'gl_MultiTexCoord1', 'gl_MultiTexCoord2',
  99. 'gl_MultiTexCoord3', 'gl_MultiTexCoord4', 'gl_MultiTexCoord5',
  100. 'gl_MultiTexCoord6', 'gl_MultiTexCoord7', 'gl_FogCoord',
  101. 'gl_MaxLights', 'gl_MaxClipPlanes', 'gl_MaxTextureUnits',
  102. 'gl_MaxTextureCoords', 'gl_MaxVertexAttribs', 'gl_MaxVaryingFloats',
  103. 'gl_MaxVertexUniformComponents', 'gl_MaxVertexTextureImageUnits',
  104. 'gl_MaxCombinedTextureImageUnits', 'gl_MaxTextureImageUnits',
  105. 'gl_MaxFragmentUniformComponents', 'gl_MaxDrawBuffers', 'gl_Point',
  106. 'gl_ModelViewMatrix', 'gl_ProjectionMatrix', 'gl_FrontMaterial',
  107. 'gl_ModelViewProjectionMatrix', 'gl_TextureMatrix', 'gl_ClipPlane',
  108. 'gl_NormalMatrix', 'gl_ModelViewMatrixInverse', 'gl_BackMaterial',
  109. 'gl_ProjectionMatrixInverse', 'gl_ModelViewProjectionMatrixInverse',
  110. 'gl_TextureMatrixInverse', 'gl_ModelViewMatrixTranspose', 'gl_Fog',
  111. 'gl_ProjectionMatrixTranspose', 'gl_NormalScale', 'gl_DepthRange',
  112. 'gl_odelViewProjectionMatrixTranspose', 'gl_TextureMatrixTranspose',
  113. 'gl_ModelViewMatrixInverseTranspose', 'gl_LightSource',
  114. 'gl_ProjectionMatrixInverseTranspose', 'gl_LightModel',
  115. 'gl_ModelViewProjectionMatrixInverseTranspose', 'gl_TexCoord',
  116. 'gl_TextureMatrixInverseTranspose', 'gl_TextureEnvColor',
  117. 'gl_FrontLightModelProduct', 'gl_BackLightModelProduct',
  118. 'gl_FrontLightProduct', 'gl_BackLightProduct', 'gl_ObjectPlaneS',
  119. 'gl_ObjectPlaneT', 'gl_ObjectPlaneR', 'gl_ObjectPlaneQ',
  120. 'gl_EyePlaneS', 'gl_EyePlaneT', 'gl_EyePlaneR', 'gl_EyePlaneQ',
  121. 'gl_FrontColor', 'gl_BackColor', 'gl_FrontSecondaryColor',
  122. 'gl_BackSecondaryColor', 'gl_FogFragCoord', 'gl_PointCoord'
  123. )
  124. ),
  125. 'SYMBOLS' => array(
  126. '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%', '^',
  127. '&', '?', ':', '.', '|', ';', ',', '<', '>'
  128. ),
  129. 'CASE_SENSITIVE' => array(
  130. GESHI_COMMENTS => false,
  131. 1 => true,
  132. 2 => true,
  133. 3 => true,
  134. 4 => true,
  135. 5 => true,
  136. 6 => true,
  137. ),
  138. 'STYLES' => array(
  139. 'KEYWORDS' => array(
  140. 1 => 'color: #000000; font-weight: bold;',
  141. 2 => 'color: #333399; font-weight: bold;',
  142. 3 => 'color: #000066; font-weight: bold;',
  143. 4 => 'color: #333399; font-weight: bold;',
  144. 5 => 'color: #993333; font-weight: bold;',
  145. 6 => 'color: #551111;'
  146. ),
  147. 'COMMENTS' => array(
  148. 1 => 'color: #666666; font-style: italic;',
  149. 2 => 'color: #009900;',
  150. 'MULTI' => 'color: #666666; font-style: italic;'
  151. ),
  152. 'ESCAPE_CHAR' => array(
  153. 0 => 'color: #000099; font-weight: bold;'
  154. ),
  155. 'BRACKETS' => array(
  156. 0 => 'color: #000066;'
  157. ),
  158. 'STRINGS' => array(
  159. 0 => 'color: #ff0000;'
  160. ),
  161. 'NUMBERS' => array(
  162. 0 => 'color: #0000ff;'
  163. ),
  164. 'METHODS' => array(
  165. 1 => 'color: #006600;'
  166. ),
  167. 'SYMBOLS' => array(
  168. 0 => 'color: #000066;'
  169. ),
  170. 'REGEXPS' => array(
  171. ),
  172. 'SCRIPT' => array(
  173. )
  174. ),
  175. 'URLS' => array(
  176. 1 => '',
  177. 2 => '',
  178. 3 => '',
  179. 4 => '',
  180. 5 => '',
  181. 6 => ''
  182. ),
  183. 'OOLANG' => true,
  184. 'OBJECT_SPLITTERS' => array(
  185. 1 => '.'
  186. ),
  187. 'REGEXPS' => array(
  188. ),
  189. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  190. 'SCRIPT_DELIMITERS' => array(
  191. ),
  192. 'HIGHLIGHT_STRICT_BLOCK' => array(
  193. ),
  194. 'TAB_WIDTH' => 4,
  195. 'PARSER_CONTROL' => array(
  196. 'OOLANG' => array(
  197. 'MATCH_BEFORE' => '',
  198. 'MATCH_AFTER' => '[a-zA-Z_][a-zA-Z0-9_]*',
  199. 'MATCH_SPACES' => '[\s]*'
  200. )
  201. )
  202. );
  203. ?>