Carsten wrote:
I use scintilla control in my job to work with Oracle database scripts.
So I knew the behaviour of old version. I saw the new version from
Philippe and tested it. With some minor changes it works for me. I
didn't found any (new) problems.
Excellent, just what I needed, a tester :-))
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.
This didn't worked for me. I added uppercase letters to get it working.
That's strange, why does it work for me?
I have no time to dig right now, I will check that in a few days.
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_Categories
I suppose that's a limitation of the language. Maybe we should test
the next word after IF?
This would be fine for my daily work, but Oracle doesn't support these
variants. :-)
What variants? The IF EXISTS isn't standard?
I just noticed a bug: it doesn't fold on opening brace. I am not sure
why.
What do you mean? I cannot find this bug.
Well, if I have:
CREATE TABLE foo (
...
);
I should have a fold mark on the line where the opening brace is, but I
don't have it..
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.
I know the old code. The new code is much better than the old code. It
is very simple so it should be easy to extend this code.
Thank you for the feedback.
I had problems with SQL*Plus remark and prompt. Philipp's implementation
didn't worked for me. So I moved the code into
case SCE_SQL_IDENTIFIER:
...
sc.GetCurrentLowered(s, sizeof(s));
if (MatchIgnoreCaseSubstring("rem~ark", s)) {
sc.ChangeState(SCE_SQL_SQLPLUS_COMMENT);
sc.SetState(SCE_SQL_SQLPLUS_COMMENT);
continue;
} else if (MatchIgnoreCaseSubstring("pro~mpt", s)) {
sc.ChangeState(SCE_SQL_SQLPLUS_PROMPT);
sc.SetState(SCE_SQL_SQLPLUS_PROMPT);
continue;
} else if (keywords1.InList(s)) {
I must admit I didn't tested this part. I will try your change.
I had to rewrite MatchIgnoreCaseSubstring too. This work for me but I
don't like the construct with ChangeState, SetState and continue. Do you
know a better solution?
I am not sure to follow you. Why rewrite this function. What works for
you? Can you give your code?
Phillipe, thank you for you rewritting the SQL lexer. I work with SQL
lexer every day so I can give feedback to you.
Aaah, happy customers :-) Thanks again.
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest