summaryrefslogtreecommitdiff
path: root/src/module.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/module.cc')
-rw-r--r--src/module.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/module.cc b/src/module.cc
index 425403b..cc0f99c 100644
--- a/src/module.cc
+++ b/src/module.cc
@@ -102,16 +102,35 @@ std::string ModuleInstantiation::dump(const std::string &indent) const
if (scope.numElements() == 0) {
dump << ");\n";
} else if (scope.numElements() == 1) {
- dump << ")\n";
- dump << scope.dump(indent + "\t");
+ dump << ") ";
+ dump << scope.dump("");
} else {
dump << ") {\n";
- scope.dump(indent + "\t");
+ dump << scope.dump(indent + "\t");
dump << indent << "}\n";
}
return dump.str();
}
+std::string IfElseModuleInstantiation::dump(const std::string &indent) const
+{
+ std::stringstream dump;
+ dump << ModuleInstantiation::dump(indent);
+ dump << indent;
+ if (else_scope.numElements() > 0) {
+ dump << indent << "else ";
+ if (else_scope.numElements() == 1) {
+ dump << else_scope.dump("");
+ }
+ else {
+ dump << "{\n";
+ dump << else_scope.dump(indent + "\t");
+ dump << indent << "}\n";
+ }
+ }
+ return dump.str();
+}
+
AbstractNode *ModuleInstantiation::evaluate(const Context *ctx) const
{
EvalContext c(ctx, this->arguments, &this->scope);
contact: Jan Huwald // Impressum