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

constructor gets confused by function pointers #26

Closed
jeff-hykin opened this issue Mar 16, 2019 · 1 comment
Closed

constructor gets confused by function pointers #26

jeff-hykin opened this issue Mar 16, 2019 · 1 comment
Assignees
Labels
🐛 Bug Something isn't working

Comments

@jeff-hykin
Copy link
Owner

jeff-hykin commented Mar 16, 2019

atom/language-c#129

struct foo {
    int (*bar)();
};

union baz {
    int (*quz)();
};

int (*bar) is tagged as a constructor

@jeff-hykin jeff-hykin added the 🐛 Bug Something isn't working label Mar 16, 2019
@jeff-hykin jeff-hykin self-assigned this Mar 16, 2019
@matter123
Copy link
Collaborator

The Explore-#71 branch contains a fix for this.
Screenshot from 2019-04-26 20-04-30

#
# Function pointers
#
    cpp_grammar[:function_pointer] = Range.new(
        start_pattern: qualified_type.maybe(@spaces).then(/\(/).maybe(@spaces).then(
                match: /\*/,
                tag_as: "variable.other.pointer.function",
            ).maybe(@spaces).maybe(
                match: identifier,
                tag_as: "variable.other.pointer.function"
            ).maybe(@spaces).zeroOrMoreOf(array_brackets).then(/\)/).maybe(@spaces).then(/\(/),
        end_pattern: /\)/.then(after_declaration),
        includes: [
            :function_parameters,
        ]
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants