From 77ebce7acf60d4f3bdea1234aa6a5e9e7333a6bd Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 10 Apr 2019 06:18:49 +0200 Subject: [PATCH] Parser takes care about nested arrays. --- engine/compiler.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/engine/compiler.c b/engine/compiler.c index 5cf5ac5..24e4730 100644 --- a/engine/compiler.c +++ b/engine/compiler.c @@ -795,7 +795,6 @@ PH7_PRIVATE sxi32 PH7_CompileArray(ph7_gen_state *pGen, sxi32 iCompileFlag) { sxi32(*xValidator)(ph7_gen_state *, ph7_expr_node *); /* Expression tree validator callback */ SyToken *pKey, *pCur; sxi32 nPair = 0; - sxi32 iNest; sxi32 rc; /* Jump the opening and the trailing parenthesis. */ pGen->pIn++; @@ -817,19 +816,10 @@ PH7_PRIVATE sxi32 PH7_CompileArray(ph7_gen_state *pGen, sxi32 iCompileFlag) { } /* Compile the key if available */ pKey = pCur; - iNest = 0; while(pCur < pGen->pIn) { - if((pCur->nType & PH7_TK_ARRAY_OP) && iNest <= 0) { + if(pCur->nType & PH7_TK_ARRAY_OP) { break; } - if(pCur->nType & PH7_TK_LPAREN /*'('*/) { - iNest++; - } else if(pCur->nType & PH7_TK_RPAREN /*')'*/) { - /* Don't worry about mismatched parenthesis here,the expression - * parser will shortly detect any syntax error. - */ - iNest--; - } pCur++; } rc = SXERR_EMPTY;