IEnumerable<IMethod> BuildFunctions(IEnumerable<PythonFunction> functions)
{
if (functions == null)
yield break;
foreach (PythonFunction pyFunc in functions)
{
var domFunc = new DomMethod () {
Name = pyFunc.Name,
Documentation = pyFunc.Documentation,
BodyRegion = pyFunc.Region,
Location = new DomLocation (pyFunc.Region.Start.Line - 1, 0),
ReturnType = new DomReturnType () {
Name = pyFunc.Name, // FIXME: Get inferred type
Namespace = Module.FullName,
},
};
m_AllWrapped.Add (domFunc);
foreach (PythonArgument pyArg in pyFunc.Arguments)
{
var domArg = new DomParameter () {
Name = pyArg.Name,
ReturnType = new DomReturnType () {
Name = pyArg.Name, // FIXME: Get inferred type
Namespace = Module.FullName,
},
};
m_AllWrapped.Add (domArg);
domFunc.Add (domArg);
}
yield return domFunc;
}
}