ENH: code reduction, improvements for expressions

- literal lookups only for expression strings

- code reduction for setExprFields.

- changed keyword "condition" to "fieldMask" (option -field-mask).
  This is a better description of its purpose and avoids possible
  naming ambiguities with functionObject triggers (for example)
  if we apply similar syntax elsewhere.

BUG: erroneous check in volumeExpr::parseDriver::isResultType()

- not triggered since this method is not used anywhere
  (may remove in future version)
This commit is contained in:
Mark Olesen
2021-12-07 18:06:45 +01:00
committed by Andrew Heather
parent 39f6618d3a
commit 510ffb3322
19 changed files with 441 additions and 295 deletions

View File

@ -135,13 +135,22 @@ public:
//- Get and expand expression with dictionary entries,
//- optionally strip C/C++ comments from the input.
//
// Expansion behaviour as per inplaceExpand
static exprString getExpression
static exprString getEntry
(
const word& name,
const word& keyword, //!< Lookup key. Uses LITERAL (not REGEX)
const dictionary& dict,
const bool stripComments = false
const bool stripComments = true
);
//- Get and expand expression with dictionary entries,
//- optionally strip C/C++ comments from the input.
// Expansion behaviour as per inplaceExpand
static exprString getOptional
(
const word& keyword, //!< Lookup key. Uses LITERAL (not REGEX)
const dictionary& dict,
const bool stripComments = true
);
//- Copy convert string to exprString.
@ -155,17 +164,26 @@ public:
// Member Functions
//- Inplace expansion with dictionary variables,
//- and strip C/C++ comments from the input
exprString& expand
(
const dictionary& dict,
const bool stripComments = true
);
//- Check for unexpanded '$' entries. Fatal if any exist.
inline bool valid() const;
//- Inplace expansion with dictionary variables,
//- and strip C/C++ comments from the input
void expand(const dictionary& dict, const bool stripComments = true);
//- Inplace trim leading and trailing whitespace
void trim();
//- Read/expand entry with dictionary variables,
//- and strip C/C++ comments from the input
bool readEntry
(
const word& keyword, //!< Lookup key. Uses LITERAL (not REGEX)
const dictionary& dict,
bool mandatory = true,
const bool stripComments = true
);
// Member Operators