You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
918 B
55 lines
918 B
include yslt.yml2
|
|
|
|
tstylesheet {
|
|
template "module" {
|
|
document("py_module.pybind11", "text") {
|
|
||
|
|
`` apply "method"
|
|
|
|
`` apply "struct"
|
|
|
|
`` apply "enum"
|
|
||
|
|
}
|
|
}
|
|
|
|
template "method" {
|
|
||
|
|
m.def("«@name»",`apply "signature"` &«@name», "");
|
|
||
|
|
}
|
|
|
|
template "signature" {
|
|
> «@string»
|
|
}
|
|
|
|
template "struct" {
|
|
||
|
|
pybind11::class_<«@name»>(m, "«@name»")
|
|
``apply "field"
|
|
;
|
|
|
|
||
|
|
}
|
|
|
|
template "field" {
|
|
||
|
|
.def_readwrite("«@name»", &::«../@name»::«@name»)
|
|
||
|
|
}
|
|
|
|
template "enum" {
|
|
||
|
|
pybind11::enum_<::«@name»>(m, "«@name»")
|
|
``apply item
|
|
;
|
|
|
|
||
|
|
}
|
|
|
|
template "item" {
|
|
||
|
|
.value("«@name»", ::«@name», "")
|
|
||
|
|
}
|
|
}
|
|
|