foamDictionary: Ignore function name in substitution list

so that foamDictionary conveniently supports the same format as the #includeFunc
argument list, e.g.

foamDictionary -set 'fieldAverage(U, p, prime2Mean = yes)' fieldAverage

The unnamed field arguments 'U' and 'p' are ignored by foamDictionary.
This commit is contained in:
Henry Weller
2020-09-20 09:28:20 +01:00
parent 560db98b34
commit 560fb1a64b

View File

@ -269,8 +269,8 @@ void substitute(dictionary& dict, string substitutions)
{
// Add '()' delimiters to the substitutions if not present
const string whitespace(" \t");
string::size_type first = substitutions.find_first_not_of(whitespace);
if (substitutions[first] != '(')
string::size_type last = substitutions.find_last_not_of(whitespace);
if (substitutions[last] != ')')
{
substitutions = '(' + substitutions + ')';
}