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 the upstream TCL parser #3157

Merged
merged 1 commit into from May 12, 2022
Merged

Use the upstream TCL parser #3157

merged 1 commit into from May 12, 2022

Conversation

techee
Copy link
Member

@techee techee commented Apr 12, 2022

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.

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.
Copy link
Member

@kugel- kugel- left a 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
Copy link
Member

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?

Copy link
Member Author

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).

@techee
Copy link
Member Author

techee commented May 3, 2022

I didn't dive into the parser, rest looks good to me.

Thanks for having a look at this.

@elextr
Copy link
Member

elextr commented May 11, 2022

Tests pass, symbols show, LGTM.

@techee techee merged commit 2fdd948 into geany:master May 12, 2022
@b4n b4n added this to the 1.39/2.0 milestone Apr 28, 2023
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

4 participants