-
Notifications
You must be signed in to change notification settings - Fork 26
Fix grammar ambiguity between attributes and interface GUIDs #385
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
Conversation
fourls
left a comment
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.
Looks good - missing a couple of changelog entries.
I've decided that I really hate what this does to the structure of the AST, so I've made changes to the ownership situation. This keeps all of the annoying I also ran across some bugs:
|
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.
Looks good! The restructure makes this a LOT better.
|
Happy to merge after a rebase to fix changelog conflicts. |
Specifically... - `PropertyNameDeclaration::attributeTypes` were always unknown. - `RoutineNameDeclaration::attributeTypes` were unknown for implementation-local routines.
This PR fixes a significant grammar ambiguity between attributes and interface GUIDs.
Consider the following:
At the moment, the grammar interprets
[Foo]as a GUID containing constant expressionFoo.It should actually be interpreted as a custom attribute on the
Bazprocedure.In the process of resolving this ambiguity, I discovered some awful details.
This applies
FooAttributetoBazand applies the GUID toTBar.Based on this, it's clear that the custom attribute and GUID syntax are really one and the same, and the ambiguity was a result of us pretending they were different nodes in the first place.
There's some gnarly technical details here about who should actually owns the attribute node in a case like this.
Here's how it shook out:
AttributeListNodeas the first child of anInterfaceTypeNodeis owned by that parent type node.InterfaceTypeNodemust look upward to find that attribute list inRoutineHeadingNode::getAttributeListandPropertyNode::getAttributeList.This would have been easier to handle with #261.