xo-expression: + Lambda::type_str
This commit is contained in:
parent
f71cb12831
commit
b18de1b0ce
2 changed files with 29 additions and 2 deletions
|
|
@ -4,7 +4,30 @@
|
|||
#include "xo/indentlog/print/vector.hpp"
|
||||
|
||||
namespace xo {
|
||||
using std::stringstream;
|
||||
|
||||
namespace ast {
|
||||
Lambda::Lambda(const std::string & name,
|
||||
const std::vector<std::string> & argv,
|
||||
const ref::rp<Expression> & body)
|
||||
: Expression(exprtype::lambda),
|
||||
name_{name},
|
||||
argv_{argv},
|
||||
body_{body}
|
||||
{
|
||||
stringstream ss;
|
||||
ss << "double";
|
||||
ss << "(";
|
||||
for (std::size_t i = 0; i < argv.size(); ++i) {
|
||||
if (i > 0)
|
||||
ss << ",";
|
||||
ss << "double";
|
||||
}
|
||||
ss << ")";
|
||||
|
||||
type_str_ = ss.str();
|
||||
} /*ctor*/
|
||||
|
||||
void
|
||||
Lambda::display(std::ostream & os) const {
|
||||
os << "<Lambda"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue