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

(Member) function attributes should be placed under function_declaration #38

Closed
nordlow opened this issue Jul 30, 2024 · 3 comments
Closed

Comments

@nordlow
Copy link
Contributor

nordlow commented Jul 30, 2024

Currently property in

void foo() pure @property;

is put in

(at_attribute (identifier))

when it should be

(function_declaration (member_function_attribute (at_attribute (identifier))))

to conform with pure being put in

(function_declaration (member_function_attribute (pure)))

.

@nordlow nordlow changed the title Function attributes should be placed under function_declartion (Member) function attributes should be placed under function_declaration Jul 30, 2024
@gdamore
Copy link
Owner

gdamore commented Sep 16, 2024

I'm not sure the grammar is completely clear here. I'll have a look -- but its possible that the grammar is ambiguous in this case (there are other cases where you need semantic information that isn't available in the syntax tree. This might be one of them.)

@gdamore
Copy link
Owner

gdamore commented Sep 17, 2024

I tested this, and it seems right already:

(source_file
  (function_declaration
    (type
      (void))
    (identifier)
    (parameters)
    (member_function_attribute
      (pure))
    (member_function_attribute
      (at_attribute
        (identifier)))
    (function_body)))

gdamore added a commit that referenced this issue Sep 17, 2024
@gdamore
Copy link
Owner

gdamore commented Sep 17, 2024

I've added a test case for the above. I'm closing this because I don't see a bug right now.

@gdamore gdamore closed this as completed Sep 17, 2024
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

No branches or pull requests

2 participants