Skip to content

Commit

Permalink
if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
dwightguth committed Aug 26, 2024
1 parent 00363a4 commit decce7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/solidity-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ Following is a list of supported statements.
| VariableDeclaration "=" Expression ";" [strict(2)]
| "(" VariableDeclaration "," ")" "=" Expression ";" [strict(2)]
syntax IfStatement ::= "if" "(" Expression ")" Statement
| "if" "(" Expression ")" Statement "else" Statement
syntax IfStatement ::= "if" "(" Expression ")" Statement [strict(1)]
| "if" "(" Expression ")" Statement "else" Statement [avoid, strict(1)]
syntax ForStatement ::= "for" "(" InitStatement ConditionStatement PostLoopStatement ")" Statement
syntax InitStatement ::= VariableDeclarationStatement | ExpressionStatement | ";"
Expand Down
5 changes: 5 additions & 0 deletions src/statement.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ module SOLIDITY-STATEMENT
<events>... .List => ListItem(event(X, ARGS)) </events>
requires isKResult(ARGS)
// if statement
rule if ( v(true, bool ) ) S => S
rule if ( v(false, bool ) ) _ => .K
rule if ( v(true, bool ) ) S else _ => S
rule if ( v(false, bool ) ) _ else S => S
endmodule

0 comments on commit decce7d

Please sign in to comment.