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