Warning:  a problem with regexes (regexen? regexii? what _is_ the plural ;-) 
and I think also your sscanf approach is lack of context, so things that look 
like functions inside strings and comments might be found.  Perhaps the sscanf 
method can find strings and comments first and not look for other stuff inside 
them?

Don't know how fast sscanf is, its possible it won't be any faster than regexes 
since its still scanning the input more than once.  Thats what is slow for 
regex parsers, the fact that multiple regexes are applied to the same input, 
not the fact that a well optimised regex library like PCRE is slow.  Repeat 
scans is one thing well written character by character parsers try not to do.

>  I'd avoid parsing all variables as universal-ctags does;

Thats the problem with assignment is declaration (see also Python and Julia for 
egs).  It takes a parser well above the pay grade of these ones to decide which 
assignments are actually declarations, and which are "just" assignments.  The 
writers of the Python parser took the "every assignment is a declaration" 
approach and the Julia parser writers took the approach "no assignment is a 
declaration".  So Python is a precedent for having all the names available, and 
I havn't seen too many complaints about it.  

Having them available also makes autocomplete more comprehensive and if they 
are removed the parser won't get back upstream probably since it would not be 
as "good" as the upstream one and you don't know if other users (emacs, vim, 
...) of Matlab ctags can make use of them.

> Honestly I think I'd entirely ditch parsing structs; 

Don't know matlab enough to comment, but if no Matlabbers object I guess its ok 
if upstream doesn't do it.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3358#issuecomment-1369317277
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3358/[email protected]>

Reply via email to