You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/12/29 14:20:59 UTC
[GitHub] [netbeans] matthiasblaesing commented on issue #5159: String escaping in SQL files results in broken color highlighting
matthiasblaesing commented on issue #5159:
URL: https://github.com/apache/netbeans/issues/5159#issuecomment-1367362546
This is a problem for lexers as MySQL decided to introduce a language not compatible with SQL. SQL-99 defines a string as delimited by single quotes, where the quote can be escaped by doubling it. See here:
https://ronsavage.github.io/SQL/sql-99.bnf.html#character%20string%20literal
https://ronsavage.github.io/SQL/sql-99.bnf.html#quote%20symbol
So from an SQL grammar perspective the first value set holds a string literal, that ends directly before the t and is which is followed by the identifier `t`. The second value set does not hold any string, but the two identifiers `Test` and `This won\'t either`.
I think I looked into this in the past and did not come up with a clean solution. If you can come up how to implement a lexer, that handles both cases without breaking existing samples, I'm happy to hear it, but I doubt it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists