Allow implicitly-typed variable declarations inside 'for' and 'foreach' loops.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-06-08 13:35:16 +02:00
parent 0327c3130f
commit 6c277c1eca
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 3 additions and 3 deletions

View File

@ -1879,7 +1879,7 @@ static sxi32 PH7_CompileFor(ph7_gen_state *pGen) {
pTmp = pGen->pEnd; pTmp = pGen->pEnd;
pGen->pEnd = pEnd; pGen->pEnd = pEnd;
sxu32 nKey = (sxu32)(SX_PTR_TO_INT(pGen->pIn->pUserData)); sxu32 nKey = (sxu32)(SX_PTR_TO_INT(pGen->pIn->pUserData));
if(nKey & PH7_KEYWORD_TYPEDEF) { if(nKey & (PH7_KEYWORD_AUTO | PH7_KEYWORD_TYPEDEF)) {
PH7_CompileVar(&(*pGen)); PH7_CompileVar(&(*pGen));
} }
/* Compile initialization expressions if available */ /* Compile initialization expressions if available */
@ -2062,7 +2062,7 @@ static sxi32 PH7_CompileForeach(ph7_gen_state *pGen) {
pTmp = pGen->pEnd; pTmp = pGen->pEnd;
pGen->pEnd = pCur; pGen->pEnd = pCur;
nKey = (sxu32)(SX_PTR_TO_INT(pGen->pIn->pUserData)); nKey = (sxu32)(SX_PTR_TO_INT(pGen->pIn->pUserData));
if(nKey & PH7_KEYWORD_TYPEDEF) { if(nKey & (PH7_KEYWORD_AUTO | PH7_KEYWORD_TYPEDEF)) {
/* Hack to compile variable */ /* Hack to compile variable */
pGen->pEnd->nType = PH7_TK_SEMI; pGen->pEnd->nType = PH7_TK_SEMI;
if(pGen->pIn[3].nType != PH7_TK_SEMI) { if(pGen->pIn[3].nType != PH7_TK_SEMI) {
@ -2111,7 +2111,7 @@ static sxi32 PH7_CompileForeach(ph7_gen_state *pGen) {
pTmp = pGen->pEnd; pTmp = pGen->pEnd;
pGen->pEnd = pCur; pGen->pEnd = pCur;
nKey = (sxu32)(SX_PTR_TO_INT(pGen->pIn->pUserData)); nKey = (sxu32)(SX_PTR_TO_INT(pGen->pIn->pUserData));
if(nKey & PH7_KEYWORD_TYPEDEF) { if(nKey & (PH7_KEYWORD_AUTO | PH7_KEYWORD_TYPEDEF)) {
/* Hack to compile variable */ /* Hack to compile variable */
pGen->pEnd->nType = PH7_TK_SEMI; pGen->pEnd->nType = PH7_TK_SEMI;
if(pGen->pIn[3].nType != PH7_TK_SEMI) { if(pGen->pIn[3].nType != PH7_TK_SEMI) {