Skip to content
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

Use some parsers from uctags with better implementation #3035

Merged
merged 8 commits into from Mar 14, 2022

Conversation

techee
Copy link
Member

@techee techee commented Nov 30, 2021

Parsers for R and verilog from ctags are token-based instead of our line-based parsers and are definitely superior and all development should go towards these parsers.

The sh parser is not token based but the uctags version seems to handle more things.

Other 2 parsers which I think we should eventually adopt are VHDL and tex parsers (both are token-based) - they generate a slightly different set of tags and tag mappings should be adopted to those for the sidebar so I skipped them for now.

Finally, I tried also switching to uctags c.c for java, D and C# but our c.c seems to be actually better there.

@elextr
Copy link
Member

elextr commented Dec 20, 2021

but our c.c seems to be actually better there.

yeah, some contributors were improving them when there was no upstream. But they stopped before an upstream became available. Probably would be nice to share upstream.

@techee
Copy link
Member Author

techee commented Dec 20, 2021

yeah, some contributors were improving them when there was no upstream. But they stopped before an upstream became available. Probably would be nice to share upstream.

The "better" part is mostly the ability of Geany's c.c to give return type of functions and types of global variables which is missing in the upstream c.c. The problem is that this is done in a rather hacky way to just record the part that might be a type in the preprocessor, keeping it completely unparsed, cleaning it from possible comments inside, and then presenting it as a type. The upstream c.c. is using a different preprocessor (cpreprocessor.c like the cxx parser, not the old lcpp that Geany uses for c.c) and I'm not sure they would be interested in the solution Geany uses.

@elextr
Copy link
Member

elextr commented Dec 20, 2021

I'm not sure they would be interested in the solution Geany uses.

Ok, fair enough, its only nice to share if its any good.

@techee
Copy link
Member Author

techee commented Dec 20, 2021

Ok, fair enough, its only nice to share if its any good.

Once all the parsers are merged, I'm planning to create a new issue replacing #1162 where I would describe what is remaining in the sync and what the differences are in the parsers and possibly involve the maintainer of uctags in the discussion.

@techee
Copy link
Member Author

techee commented Dec 20, 2021

Once all the parsers are merged

To clarify, I meant the currently pending pull requests here.

@elextr
Copy link
Member

elextr commented Dec 20, 2021

I meant the currently pending pull requests here.

Does that include the ones with the Here be Dragons (tag-manager) 😄 label?

@techee
Copy link
Member Author

techee commented Dec 20, 2021

Does that include the ones with the Here be Dragons (tag-manager) 😄 label?

No, just those worry-free "ctags parser" 10KLOC+ PRs :-).

The uctags R parser is token-based and seems to be much more advanced than
our ad-hoc parser.
The parser is also only line-based but seems to handle many more
things than our sh parser.
The new parser is token-based and appears to be significantly improved.
The difference seems to be the scope information produced by the new
parsers.
@techee techee merged commit 4eb741e into geany:master Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants