[Geany-devel] [Geany] cython language support

Enrico Tröger enrico.troeger at xxxxx
Wed Jan 21 16:10:56 UTC 2009


On Wed, 21 Jan 2009 15:21:44 +0100, Sebastien Barthelemy
<barthelemy at crans.org> wrote:

>2009/1/21 Enrico Tröger <enrico.troeger at uvena.de>:
>> On Tue, 20 Jan 2009 16:20:48 +0100, Sebastien Barthelemy
>> <barthelemy at crans.org> wrote:
>>>- I added GEANY_FILETYPES_CYTHON to filetypes.{c,h}. I choosed
>>>ft->lang = 7, but I'm not sure about it means ([2] doesn't mention
>>>it)
>>
>> src/filetypes.h line 128
>
>/** Represents the langType of tagmanager (see the table
>	 * in tagmanager/parsers.h), -1 represents all, -2 none. */
>
>I saw this comment but I do not know what the tagmanager does yet.

Mainly, the tagmanager creates the data for the symbol list in the
sidebar. For your needs, setting langType to 7 is the best as this
parses symbols using the existing Python parser.


>> From what I have read in the IRC backlog, I don't see why another
>> filetype is necessary at least for syntax highlighting.
>> Either you want to reuse the Python lexer for highlighting(a), that
>> would be pretty easy in src/highlighting.c or you have to write a new
>> Scintilla lexer for Cython first(b).
>>
>> In case of (a): why would we need a new filetype at all?
>
>there are keywords in Cython that are not keywords in Python. For
>instance, "cdef int a = 0" is valid Cython but invalid Python. On the
>contrary "cdef = 0" is valid python (where cdef is a regular var) but
>invalid cython.
>
>Yet, they are very similar, so the Python lexer should be ok, with
>additionnal keywords. (I never wrote one, nor heard of them before
>yesterday, so I might be wrong).

Well, if you don't need a different lexer (the code for syntax
highlighting) nor a different parser, it's really just about a set of
different keywords. In this case I doubt whether it is reasonable to
add just another filetype only for different keywords.

Maybe we can find a solution without creating another filetype but I
definetely won't work on this during the next two or three weeks. There
are too many other, important things on the road.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20090121/e40fa42b/attachment.pgp>


More information about the Devel mailing list