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 735319 - Syntax definition files for Apache Pig source files
Syntax definition files for Apache Pig source files
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: 2014-08-24 11:33 UTC by Eyal Allweil
Modified: 2015-01-04 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Language definition file for Apache Pig 0.11 (8.47 KB, patch)
2014-08-24 15:31 UTC, Eyal Allweil
none Details | Review
Patch for gtksourceview 2.0 (for gedit on windows) (8.97 KB, patch)
2014-08-26 08:55 UTC, Eyal Allweil
none Details | Review
Patch with language file and test case for Apache Pig 0.11 (8.82 KB, patch)
2014-08-29 21:50 UTC, Eyal Allweil
none Details | Review
Patch with language file and test case for Apache Pig 0.12 (9.61 KB, patch)
2014-09-23 15:47 UTC, Eyal Allweil
needs-work Details | Review
Syntax highlighting and test file for Apache Pig 0.12 (11.30 KB, patch)
2014-09-23 21:59 UTC, Eyal Allweil
committed Details | Review

Description Eyal Allweil 2014-08-24 11:33:57 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
Comment 1 Eyal Allweil 2014-08-24 15:31:32 UTC
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.
Comment 2 Eyal Allweil 2014-08-26 08:55:47 UTC
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.
Comment 3 Eyal Allweil 2014-08-29 21:50:14 UTC
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.
Comment 4 Eyal Allweil 2014-09-23 15:47:38 UTC
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.
Comment 5 Ignacio Casal Quinteiro (nacho) 2014-09-23 15:49:24 UTC
Review of attachment 286889 [details] [review]:

Please provide a 2 spaces indented file before we continue with the review.
Comment 6 Paolo Borelli 2014-09-23 17:08:57 UTC
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 :)
Comment 7 Eyal Allweil 2014-09-23 21:59:52 UTC
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?
Comment 8 Paolo Borelli 2014-09-24 06:40:24 UTC
(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
Comment 9 Eyal Allweil 2014-09-27 09:28:13 UTC
> 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?
Comment 10 Paolo Borelli 2014-09-27 10:52:40 UTC
(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 :)
Comment 11 Eyal Allweil 2014-10-27 07:23:36 UTC
Hi guys-

It looks like the branch is open - can you take a look at it?
Comment 12 Paolo Borelli 2014-10-27 13:30:02 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 13 Paolo Borelli 2014-10-27 13:30:29 UTC
Review of attachment 286941 [details] [review]:

pushed to master
Comment 14 Eyal Allweil 2014-10-27 16:06:51 UTC
Thanks!
Comment 15 Sébastien Wilmet 2014-10-27 16:13:01 UTC
I think you've reopened the bug by mistake, or is there a good reason?
Comment 16 Paolo Borelli 2015-01-04 17:50:18 UTC
let's re-close