1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Added support for C-style vararg methods

This commit is contained in:
Brian Fiete 2020-02-11 07:34:47 -08:00
parent 89e6b0d577
commit 7741344fd2
16 changed files with 129 additions and 68 deletions

View file

@ -1960,6 +1960,14 @@ String BeModule::ToString(BeFunction* wantFunc)
dc.mSeenNames[param.mName] = 0;
str += "%" + param.mName;
}
if (funcType->mIsVarArg)
{
if (!funcType->mParams.IsEmpty())
str += ", ";
str += "...";
}
str += ")";
if (func->mAlwaysInline)
@ -2917,6 +2925,14 @@ void BeModule::ToString(StringImpl& str, BeType* type)
str += ", ";
ToString(str, funcType->mParams[paramIdx].mType);
}
if (funcType->mIsVarArg)
{
if (!funcType->mParams.IsEmpty())
str += ", ";
str += "...";
}
str += ")";
return;
}