ENH: generalize string expression evaluation
- replace stringOps::toScalar with a more generic stringOps::evaluate method that handles scalars, vectors etc. - improve #eval to handle various mathematical operations. Previously only handled scalars. Now produce vectors, tensors etc for the entries. These tokens are streamed directly into the entry.
This commit is contained in:
@ -570,9 +570,10 @@ static Foam::string recursiveExpand
|
||||
|
||||
///Info<< "eval <" << out << ">" << endl;
|
||||
|
||||
// Even with allow empty, expressions need content
|
||||
const scalar sval = stringOps::toScalar(out);
|
||||
const word val(Foam::name(sval));
|
||||
// Even with allow empty, expressions may need content
|
||||
|
||||
string val(stringOps::evaluate(out));
|
||||
stringOps::inplaceTrim(val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user