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

Fix C# regression in preprocessor directive parsing #514

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

mjambon
Copy link
Member

@mjambon mjambon commented Oct 10, 2024

It was due to a left-over syntax extension workaround that no longer applies and was causing conflicts.

This also fixes incorrect parsing of typed metavariables where the type is parametrized. The problem occurred just now in Semgrep and didn't have a test for this specific case (e.g. (List<T> $X) was parsed as (List < T) > $X).

Integration work in progress at https://github.com/semgrep/semgrep-proprietary/pull/2390

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)

It was due to a left-over syntax extension workaround that no longer
applies and was causing conflicts.
@mjambon mjambon requested a review from a team as a code owner October 10, 2024 03:34
@mjambon mjambon requested review from ihji and aryx October 10, 2024 03:34
(expression_statement
(invocation_expression
(identifier)
(argument_list))))))))
Copy link
Member Author

Choose a reason for hiding this comment

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

^ This test was failing

Test 'Typed metavariable 3' was failing and was being parsed as binary
'<' and '>' operations.
@mjambon mjambon merged commit a55e4a6 into main Oct 11, 2024
2 of 3 checks passed
@mjambon mjambon deleted the martin/fix-preproc-regression branch October 11, 2024 02:41
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.

2 participants