diff options
author | bitsawer <sawerduster@gmail.com> | 2023-02-26 19:26:33 +0200 |
---|---|---|
committer | bitsawer <sawerduster@gmail.com> | 2023-02-26 19:26:33 +0200 |
commit | 61219aeed6e6c390877254cd622195896f6efb85 (patch) | |
tree | 214dbfb491151019262775f8f1f2f4d39ce03025 /tests | |
parent | f589ac658924518894e18a38061eb00793a3b0a9 (diff) | |
download | pygments-git-61219aeed6e6c390877254cd622195896f6efb85.tar.gz |
Fix GLSL and HLSL preprocessor directive start
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examplefiles/glsl/glsl.frag | 6 | ||||
-rw-r--r-- | tests/examplefiles/glsl/glsl.frag.output | 8 | ||||
-rw-r--r-- | tests/examplefiles/glsl/glsl.vert | 6 | ||||
-rw-r--r-- | tests/examplefiles/glsl/glsl.vert.output | 8 | ||||
-rw-r--r-- | tests/examplefiles/hlsl/example.hlsl | 6 | ||||
-rw-r--r-- | tests/examplefiles/hlsl/example.hlsl.output | 8 |
6 files changed, 42 insertions, 0 deletions
diff --git a/tests/examplefiles/glsl/glsl.frag b/tests/examplefiles/glsl/glsl.frag index 6033a078..6f4befab 100644 --- a/tests/examplefiles/glsl/glsl.frag +++ b/tests/examplefiles/glsl/glsl.frag @@ -1,5 +1,11 @@ /* Fragment shader */ +// Macro inside a single-line comment: #define COMMENT_MACRO 1 + +/* Macro inside a block comment: #define COMMENT_MACRO 2 */ + + # define INDENTED_MACRO 5.0 + #define SINGLELINE_MACRO 10.0 #define MULTILINE_MACRO(a, b) vec2( \ diff --git a/tests/examplefiles/glsl/glsl.frag.output b/tests/examplefiles/glsl/glsl.frag.output index 6740e5ec..0623b055 100644 --- a/tests/examplefiles/glsl/glsl.frag.output +++ b/tests/examplefiles/glsl/glsl.frag.output @@ -1,6 +1,14 @@ '/* Fragment shader */' Comment.Multiline '\n\n' Text.Whitespace +'// Macro inside a single-line comment: #define COMMENT_MACRO 1' Comment.Single +'\n\n' Text.Whitespace + +'/* Macro inside a block comment: #define COMMENT_MACRO 2 */' Comment.Multiline +'\n\n ' Text.Whitespace +'# define INDENTED_MACRO 5.0' Comment.Preproc +'\n\n' Text.Whitespace + '#define SINGLELINE_MACRO 10.0' Comment.Preproc '\n\n' Text.Whitespace diff --git a/tests/examplefiles/glsl/glsl.vert b/tests/examplefiles/glsl/glsl.vert index 20d82921..e658fd4d 100644 --- a/tests/examplefiles/glsl/glsl.vert +++ b/tests/examplefiles/glsl/glsl.vert @@ -1,5 +1,11 @@ /* Vertex shader */ +// Macro inside a single-line comment: #define COMMENT_MACRO 1 + +/* Macro inside a block comment: #define COMMENT_MACRO 2 */ + + # define INDENTED_MACRO 5.0 + #define SINGLELINE_MACRO 10.0 #define MULTILINE_MACRO(a, b) vec2( \ diff --git a/tests/examplefiles/glsl/glsl.vert.output b/tests/examplefiles/glsl/glsl.vert.output index f8f4e021..7d47f6b0 100644 --- a/tests/examplefiles/glsl/glsl.vert.output +++ b/tests/examplefiles/glsl/glsl.vert.output @@ -1,6 +1,14 @@ '/* Vertex shader */' Comment.Multiline '\n\n' Text.Whitespace +'// Macro inside a single-line comment: #define COMMENT_MACRO 1' Comment.Single +'\n\n' Text.Whitespace + +'/* Macro inside a block comment: #define COMMENT_MACRO 2 */' Comment.Multiline +'\n\n ' Text.Whitespace +'# define INDENTED_MACRO 5.0' Comment.Preproc +'\n\n' Text.Whitespace + '#define SINGLELINE_MACRO 10.0' Comment.Preproc '\n\n' Text.Whitespace diff --git a/tests/examplefiles/hlsl/example.hlsl b/tests/examplefiles/hlsl/example.hlsl index a531fc6a..0d305289 100644 --- a/tests/examplefiles/hlsl/example.hlsl +++ b/tests/examplefiles/hlsl/example.hlsl @@ -1,5 +1,11 @@ // A few random snippets of HLSL shader code I gathered...
+// Macro inside a single-line comment: #define COMMENT_MACRO 1
+
+/* Macro inside a block comment: #define COMMENT_MACRO 2 */
+
+ # define INDENTED_MACRO 5.0
+
#define SINGLELINE_MACRO 10.0
#define MULTILINE_MACRO(a, b) float2( \
diff --git a/tests/examplefiles/hlsl/example.hlsl.output b/tests/examplefiles/hlsl/example.hlsl.output index f49f6851..0c921465 100644 --- a/tests/examplefiles/hlsl/example.hlsl.output +++ b/tests/examplefiles/hlsl/example.hlsl.output @@ -1,6 +1,14 @@ '// A few random snippets of HLSL shader code I gathered...' Comment.Single '\n\n' Text.Whitespace +'// Macro inside a single-line comment: #define COMMENT_MACRO 1' Comment.Single +'\n\n' Text.Whitespace + +'/* Macro inside a block comment: #define COMMENT_MACRO 2 */' Comment.Multiline +'\n\n\t' Text.Whitespace +'# define INDENTED_MACRO 5.0' Comment.Preproc +'\n\n' Text.Whitespace + '#define SINGLELINE_MACRO 10.0' Comment.Preproc '\n\n' Text.Whitespace |