Skip to content
Snippets Groups Projects
Commit 8fc56121 authored by mattijs's avatar mattijs
Browse files

BUG: dynamicCodeContext: preprocessing options_, localCode_

parent 258d9a7f
No related merge requests found
......@@ -85,6 +85,14 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
stringOps::inplaceExpand(libs_, dict);
}
// optional
const entry* localPtr = dict.lookupEntryPtr("localCode", false, false);
if (localPtr)
{
localCode_ = stringOps::trim(localPtr->stream());
stringOps::inplaceExpand(localCode_, dict);
}
// calculate SHA1 digest from include, options, localCode, code
OSHA1stream os;
os << include_ << options_ << libs_ << localCode_ << code_;
......@@ -103,14 +111,18 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
{
addLineDirective(include_, includePtr->startLineNumber(), dict.name());
}
if (optionsPtr)
{
addLineDirective(options_, optionsPtr->startLineNumber(), dict.name());
}
// Do not add line directive to options_ (Make/options) since at it is a
// single line at this point. Can be fixed.
if (libsPtr)
{
addLineDirective(libs_, libsPtr->startLineNumber(), dict.name());
}
if (localPtr)
{
addLineDirective(localCode_, localPtr->startLineNumber(), dict.name());
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment