Parser takes care about nested arrays.
The build was successful.
Details
The build was successful.
Details
This commit is contained in:
parent
c1e30d4c68
commit
77ebce7acf
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue