GNOME Bugzilla – Bug 735319
Syntax definition files for Apache Pig source files
Last modified: 2015-01-04 17:50:18 UTC
Apache Pig is a platform used for creating Map-Reduce programs on Hadoop. The language used for Pig is called "Pig Latin", and it would be nice for GTKSourceView editors to support highlighting for Pig Latin. Pig has been around for a while and lots of editors and ides support this. I've written two lang files for Pig; one for gtksourceview 2.0 (for gedit on windows) and one for 3.0. Should I attach two separate patches for the latest branch of these? In the meantime, I've placed the lang files on the "additional languages" wiki page here: https://wiki.gnome.org/Projects/GtkSourceView/LanguageDefinitions
Created attachment 284347 [details] [review] Language definition file for Apache Pig 0.11 Patch for master branch with language definition file for Apache Pig 0.11, for gtksourceview-3.0. Hopefully the patch is fine - it's my first.
Created attachment 284481 [details] [review] Patch for gtksourceview 2.0 (for gedit on windows) I'm guessing that a language definition file for gtksourceview 2.0 should be off the gnome-2-30 branch, so that's what I made. It's like the other pig language definition file, but some things were missing from the older def.lang, so I put a copy into this file. Again, hoping that this is fine. I checked that it works on gedit on windows.
Created attachment 284862 [details] [review] Patch with language file and test case for Apache Pig 0.11 Language definition and test files for Apache Pig 0.11 Patch for master branch with language definition file for Apache Pig 0.11, for gtksourceview-3.0. Also contains file.pig, a sample pig file for tests.
Created attachment 286889 [details] [review] Patch with language file and test case for Apache Pig 0.12 Language definition and test file for Apache Pig 0.12 Patch for master branch with language definition file for Apache Pig 0.12, for gtksourceview-3.0. Also contains file.pig, a sample pig file for tests. GtkSourceView people - please respond in some way to this patch. If it is fine, accept it. If not, tell me how I can improve it. If you don't think Pig is important enough to warrant inclusion, please tell me that, too. Just respond in some way to my attempt to improve gedit/gtksourceview.
Review of attachment 286889 [details] [review]: Please provide a 2 spaces indented file before we continue with the review.
Review of attachment 286889 [details] [review]: First of all thanks for the file and sorry for the lack of feedback, we were frozen for the 3.14.0 release and we were focused on bugfixes only. A couple more comments at a quick glance: In the patch make sure to add your file to Makefile.am and to po/POTFILES.in ::: data/language-specs/pig.lang @@ +57,3 @@ + </context> + + <context id="boolean-literal" style-ref="def:boolean"> usually we never ref a default style, we ref a style defined at the top that in turns maps to the def style. This allows a user to write a scheme that uses pink for pig booleans, but yellow for booleans in all other languages :)
Created attachment 286941 [details] [review] Syntax highlighting and test file for Apache Pig 0.12 Great - thanks for the comments, they're appreciated! I converted it to two-space indentation, and added pig.lang to makefile.am and POTFILES.in. I also changed the references to def styles to a style defined in the top. However, I left the direct references to contexts defined in def.lang at the bottom- I was basically imitating what I saw in java.lang, and I didn't want duplicate definitions of contexts in my lang file. Is that OK? One more thing (I'm being greedy) - I also made a version of pig.lang for gtksourceview 2.0 (for gedit on windows) without the references to def.lang that didn't seem to exist. Should I prepare a patch for a different branch for that? If so, which branch?
(In reply to comment #7) > > I also changed the references to def styles to a style defined in the top. > > However, I left the direct references to contexts defined in def.lang at the > bottom- I was basically imitating what I saw in java.lang, and I didn't want > duplicate definitions of contexts in my lang file. Is that OK? > Yes, that's ok. > One more thing (I'm being greedy) - I also made a version of pig.lang for > gtksourceview 2.0 (for gedit on windows) without the references to def.lang > that didn't seem to exist. Should I prepare a patch for a different branch for > that? If so, which branch? The references to def.lang were already there in 2.0 I think... maybe some specific one was not. In any case we do not plan further 2.0 releases, so for now I'd suggest to keep the file on the wiki or somewhere else for people who want to manually add it. For what is worth we are almost there for a version of gedit 3 on windows
> In any case we do not plan further 2.0 releases, so for now I'd suggest to keep > the file on the wiki or somewhere else for people who want to manually add it. Ok. There's a reference to this from the github I opened for pig-on-gedit, with instructions for this case. Is there anything else I need to/can do for this issue?
(In reply to comment #9) > Is there anything else I need to/can do for this issue? Not for now. We'll have a closer look at the file and commit it as soon as we branch for development. (and if we do not get to it, feel free to prod us! we forget things sometimes :)
Hi guys- It looks like the branch is open - can you take a look at it?
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.
Review of attachment 286941 [details] [review]: pushed to master
Thanks!
I think you've reopened the bug by mistake, or is there a good reason?
let's re-close