b4n requested changes on this pull request.
OK, here's my latest with the help of GCC. See also https://github.com/techee/geany/pull/1 which contains some small stuff that I think are relevant, but please review them, don't take them as gospel.
Apart from that, I think the next thing is merging an see how it goes, as as far as I can tell it works very well.
pushNarrowedInputStream (language,
startLine, startCharOffset, endLine, endCharOffset, sourceLineOffset); #ifndef CTAGS_LIB tagFileResized = createTagsWithFallback1 (language); +#else + /* Simple parsing without rescans - not used by any sub-parsers anyway */
I don't really care right now because as you pointed out there's no use case yet, but you mentioning in the commit message that "the C and Fortran parsers" being the only parsers using retry mode and that they do not support sub-parsers makes the retry case irrelevant is not correct: nothing prevents a parser from calling the C or Fortran parsers as sub-parsers. IIUC, the upstream Flex or so parser actually does this.
But as said, don't worry too much about that right now; we can fix this stuff when we actually have use for it.
else if (c == SINGLE_QUOTE)
break; else if (c == NEWLINE) { - ungetcToInputFile (c); - break; - } - else if (count == 1 && strchr ("DHOB", toupper (c)) != NULL) - veraBase = c; - else if (veraBase != '\0' && ! isalnum (c)) - {
I can't find these lines being suppressed upstream, so I assume it's a local change. However, you should then remove the variable declaration for `veraBase` as well.
vString *const parent, int is_class_parent, const char *arglist)
{ tagEntryInfo tag; + int corkIndex; + int fqCorkIndex = CORK_NIL; + const struct corkInfo nilInfo = {CORK_NIL};
unused variables `fqCorkIndex` and `nilInfo`, any reason to have them?
vString *const parent, int is_class_parent, const char *arglist)
{ tagEntryInfo tag; + int corkIndex; + int fqCorkIndex = CORK_NIL; + const struct corkInfo nilInfo = {CORK_NIL};
I see they were upstream in the old Python parser, but they were used at the time.
if (vStringLength (name) > 0) { + tagEntryInfo *parent = getEntryOfNestingLevel (nl);
This variable is unused, but upstream (*rst.c*) uses it to mess with the scope (which seems stupid, but well). Unused variables have that issue that people have a tendency to remove them… which generally seems legitimate. BTW, if we remove this, then `nl` gets unused, but we still gotta call `getNestingLevel()` because it does the `nestingLevelsPop()` stuff needed. What do you think?
if (vStringLength (name) > 0) { + tagEntryInfo *parent = getEntryOfNestingLevel (nl);
same here than in *rest.c*, `parent` is unused, same question applies.