-
Notifications
You must be signed in to change notification settings - Fork 444
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
Allow annotations on functions #4452
Conversation
Good addition. Can you add a simple test program using this feature, too? |
Do you want to create an issue and/or PR for the language spec, too? If you would prefer somone else do that, I can do it. |
The spec is a bit unclear, but seems to allow annotations on any 'element' in a program, but it is not clear what is and is not an element. Besides this case, p4c currently does not allow annotations on |
Agreed that the spec English prose can be a bit unclear on this point. The part that would be worth updating in the spec is the grammar.mdk file that is currently almost the same as the Bison grammar used by p4c. This PR updates the grammar used by p4c, so making corresponding changes in the grammar.mdk file of the spec would be good. |
2869141
to
806b7c8
Compare
I can add a testcase defining a trivial function with a random annotation, but that really only tests that the perser accepts it (which is pretty trivial -- not sure if it is worth the extra 1 second of CI time) |
806b7c8
to
fb48579
Compare
fb48579
to
2b206bd
Compare
2b206bd
to
0fcd514
Compare
I added a spec (grammar) change to match #1274 |
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.
LGTM, although I am not the best person to review the C++ parts of the changes, which is most of this :-)
Probably an oversight that this wasn't allowed before. Use case is to specify which hardware resource(s) should be used to implement a specific function