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

[rubysrc2cpg] Parser and ast changes for empty right hand side of association #3226

Merged
merged 8 commits into from
Jul 26, 2023

Conversation

karan-batavia
Copy link
Contributor

@xavierpinho, can you please review?

@karan-batavia
Copy link
Contributor Author

@xavierpinho , addressed your review.

cpg.call.size shouldBe 2
val List(callNode, operatorNode) = cpg.call.l
callNode.name shouldBe "foo"
operatorNode.name shouldBe "<operator>.activeRecordAssociation"
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of this PR's responsibility, but might as well take advantage of a sample at hands.

I think there shouldn't be an operator here. The sample foo(bar:) should mean the same as foo(bar: bar), in which case there wouldn't be an operator, but rather a call to bar.

Do you have a different opinion?

Copy link
Contributor Author

@karan-batavia karan-batavia Jul 25, 2023

Choose a reason for hiding this comment

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

foo(bar:bar) would have an operator as well, right? Imo, it helps when there is something present on the RHS.

Copy link
Contributor

Choose a reason for hiding this comment

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

foo(bar:bar) would have an operator as well, right? Imo, it helps when there is something present on the RHS.

Not sure. Would need to see how keyword parameters are handled in other frontends. As a first guess, I'd say it shouldn't have, as we are only mapping the parameter name bar with the call bar, not really creating another call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure about this.

@karan-batavia
Copy link
Contributor Author

@xavierpinho, if there are no blockers, can you please merge?

@xavierpinho
Copy link
Contributor

@xavierpinho, if there are no blockers, can you please merge?

There are merge conflicts. Please rebase or merge with master and we should be good

@karan-batavia
Copy link
Contributor Author

@xavierpinho Merged master.

@xavierpinho xavierpinho merged commit 214ad17 into joernio:master Jul 26, 2023
5 checks passed
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