Skip to content

Commit

Permalink
Refactor crate parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
virgil-serbanuta committed Oct 4, 2024
1 parent 8a52f7d commit d194889
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 3 additions & 1 deletion rust-semantics/preprocessing/syntax.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
```k
module RUST-PREPROCESSING-SYNTAX
imports RUST-CRATE-LIST-SYNTAX
imports RUST-SHARED-SYNTAX
syntax Initializer ::= crateParser(crate: Crate)
syntax Initializer ::= cratesParser(crates: WrappedCrateList)
| crateParser(crate: Crate)
endmodule
module RUST-PREPROCESSING-PRIVATE-SYNTAX
Expand Down
13 changes: 13 additions & 0 deletions rust-semantics/rust-common-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ module RUST-COMMON-SYNTAX
syntax Identifier ::= r"[A-Za-z_][A-Za-z0-9\\_]*" [token]
endmodule
module RUST-CRATES-SYNTAX
imports RUST-COMMON-SYNTAX
imports RUST-CRATE-LIST-SYNTAX
endmodule
module RUST-CRATE-LIST-SYNTAX
syntax TypePath
syntax Crate
syntax WrappedCrate ::= "<(<" absolutePath: TypePath "<|>" crate: Crate ">)>"
syntax WrappedCrateList ::= NeList{WrappedCrate, ""}
endmodule
module RUST-SHARED-SYNTAX
imports STRING-SYNTAX
imports BOOL-SYNTAX
Expand Down
5 changes: 1 addition & 4 deletions ukm-semantics/targets/preprocessing/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ module COMMON-K-CELL
configuration
<k>
crateParser($CRATE1:Crate)
~> crateParser($CRATE2:Crate)
~> crateParser($CRATE3:Crate)
~> crateParser($CRATE4:Crate)
cratesParser($PGM:WrappedCrateList)
~> ukmPreprocessCrates
~> ukmEncodePreprocessedCell
</k>
Expand Down
5 changes: 1 addition & 4 deletions ukm-semantics/targets/testing/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ module COMMON-K-CELL
configuration
<k>
crateParser($CRATE1:Crate)
~> crateParser($CRATE2:Crate)
~> crateParser($CRATE3:Crate)
~> crateParser($CRATE4:Crate)
cratesParser($PGM:WrappedCrateList)
~> $TEST:ExecutionTest
</k>
endmodule
Expand Down

0 comments on commit d194889

Please sign in to comment.