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

[C#] Ast structure for CoalesceExpression #4788

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

karan-batavia
Copy link
Contributor

No description provided.

val leftAst = astForExpression(createDotNetNodeInfo(coalesceExpression.json(ParserKeys.Left)))
val rightAst = astForExpression(createDotNetNodeInfo(coalesceExpression.json(ParserKeys.Right)))

leftAst ++ rightAst
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably add a <operator>.coalesce so that we can embed the correct semantics

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this not also be a callNode or something similar with the operator you suggested above?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@AndreiDreyer Yes, something like callAst(callNode, leftAst ++ rightAst)

|}
|""".stripMargin)

"resolve methodFullName" in {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would like AST tests here too, please. Specifically to verify the coalescing operator.

@DavidBakerEffendi DavidBakerEffendi added the c# Relates to csharpsrc2cpg label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c# Relates to csharpsrc2cpg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants