This commit is contained in:
+1
-9
@@ -3648,23 +3648,15 @@ static sxi32 PH7_GenStateCompileClassMethod(
|
||||
) {
|
||||
sxu32 nLine = pGen->pIn->nLine;
|
||||
ph7_class_method *pMeth;
|
||||
sxi32 iFuncFlags;
|
||||
SyString *pName;
|
||||
SyToken *pEnd;
|
||||
sxi32 rc;
|
||||
/* Extract visibility level */
|
||||
iProtection = PH7_GetProtectionLevel(iProtection);
|
||||
iFuncFlags = 0;
|
||||
if(pGen->pIn >= pGen->pEnd) {
|
||||
/* Invalid method name */
|
||||
PH7_GenCompileError(pGen, E_ERROR, nLine, "Invalid method name '%z' in class '%z'", &pGen->pIn->sData, &pClass->sName);
|
||||
}
|
||||
if(pGen->pIn < pGen->pEnd && (pGen->pIn->nType & PH7_TK_AMPER)) {
|
||||
/* Return by reference,remember that */
|
||||
iFuncFlags |= VM_FUNC_REF_RETURN;
|
||||
/* Jump the '&' token */
|
||||
pGen->pIn++;
|
||||
}
|
||||
if(pGen->pIn >= pGen->pEnd || (pGen->pIn->nType & (PH7_TK_ID)) == 0) {
|
||||
/* Invalid method name */
|
||||
PH7_GenCompileError(pGen, E_ERROR, nLine, "Invalid method name '%z' in class '%z'", &pGen->pIn->sData, &pClass->sName);
|
||||
@@ -3700,7 +3692,7 @@ static sxi32 PH7_GenStateCompileClassMethod(
|
||||
PH7_GenCompileError(pGen, E_ERROR, nLine, "Expected '(' after method name '%z::%z()'", &pClass->sName, pName);
|
||||
}
|
||||
/* Allocate a new class_method instance */
|
||||
pMeth = PH7_NewClassMethod(pGen->pVm, pClass, pName, nLine, iProtection, iFlags, iFuncFlags);
|
||||
pMeth = PH7_NewClassMethod(pGen->pVm, pClass, pName, nLine, iProtection, iFlags);
|
||||
if(pMeth == 0) {
|
||||
PH7_GenCompileError(&(*pGen), E_ERROR, nLine, "PH7 is running out-of-memory");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user