After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608598 - ooc language syntax file
ooc language syntax file
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other All
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-31 16:05 UTC by nddrylliog
Modified: 2010-02-01 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Current (2010-01-31) version of the ooc language file for gtksourceview (6.58 KB, application/octet-stream)
2010-01-31 16:05 UTC, nddrylliog
Details
Fixed ooc language file with LGPL license and Copyright (7.41 KB, text/plain)
2010-01-31 16:19 UTC, nddrylliog
Details
latest ooc language syntax file (8.27 KB, text/plain)
2010-01-31 20:15 UTC, nddrylliog
Details
10-line ooc example (259 bytes, text/plain)
2010-01-31 23:28 UTC, nddrylliog
Details

Description nddrylliog 2010-01-31 16:05:32 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!
Comment 1 Ignacio Casal Quinteiro (nacho) 2010-01-31 16:12:42 UTC
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.
Comment 2 nddrylliog 2010-01-31 16:19:35 UTC
Created attachment 152675 [details]
Fixed ooc language file with LGPL license and Copyright

Added LGPL license & copyright
Comment 3 nddrylliog 2010-01-31 16:20:48 UTC
(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 =)
Comment 4 Ignacio Casal Quinteiro (nacho) 2010-01-31 19:21:59 UTC
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?
Comment 5 nddrylliog 2010-01-31 20:15:19 UTC
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
Comment 6 nddrylliog 2010-01-31 20:56:11 UTC
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)
Comment 7 jessevdk@gmail.com 2010-01-31 21:22:17 UTC
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.
Comment 8 nddrylliog 2010-01-31 21:37:23 UTC
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!
Comment 9 Ignacio Casal Quinteiro (nacho) 2010-01-31 22:36:33 UTC
mmm, I think you forgot to attach the example?
Comment 10 nddrylliog 2010-01-31 23:28:19 UTC
Created attachment 152699 [details]
10-line ooc example

Oh, huh, whoops =)
Example attached.
Comment 11 Ignacio Casal Quinteiro (nacho) 2010-02-01 10:39:48 UTC
(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
Comment 12 Ignacio Casal Quinteiro (nacho) 2010-02-01 10:47:05 UTC
Thanks a lot for the lang file. I've just pushed it into master, so you will have it for the next major release.
Comment 13 nddrylliog 2010-02-01 12:51:11 UTC
(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 =)
Comment 14 Ignacio Casal Quinteiro (nacho) 2010-02-01 12:53:19 UTC
(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 =)