-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly implement expression/statement results (#94)
- Loading branch information
1 parent
0daa578
commit b303afe
Showing
6 changed files
with
36 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
```k | ||
module RUST-STATEMENT-EXPRESSION | ||
imports private RUST-REPRESENTATION | ||
imports private RUST-SHARED-SYNTAX | ||
syntax Instruction ::= "clearValue" | ||
rule E:Expression ; => (E ~> clearValue) | ||
rule (_:PtrValue ~> clearValue) => .K | ||
rule clearValue => .K | ||
endmodule | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
```k | ||
module RUST-STATEMENTS | ||
imports RUST-SHARED-SYNTAX | ||
imports private RUST-SHARED-SYNTAX | ||
imports private RUST-VALUE-SYNTAX | ||
rule Nes:NonEmptyStatements E:Expression => Nes ~> E | ||
rule S:Statement Ss:NonEmptyStatements => S ~> Ss | ||
rule .NonEmptyStatements => .K | ||
syntax K ::= statementsToK(NonEmptyStatements) [function, total] | ||
rule statementsToK(.NonEmptyStatements) => .K | ||
rule statementsToK(S:Statement Ss:NonEmptyStatements) | ||
=> S ~> statementsToK(Ss) | ||
rule Nes:NonEmptyStatements E:Expression => statementsToK(Nes) ~> E | ||
rule Ss:NonEmptyStatements => statementsToK(Ss) ~> ptrValue(null, tuple(.ValueList)) | ||
endmodule | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
new IfExpressions; | ||
call IfExpressions.test_if_no_return | ||
call IfExpressions.test_if_no_return; | ||
return_value; | ||
check_eq () |