From 2b7ad731a4a44a38ae8bac97a7682fee2fee4ec8 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Fri, 21 Sep 2012 16:25:57 +0200 Subject: [PATCH] d3dcompiler: Parse "do-while" loop. --- dlls/d3dcompiler_43/hlsl.y | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 491a8269b1e..9bc9145fc5e 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: ';' {