44 static constexpr label maxRecursionDepth_ = 100;
47 static List<expressions::exprString> expandExprStrings
49 const UList<string>& inputs,
50 const dictionary&
dict,
57 DynamicList<expressions::exprString> result;
59 for (
const string&
input : inputs)
62 const auto varExpressions = stringOps::split<string>(
input,
';');
64 for (
const auto& subMatch : varExpressions)
76 if (varExpr[0] ==
'#')
80 List<expressions::exprString> expansions
94 result.reserve(result.size() + expansions.size());
95 for (expressions::exprString& str : expansions)
97 result.append(std::move(str));
138 const entry* eptr =
dict.findEntry(keyword, keyType::LITERAL_RECURSIVE);
145 <<
"Missing mandatory entry: " << keyword <<
nl <<
nl 152 if (++recursionDepth > maxRecursionDepth_)
155 <<
"Exceeded recursion depth (" << maxRecursionDepth_
156 <<
") while reading list " << keyword <<
nl 157 <<
"Likely caused by circular referencing" <<
nl 162 ITstream& is = eptr->stream();
167 if (tok.isLabel() || tok.isPunctuation(token::BEGIN_LIST))
173 else if (tok.isString())
177 list[0] = tok.stringToken();
182 <<
" Entry '"<< keyword
183 <<
"' not a string or list of strings" <<
nl 190 dict.checkITstream(is, keyword);
193 return expandExprStrings(list,
dict, mandatory, recursionDepth);
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
A class for handling words, derived from Foam::string.
static Istream & input(Istream &is, IntRange< T > &range)
string trim(const std::string &s)
Return string trimmed of leading and trailing whitespace.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
static exprString toExpr(const std::string &str)
Copy convert string to exprString.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...