GNOME Bugzilla – Bug 608598
ooc language syntax file
Last modified: 2010-02-01 12:53:19 UTC
Created attachment 152674 [details] Current (2010-01-31) version of the ooc language file for gtksourceview Hey there! I've just written a language syntax file for the ooc programming language. The code can be found on github: http://github.com/nddrylliog/ooc-gtksourceview It would be very appreciated if it was merged with the main gtksourceview distribution! Also, if you have suggestions on how to improve the syntax file, e.g. features it's not yet making use of (I still have to read more on gtkautocomplete, etc.), I'm listening. You can find more information on the language here: http://ooc-lang.org/ And a few projects here: http://github.com/languages/ooc We already have syntax highlighting support in Pygments (so on github, etc.), and gtksourceview is very important to us if we want to integrate tighter with Anjuta, for example =) Thanks in advance for your time, and keep up the good work!
As a first quick look, I'd like to comment that the copyright is missing. Would you mind to add it, also say that we only accept LGPL licenses. After that fix I'll start reviewing the file. Thanks for it.
Created attachment 152675 [details] Fixed ooc language file with LGPL license and Copyright Added LGPL license & copyright
(In reply to comment #1) > As a first quick look, I'd like to comment that the copyright is missing. Would > you mind to add it, also say that we only accept LGPL licenses. After that fix > I'll start reviewing the file. Thanks for it. See attachment https://bugzilla.gnome.org/attachment.cgi?id=152675 Thanks for the fast response =)
Thanks a lot, the file in general looks pretty well. Some comments about the lang file below: <property name="mimetypes">text/x-ooc</property> I think that is not the proper mime type or it is not well detected by shared mime types. So let's remove that line for now. <context id="memory" style-ref="keyword"> <keyword>new</keyword> <!-- new isn't really a keyword, but its nice to have it colored =) --> <keyword>this</keyword> <!-- same here --> </context> I'd just remove that comments, the cpp lang file also marks that words as keywords so no problem for me. <context id="numeric" style-ref="number"> <match extended="true"> (\b([0-9]+|0[xX][0-9a-fA-F]+)[Ll]?\b| \b(([0-9]+[Ee][-]?[0-9]+| ([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFdD]?| [0-9]+[FfDd])) </match> </context> I'd split this in octal, decimal etc. Could you also attach an example not longer than 10 lines for the test cases?
Created attachment 152693 [details] latest ooc language syntax file Splitted numeric into decimal, hexadecimal, octal (stolen from c.lang), removed useless comments, removed mime-type. Attached fixed syntax file, and a 10-line example
Also, somebody is telling me that gedit depends on the mime-type to choose the syntax highlighting file to use.. and that "x-" is the correct prefix for 'undefined mimetypes' Do you know how to make a mime type mainstream? Freedesktop seems to have a standard on that, but I don't know who keeps that organized (hopefully it's not distribution-specific)
You can have it match mime type, or file name globs. As a rule, we only use mime type definitions for mime types that are in the freedesktop shared mime type database (because those will be actually available on users' systems). The proper thing to do then is to first get a new mime type accepted into the freedesktop spec (you can file a bug at their bugzilla). When it is accepted we can put the mime type in the lang file.
Asked for the text/x-ooc mime type on freedesktop's bug tracker https://bugs.freedesktop.org/show_bug.cgi?id=26353 Thanks for all the infos, Jesse!
mmm, I think you forgot to attach the example?
Created attachment 152699 [details] 10-line ooc example Oh, huh, whoops =) Example attached.
(In reply to comment #8) > Asked for the text/x-ooc mime type on freedesktop's bug tracker > https://bugs.freedesktop.org/show_bug.cgi?id=26353 > > Thanks for all the infos, Jesse! BTW I remit you to this post: http://www.hadess.net/2010/01/shared-mime-info-patches.html It says what info you have to provide to get accepted the patch
Thanks a lot for the lang file. I've just pushed it into master, so you will have it for the next major release.
(In reply to comment #11) > BTW I remit you to this post: > http://www.hadess.net/2010/01/shared-mime-info-patches.html > > It says what info you have to provide to get accepted the patch Ooh right. Silly me. I've submitted a proper patch now. Thanks for helping! In case the text/x-ooc mime type gets accepted, I suppose I can just come here and open another issue to get the .lang file modified to take it into account? (In reply to comment #12) > Thanks a lot for the lang file. I've just pushed it into master, so you will > have it for the next major release. Awesome! Thanks to you =)
(In reply to comment #13) > (In reply to comment #11) > > BTW I remit you to this post: > > http://www.hadess.net/2010/01/shared-mime-info-patches.html > > > > It says what info you have to provide to get accepted the patch > > Ooh right. Silly me. I've submitted a proper patch now. Thanks for helping! > > In case the text/x-ooc mime type gets accepted, I suppose I can just come here > and open another issue to get the .lang file modified to take it into account? Yep once it get accepted you just have to file a new bug and attach the patch. > > (In reply to comment #12) > > Thanks a lot for the lang file. I've just pushed it into master, so you will > > have it for the next major release. > > Awesome! Thanks to you =)