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

Move custom operator handling to scanner.c #220

Merged
merged 2 commits into from
Sep 4, 2022
Merged

Conversation

alex-pinkus
Copy link
Owner

Custom operator rules are better expressed as conditions to track in eat_operator vs a series of impenetrable regexes.

Also requires a fix for an undiscovered bug where x[...]! was not considered to be a legal target for an expression. Since the old logic allowed += to be a "custom operator", we were covering up for that failure by interpreting x[...]! += y as a custom infix expression.

This fixes the last parse failure in the current list of top repos, so we also bring in some new top repos. The new list comes from the ones the Semgrep folks have added for their own parse rate tracking. For some reason, Semgrep uses very old repos, so we have to support older language constructs.

Fixes #5

Custom operator rules are better expressed as conditions to track in
`eat_operator` vs a series of impenetrable regexes.

Also requires a fix for an undiscovered bug where `x[...]!` was not
considered to be a legal target for an expression. Since the old logic
allowed `+=` to be a "custom operator", we were covering up for that
failure by interpreting `x[...]! += y` as a custom infix expression.

Fixes #5
@alex-pinkus alex-pinkus merged commit 02b04b0 into main Sep 4, 2022
@alex-pinkus alex-pinkus deleted the custom-operators branch September 4, 2022 03:38
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.

Custom operators are obtuse and restrictive
1 participant