Skip to content

Conversation

@cwaldren-ld
Copy link
Contributor

@cwaldren-ld cwaldren-ld commented Jul 12, 2023

Adds a data structure for detecting circular references during evaluation. It is called EvaluationStack and uses RAII to notice/forget keys.

Intended usage is like:

if (auto guard = stack.SeenPrerequisite("foo")) {
   // Now "foo" has been seen. Can't obtain another guard until this one is destroyed.
   assert_false(stack.SeenPrerequisite("foo"))
}

@cwaldren-ld cwaldren-ld force-pushed the cw/evaluation-stack branch from c37bb03 to f67defe Compare July 12, 2023 00:52
@cwaldren-ld cwaldren-ld force-pushed the cw/evaluation-stack branch from f67defe to 4b6816a Compare July 12, 2023 00:53
@cwaldren-ld cwaldren-ld marked this pull request as ready for review July 12, 2023 00:54
@cwaldren-ld cwaldren-ld requested a review from a team July 12, 2023 00:54
@cwaldren-ld cwaldren-ld requested a review from kinyoklion July 12, 2023 00:55
@cwaldren-ld cwaldren-ld merged commit e6039d5 into evaluator Jul 12, 2023
@cwaldren-ld cwaldren-ld deleted the cw/evaluation-stack branch July 12, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants