From 0eb5fee633b64f1dddc5cedea1f5e6ef9c763313 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Tue, 3 Jun 2025 14:02:46 -0500 Subject: [PATCH] vkd3d-shader/preproc: Parse comments in #include and #line directives. --- libs/vkd3d-shader/preproc.l | 4 ++-- tests/hlsl_d3d12.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/preproc.l b/libs/vkd3d-shader/preproc.l index 4a8d0fdda..4e39bf659 100644 --- a/libs/vkd3d-shader/preproc.l +++ b/libs/vkd3d-shader/preproc.l @@ -71,8 +71,8 @@ INT_SUFFIX [uUlL]{0,2} %% -"//" {yy_push_state(CXX_COMMENT, yyscanner);} -"/*" {yy_push_state(C_COMMENT, yyscanner);} +"//" {yy_push_state(CXX_COMMENT, yyscanner);} +"/*" {yy_push_state(C_COMMENT, yyscanner);} \\{NEWLINE} {} \n { yy_pop_state(yyscanner); diff --git a/tests/hlsl_d3d12.c b/tests/hlsl_d3d12.c index 268856b03..6d3569cf4 100644 --- a/tests/hlsl_d3d12.c +++ b/tests/hlsl_d3d12.c @@ -59,7 +59,7 @@ static void check_preprocess_(const char *file, int line, const char *source, static const char test_include_top[] = "#include \"file1\"\n" - "#include < file2 >\n" + "#include/* a comment */< file2 >//another comment\n" "ARGES\n"; static const char test_include_file1[] =