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

Implement Sorbet -> Prism translations for op assigns for local and instance variables #233

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

egiurleo
Copy link

@egiurleo egiurleo commented Sep 3, 2024

Closes #111
Closes #112
Closes #113
Closes #126
Closes #127
Closes #128

Test plan

See included automated tests.

@egiurleo egiurleo self-assigned this Sep 3, 2024
Comment on lines +343 to +351
case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
return translateAssignment<pm_instance_variable_and_write_node, parser::AndAsgn, parser::IVarLhs>(node);
}
case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
return translateAssignment<pm_instance_variable_operator_write_node, parser::OpAsgn, parser::IVarLhs>(node);
}
case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
return translateAssignment<pm_instance_variable_or_write_node, parser::OrAsgn, parser::IVarLhs>(node);
}

Choose a reason for hiding this comment

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

This turned out incredibly nice.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah it's rare for C++ to make me go "ooooh ahhhhh" but that's what this code does 😆

@egiurleo egiurleo merged commit b57aa85 into prism Sep 4, 2024
1 check passed
@egiurleo egiurleo deleted the emily/op-assigns branch September 4, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment