diff options
author | bitsawer <sawerduster@gmail.com> | 2023-02-23 14:25:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-23 13:25:42 +0100 |
commit | ea05e21a0e74ae1c0a0da9bc50574530280bc3c2 (patch) | |
tree | cbe61bf348231cf2b8cc0b994ce3b7296f34360e /tests | |
parent | 5704c619bd8cb252a9b5d61cb747ee592591ba4b (diff) | |
download | pygments-git-ea05e21a0e74ae1c0a0da9bc50574530280bc3c2.tar.gz |
Fix GLSL and HLSL preprocessor line continuation (#2350)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examplefiles/glsl/glsl.frag | 8 | ||||
-rw-r--r-- | tests/examplefiles/glsl/glsl.frag.output | 8 | ||||
-rw-r--r-- | tests/examplefiles/glsl/glsl.vert | 8 | ||||
-rw-r--r-- | tests/examplefiles/glsl/glsl.vert.output | 8 | ||||
-rw-r--r-- | tests/examplefiles/hlsl/example.hlsl | 7 | ||||
-rw-r--r-- | tests/examplefiles/hlsl/example.hlsl.output | 6 |
6 files changed, 43 insertions, 2 deletions
diff --git a/tests/examplefiles/glsl/glsl.frag b/tests/examplefiles/glsl/glsl.frag index 132b0353..6033a078 100644 --- a/tests/examplefiles/glsl/glsl.frag +++ b/tests/examplefiles/glsl/glsl.frag @@ -1,4 +1,12 @@ /* Fragment shader */ + +#define SINGLELINE_MACRO 10.0 + +#define MULTILINE_MACRO(a, b) vec2( \ + a, \ + b \ +) + void main() { gl_FragColor[0] = gl_FragCoord[0] / 400.0; diff --git a/tests/examplefiles/glsl/glsl.frag.output b/tests/examplefiles/glsl/glsl.frag.output index 654f5c06..6740e5ec 100644 --- a/tests/examplefiles/glsl/glsl.frag.output +++ b/tests/examplefiles/glsl/glsl.frag.output @@ -1,5 +1,11 @@ '/* Fragment shader */' Comment.Multiline -'\n' Text.Whitespace +'\n\n' Text.Whitespace + +'#define SINGLELINE_MACRO 10.0' Comment.Preproc +'\n\n' Text.Whitespace + +'#define MULTILINE_MACRO(a, b) vec2( \\\n a, \\\n b \\\n)' Comment.Preproc +'\n\n' Text.Whitespace 'void' Keyword.Type ' ' Text.Whitespace diff --git a/tests/examplefiles/glsl/glsl.vert b/tests/examplefiles/glsl/glsl.vert index 23dc6a6b..20d82921 100644 --- a/tests/examplefiles/glsl/glsl.vert +++ b/tests/examplefiles/glsl/glsl.vert @@ -1,4 +1,12 @@ /* Vertex shader */ + +#define SINGLELINE_MACRO 10.0 + +#define MULTILINE_MACRO(a, b) vec2( \ + a, \ + b \ +) + uniform float waveTime; uniform float waveWidth; uniform float waveHeight; diff --git a/tests/examplefiles/glsl/glsl.vert.output b/tests/examplefiles/glsl/glsl.vert.output index b4be9048..f8f4e021 100644 --- a/tests/examplefiles/glsl/glsl.vert.output +++ b/tests/examplefiles/glsl/glsl.vert.output @@ -1,5 +1,11 @@ '/* Vertex shader */' Comment.Multiline -'\n' Text.Whitespace +'\n\n' Text.Whitespace + +'#define SINGLELINE_MACRO 10.0' Comment.Preproc +'\n\n' Text.Whitespace + +'#define MULTILINE_MACRO(a, b) vec2( \\\n a, \\\n b \\\n)' Comment.Preproc +'\n\n' Text.Whitespace 'uniform' Keyword ' ' Text.Whitespace diff --git a/tests/examplefiles/hlsl/example.hlsl b/tests/examplefiles/hlsl/example.hlsl index 21d0a672..a531fc6a 100644 --- a/tests/examplefiles/hlsl/example.hlsl +++ b/tests/examplefiles/hlsl/example.hlsl @@ -1,5 +1,12 @@ // A few random snippets of HLSL shader code I gathered...
+#define SINGLELINE_MACRO 10.0
+
+#define MULTILINE_MACRO(a, b) float2( \
+ a, \
+ b \
+)
+
[numthreads(256, 1, 1)]
void cs_main(uint3 threadId : SV_DispatchThreadID)
{
diff --git a/tests/examplefiles/hlsl/example.hlsl.output b/tests/examplefiles/hlsl/example.hlsl.output index d35d975b..f49f6851 100644 --- a/tests/examplefiles/hlsl/example.hlsl.output +++ b/tests/examplefiles/hlsl/example.hlsl.output @@ -1,6 +1,12 @@ '// A few random snippets of HLSL shader code I gathered...' Comment.Single '\n\n' Text.Whitespace +'#define SINGLELINE_MACRO 10.0' Comment.Preproc +'\n\n' Text.Whitespace + +'#define MULTILINE_MACRO(a, b) float2( \\\n\ta, \\\n\tb \\\n)' Comment.Preproc +'\n\n' Text.Whitespace + '[' Punctuation 'numthreads' Name.Decorator '(' Punctuation |