44static constexpr label maxRecursionDepth_ = 100;
47static 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));
102 result.append(expressions::exprString(varExpr,
dict));
135 const entry* eptr =
dict.findEntry(keyword, keyType::LITERAL_RECURSIVE);
142 <<
"Missing mandatory entry: " << keyword <<
nl <<
nl
149 if (++recursionDepth > maxRecursionDepth_)
152 <<
"Exceeded recursion depth (" << maxRecursionDepth_
153 <<
") while reading list " << keyword <<
nl
154 <<
"Likely caused by circular referencing" <<
nl
179 <<
" Entry '"<< keyword
180 <<
"' not a string or list of strings" <<
nl
187 dict.checkITstream(is, keyword);
190 return expandExprStrings(list,
dict, mandatory, recursionDepth);
An input stream of tokens.
virtual void rewind()
Rewind the stream so that it may be read again.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void resize(const label len)
Adjust allocated size of list.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A keyword and a list of tokens is an 'entry'.
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
A token holds an item read from Istream.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
bool isLabel() const noexcept
Token is LABEL.
const string & stringToken() const
Return const reference to the string contents.
bool isString() const noexcept
Token is string-variant (STRING, EXPRESSION, VARIABLE, VERBATIM)
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
string trim(const std::string &s)
Return string trimmed of leading and trailing whitespace.
static Istream & input(Istream &is, IntRange< T > &range)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)