From 075d2f09639b7d1d83174ca222ab4c8ffd0ab3d7 Mon Sep 17 00:00:00 2001 From: belliash Date: Thu, 21 Mar 2019 17:30:08 +0100 Subject: [PATCH] Temporary workaround to allow the use of curly braces and array() syntax concurrently. --- engine/compiler.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/engine/compiler.c b/engine/compiler.c index 1100e00..f885a40 100644 --- a/engine/compiler.c +++ b/engine/compiler.c @@ -798,9 +798,14 @@ PH7_PRIVATE sxi32 PH7_CompileArray(ph7_gen_state *pGen, sxi32 iCompileFlag) { sxi32 nPair = 0; sxi32 iNest; sxi32 rc; - /* Jump the 'array' keyword,the leading left parenthesis and the trailing parenthesis. - */ - pGen->pIn += 2; + if(pGen->pIn->nType & PH7_TK_OCB) { + /* Jump the opening curly bracket */ + pGen->pIn++; + } else { + /* Jump the 'array' keyword,the leading left parenthesis */ + pGen->pIn += 2; + } + /* Jump the trailing parenthesis. */ pGen->pEnd--; xValidator = 0; SXUNUSED(iCompileFlag); /* cc warning */