Skip to content

Conversation

@CohenArthur
Copy link
Member

@CohenArthur CohenArthur commented Aug 29, 2021

Closes #191

@CohenArthur CohenArthur marked this pull request as draft August 29, 2021 23:24
@CohenArthur
Copy link
Member Author

Since we are mutating an existing instance of "something", we might need to keep track of all instantiated variables in the context in order to mutate them later. This should be done in another PR

@CohenArthur
Copy link
Member Author

We can set a field's value in one of those two cases:

  • We just created a variable, and are mutating one of its fields.
  • We are mutating an argument given to a function

Thus, we can only keep track of variables to mutate via the scope map. We should be able to use the get_var and replace_var methods already present in it.

The only other problem remaining is to allow the mutation of a field of a field of a field... of a variable. Think vec3.point.x = 15. Which I am unsure how to resolve currently, as I'd like to avoid keeping a Box<dyn Instruction> as value in the FieldAssign struct

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.

Implement FieldAssign

2 participants