-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Yul grammar changes. #5524
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
Yul grammar changes. #5524
Conversation
chriseth
commented
Nov 28, 2018
- also the top level object needs to be named
- code is not optional
- also the top level object needs to be named - code is not optional
@@ -559,8 +559,7 @@ regular strings in native encoding. For code, | |||
|
|||
Grammar:: | |||
|
|||
TopLevelObject = 'object' '{' Code? ( Object | Data )* '}' | |||
Object = 'object' StringLiteral '{' Code? ( Object | Data )* '}' | |||
Object = 'object' StringLiteral '{' Code ( Object | Data )* '}' |
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.
Why is code not optional?
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.
I think it should be 'object' StringLiteral '{' (Code | Object | Data )+ '}'
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.
I would not allow multiple code blocks - what happens to control flow at the end of the first code block? If you want to refer to code as data, you should wrap it inside a sub-object.
About objects without code: Do you see a use-case? We can allow it at some later point, if we want, but for now, I would require code - the code itself can be empty, though.
@@ -559,8 +559,7 @@ regular strings in native encoding. For code, | |||
|
|||
Grammar:: | |||
|
|||
TopLevelObject = 'object' '{' Code? ( Object | Data )* '}' | |||
Object = 'object' StringLiteral '{' Code? ( Object | Data )* '}' | |||
Object = 'object' StringLiteral '{' Code ( Object | Data )* '}' |
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.
Object = 'object' StringLiteral '{' Code ( Object | Data )* '}' | |
Object = 'object' StringLiteral '{' (Code | Object | Data )+ '}' |
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.
I think an object has exactly one Code
.
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.
But I don't think code is mandatory, should make it optional then.
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.
This PR is suggesting that it should be :)
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.
Having exactly one Code
(which could be empty) would also be inline with what the CLI test expects with #5341.
@@ -559,8 +559,7 @@ regular strings in native encoding. For code, | |||
|
|||
Grammar:: | |||
|
|||
TopLevelObject = 'object' '{' Code? ( Object | Data )* '}' | |||
Object = 'object' StringLiteral '{' Code? ( Object | Data )* '}' | |||
Object = 'object' StringLiteral '{' Code ( Object | Data )* '}' |
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.
Having exactly one Code
(which could be empty) would also be inline with what the CLI test expects with #5341.
Merging for now, we can still change it later. |