[Geany-devel] [Geany] cython language support

Enrico Tröger enrico.troeger at xxxxx
Wed Jan 21 13:43:09 UTC 2009


On Tue, 20 Jan 2009 16:20:48 +0100, Sebastien Barthelemy
<barthelemy at crans.org> wrote:

>Hello,
>
>I would like geany to support the cython [1] programming language. The
>Cython language is very close to the Python language, but Cython
>additionally supports calling C functions and declaring C types on
>variables and class attributes. It is really useful when wrapping C
>libraries into python. Cython is built upon Pyrex, they both uses the
>same filename extension and a compatible to a certain extent.
>
>I had a look at [2] but I'm still not sure of what should be done.
>Here is my first attempt:
>
>- 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


>These modifications are in the attached patch (against trunk). It
>compiles and works: I now have a cython filetype in geany. However, I
>still have no folding nor syntax highlighting. Can you guide me a
>little bit for the next step?

>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?

Some example files would be helpful (something more complex than the
snippet mentioned in IRC).


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/b3959f4e/attachment.pgp>


More information about the Devel mailing list