Home Download Buy Blog Forum Support

SystemVerilog language plugin bug (function names after ws)

SystemVerilog language plugin bug (function names after ws)

Postby sv_user on Sun Feb 23, 2014 10:19 pm

The following SystemVerilog code demonstrates valid use of cosmetic whitespace in a function definition:

function int
this_function_is_not_recognised();

// Function content...

endfunction

...however, the Sublime Text (+SystemVerilog plugin) does not consider this function name when using Ctrl+R - in this case, the function is incorrectly picked up as "int".
sv_user
 
Posts: 4
Joined: Sun Feb 23, 2014 10:12 pm

Re: SystemVerilog language plugin bug (function names after ws)

Postby FichteFoll on Mon Feb 24, 2014 2:27 am

If you are using a plugin for highlighting SystemVerilog code, it's the plugin's fault and not Sublime's. Well, directly speaking at least.

I see that there is a problem with the syntax definition and I also see why this is prolematic to parse as a regular expression, which ST limits you on, but there is a way to match this kind of function splitting, even if not "perfectly".
FichteFoll
 
Posts: 375
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: SystemVerilog language plugin bug (function names after ws)

Postby sv_user on Thu Feb 27, 2014 12:40 am

SystemVerilog is not whitespace-sensitive - in general, I believe all tokens can be separated by arbitrary whitespace (i.e. any number of spaces, tabs or newlines).

I was hoping the plugin author would be able to make a quick fix for this issue (and potentially update the other regexs as well), however if I find some time I'll investigate the procedure, however I'm new to Sublime Text, so I'll need to get up to speed with the revision control system used, the local install/build/test procedure, etc first...

Unless, of course, someone else beats me to it.
sv_user
 
Posts: 4
Joined: Sun Feb 23, 2014 10:12 pm

Re: SystemVerilog language plugin bug (function names after ws)

Postby sv_user on Sun Mar 02, 2014 10:38 pm

I've taken a look at the language definition file and even from a cursory inspection I can see a number of bugs (also confirmed by real-world source code samples that fail to highlight or context-search correctly). I'm now in two minds whether it's worth trying to fix the original file or write a new one.

It also appears that many of the language definition tutorials found online are out of date (referring to JSON instead of YAML, etc).

If I find time, I'll fix it, but I was hoping for something that worked out the box and not having to jump through hoops.
sv_user
 
Posts: 4
Joined: Sun Feb 23, 2014 10:12 pm

Re: SystemVerilog language plugin bug (function names after ws)

Postby FichteFoll on Mon Mar 03, 2014 2:11 am

Yes, the updated YAML syntax docs have not been merged to the main branch but to the ST2 branch. I have no idea why this was even considered and I aim to merge these more or less myself, if I have to, but I don't have time for that currently. You can find the YAML docs here.
FichteFoll
 
Posts: 375
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: SystemVerilog language plugin bug (function names after ws)

Postby Clams on Thu Mar 13, 2014 12:09 pm

I'm maintaining the verilog syntax and I'm fully aware that there is lot of things that could be improved: if you have modification please update the existing one and do some pull request so that everyone benefits from your change :)
Clams
 
Posts: 46
Joined: Fri Dec 30, 2011 7:44 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 18 guests