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

Pass expander whenever we need to expand something #1558

Merged
merged 5 commits into from
Nov 21, 2018

Conversation

rgrinberg
Copy link
Member

Rather than passing separate arguments to pass to the expander.

There's still a few more cases to handle. I will do those once #1554 is merged

@rgrinberg rgrinberg requested a review from a user November 20, 2018 15:02
@rgrinberg rgrinberg requested a review from emillon as a code owner November 20, 2018 15:02
@rgrinberg
Copy link
Member Author

This is now ready. Now whenever we want to expand variables in the code we need to have an Expander.t instead of a bunch of related stuff. There's still a bit of tension for how to best obtain this expander. There's a couple of options so far:

  • Get it from the dir and Super_context. Requires the least boilerplate whenever those are already there.

  • Pass the expander manually.

I've opted mostly for the latter because it's similar to how we handle the scope. There's a few cases where I had to fallback to the former as things like the Compilation context and sub system context don't have expanders yet.

@rgrinberg
Copy link
Member Author

rgrinberg commented Nov 20, 2018

Btw, along with the upcoming rule_context. Here's a summary of the kind of values we'll have to construct rules:

  • Rule_context - whenever we need to add rules
  • Expander - whenever we evaluate OSL/templates/blang
  • Scope - whenever we interact with the library database
  • Compilation context - whenever we compile OCaml code

This should make things a bit more clean in our code.

Rather than passing separate arguments to pass to the expander

Signed-off-by: Rudi Grinberg <[email protected]>
Signed-off-by: Rudi Grinberg <[email protected]>
We are now passing the expander instead of the scope in many cases. The scope
was used in many cases as an argument for the expander anyway.

Signed-off-by: Rudi Grinberg <[email protected]>
@rgrinberg rgrinberg merged commit a51d4b2 into ocaml:master Nov 21, 2018
@rgrinberg rgrinberg deleted the expander-pass branch November 21, 2018 17:15
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.

1 participant