This is probably what we would like to skip during compilation.

This commit is contained in:
Rafal Kupiec 2018-07-25 13:34:17 +02:00
parent abf9cf61b8
commit 6628a1ea3d
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -4277,29 +4277,29 @@ static sxi32 GenStateCompileClass(ph7_gen_state *pGen, sxi32 iFlags) {
} }
/* Extract base class name */ /* Extract base class name */
pBaseName = &pGen->pIn->sData; pBaseName = &pGen->pIn->sData;
/* Perform the query */ // /* Perform the query */
pBase = PH7_VmExtractClass(pGen->pVm, pBaseName->zString, pBaseName->nByte, FALSE, 0); // pBase = PH7_VmExtractClass(pGen->pVm, pBaseName->zString, pBaseName->nByte, FALSE, 0);
/* Interfaces are not allowed */ // /* Interfaces are not allowed */
while(pBase && (pBase->iFlags & PH7_CLASS_INTERFACE)) { // while(pBase && (pBase->iFlags & PH7_CLASS_INTERFACE)) {
pBase = pBase->pNextName; // pBase = pBase->pNextName;
} // }
if(pBase == 0) { // if(pBase == 0) {
/* Inexistant base class */ // /* Inexistant base class */
rc = PH7_GenCompileError(pGen, E_ERROR, pGen->pIn->nLine, "Inexistant base class '%z'", pBaseName); // rc = PH7_GenCompileError(pGen, E_ERROR, pGen->pIn->nLine, "Inexistant base class '%z'", pBaseName);
if(rc == SXERR_ABORT) { // if(rc == SXERR_ABORT) {
/* Error count limit reached,abort immediately */ // /* Error count limit reached,abort immediately */
return SXERR_ABORT; // return SXERR_ABORT;
} // }
} else { // } else {
if(pBase->iFlags & PH7_CLASS_FINAL) { // if(pBase->iFlags & PH7_CLASS_FINAL) {
rc = PH7_GenCompileError(pGen, E_ERROR, nLine, // rc = PH7_GenCompileError(pGen, E_ERROR, nLine,
"Class '%z' may not inherit from final class '%z'", pName, &pBase->sName); // "Class '%z' may not inherit from final class '%z'", pName, &pBase->sName);
if(rc == SXERR_ABORT) { // if(rc == SXERR_ABORT) {
/* Error count limit reached,abort immediately */ // /* Error count limit reached,abort immediately */
return SXERR_ABORT; // return SXERR_ABORT;
} // }
} // }
} // }
/* Advance the stream cursor */ /* Advance the stream cursor */
pGen->pIn++; pGen->pIn++;
} }
@ -4585,22 +4585,22 @@ static sxi32 GenStateCompileClass(ph7_gen_state *pGen, sxi32 iFlags) {
} }
/* Install the class */ /* Install the class */
rc = PH7_VmInstallClass(pGen->pVm, pClass); rc = PH7_VmInstallClass(pGen->pVm, pClass);
if(rc == SXRET_OK) { // if(rc == SXRET_OK) {
ph7_class **apInterface; // ph7_class **apInterface;
sxu32 n; // sxu32 n;
if(pBase) { // if(pBase) {
/* Inherit from base class and mark as a subclass */ // /* Inherit from base class and mark as a subclass */
rc = PH7_ClassInherit(&(*pGen), pClass, pBase); // rc = PH7_ClassInherit(&(*pGen), pClass, pBase);
} // }
apInterface = (ph7_class **)SySetBasePtr(&aInterfaces); // apInterface = (ph7_class **)SySetBasePtr(&aInterfaces);
for(n = 0 ; n < SySetUsed(&aInterfaces) ; n++) { // for(n = 0 ; n < SySetUsed(&aInterfaces) ; n++) {
/* Implements one or more interface */ // /* Implements one or more interface */
rc = PH7_ClassImplement(pClass, apInterface[n]); // rc = PH7_ClassImplement(pClass, apInterface[n]);
if(rc != SXRET_OK) { // if(rc != SXRET_OK) {
break; // break;
} // }
} // }
} // }
SySetRelease(&aInterfaces); SySetRelease(&aInterfaces);
if(rc != SXRET_OK) { if(rc != SXRET_OK) {
PH7_GenCompileError(pGen, E_ERROR, nLine, "Fatal, PH7 is running out of memory"); PH7_GenCompileError(pGen, E_ERROR, nLine, "Fatal, PH7 is running out of memory");