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 618552 - Syntax definition file for BennuGD
Syntax definition file for BennuGD
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-05-13 16:30 UTC by Joseba García Etxebarria
Modified: 2010-06-22 03:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
BennuGD language bindings (10.76 KB, text/plain)
2010-05-13 16:30 UTC, Joseba García Etxebarria
Details
BennuGD language definition for gtksourceview (11.40 KB, text/plain)
2010-05-17 21:30 UTC, Joseba García Etxebarria
Details
BennuGD language definition for gtksourceview-2 (11.05 KB, text/plain)
2010-05-17 23:01 UTC, Joseba García Etxebarria
Details
BennuGD language definition test file (494 bytes, text/plain)
2010-05-23 18:30 UTC, Joseba García Etxebarria
Details
BennuGD language definition for gtksourceview-2 (11.15 KB, text/plain)
2010-05-23 18:35 UTC, Joseba García Etxebarria
Details
BennuGD language definition for gtksourceview-2 (10.59 KB, text/plain)
2010-06-20 23:14 UTC, Joseba García Etxebarria
Details

Description Joseba García Etxebarria 2010-05-13 16:30:33 UTC
Created attachment 160977 [details]
BennuGD language bindings

BennuGD is an open source programming language aimed at game creation.
You can see its webpage at http://bennugd.org
The attached file adds syntax highlighting support for BennuGD in gtksourceview and I would like to request it be added to gtksourceview upstream.

Thanks in advance for your time.
Comment 1 Ignacio Casal Quinteiro (nacho) 2010-05-13 18:58:29 UTC
Hi, thanks for taking the time to work in that language, here are some things:
 * the license is missing, we only accept LGPL licenses
 * do not add one empty line in each word/context etc
 * use a 2 spaces indentation
 * we prefer lang files with this layout: http://git.gnome.org/browse/gtksourceview/tree/gtksourceview/language-specs/prolog.lang

all the context definitions and then the lang context at the end adding the needed context definition added before.

 * there is a comment at the end with several regexes, what's that for? if it isn't needed please remove it
 * please use meaninful names for keywords contexts, "keyword" and "keyword2" is not very specific
Comment 2 Joseba García Etxebarria 2010-05-13 19:01:41 UTC
Hi Ignacio,

Thanks for our guidelines. I'll fix the issues you point at and will submit the fixed definition file ASAP.

Joseba
Comment 3 Joseba García Etxebarria 2010-05-17 21:30:16 UTC
Created attachment 161281 [details]
BennuGD language definition for gtksourceview

This new version should make the definition file much more conformant with the gtksourceview style.
Comment 4 Ignacio Casal Quinteiro (nacho) 2010-05-17 21:36:14 UTC
<property name="mimetypes">text/x-bennugd-prg</property>
is that mime type detected when doing gvfs-info in a file? If not please remove it.

You sure the language is case insensitive?


    <context id="bennugd">
Please move that to the end, like in the prolog lang.
Also add the class for the spell checking

I think that fixing that the lang should be ready.
Comment 5 Joseba García Etxebarria 2010-05-17 22:58:26 UTC
(In reply to comment #4)
> <property name="mimetypes">text/x-bennugd-prg</property>
> is that mime type detected when doing gvfs-info in a file? If not please remove
> it.
> 
It's not what you get with the upstream packages, one can register the mimetype with packages from a PPA, but they're not broadly available. I've removed that line.
> 
> You sure the language is case insensitive?
> 
Yep.
> 
>     <context id="bennugd">
> Please move that to the end, like in the prolog lang.
> Also add the class for the spell checking

Done.
> 
> I think that fixing that the lang should be ready.

:) Thank you very much for your guidance, I believe the new attachment is correct now.
Comment 6 Joseba García Etxebarria 2010-05-17 23:01:18 UTC
Created attachment 161291 [details]
BennuGD language definition for gtksourceview-2
Comment 7 Ignacio Casal Quinteiro (nacho) 2010-05-18 20:55:12 UTC
Another thing, we would need a test file, not more than 10 lines to include in our highlighting tests.
Comment 8 Ignacio Casal Quinteiro (nacho) 2010-05-18 21:04:53 UTC
more things :)
you are missing:

class-disabled="no-spell-check"

in the string definitions
Comment 9 Joseba García Etxebarria 2010-05-23 18:30:10 UTC
Created attachment 161808 [details]
BennuGD language definition test file

Very simple bouncing box example.
Comment 10 Joseba García Etxebarria 2010-05-23 18:35:40 UTC
Created attachment 161809 [details]
BennuGD language definition for gtksourceview-2

This language definition file has some problems with detecting all the symbols defined after "=".
Comment 11 Joseba García Etxebarria 2010-05-23 18:36:39 UTC
Sorry for taking so much to reply, I'm having my semester exams right now.
I have attached the test source code. As you might see, the language definition file previously attached has some problems in the sense that it will highlight the "mod" in set_mode as if it were a keyword.
I have separated the text operators from their symbol equivalents in order to avoid that.
The file still has problems in the sense that it won't detect the symbols defined after "=".
I believe that's because the <prefix> & <suffix> tags I included are not well suited for this case. I directly copied them from the prolog.lang file, but they're probably wrong. Any ideas on how can I fix them?

Again, sorry for the delay and thanks for your help.
Comment 12 Ignacio Casal Quinteiro (nacho) 2010-06-08 22:33:55 UTC
Sorry for the late response:

 <context id="array-operators" style-ref="identifier">
      <match>(\[|\])</match>
    </context>

that looks too much, the [] are already highlighted with the bracket matching.

About the operator I'd say to just remove them for now if they don't work. Once it is working you can file a new bug and add a patch for it.
Apart from that the lang file looks good to be added upstream.
Comment 13 Joseba García Etxebarria 2010-06-20 23:13:02 UTC
Thank you very much for your help and sorry for the long delay in the response. As I said, I'm currently having my semester exams and cannot spend much time on this.

I'm attaching a modified version with the text operators & the bracket matching removed, as you suggest.

Again, thank you very much for your advise.
Comment 14 Joseba García Etxebarria 2010-06-20 23:14:51 UTC
Created attachment 164184 [details]
BennuGD language definition for gtksourceview-2
Comment 15 Ignacio Casal Quinteiro (nacho) 2010-06-21 09:02:11 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 16 Joseba García Etxebarria 2010-06-22 03:20:41 UTC
Thanks a lot, again :)