Skip to content

Commit

Permalink
Merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
virgil-serbanuta committed Nov 25, 2024
1 parent 212be93 commit 0830a70
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
28 changes: 14 additions & 14 deletions ulm-semantics/main/encoding/encoder.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ module ULM-ENCODING-HELPER
// Encoding of individual types
rule convertToKBytes(i8(V) , "int8") => Int2Bytes(32, MInt2Signed(V), BE:Endianness)
rule convertToKBytes(u8(V) , "uint8") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(i16(V), "int16") => Int2Bytes(32, MInt2Signed(V), BE:Endianness)
rule convertToKBytes(u16(V), "uint16") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(i32(V), "int32") => Int2Bytes(32, MInt2Signed(V), BE:Endianness)
rule convertToKBytes(u32(V), "uint32") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(i64(V), "int64") => Int2Bytes(32, MInt2Signed(V), BE:Endianness)
rule convertToKBytes(u64(V), "uint64") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(u128(V), "uint128") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(true, "bool") => Int2Bytes(32, 1, BE:Endianness)
rule convertToKBytes(i8(V) , "int8") => Int2Bytes(32, MInt2Signed(V), BE:Endianness)
rule convertToKBytes(u8(V) , "uint8") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(i16(V), "int16") => Int2Bytes(32, MInt2Signed(V), BE:Endianness)
rule convertToKBytes(u16(V), "uint16") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(i32(V), "int32") => Int2Bytes(32, MInt2Signed(V), BE:Endianness)
rule convertToKBytes(u32(V), "uint32") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(i64(V), "int64") => Int2Bytes(32, MInt2Signed(V), BE:Endianness)
rule convertToKBytes(u64(V), "uint64") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(u128(V), "uint128") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(true, "bool") => Int2Bytes(32, 1, BE:Endianness)
rule convertToKBytes(false, "bool") => Int2Bytes(32, 0, BE:Endianness)
rule convertToKBytes(u256(V), "uint256") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(u160(V), "uint160") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(u160(V), "address") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(u256(V), "uint256") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(u160(V), "uint160") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
rule convertToKBytes(u160(V), "address") => Int2Bytes(32, MInt2Unsigned(V), BE:Endianness)
endmodule
Expand Down Expand Up @@ -173,7 +173,7 @@ module ULM-CALLDATA-ENCODER
syntax PathInExpressionOrError ::= PathInExpression | SemanticsError
syntax PathInExpressionOrError ::= debugType(Type) [function, total]
rule debugType(u8 ) => :: debug :: debug_u8
rule debugType(u16 ) => :: debug :: debug_u16
rule debugType(u32 ) => :: debug :: debug_u32
Expand Down
4 changes: 1 addition & 3 deletions ulm-semantics/main/preprocessing/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ module ULM-PREPROCESSING-STORAGE
)
=> ulmAddStorageMethodBody
(... methodName: Method
, storageName: StorageName
, mapperValueType: MapperValue
, appendParamsInstructions:
encodeStatements
codegenValuesEncoder
( buffer_id
, ( ptrValue(null, StorageName) : str
, paramsToEncodeValues(Params)
Expand All @@ -42,7 +41,6 @@ module ULM-PREPROCESSING-STORAGE
<k>
ulmAddStorageMethodBody
(... methodName: Method:PathInExpression
, storageName: StorageName:String
, mapperValueType: MapperValueType:Type
, appendParamsInstructions: Append:NonEmptyStatements
) => .K
Expand Down
1 change: 0 additions & 1 deletion ulm-semantics/main/preprocessing/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ module ULM-PREPROCESSING-SYNTAX-PRIVATE
)
| ulmAddStorageMethodBody
( methodName: PathInExpression
, storageName: String
, mapperValueType: Type
, appendParamsInstructions: NonEmptyStatementsOrError
)
Expand Down
6 changes: 3 additions & 3 deletions ulm-semantics/test/execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module ULM-TEST-EXECUTION
=> concat
( let buffer_id = :: bytes_hooks :: empty( .CallParamsList );
.NonEmptyStatements
, encodeStatements(buffer_id, encodeArgsToEncodeValues(Args))
, codegenValuesEncoder(buffer_id, encodeArgsToEncodeValues(Args))
)
rule encode_call_data C:EncodeCall
Expand Down Expand Up @@ -227,7 +227,7 @@ module ULM-TEST-EXECUTION
( concat
( let buffer_id = :: bytes_hooks :: empty( .CallParamsList );
.NonEmptyStatements
, encodeStatements
, codegenValuesEncoder
( buffer_id
, (StorageName : str , encodeArgsToEncodeValues(Args))
)
Expand All @@ -251,7 +251,7 @@ module ULM-TEST-EXECUTION
( concat
( let buffer_id = :: bytes_hooks :: empty( .CallParamsList );
.NonEmptyStatements
, encodeStatements
, codegenValuesEncoder
( buffer_id
, encodeArgsToEncodeValues(Args)
)
Expand Down

0 comments on commit 0830a70

Please sign in to comment.