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

C++: handle function-try-block #1747

Merged

Conversation

masatake
Copy link
Member

Close #1746.

The original bug report opened by @ChoppinBlockParty:

void foo() try {
}catch(...){
}

"foo" is not captured well.

This commit introduces code ignoring "try" token if the last token is
a pair of "(" and ")".

NOTE: This change doesn't handle well the catch block. For an
example, a local variable inside the catch block should have "foo" as
"scope". The current implementation cannot recognize it.

Signed-off-by: Masatake YAMATO yamato@redhat.com

Close universal-ctags#1746.

The original bug report opened by @ChoppinBlockParty:

    void foo() try {
    }catch(...){
    }

"foo" is not captured well.

This commit introduces code ignoring "try" token if the last token is
a pair of "(" and ")".

NOTE: This change doesn't handle well the catch block.  For an
example, a local variable inside the catch block should have "foo" as
"scope". The current implementation cannot recognize it.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 84.854% when pulling 98ba4ee on masatake:cxx-handling-function-try-block into 54afb0f on universal-ctags:master.

@pragmaware
Copy link
Contributor

Your trick looks good and is a quick solution.
I can work something out for the "catch" problem.
Let's merge this PR so I continue from here.

@pragmaware pragmaware merged commit 576c750 into universal-ctags:master Apr 30, 2018
@masatake
Copy link
Member Author

masatake commented May 1, 2018

@pragmaware, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants