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
......@@ -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;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment