SystemVerilog icon indicating copy to clipboard operation
SystemVerilog copied to clipboard

Function regex issue

Open sxu55 opened this issue 2 years ago • 2 comments
trafficstars

It seems the regex to recognize sv function has some problem: if the left parenthesis and the function name are not on the same line, the function is not parsed correctly by the regex, as illustrated by the two screenshots below:

When parsed correctly: A072B8B3-9FF3-4D1E-8466-3F91E702BFF5

When parsed incorrectly: F4675CD4-E777-4816-A689-4E94900E68B7

sxu55 avatar Mar 27 '23 23:03 sxu55

The problem is that I do not have a good general fix for this: i cannot make the distinction between a function with no return type or a function with a return type and the name on the next line, that's why I'n using the open parenthensis to ensure it correspond to a function name ...

TheClams avatar Apr 09 '23 05:04 TheClams

Could you just add an optional newline to the regex so if the parentheses are on a new line it still catches the function name on the previous line?

DeeeeLAN avatar Apr 09 '23 20:04 DeeeeLAN