Neil Hodgson wrote:
This sort of update is very hard to review as it mixes up substantive changes, mechanism changes and formatting changes.
Actually, that's not changes but rewritting...
One thing that worries me is "MySQL requires a space or control char after -- ... Perhaps we should enforce that".
That's a comment, and I have commented out the test enforcing that. So it behaves OK with comment like --Foo.
The lexer currently handles PL/SQL (although that isn't well documented) which is a language defined by Oracle that looks a lot like Ada with "--" introducing comments. If MySQL is different enough to require different handling here then it needs to have an option to enable this behaviour.
It would allow to make comments like above, rejected by MySQL, stand out, but I actually I don't feel this feature compelling enough...
Breaking Oracle compatibility would not be a good idea and that comment makes me wonder if there are changes that are not compatible with PL/SQL.
Basically, I tried and respected as most as I could the behaviour of the old SQL lexer.
The "if (ch == 'i' || ch == 'b' || ch == 'e' || ch ==
'l') {" code appears to be an overly fragile optimisation which will
probably break if a keyword is in upper case although I haven't
analysed the code enough to be sure.
No. I don't know why it works ;-) but it works with upper case as well. Actually, I saw this kind of optimisation in the Lua folder. I won't mind if it goes.
Actually, I found a bug, that is probably already in the current lexer:if it find a IF inside a request, it displays to fold symbol, and if it doesn't find an END, it folds up to the end of the file:
DROP TABLE IF EXISTS ap_Categories; CREATE TABLE IF NOT EXISTS ap_CategoriesI suppose that's a limitation of the language. Maybe we should test the next word after IF?
I just noticed a bug: it doesn't fold on opening brace. I am not sure why.
It may be an idea to tell me what substantive changes you want and I'll try to apply them.
That's easy: the substantive change I want to keep is the replacement of the old lexer by mine :-P
Then when that code looks OK, the other changes can be examined.
It would be nice if other users of SQL would test my lexer. I use mostly simple constructs. I searched more sophisticated code on the Net, but I didn't tested every possible construct.
-- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- -- _______________________________________________ Scintilla-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scintilla-interest
