[PATCH 3/5] d3dcompiler: Parse "do-while" loop.
Matteo Bruni
mbruni at codeweavers.com
Fri Sep 21 09:25:57 CDT 2012
---
dlls/d3dcompiler_43/hlsl.y | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y
index 491a826..9bc9145 100644
--- a/dlls/d3dcompiler_43/hlsl.y
+++ b/dlls/d3dcompiler_43/hlsl.y
@@ -1368,6 +1368,21 @@ loop_statement: KW_WHILE '(' expr ')' statement
set_location(&loc, &@1);
$$ = create_loop(LOOP_WHILE, NULL, cond, NULL, $5, &loc);
}
+ | KW_DO statement KW_WHILE '(' expr ')' ';'
+ {
+ struct source_location loc;
+ struct list *cond = d3dcompiler_alloc(sizeof(*cond));
+
+ if (!cond)
+ {
+ ERR("Out of memory.\n");
+ return -1;
+ }
+ list_init(cond);
+ list_add_head(cond, &$5->entry);
+ set_location(&loc, &@1);
+ $$ = create_loop(LOOP_DO_WHILE, NULL, cond, NULL, $2, &loc);
+ }
expr_statement: ';'
{
--
1.7.8.6
More information about the wine-patches
mailing list