mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/preproc: Support namespaces in macro identifiers.
This commit is contained in:
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
@ -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}
|
||||
|
||||
%%
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user