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

Shared: support quoted operands in access path components #13441

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Jun 13, 2023

The operand to an access path component can now be be enclosed in single quotes. In this case, any character is allowed in-between the single quotes, and two consecutive single quotes will be interpreted as an individual single quote.

This was motivated by a desire to refer to Ruby's [] and []= methods as Method['[]'] and Method['[]='], respectively. I wanted something general enough to ensure we won't have the same problem in the future, and this ensures that arbitrary strings can now be encoded in the operand.

asgerf added 4 commits June 16, 2023 10:15
Operands in access path components can now be surrounded by single quotes in order to use reserved characters (commas and brackets) as part of the operand text.

As an escape mechanism, two consecutive single quote characters are converted to an individual single quote. This was chosen mainly since other escaping mechanisms are hard to implement efficiently in CodeQL.
@asgerf asgerf force-pushed the shared/access-path-quotation branch from 5503751 to fc4026f Compare June 16, 2023 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant