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

Make the Rust config more modular #61

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions rust-semantics/execution/calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

module RUST-CALLS
imports BOOL
imports RUST-STACK
imports RUST-HELPERS
imports RUST-REPRESENTATION
imports RUST-RUNNING-CONFIGURATION
imports private COMMON-K-CELL
imports private RUST-EXECUTION-CONFIGURATION
imports private RUST-HELPERS
imports private RUST-PREPROCESSING-CONFIGURATION
imports private RUST-REPRESENTATION
imports private RUST-STACK

// https://doc.rust-lang.org/stable/reference/expressions/method-call-expr.html

Expand Down
5 changes: 3 additions & 2 deletions rust-semantics/execution/stack.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
```k

module RUST-STACK
imports LIST
imports RUST-RUNNING-CONFIGURATION
imports private COMMON-K-CELL
imports private LIST
imports private RUST-EXECUTION-CONFIGURATION

syntax Instruction ::= "pushLocalState"
| "popLocalState"
Expand Down
3 changes: 2 additions & 1 deletion rust-semantics/preprocessing/constants.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
```k
module RUST-CONSTANTS
imports private COMMON-K-CELL
imports private RUST-CASTS
imports private RUST-PREPROCESSING-CONFIGURATION
imports private RUST-REPRESENTATION
imports private RUST-RUNNING-CONFIGURATION
imports private RUST-SHARED-SYNTAX

syntax KItem ::= setConstant(Identifier, ValueOrError)
Expand Down
2 changes: 1 addition & 1 deletion rust-semantics/preprocessing/crate.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
```k

module CRATE
imports private COMMON-K-CELL
imports private LIST
imports private MAP
imports private RUST-PREPROCESSING-PRIVATE-SYNTAX
imports private RUST-PREPROCESSING-SYNTAX
imports private RUST-REPRESENTATION
imports private RUST-RUNNING-CONFIGURATION

syntax Initializer ::= crateParser(crate: Crate, traitName: MaybeIdentifier, traitFunctions: Map)

Expand Down
3 changes: 2 additions & 1 deletion rust-semantics/preprocessing/initialization.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
```k

module INITIALIZATION
imports private RUST-RUNNING-CONFIGURATION
imports private COMMON-K-CELL
imports private RUST-PREPROCESSING-CONFIGURATION
imports private RUST-PREPROCESSING-PRIVATE-HELPERS
imports private RUST-PREPROCESSING-PRIVATE-SYNTAX

Expand Down
1 change: 0 additions & 1 deletion rust-semantics/rust-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module RUST-COMMON
imports RUST-HELPERS
imports RUST-PREPROCESSING
imports RUST-REPRESENTATION
imports RUST-RUNNING-CONFIGURATION
imports RUST-SHARED-SYNTAX

endmodule
13 changes: 10 additions & 3 deletions rust-semantics/targets/execution/configuration.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
```k

module RUST-RUNNING-CONFIGURATION
imports private RUST-PREPROCESSING-SYNTAX
module COMMON-K-CELL
imports private RUST-EXECUTION-TEST-PARSING-SYNTAX
imports private RUST-PREPROCESSING-SYNTAX

configuration
<k> crateParser($PGM:Crate) ~> $TEST:ExecutionTest </k>
endmodule

module RUST-RUNNING-CONFIGURATION
imports COMMON-K-CELL
imports RUST-CONFIGURATION
imports RUST-EXECUTION-TEST-CONFIGURATION

configuration
<rust-mx>
<k> crateParser($PGM:Crate) ~> $TEST:ExecutionTest </k>
<k/>
<rust/>
<rust-test/>
</rust-mx>
Expand Down
1 change: 1 addition & 0 deletions rust-semantics/targets/execution/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ endmodule
module RUST
imports RUST-COMMON
imports RUST-EXECUTION-TEST
imports RUST-RUNNING-CONFIGURATION
endmodule

```
18 changes: 14 additions & 4 deletions rust-semantics/targets/preprocessing/configuration.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
```k

module RUST-RUNNING-CONFIGURATION
module COMMON-K-CELL
imports private RUST-PREPROCESSING-SYNTAX
imports RUST-CONFIGURATION

configuration
<k> crateParser($PGM:Crate) </k>

endmodule

module RUST-RUNNING-CONFIGURATION
imports COMMON-K-CELL
imports RUST-PREPROCESSING-CONFIGURATION

configuration
<rust-mx>
<k> crateParser($PGM:Crate) </k>
<rust/>
<k/>
<rust>
<preprocessed/>
</rust>
</rust-mx>
endmodule

Expand Down
8 changes: 6 additions & 2 deletions rust-semantics/targets/preprocessing/rust.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
```k

requires "configuration.md"
requires "../../rust-common.md"
requires "../../preprocessing.md"
requires "../../representation.md"
requires "../../expression.md"
requires "../../rust-common-syntax.md"

module RUST-SYNTAX
imports RUST-COMMON-SYNTAX
endmodule

module RUST
imports RUST-COMMON
imports private RUST-EXPRESSION
imports private RUST-PREPROCESSING
imports private RUST-RUNNING-CONFIGURATION
endmodule

```
13 changes: 8 additions & 5 deletions rust-semantics/test/execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ module RUST-EXECUTION-TEST-PARSING-SYNTAX
endmodule

module RUST-EXECUTION-TEST
imports LIST
imports RUST-EXECUTION-TEST-PARSING-SYNTAX
imports RUST-HELPERS
imports RUST-REPRESENTATION
imports RUST-RUNNING-CONFIGURATION
imports private COMMON-K-CELL
imports private LIST
imports private RUST-EXECUTION-CONFIGURATION
imports private RUST-EXECUTION-TEST-PARSING-SYNTAX
imports private RUST-EXECUTION-TEST-CONFIGURATION
imports private RUST-HELPERS
imports private RUST-PREPROCESSING-CONFIGURATION
imports private RUST-REPRESENTATION

rule E:ExecutionItem ; Es:ExecutionTest => E ~> Es
rule .ExecutionTest => .K
Expand Down
Loading