Skip to content

Commit

Permalink
Accept next option immediately after a numeric value
Browse files Browse the repository at this point in the history
Undocumented feature for compatibility with ASL
  • Loading branch information
glebbelov committed Mar 20, 2024
1 parent 87b7134 commit 0d98044
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/mp/solver-opt.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ class TypedSolverOption : public SolverOption {
void Parse(const char *&s, bool splitString=false) override {
const char *start = s;
T value = internal::OptionHelper<T>::Parse(s, splitString);
if (*s && !std::isspace(*s)) {
if (false // undocumented: we accept next option after a numeric option
&& *s && !std::isspace(*s)) {
do ++s;
while (*s && !std::isspace(*s));
throw InvalidOptionValue(name(), std::string(start, s - start));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
}
},
{
"name": "mipbound_01 bestbound=1 return_mipgap=3",
"name": "mipbound_01 bestbound=1return_mipgap=3",
"comment": "Undocumented ASL/MP feature: no space after numeric option",
"tags": [ "linear", "return_mipgap"],
"options": { "ANYSOLVER_options": "bestbound=1 return_mipgap=3" },
"objective": 1,
Expand Down

0 comments on commit 0d98044

Please sign in to comment.