GNOME Bugzilla – Bug 628246
Language description file submission: SystemVerilog
Last modified: 2010-10-06 22:19:09 UTC
Created attachment 168998 [details] SystemVerilog language definition file I've recently written a SystemVerilog language definition file for gtksourceview (attached); if this file meets your acceptance criteria, please upload this to your repository and add it to future releases of gtksourceview. In addition, this file depends on a (much updated) Verilog language definition file (also attached) - this file now includes: * String literals. * Integer constants (as opposed to base-n values only). * Real constants. * System tasks (separated into IEEE-mandatory and LRM-additional). * A number of minor corrections/additions to the base language definition. N.b.: I have previously been in contact with Paolo Borelli regarding this matter.
Created attachment 168999 [details] Verilog language definition file (updated from Paolo's original).
I have raised this "bug" against gtksourceviewmm as I could not find an entry for gtksourceview itself - please reassign if there is a more appropriate owner.
Comment on attachment 168998 [details] SystemVerilog language definition file Changed type to XML
Comment on attachment 168999 [details] Verilog language definition file (updated from Paolo's original). Update type to XML
I haven't set a mime-type for this file as I don't know what to set - this should probably be updated to something sensible (if anyone happens to know what type to set).
(In reply to comment #5) > I haven't set a mime-type for this file as I don't know what to set - this > should probably be updated to something sensible (if anyone happens to know > what type to set). By which I meant that I have not set a mime type for _SystemVerilog_ files.
Both files look mostly fine to me to commit, just some minor comments: System Verilog: - it is ok to not have a mime-type, it is not mandatory. If you want one you need to submit a patch to freedesktop.org shared-mime-info package - it seems to me that the wrapper context sv-proper is not needed, you can simply include the context in the main systemverilog:systemverrilog context - it would be great if you could add a small systemverilog test snippet to tests/testfiles.sh (and maybe also one for verilog since it is missing) Verilog additions: - can you add a couple of comments before ieee and lrm tasks pointing to an online resource that documents them? - you probably sorted keywords which moved "for" before "force": the ordering was intentional to avoid a bug which caused to just highlight "for" inside "force". However I think this is now fixed, we need to check that.
I've tested "for" and "force" and the previous bug you mention appears to have been fixed (n.b. this sort of bug would also show itself with "if" and "iff", but it's fine for those as well). I've removed the unnecessary extra level of context (I think what I have now is what you suggested - let me know if you want me to change it). I've also tweaked both files a bit (removing some overlap and tidying up keyword/types). The content of both files is based on official IEEE specs - IEEE-1364-2005 (Verilog 2005) and IEEE-1800-2009 (SystemVerilog 2009), so should be as up-to-date as possible. I can't upload or link to the actual specs as you require IEEE membership to download the specs yourself (I have access to these documents via the company I work for, but cannot redistribute specs to non-members). I've done a little bit of testing myself, however as I work for an IP company I cannot give you any of my "real" source code; I have a trivial example test file that I will also attach to this bug.
Created attachment 169004 [details] SystemVerilog language definition file (updated)
Created attachment 169005 [details] Verilog language definition file (updated)
Created attachment 169006 [details] Trivial test file for SystemVerilog
Pushed the verilog update. I haven't had a look at the other files yet.
Hmm, I developed these files on my home (Ubuntu) machine and just tried them on a work machine and had a few problems... Our IT department use CentOS to maintain binary compatibility with RHE5, but (unfortunately) that means gtksourceview-1.0 is used (not 2.0, which I have locally). I've changed the version="2.0" string to "1.0", but this naive attempt at "backporting" didn't work - I get errors trying to load these files. Is there a reference I can read that describes how to backport?
unfortunately at that time we didn't have any specific documentation about the old format. You can see the old lang files here http://git.gnome.org/browse/gtksourceview/tree/gtksourceview/language-specs?h=gnome-2-18 Note that the format is less expressive and does not allow inclusion etc. in gtksourceview 1.X files must be placed in /usr/share/gtksourceview-1/languange-specs and ~/.gnome2/gtksourceview-1/language-specs (if I recall correctly)
> in gtksourceview 1.X files must be placed in > /usr/share/gtksourceview-1/languange-specs and > ~/.gnome2/gtksourceview-1/language-specs Yep - that's what strace told me ;-) I'll have a look at those files and see if I can hack up some backported definitions. Thanks again for the help on this.
I've created the backported language definitions for personal use. Would it be worth me attaching them to this bug? I doubt anyone else would find them useful, but thought I'd ask just in case.
We will not update gtksourceview 1 anymore, but if you want to attach them here or on http://live.gnome.org/GtkSourceView/LanguageDefinitions in case someone needs them, feel free to do so. The systemverilog file looks fine to commit to me.
Created attachment 169189 [details] Verilog language definition file (gtksourceview 1.0 format)
Created attachment 169190 [details] SystemVerilog language definition file (gtksourceview 1.0 format)
I've just pushed your lang file with a minor fix in the globs. Thanks a lot.
What was the update to the globs (out of interest)?
you have to use ; instead of , to separate the globs.
Ah, my bad; thanks for that. I'm just about to file a freedesktop.org bug to get mime types for Verilog and SystemVerilog. ...then my work here will be done :-)
MIME type request opened: https://bugs.freedesktop.org/show_bug.cgi?id=30012
The MIME type definition has been accepted - as such I've added the MIME type to the language definition file. I've also noticed that there is a minor bug in the Verilog definition file - the MIME type is wrong (text/x-verilog-src instead of text/x-verilog). I'll upload new files shortly...
Created attachment 171861 [details] Verilog language definition file (updated) Updated Verilog language definition file - now uses correct MIME type "text/x-verilog" instead of "text/x-verilog-src".
Created attachment 171862 [details] SystemVerilog language definition file (updated) Updated SystemVerilog language definition file - now includes MIME types (text/x-svhdr and text/x-svsrc).