GNOME Bugzilla – Bug 618552
Syntax definition file for BennuGD
Last modified: 2010-06-22 03:20:41 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.
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
Hi Ignacio, Thanks for our guidelines. I'll fix the issues you point at and will submit the fixed definition file ASAP. Joseba
Created attachment 161281 [details] BennuGD language definition for gtksourceview This new version should make the definition file much more conformant with the gtksourceview style.
<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.
(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.
Created attachment 161291 [details] BennuGD language definition for gtksourceview-2
Another thing, we would need a test file, not more than 10 lines to include in our highlighting tests.
more things :) you are missing: class-disabled="no-spell-check" in the string definitions
Created attachment 161808 [details] BennuGD language definition test file Very simple bouncing box example.
Created attachment 161809 [details] BennuGD language definition for gtksourceview-2 This language definition file has some problems with detecting all the symbols defined after "=".
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.
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.
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.
Created attachment 164184 [details] BennuGD language definition for gtksourceview-2
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.
Thanks a lot, again :)