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

Support translating struct updates to Bluespec. Refs #10. #13

Merged
merged 3 commits into from
Jul 11, 2024

Conversation

RyanGlScott
Copy link
Collaborator

To accomplish this, we leverage Bluespec's functional struct updates. For instance, suppose we have a Copilot struct with fields x :: Field "x" Int32 and y :: Field "y" Int32. If we update a struct's x field to be 42, then the generated Bluespec code would look roughly like v { x = 42 }.

In order to test UpdateField (the copilot-core representation of struct field updates), we also generalize the test suite infrastructure a bit, as we need to be able to display and read struct values. Thankfully, this proves relatively straightforward.

Fixes #10.

RyanGlScott and others added 3 commits July 11, 2024 08:57
To accomplish this, we leverage Bluespec's functional struct updates. For
instance, suppose we have a Copilot struct with fields `x :: Field "x" Int32`
and `y :: Field "y" Int32`.  If we update a struct's `x` field to be `42`, then
the generated Bluespec code would look roughly like `v { x = 42 }`.
Doing so requires generalizing the test suite infrastructure a bit, as we need
to be able to display and read struct values in order to test `UpdateField`.
Thankfully, this proves relatively straightforward.
@RyanGlScott RyanGlScott merged commit 94788cd into master Jul 11, 2024
3 checks passed
@RyanGlScott RyanGlScott deleted the T10-struct-updates branch July 11, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support struct updates
1 participant