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

fix issue 19062 - Accepted grammar for DIP 1009 introduces the InExpression which already exists #128

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 27 additions & 37 deletions DIPs/accepted/DIP1009.md
Expand Up @@ -3,8 +3,8 @@
| Field | Value |
|-------------------|-----------------------------------------------------------------|
| DIP: | 1009 |
| Review Count: | 3 |
| Author:         | Zach Tollen(reachzach@gmail.com)     |
| Review Count: | 3 |
| Author: | Zach Tollen(reachzach@gmail.com) |
| Implementation: | [Timon Gehr] |
| Status: | Accepted |

Expand Down Expand Up @@ -275,81 +275,71 @@ The grammar for `assert` arguments is redefined in terms of `ContractArguments`,
Existing statement-based `in`, `out` and `invariant` contracts are preserved (with the same semantics).
However, in contrast to before, multiple `in` and `out` contracts are now allowed on the same function declaration, even if they are statement-based.

Changed grammar rules:
Grammar changes:

```
- AssertExpression:
AssertExpression:
- assert ( AssignExpression ,[opt] )
- assert ( AssignExpression , AssignExpression ,[opt] )
+ assert ( ContractArguments )

- FunctionContracts:
FunctionContracts:
- InStatement OutStatement[opt]
- OutStatement InStatement[opt]
+ FunctionContract
+ FunctionContract FunctionContracts

- FunctionBody:
FunctionBody:
- BlockStatement
- FunctionContracts[opt] BodyStatement
- FunctionContracts
+ SpecifiedFunctionBody
+ MissingFunctionBody

- FunctionLiteralBody:
FunctionLiteralBody:
- BlockStatement
- FunctionContracts[opt] BodyStatement
+ SpecifiedFunctionBody

- Invariant:
Invariant:
- invariant ( ) BlockStatement
- invariant BlockStatement

+ invariant ( ) BlockStatement
+ invariant BlockStatement
+ invariant ( ContractArguments ) ;

+ ContractArguments:
+ AssignExpression ,[opt]
+ AssignExpression , AssignExpression ,[opt]

+ AssertExpression:
+ assert ( ContractArguments )

+ InExpression:
+ InContractExpression:
+ in ( ContractArguments )

+ OutExpression:
+ OutContractExpression:
+ out ( ; ContractArguments )
+ out ( Identifier ; ContractArguments )

+ InOutExpression:
+ InExpression
+ OutExpression
+ InOutContractExpression:
+ InContractExpression
+ OutContractExpression

+ InOutStatement:
+ InStatement
+ OutStatement

+ FunctionContract:
+ InOutExpression
+ InOutContractExpression
+ InOutStatement

+ FunctionContracts:
+ FunctionContract
+ FunctionContract FunctionContracts

+ SpecifiedFunctionBody:
+ do[OPT] BlockStatement
+ FunctionContracts[opt] InOutExpression do[OPT] BlockStatement
+ do[opt] BlockStatement
+ FunctionContracts[opt] InOutContractExpression do[opt] BlockStatement
+ FunctionContracts[opt] InOutStatement do BlockStatement

+ MissingFunctionBody:
+ ;
+ FunctionContracts[opt] InOutExpression ;
+ FunctionContracts[opt] InOutContractExpression ;
+ FunctionContracts[opt] InOutStatement

+ FunctionBody:
+ SpecifiedFunctionBody
+ MissingFunctionBody

+ FunctionLiteralBody:
+ SpecifiedFunctionBody

+ Invariant:
+ invariant ( ) BlockStatement
+ invariant BlockStatement
+ invariant ( ContractArguments ) ;
```

## Code Breakage
Expand Down