On Wed, 21 Jan 2009 15:21:44 +0100, Sebastien Barthelemy barthelemy@crans.org wrote:
2009/1/21 Enrico Tröger enrico.troeger@uvena.de:
On Tue, 20 Jan 2009 16:20:48 +0100, Sebastien Barthelemy barthelemy@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