Hello all,

I barely use SQL files but when I have to move some data from my local
MySQL server to another location, so the only SQL I use to see is
generated by MySQL.

The current lexer parses fine those files but for a small glitch that
have been hiting my eyes lately.

MySQL use backticks `` to mark the table and fields' names resulting in
code like:

 CREATE TABLE `auth` (
  `type` int(10) unsigned NOT NULL auto_increment,
  `user` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

As you can see there are a lot of strings marked with backticks but the
current lexer does not identify them as strings - of course, as they're
not strings in SQL syntax - and highlights them as SQL keywords if there
is a match with any of the keywords' lists.

In the example above `user` and `type` are marked as keywords when
they're not.

To deal with this I have made some tiny changes to the current lexer to
recognize text surrounded by backticks as string, if you set the
property "sql.backticks.string".

It won't break any existing configuration so I let it here for your
review in the hope you'd find it interesting. 

http://iagorubio.com/scintilla/LexSQL.patch
http://iagorubio.com/scintilla/LexSQL.cxx.zip


Best Regards.
-- 
Iago Rubio

_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to