diff --git a/src/pyexpression/pyexpression.cpp b/src/pyexpression/pyexpression.cpp index 01447f4f..2c8ca496 100644 --- a/src/pyexpression/pyexpression.cpp +++ b/src/pyexpression/pyexpression.cpp @@ -8,6 +8,7 @@ #include "xo/expression/Primitive.hpp" #include "xo/expression/ConstantInterface.hpp" #include "xo/expression/Constant.hpp" +#include "xo/expression/Variable.hpp" #include "xo/pyutil/pyutil.hpp" #include #include @@ -23,6 +24,8 @@ namespace xo { using xo::ast::make_primitive; using xo::ast::ConstantInterface; using xo::ast::Constant; + using xo::ast::Variable; + using xo::ast::make_var; using xo::reflect::TaggedPtr; using xo::ref::rp; namespace py = pybind11; @@ -117,6 +120,14 @@ namespace xo { m.def("make_apply", &make_apply); + // ----- Variables ----- + + py::class_>(m, "Variable") + .def_property_readonly("name", &Variable::name, py::doc("variable name")) + ; + + m.def("make_var", &make_var); + } /*pyexpresion*/ } /*namespace ast*/ } /*namespace xo*/