Skip to content
Snippets Groups Projects
Commit 237f2e10 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

STYLE: accept label for version in dictionary header

- refinement of commit 33f9ae50.

  After foamDictionary -expand, the '2.0' becomes '2', so accept that
  as a reasonable token.
parent 51db3c85
Branches
Tags
No related merge requests found
......@@ -155,14 +155,16 @@ Foam::IOstreamOption::versionNumber::versionNumber(const token& tok)
{
(*this) = versionNumber(tok.stringToken());
}
else if (tok.isScalar())
else if (tok.isNumber())
{
(*this) = versionNumber(float(tok.scalarToken()));
// Accept integer or floating-point
// Eg, '2.0' becomes '2' after foamDictionary -expand
(*this) = versionNumber(float(tok.number()));
}
else
{
WarningInFunction
<< "Wrong token for version - expected word/float, found "
<< "Wrong token for version - expected word/number, found "
<< tok.info() << nl;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment