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 634648 - Syntax highlighting for COBOL
Syntax highlighting for COBOL
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2010-11-12 00:01 UTC by Moo
Modified: 2011-01-11 23:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Cobol.lang file and 2 COBOL source code examples (7.34 KB, application/x-gzip)
2010-11-24 14:32 UTC, Fernando Brito
Details
(new) cobol.lang file (15.96 KB, text/plain)
2010-11-24 14:56 UTC, Fernando Brito
Details
cobol source file with some errors (1.13 KB, text/plain)
2010-11-24 14:57 UTC, Fernando Brito
Details
cobol source file that works (1.07 KB, text/plain)
2010-11-24 14:57 UTC, Fernando Brito
Details
cobol source file made by me (831 bytes, text/plain)
2010-11-24 15:31 UTC, Fernando Brito
Details
(new 2) cobol.lang file (15.31 KB, text/plain)
2010-11-24 15:53 UTC, Fernando Brito
Details

Description Moo 2010-11-12 00:01:55 UTC
gedit does not have syntax highlighting for COBOL.
Comment 1 Fernando Brito 2010-11-24 14:32:06 UTC
Created attachment 175167 [details]
Cobol.lang file and 2 COBOL source code examples
Comment 2 Fernando Brito 2010-11-24 14:33:49 UTC
Hello,

I currently working on that - Google Code In (http://www.google-melange.com/gci/task/show/google/gci2010/gnome/t129020358041)- and I think I am done. 

Can anyone think on any other "feature"?

Some screenshots: 
http://img528.imageshack.us/img528/7208/pic1t.png
http://img686.imageshack.us/img686/34/pic2oa.png

What do you guys think?
Comment 3 Ignacio Casal Quinteiro (nacho) 2010-11-24 14:38:28 UTC
hey, can you attach teh files separately, so it is easier to review.
Comment 4 Fernando Brito 2010-11-24 14:45:07 UTC
Ooops, sorry :)

And by the way, I forgot to check for "bad line comment" in my old (tar.gz) attachment.

Compare pic2 (http://img686.imageshack.us/img686/34/pic2oa.png) with this one: http://img13.imageshack.us/img13/1013/pic3gi.png

I am now going to attach the (new) files separately.
Comment 5 Fernando Brito 2010-11-24 14:56:27 UTC
Created attachment 175168 [details]
(new) cobol.lang file
Comment 6 Fernando Brito 2010-11-24 14:57:12 UTC
Created attachment 175169 [details]
cobol source file with some errors
Comment 7 Fernando Brito 2010-11-24 14:57:45 UTC
Created attachment 175170 [details]
cobol source file that works
Comment 8 Ignacio Casal Quinteiro (nacho) 2010-11-24 15:04:14 UTC
Looks good nice work.
Comment 9 Ignacio Casal Quinteiro (nacho) 2010-11-24 15:07:07 UTC
Are the programs lgpl? if not can you provide a small test lgpl?
Comment 10 Ignacio Casal Quinteiro (nacho) 2010-11-24 15:08:52 UTC
Another thing, does cobol support escaped chars in strings? if not just remove it. and this line is not needed:
<define-regex id="symbolchar">[-!+\\|=:&amp;&gt;&lt;]</define-regex>
Comment 11 Fernando Brito 2010-11-24 15:31:48 UTC
Created attachment 175171 [details]
cobol source file made by me

Oh, good point :o

I took the previous examples from here: http://www.csis.ul.ie/cobol/examples/default.htm#SimplePrograms

"These programs are the copyright property of Michael Coughlan. You have permission to use these programs for your own personal use but you may not reproduce them in any published work without written permission from the author."

Wikipedia has a Hello World (http://en.wikipedia.org/wiki/COBOL#Hello.2C_world), but I think it is too simple.

I did a birth year guesser (attached).

================================================
brito@brito-ubuntu /home/brito/gci/cbl: $ cobc -x bday.cbl 
brito@brito-ubuntu /home/brito/gci/cbl: $ ./bday 
==> How old are you?
18
==> Had you already had birthday this year (y or n)?
y
Let me guess... You were born in 1992
================================================


And COBOL can scape quotation marks putting another quotation mark before it (http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.tandem/2008-02/msg00055.html).

Ex: DISPLAY "Quotations marks: "" there"

I am testing with another special characters.
Comment 12 Fernando Brito 2010-11-24 15:53:20 UTC
Created attachment 175173 [details]
(new 2) cobol.lang file

Changelog:
- Took out unnecessary line that I forgot to remove when copied from prolog.lang (thanks Ignacio) 
- Took out regex to scape chars
- Added credits to regex on bad-comment-line
Comment 13 Ignacio Casal Quinteiro (nacho) 2010-11-24 17:11:46 UTC
I made minor cleanup and I pushed it. Thanks a lot for it.