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 628246 - Language description file submission: SystemVerilog
Language description file submission: SystemVerilog
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-29 13:01 UTC by annex666
Modified: 2010-10-06 22:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
SystemVerilog language definition file (9.06 KB, text/xml)
2010-08-29 13:01 UTC, annex666
Details
Verilog language definition file (updated from Paolo's original). (14.95 KB, text/xml)
2010-08-29 13:02 UTC, annex666
Details
SystemVerilog language definition file (updated) (8.67 KB, text/plain)
2010-08-29 16:22 UTC, annex666
Details
Verilog language definition file (updated) (15.16 KB, text/plain)
2010-08-29 16:23 UTC, annex666
Details
Trivial test file for SystemVerilog (1.10 KB, text/plain)
2010-08-29 16:26 UTC, annex666
Details
Verilog language definition file (gtksourceview 1.0 format) (4.04 KB, text/plain)
2010-08-31 19:18 UTC, annex666
Details
SystemVerilog language definition file (gtksourceview 1.0 format) (5.08 KB, text/plain)
2010-08-31 19:19 UTC, annex666
Details
Verilog language definition file (updated) (15.16 KB, text/plain)
2010-10-06 22:16 UTC, annex666
Details
SystemVerilog language definition file (updated) (8.73 KB, text/plain)
2010-10-06 22:19 UTC, annex666
Details

Description annex666 2010-08-29 13:01:29 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.
Comment 1 annex666 2010-08-29 13:02:41 UTC
Created attachment 168999 [details]
Verilog language definition file (updated from Paolo's original).
Comment 2 annex666 2010-08-29 13:04:07 UTC
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 3 annex666 2010-08-29 13:05:29 UTC
Comment on attachment 168998 [details]
SystemVerilog language definition file

Changed type to XML
Comment 4 annex666 2010-08-29 13:06:07 UTC
Comment on attachment 168999 [details]
Verilog language definition file (updated from Paolo's original).

Update type to XML
Comment 5 annex666 2010-08-29 13:08:10 UTC
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).
Comment 6 annex666 2010-08-29 13:19:23 UTC
(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.
Comment 7 Paolo Borelli 2010-08-29 14:34:48 UTC
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.
Comment 8 annex666 2010-08-29 16:21:08 UTC
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.
Comment 9 annex666 2010-08-29 16:22:46 UTC
Created attachment 169004 [details]
SystemVerilog language definition file (updated)
Comment 10 annex666 2010-08-29 16:23:37 UTC
Created attachment 169005 [details]
Verilog language definition file (updated)
Comment 11 annex666 2010-08-29 16:26:09 UTC
Created attachment 169006 [details]
Trivial test file for SystemVerilog
Comment 12 Ignacio Casal Quinteiro (nacho) 2010-08-29 18:44:51 UTC
Pushed the verilog update. I haven't had a look at the other files yet.
Comment 13 annex666 2010-08-30 00:59:09 UTC
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?
Comment 14 annex666 2010-08-30 01:15:41 UTC
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?
Comment 15 Paolo Borelli 2010-08-30 06:45:04 UTC
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)
Comment 16 annex666 2010-08-30 10:38:32 UTC
> 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.
Comment 17 annex666 2010-08-30 13:20:10 UTC
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.
Comment 18 Paolo Borelli 2010-08-31 10:07:47 UTC
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.
Comment 19 annex666 2010-08-31 19:18:01 UTC
Created attachment 169189 [details]
Verilog language definition file (gtksourceview 1.0 format)
Comment 20 annex666 2010-08-31 19:19:06 UTC
Created attachment 169190 [details]
SystemVerilog language definition file (gtksourceview 1.0 format)
Comment 21 Ignacio Casal Quinteiro (nacho) 2010-09-04 10:30:09 UTC
I've just pushed your lang file with a minor fix in the globs. Thanks a lot.
Comment 22 annex666 2010-09-04 10:34:53 UTC
What was the update to the globs (out of interest)?
Comment 23 Ignacio Casal Quinteiro (nacho) 2010-09-04 10:40:27 UTC
you have to use ; instead of , to separate the globs.
Comment 24 annex666 2010-09-04 10:43:27 UTC
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 :-)
Comment 25 annex666 2010-09-04 12:28:52 UTC
MIME type request opened: https://bugs.freedesktop.org/show_bug.cgi?id=30012
Comment 26 annex666 2010-10-06 22:14:54 UTC
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...
Comment 27 annex666 2010-10-06 22:16:58 UTC
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".
Comment 28 annex666 2010-10-06 22:19:09 UTC
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).