diff --git a/rust-semantics/expression/casts.md b/rust-semantics/expression/casts.md index ebbd293..5ffd642 100644 --- a/rust-semantics/expression/casts.md +++ b/rust-semantics/expression/casts.md @@ -36,6 +36,8 @@ module RUST-CASTS rule implicitCast(u128(Value), i64) => i64(Int2MInt(MInt2Unsigned(Value))) rule implicitCast(u128(Value), u64) => u64(Int2MInt(MInt2Unsigned(Value))) + rule implicitCast(V:Bool, bool) => V + // Rewrites rule V:Value ~> implicitCastTo(T:Type) => implicitCast(V, T) diff --git a/rust-semantics/preprocessing/constants.md b/rust-semantics/preprocessing/constants.md index 788e33d..9d3edf5 100644 --- a/rust-semantics/preprocessing/constants.md +++ b/rust-semantics/preprocessing/constants.md @@ -10,11 +10,11 @@ module RUST-CONSTANTS rule (const Name:Identifier : T:Type = V:Value;):ConstantItem:KItem - => setConstant(Name, implicitCast(V, T)) [priority(100)] - - rule - (const Name:Identifier : _:Type = V:Bool;):ConstantItem:KItem - => setConstant(Name, V) [priority(50)] + => setConstant(Name, implicitCast(V, T)) + + // rule + // (const Name:Identifier : _:Type = V:Bool;):ConstantItem:KItem + // => setConstant(Name, V) [priority(50)] rule diff --git a/rust-semantics/representation.md b/rust-semantics/representation.md index 5f6f4e9..8dedb5c 100644 --- a/rust-semantics/representation.md +++ b/rust-semantics/representation.md @@ -59,6 +59,8 @@ module RUST-REPRESENTATION | "u32" [token] | "i64" [token] | "u64" [token] + | "bool" [token] + syntax MaybeIdentifier ::= ".Identifier" | Identifier endmodule