Thanks for the information... I confess that I did not triy your suggestion
yet, but I got another idea: I replaced the section of an existing keyword
list with part of my word list, and it worked fine to me, like this:

# FlagShip 6 function and procedure
keywordclass.fs6funcproc=\
ra0_bairro \
ra0_cep \
ra0_cgc \
ra0_cidade \
ra0_contat \
ra0_desc \
ra0_destip \
ra0_endere

So, now I come with another question: is there a limit for the number of
words in a keyword list? Is there a problem if I place one word by line,
like this? Because when I placed the entire word list (all the field names
of all the tables of my system - about 46000 words), the editor stopped
colouring the text.
Ok, I agree that is a lot of words, but users always want more and more...

Thanks,
Robert Koch - RS - Brasil


----- Original Message ----- From: "Philippe Lhoste" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, January 30, 2007 12:41 PM
Subject: [scite] Re: How to create a new keyword list?


Robert Koch - Microsiga wrote:
I speak portuguese, so sorry for writing a bad english...

As lot of us... (I am French)

Well, I have been trying to create a new keyword list for the Flagship
language. I created the list in flagship.properties, but the words does
not get coloured.

It might help to have an idea of the syntax you used.

I searched for "keyword", "flagship", "style.flagship" and other in the
source files of Scite and Scintilla, but I could not find out how to link
my new keyword list to a color.

I looked at flagship.properties and LexFlagship.cxx

The later has:

WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
WordList &keywords4 = *keywordlists[3];

which shows this lexer accepts only 4 keyword lists.
They are used in the former with:

keywords.$(file.patterns.flagship)=$(keywordclass.fs6commands)
keywords2.$(file.patterns.flagship)=$(keywordclass.fs6libfunc)
keywords3.$(file.patterns.flagship)=$(keywordclass.fs6funcproc)
keywords4.$(file.patterns.flagship)=$(keywordclass.fs6class)

Is it enough to change some "properties" file, ou do I have to recompile
something? Do I have to create a new entry in stype.flagship? Is is the
case, how to do that? I tried until download the sources and include a
test for my keyword list in the LexFlagship.cxx, but even so it did not
work...

If you want a list separated of the 4 others, you have to recompile
something...

You need to add:

WordList &keywords5 = *keywordlists[4];

and later to change:

} else if (keywords4.InList(s)) {
sc.ChangeState(SCE_FS_KEYWORD4);

to:

} else if (keywords4.InList(s)) {
sc.ChangeState(SCE_FS_KEYWORD4);
} else if (keywords5.InList(s)) {
sc.ChangeState(SCE_FS_KEYWORD5);

and to add the right definition of SCE_FS_KEYWORD5 to the relevant files
in Scintilla project (search the previous one).

Oh, and add an entry to FSWordListDesc although I am not sure how this
table is actually used.

In the .properties file, you have to define your list and its style:

# FlagShip 6 User defined keywords
keywordclass.fs6userDef=\
foo bar gah bu zo meuh

keywords5.$(file.patterns.flagship)=$(keywordclass.fs6userDef)

# keywords 5 - User defined
style.flagship.18=$(colour.keyword),bold


--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

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


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

Reply via email to