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

Update julia grammar #520

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update julia grammar #520

wants to merge 1 commit into from

Conversation

savq
Copy link

@savq savq commented Jan 8, 2025

Update the Julia grammar to tree-sitter/tree-sitter-julia#135. That PR introduced several breaking changes, including changes in the way function signatures and parameters were parsed.

(This should reduce the size of the parser.c in semgrep-julia by about 15MB).

Checklist

  • Any new parsing code was already published, integrated, and merged into Semgrep. DO NOT MERGE THIS PR BEFORE THE SEMGREP INTEGRATION WORK WAS COMPLETED.
  • Change has no security implications (otherwise, ping the security team)

Update the Julia grammar to tree-sitter-julia#135. That PR introduced
several breaking changes, including changes in the way function
signatures and parameters were parsed.
@CLAassistant
Copy link

CLAassistant commented Jan 8, 2025

CLA assistant check
All committers have signed the CLA.

@aryx aryx requested a review from mjambon January 9, 2025 07:22
Copy link
Collaborator

@aryx aryx left a comment

Choose a reason for hiding this comment

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

looks good to me

),

_statement: ($, previous) => choice(
previous,
$.semgrep_ellipsis,
),

typed_parameter: ($, previous) => choice(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why removing this? We can still have ellpisis in type parameters even with this removal?

Copy link
Author

Choose a reason for hiding this comment

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

Julia doesn't have a distinction between expressions and patterns, so function signatures are parsed as function calls, and checked in the lowering phase (after macro expansion). Having these parameter rules added a lot of duplication and conflicts, so we removed them.

We can still have ellpisis in type parameters even with this removal?

Yes. Ellipsis would now be parsed as splat_expression.

@savq savq marked this pull request as ready for review January 17, 2025 16:03
@savq savq requested a review from a team as a code owner January 17, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants