[Lazarus] SynEdit - SQL highlighter with $ in keywords

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] SynEdit - SQL highlighter with $ in keywords

Free Pascal - Lazarus mailing list
Hi All,

I try to extend TSynSQLSyn with keyword lists of Firebird 2.5, 3.0 and
4.0. Every keyword included in one list/version and used as tKey (e.g.
sqlFirebird30: EnumerateKeywords(Ord(tkKey), Firebird30KW, IdentChars,
@DoAddKeyword);). Some keywords contains a $ sign (RDB$DB_KEY,
RDB$GET_CONTEXT, RDB$RECORD_VERSION, RDB$SET_CONTEXT). If I try to use
the new highlighters got "Keyword "RDB" already in list with value
"sqlFirebird30"". (I tried with actual trunk.) Any idea why and how to
solve the problem?

Gabor
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] SynEdit - SQL highlighter with $ in keywords

Free Pascal - Lazarus mailing list
Am Sun, 10 Nov 2019 14:33:03 +0100
schrieb Gabor Boros via lazarus <[hidden email]>:

> Hi All,
>
> I try to extend TSynSQLSyn with keyword lists of Firebird 2.5, 3.0
> and 4.0. Every keyword included in one list/version and used as tKey
> (e.g. sqlFirebird30: EnumerateKeywords(Ord(tkKey), Firebird30KW,
> IdentChars, @DoAddKeyword);). Some keywords contains a $ sign
> (RDB$DB_KEY, RDB$GET_CONTEXT, RDB$RECORD_VERSION, RDB$SET_CONTEXT).
> If I try to use the new highlighters got "Keyword "RDB" already in
> list with value "sqlFirebird30"". (I tried with actual trunk.) Any
> idea why and how to solve the problem?
>
> Gabor

Hi Gabor,

have a look at the implementation of TSynSQLSyn.GetIdentChars().

You could add somthing like

  if fDialect = sqlFirebird30 then
    Include(Result, '$');

Gerd
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] SynEdit - SQL highlighter with $ in keywords

Free Pascal - Lazarus mailing list
2019. 11. 10. 19:51 keltezéssel, Gerd Sager via lazarus írta:

> Hi Gabor,
>
> have a look at the implementation of TSynSQLSyn.GetIdentChars().
>
> You could add somthing like
>
>    if fDialect = sqlFirebird30 then
>      Include(Result, '$');
>
> Gerd


Works like a charm. Thank you very much Gerd!

Gabor

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus