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

A CodeQL library for Kaleidoscope #3

Draft
wants to merge 6 commits into
base: extractor
Choose a base branch
from
Draft

A CodeQL library for Kaleidoscope #3

wants to merge 6 commits into from

Conversation

aibaars
Copy link
Owner

@aibaars aibaars commented Oct 6, 2023

No description provided.

override Location getLocation() { result = node.getLocation() }
}

class ParenExpression extends Expression, TParenExpression {
Copy link

Choose a reason for hiding this comment

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

Did you consider using the synthesis/desugaring framework for desugaring away parentheses?

Copy link
Owner Author

Choose a reason for hiding this comment

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

That felt a bit overkill .

Comment on lines +11 to +16
this =
any(BinaryOpExpression e |
e.getOperator().getName() = "=" and
variable = e.getLhs().(VariableExpression).getVariable()
) or
variable = this.(Initializer).getVariable()
Copy link

Choose a reason for hiding this comment

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

Perhaps have another field rhs, to avoid duplicating this pattern in getValue.

Copy link
Owner Author

Choose a reason for hiding this comment

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

The rhs is optional in a variable declaration (Initializer) in which case it defaults to 0.0.

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.

4 participants