Skip to content

Commit

Permalink
Re-enable multiple output items per model
Browse files Browse the repository at this point in the history
  • Loading branch information
guidotack committed Dec 20, 2016
1 parent f472f5e commit 64e482e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Bug fixes:
- Fix a bug in the type checking for generators that iterate over
arrays of enums.
- Fix a bug in the output handling of arrays of enums.
- Fix handling of multiple output items (only the last item was
compiled, now the concatenation is used for output as defined
in the specification).

Version 2.1.1
=============
Expand Down
1 change: 1 addition & 0 deletions include/minizinc/model.hh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ namespace MiniZinc {
SolveI* solveItem(void);

OutputI* outputItem(void);
void setOutputItem(OutputI* oi);


/// Add a file-level documentation comment
Expand Down
8 changes: 8 additions & 0 deletions lib/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ namespace MiniZinc {
}
}

void
Model::setOutputItem(OutputI* oi) {
Model* m = this;
while (m->_parent)
m = m->_parent;
m->_outputItem = oi;
}

void
Model::registerFn(EnvI& env, FunctionI* fi) {
Model* m = this;
Expand Down
1 change: 1 addition & 0 deletions lib/typecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,7 @@ namespace MiniZinc {
bo->type(Type::parstring(1));
outputItem->e(bo);
oi->remove();
m->setOutputItem(outputItem);
}
}
} _tsv3(env.envi(),m);
Expand Down

0 comments on commit 64e482e

Please sign in to comment.