PP/HLSL: Fix #1424: support comma in nested curly braces for macro arg

This commit is contained in:
John Kessenich
2018-07-02 10:40:32 -06:00
parent 0b964b3c35
commit 9cc81de096
5 changed files with 61 additions and 10 deletions

17
Test/hlsl.pp.expand.frag Executable file
View File

@@ -0,0 +1,17 @@
#define EMP1(a)
#define EMP2(a, b)
#define EXP1(a) = a
#define EXP2(a, b) = a, b
struct A
{
float4 a EMP1({1,2,3,4}); // No PP arg errors
float4 b EMP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // No PP arg errors
float4 c EXP1({1,2,3,4}); // ERROR: No PP arg errors, but init error
float4 d EXP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // ERROR: No PP arg errors, but init error
};
void main()
{
}