| Index: lib/src/prism/components/prism-glsl.js
|
| diff --git a/lib/src/prism/components/prism-glsl.js b/lib/src/prism/components/prism-glsl.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e9cbfacb3283093503744e32a045e54dcd8e9319
|
| --- /dev/null
|
| +++ b/lib/src/prism/components/prism-glsl.js
|
| @@ -0,0 +1,16 @@
|
| +Prism.languages.glsl = Prism.languages.extend('clike', {
|
| + 'comment': [
|
| + /\/\*[\w\W]*?\*\//,
|
| + /\/\/(?:\\(?:\r\n|[\s\S])|.)*/
|
| + ],
|
| + 'number': /\b(?:0x[\da-f]+|(?:\.\d+|\d+\.?\d*)(?:e[+-]?\d+)?)[ulf]*\b/i,
|
| + 'keyword': /\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/
|
| +});
|
| +
|
| +Prism.languages.insertBefore('glsl', 'comment', {
|
| + 'preprocessor': {
|
| + pattern: /(^[ \t]*)#(?:(?:define|undef|if|ifdef|ifndef|else|elif|endif|error|pragma|extension|version|line)\b)?/m,
|
| + lookbehind: true,
|
| + alias: 'builtin'
|
| + }
|
| +});
|
|
|