On Tue, 20 Jan 2009 16:20:48 +0100, Sebastien Barthelemy barthelemy@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