-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ctags breaks on template instantiations that bitshift in parameters #120
Comments
This is the expected tags output of this issue? |
Pretty much, yes. |
The following commit may fix it. |
Unfortunately - that commit will most likely fail in the case of:
because the code in the commit that you linked to only ignores the <> characters after an = or when inside of ()'s. So even with your commit - you should still do the one character lookahead to decide whether or not you've got a bit shift happening. Of course, then there's also having conditional expressions as template parameters which would likely trip up both of our fixes. |
Yup - just tried here with
and I get:
aVar does'n't come out - if I add the lookahead/skip in c.c (similar to what's in my pull request in arduino/ctags#7) then I get this output:
|
universal-ctags/ctags#807 for a fix on universal-ctags |
Fixed by merging arduino/ctags#7 |
FastLED makes pretty extensive use of templates to do a lot of this work. Some of what's done with templates involves creating bitmasks from template parameters as parameters to other templates. Unfortunately, when the ctags parser sees "1<<X" as a template parameter, it eats itself.
This code demonstrates the problem:
Because ctags stops parsing, the prototype for myctagstestfunc() is never created, and the dreaded
'myctagstestfun' was not declared in this scope
error (as seen in #68)The text was updated successfully, but these errors were encountered: