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

SQL: Quoted variables are now greedy #1510

Merged
merged 5 commits into from
Aug 23, 2018

Conversation

RunDevelopment
Copy link
Member

@RunDevelopment RunDevelopment commented Aug 1, 2018

This resolves #1509.


I added a small fix to bypass #1492.
It now (mostly) works because the quoted variables are now matched before strings. Therefore strings (of quoted variables) are always contained by the variable which leads to there match being discarded.

This little trick also reduces the greedy matching overhead because it doesn't have to rematch any patterns. Maybe we should include this trick into the docs as a best practice?

@mAAdhaTTah
Copy link
Member

Got conflicts here, probs a result of the other SQL PR I just merged.

@mAAdhaTTah
Copy link
Member

Are there styles for quoted-variable? I don't think that's a currently-existing token...

@RunDevelopment
Copy link
Member Author

I know any styles for quoted-variable either. It's just a temporary name because it has to be matched before string.
But we could move variable before string as well and merge the two into one variable token without any side effects (I think).

@mAAdhaTTah
Copy link
Member

Give that a shot if you think it's feasible. I'd definitely like to avoid introducing new tokens used in a single language, if possible.

@RunDevelopment
Copy link
Member Author

RunDevelopment commented Aug 23, 2018

I did implement the merged variable token.

Is it ready to merge then?

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.

Single-quoted variables not working for SQL highlighting
2 participants