Skip to content

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

Merged
merged 1 commit into from
Dec 3, 2018
Merged

Yul grammar changes. #5524

merged 1 commit into from
Dec 3, 2018

Conversation

chriseth
Copy link
Contributor

  • 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 )* '}'
Copy link
Member

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?

Copy link
Member

@axic axic Nov 28, 2018

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 )+ '}'

Copy link
Contributor Author

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 )* '}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Object = 'object' StringLiteral '{' Code ( Object | Data )* '}'
Object = 'object' StringLiteral '{' (Code | Object | Data )+ '}'

Copy link
Member

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.

Copy link
Member

@axic axic Nov 28, 2018

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.

Copy link
Member

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 :)

Copy link
Collaborator

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 )* '}'
Copy link
Collaborator

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.

@chriseth
Copy link
Contributor Author

chriseth commented Dec 3, 2018

Merging for now, we can still change it later.

@chriseth chriseth merged commit 0d1dd30 into develop Dec 3, 2018
@chriseth chriseth deleted the yulGrammarChanges branch February 7, 2019 13:07
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

Successfully merging this pull request may close these issues.

4 participants