Skip to content

ENT-10184: Top down evaluation #5834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cf-agent/cf-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -1678,11 +1678,19 @@ PromiseResult ScheduleAgentOperationsTopDownOrder(EvalContext *ctx, const Bundle
PromiseResult result = PROMISE_RESULT_SKIPPED;
for (int pass = 1; pass < CF_DONEPASSES; pass++)
{
char *last_promise_type = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be const char *

for (size_t ppi = 0; ppi < SeqLength(bp->all_promises); ppi++)
{
EvalContextSetPass(ctx, pass);
Promise *pp = SeqAt(bp->all_promises, ppi);
BundleSection *parent_section = pp->parent_section;

if (!StringEqual(last_promise_type, parent_section->promise_type))
{
SpecialTypeBannerFromString(parent_section->promise_type, pass);
}
last_promise_type = parent_section->promise_type;

EvalContextStackPushBundleSectionFrame(ctx, parent_section);

PromiseResult promise_result = ExpandPromise(ctx, pp, KeepAgentPromise, NULL);
Expand Down
14 changes: 14 additions & 0 deletions libpromises/ornaments.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,20 @@ void SpecialTypeBanner(TypeSequence type, int pass)
}
}

void SpecialTypeBannerFromString(char *type, int pass)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const char *type

{
if (StringEqual(type, "classes"))
{
Log(LOG_LEVEL_VERBOSE, "C: .........................................................");
Log(LOG_LEVEL_VERBOSE, "C: BEGIN classes / conditions (pass %d)", pass);
}
if (StringEqual(type, "vars"))
{
Log(LOG_LEVEL_VERBOSE, "V: .........................................................");
Log(LOG_LEVEL_VERBOSE, "V: BEGIN variables (pass %d)", pass);
}
}

void PromiseBanner(EvalContext *ctx, const Promise *pp)
{
char handle[CF_MAXVARSIZE];
Expand Down
1 change: 1 addition & 0 deletions libpromises/ornaments.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <eval_context.h>

void SpecialTypeBanner(TypeSequence type, int pass);
void SpecialTypeBannerFromString(char *type, int pass);
void PromiseBanner(EvalContext *ctx, const Promise *pp);
void Banner(const char *s);
void Legend();
Expand Down
Loading