GNOME Bugzilla – Bug 636512
COBOL syntax hilighting for GtkSourceView-2.x
Last modified: 2014-02-15 12:53:20 UTC
Created attachment 175869 [details] COBOL lang file Hi, the file attached adds support for syntax hilighting for the COBOL programming lanuage. I wrote it some time ago and I'd like to contribute it. Short question: Are there any differences between gtksourceview-2.x and 3.x? I guess, but what kind of differences? Greetings!
This has been already added in master, http://git.gnome.org/browse/gtksourceview/commit/?id=157c6cd04df1352bf5ca9a3b6a36d29cbf4ea726 please check if you want the file and if something is missing feel free to provide a patch against it. In relation to lang files there is no difference between 2.x and 3.x.
First of all: Thanks for the response. But I don't get it right now: The file I provided adds support for COBOL (introduced 1960s) where the file you provided shows syntax hilighting for Go (the language Google introduced a while ago). Maybe I'm just blind ;-) Or shall the Go-file help me to assure quality?
ups, sorry wrong link: http://git.gnome.org/browse/gtksourceview/tree/data/language-specs/cobol.lang
Cobol lang file indeed does exist in master branch (gtksourceview-3.0), but it does not exist in gnome-2-30 branch (gtksourceview-2.0). Maybe it should be backported?
Marking this as needinfo. Let us know if you want to improve the current cobol lang file.
I hope everybody had a nice christmas and a good start. I am sorry that my answer took a little longer. I had only limited time before christmas ;-) Yeah, I want to improve the file. I will start in the next few days. But I would be glad if someone could tell me how to do it correctly. Shall I download it from the git repository and upload it here when I am done? Or is there a simpler method? Greetings :-)
Yep using git and attaching it here is the way to do it.
So, it took a while because I had some busy weeks. The biggest change are many many many new keywords. Furthermore I did use small-case letters so that I could use my old keywords from the previous file and the new one has a consistent feel (but I will undo it if you prefer the upper-case style ;-) ). I like the error style if you are writing in the first 6 columns ore behind the 80. column but compilers like OpenCOBOL have a flag '-free' that allows to write in these before or behind these columns. Does it make sense to remove it because of this point? Greetings :-)
Created attachment 179293 [details] COBOL lang file, II.
dunno, if cobol doesn't allow lowercase I think the keywords should be always uppercase. Also let's leave the error thingie for now, if somebody complains we can always remove it.
Oh oh oh, I read my last comment... this english is... seems that I was a little dizzy yesterday :-) > dunno, if cobol doesn't allow lowercase I think the keywords should be always uppercase. COBOL supports lowercase letters. You can write COBOL as you like but most (mainframe) developers use the uppercase style; it's like an unwritten law. > Also let's leave the error thingie for now, if somebody complains we can always remove it. It's ok for the moment but I'm not very happy with this solution! In my opinion it should be supported also it's not default in COBOL programming. So long :-)
(In reply to comment #11) > Oh oh oh, I read my last comment... this english is... seems that I was a > little dizzy yesterday :-) > > > dunno, if cobol doesn't allow lowercase I think the keywords should be always > uppercase. > > COBOL supports lowercase letters. You can write COBOL as you like but most > (mainframe) developers use the uppercase style; it's like an unwritten law. So then let's support both, I'd rather have it in uppercase but with the option of case-sensitive=false, see the pascal.lang to know how to do this. > > > Also let's leave the error thingie for now, if somebody complains we > can always remove it. > > It's ok for the moment but I'm not very happy with this solution! In my opinion > it should be supported also it's not default in COBOL programming. > > So long :-)
> So then let's support both, I'd rather have it in uppercase but with the option > of case-sensitive=false, see the pascal.lang to know how to do this. The case-sensitive=false option is already implemented in the file. And is it really necessary to write all keywords in uppercase, too? I only ask because that's a lot of keywords I'd have to change ;-)
Oh! well I guess we can leave it in lower case :)
So, is the latest patch ok? Haven't checked the diff though, I just want to know if it is the one to review or should I wait for an updated one?
Sorry it took some time; I had no internet last week :'( I have uploaded a new file which changes my mail adress. Otherwise there are no further changes and it's ready to review! :-)
Created attachment 181305 [details] COBOL lang file III. newest file
Created attachment 181306 [details] COBOL lang file, IV.
The file looks good, let's put it in once we can add new features again. Just one comment I'd say to change this: <default-regex-options case-sensitive="false"> </default-regex-options> to: <default-regex-options case-sensitive="false"/>
Commit pushed: https://git.gnome.org/browse/gtksourceview/commit/?id=b7c4133e97b360e31d4fad3e269d589b82c0e553 Thanks.