|
|
@ -17,19 +17,50 @@ tstylesheet { |
|
|
|
|| |
|
|
|
|
|
|
|
m.def("«@name»", |
|
|
|
[](`apply "use", mode="lambda_sig"`) -> `apply return` { |
|
|
|
return ::«@name»( |
|
|
|
[](`apply "use", mode="lambda_sig"`) -> pybind11::tuple { |
|
|
|
`apply "return", mode="create"` |
|
|
|
`apply "return", mode="assign"`::«@name»( |
|
|
|
``apply "use", mode="arg_list" |
|
|
|
); |
|
|
|
return pybind11::make_tuple( |
|
|
|
ret`if "count(use)>0" > ,` |
|
|
|
``apply "use", mode="return_as_tuple" |
|
|
|
); |
|
|
|
}, |
|
|
|
pybind11::return_value_policy::copy); |
|
|
|
|| |
|
|
|
} |
|
|
|
|
|
|
|
template "return" mode="create" { |
|
|
|
const "type", "@type"; |
|
|
|
choose { |
|
|
|
when "$type != 'void'" { |
|
|
|
> «@type» ret; |
|
|
|
} otherwise { |
|
|
|
> pybind11::none ret; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
template "return" { |
|
|
|
> «@type» |
|
|
|
template "return" mode="assign" { |
|
|
|
const "type", "@type"; |
|
|
|
choose { |
|
|
|
when "$type != 'void'" { |
|
|
|
> ret = |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
template "use", mode="return_as_tuple" { |
|
|
|
const "name", "@name"; |
|
|
|
const "type", "@type"; |
|
|
|
choose { |
|
|
|
when "$type != 'PEP_SESSION'" { |
|
|
|
|> «$name»`if "position()!=last()" > ,` |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// TODO: UTTTTER PEP-SPECIFIC HACKS (PEP_SESSION) |
|
|
|
template "use", mode="arg_list" { |
|
|
|
const "name", "@name"; |
|
|
@ -56,10 +87,10 @@ tstylesheet { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
template "signature" { |
|
|
|
const "string", "@string"; |
|
|
|
> «$string» |
|
|
|
} |
|
|
|
// template "signature" { |
|
|
|
// const "string", "@string"; |
|
|
|
// > «$string» |
|
|
|
// } |
|
|
|
|
|
|
|
template "struct" { |
|
|
|
| pybind11::class_<«@name»>(m, "«@name»") |
|
|
@ -76,7 +107,7 @@ tstylesheet { |
|
|
|
|| |
|
|
|
.def_property("«@name»", |
|
|
|
[](::«$structname» &obj) -> «@type» { |
|
|
|
//cout << "«$structname»::«@name»: getter called" << endl; |
|
|
|
//cout << "«$structname» ::«@name»: getter called" << endl; |
|
|
|
return obj.«@name»; |
|
|
|
}, |
|
|
|
|| |
|
|
|