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

Make reserved word assignment regex work better with function calls #5759

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

davepagurek
Copy link
Contributor

Resolves #5734

Changes:

  • Made the assignment statement regex a little bigger to handle more edge cases:
    • Instead of splitting on all commas, it uses a regex to parse the whole list of assignments
    • It will now correctly parse single-level function calls and ignore them
    • It will stop parsing after anything it doesn't match so that it doesn't introduce new false positives
    • It still uses regexes instead of writing a simple recursive parser to avoid complexity/bugs
  • Added tests to make sure function parameters on right hand sides of assignments are ignored

PR Checklist

  • npm run lint passes
  • [Inline documentation] is included / updated
  • [Unit tests] are included / updated

@limzykenneth limzykenneth merged commit ae8fe75 into processing:main Aug 11, 2022
@limzykenneth
Copy link
Member

Pretty complex regex there that took some time to wrap my head around. If we didn't miss anything obvious it should be good enough for now. Thanks!

@Qianqianye
Copy link
Contributor

Thanks @davepagurek and @limzykenneth

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.

reserved function "width" error message shows for valid code
3 participants