Parser takes care about nested arrays.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-04-10 06:18:49 +02:00
parent c1e30d4c68
commit 77ebce7acf
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 1 additions and 11 deletions

View File

@ -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;