vkd3d-shader/preproc: Support namespaces in macro identifiers.

This commit is contained in:
Arkadiusz Hiler 2024-09-20 18:35:38 +03:00 committed by Henri Verbeet
parent a2aeb3a142
commit a3017fe9d5
Notes: Henri Verbeet 2024-09-24 14:09:30 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1096
2 changed files with 59 additions and 1 deletions

View File

@ -66,7 +66,7 @@ static void update_location(struct preproc_ctx *ctx);
NEWLINE \r?\n
WS [ \t\r]
IDENTIFIER [A-Za-z_][A-Za-z0-9_]*
IDENTIFIER (::)?[A-Za-z_]((::)?[A-Za-z0-9_]+)*
INT_SUFFIX [uUlL]{0,2}
%%

View File

@ -317,3 +317,61 @@ KEY(pa)
#define KEY KEY2(fa il)
KEY
pass
[preproc]
#define Key1::Key2 pass
Key1::Key2
[preproc]
#define ::Key pass
::Key
[preproc]
#define Key1::Key2(x) pass
Key1::Key2(fail)
[preproc]
#define Key1::Key2::Key3 pass
Key1::Key2::Key3
[preproc]
#define Key1:pass value
Key1:pass
[preproc]
#define Key1::::pass value
Key1::::pass
[preproc]
#define fail:: pass
fail
[preproc]
#define pass bar
#define key::bar fail
key::pass
[preproc]
#define pass bar
#define bar::key fail
pass::key
[preproc]
#define fail::1KEY pass
fail::1KEY
[preproc]
#define::pass value
::pass
[preproc]
#define fail(key1::key2) key1::key2
fail(pass)
[preproc]
#define key1:: key2 pass
key1
[preproc]
#define key1 ::key2 pass
key1