Skip to content

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