Skip to content
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

Fix nested any/all evaluation #6

Merged
merged 1 commit into from
Mar 30, 2020

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Mar 29, 2020

Checklist

  • I have read the Contributor Guide
  • I have read and agree to the Code of Conduct
  • I have added a description of my changes and why I'd like them included in the section below

Description of Changes

The current evaluator pops everything on the stack in order to evaluate any or all queries. That breaks in nested situations like:

all(any(unix, target_arch="x86"), not(any(target_os="android", target_os="emscripten")))

Fix this by tracking the number of predicates in the Any and All variants.

This unfortunately breaks semver because the definition of Func changes.
Func doesn't seem to be exported anywhere so maybe in the upcoming release
it could be made private?

The current evaluator pops everything on the stack in order to evaluate `any` or `all` queries. That breaks in nested situations like:

```
all(any(unix, target_arch="x86"), not(any(target_os="android", target_os="emscripten")))
```

Fix this by tracking the number of predicates in the `Any` and `All` variants.

This unfortunately breaks semver because the definition of `Func` changes.
`Func` doesn't seem to be exported anywhere so maybe in the upcoming release
it could be made private?
Copy link
Member

@Jake-Shadle Jake-Shadle left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding a test! 🙂

@Jake-Shadle Jake-Shadle merged commit 327c706 into EmbarkStudios:master Mar 30, 2020
@sunshowers sunshowers deleted the fix-any-all branch March 30, 2020 17:02
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.

2 participants