[Geany-Users] awk filetypes
Lex Trotman
elextr at gmail.com
Mon Oct 15 06:08:10 UTC 2012
On 15 October 2012 16:29, Jean-Max Reymond <jmreymond at free.fr> wrote:
> Le 15/10/2012 01:46, Lex Trotman a écrit :
>
>>
>>
>> On 15 October 2012 02:35, Jean-Max Reymond <jmreymond at free.fr
>> <mailto:jmreymond at free.fr>> wrote:
>>
>> Hi,
>> I have written a filetype for awk files but I have some troubles
>> with lexer_filetype
>>
>> In order to work correctly, I have to add a line lexer_filetype=C
>> (whitout this line, nothing is colored). So, my keywords are
>> highligted but the commentary does not work, only the C syntax is
>> highligted. What's wrong ?
>> Thanks for your tips,
>>
>>
>> Hi,
>>
>> The lexer is the piece of code that parses your file to decide what
>> colour each character should be, thats why you need to specify one. The
>> lexer_filetype=X says use the lexer that is used for filetype X. So that
>> line tells your filetype to use the C lexer, so thats why only C
>> comments are highlighted. Note the C lexer is hard coded to C syntax,
>> if you set the various comment settings in the filetype file they affect
>> things like menu->edit->format->comment/**uncomment/toggle comment not
>> the
>> lexer. I don't remember the awk details but I would think C is probably
>> the nearest other language.
>>
>> The lexers are part of the Scintilla project whose editing widget we use
>> (www.scintilla.org <http://www.scintilla.org>). Unfortunately they
>>
>> don't have an awk specific one so someone would have to write one to get
>> exact awk syntax colouration.
>>
>
> thanks for your answer.
> You're right that C is the nearest language so I use the lexer_filetype=C
> I is very surprising that comment_single=# in the [settings] section is
> overridden by lexer_filetype .
>
It isn't overridden so much as ignored, the lexer is for a specific
language, and for any language the comments are defined so the lexer
doesn't need to look at any settings. The lexer knows nothing about your
attempt to (ab)use it for a similar language.
> Now, I have to fix the Symbols tab which does not display the variables
> and functions
>
>
Sadly the problem is similar, but this time with parsers from the Ctags
project. Those parsers find the symbols in open files that are shown in
the symbols tab. Again there isn't an Awk parser in Geany.
Cheers
Lex
>
>
> --
> Jean-Max Reymond
> Éruption de l'Etna: http://jmreymond.free.fr/**Etna2002<http://jmreymond.free.fr/Etna2002>
> ______________________________**_________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-**bin/mailman/listinfo/users<https://lists.geany.org/cgi-bin/mailman/listinfo/users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20121015/656946a6/attachment.html>
More information about the Users
mailing list