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 the upstream TCL parser #3157
Conversation
The TCL parser is split into three parts: tcl - for parsing pure tcl code tcloo - for parsing tcloo OO extension of tcl itcl - for parsing itcl OO extension of tcl TCLOO and ITCL parsers run the TCL parser as a subparser but it isn't possible to combine all three parsers at the same time. Since TCLOO is the "modern" (but 10 years old) OO extension, it seems to be a better choice for Geany (if needed, a new filetype could be introduced for ITCL). Since it's run as a subparser, we need to introduce also a subparser tag type mapping for TCL (types are mapped to the same values here because they don't conflict with the TCLOO types). Also, the new parser reports full scope information so take care of that. In addition, scope by the TCL parser is prefixed by :: which we need to strip because the TM doesn't expect scope in this format. Update the unit test based on several uctags unit tests to cover the tags we generate with this parser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't dive into the parser, rest looks good to me.
|
||
public method method1 | ||
protected method method2 | ||
private method method3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it matters but the new tests don't include public/private methods, TclOO supports these according to https://wiki.tcl-lang.org/page/TclOO+Tutorial, but I don't know if it ctags handles it at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I understand it from the link you provided, public methods start with lowercase, private methods start with uppercase. The generated tags don't seem to report these (it wasn't the case before either and we don't use this information in Geany for anything right now).
Thanks for having a look at this. |
Tests pass, symbols show, LGTM. |
The TCL parser is split into three parts:
tcl - for parsing pure tcl code
tcloo - for parsing tcloo OO extension of tcl
itcl - for parsing itcl OO extension of tcl
TCLOO and ITCL parsers run the TCL parser as a subparser but it isn't
possible to combine all three parsers at the same time. Since TCLOO
is the "modern" (but 10 years old) OO extension, it seems to be a better
choice for Geany (if needed, a new filetype could be introduced for
ITCL).
Since it's run as a subparser, we need to introduce also a subparser
tag type mapping for TCL (types are mapped to the same values here
because they don't conflict with the TCLOO types).
Also, the new parser reports full scope information so take care of that.
In addition, scope by the TCL parser is prefixed by :: which we need
to strip because the TM doesn't expect scope in this format.
Update the unit test based on several uctags unit tests to cover the
tags we generate with this parser.