From 0830a70a055749e1d8200d90c9a9db24d24a9a57 Mon Sep 17 00:00:00 2001 From: Virgil Date: Mon, 25 Nov 2024 23:43:17 +0200 Subject: [PATCH] Merge fixes --- ulm-semantics/main/encoding/encoder.md | 28 ++++++++++----------- ulm-semantics/main/preprocessing/storage.md | 4 +-- ulm-semantics/main/preprocessing/syntax.md | 1 - ulm-semantics/test/execution.md | 6 ++--- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/ulm-semantics/main/encoding/encoder.md b/ulm-semantics/main/encoding/encoder.md index bc3ed229..2670d74c 100644 --- a/ulm-semantics/main/encoding/encoder.md +++ b/ulm-semantics/main/encoding/encoder.md @@ -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 @@ -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 diff --git a/ulm-semantics/main/preprocessing/storage.md b/ulm-semantics/main/preprocessing/storage.md index 87757ff9..3c46f768 100644 --- a/ulm-semantics/main/preprocessing/storage.md +++ b/ulm-semantics/main/preprocessing/storage.md @@ -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) @@ -42,7 +41,6 @@ module ULM-PREPROCESSING-STORAGE ulmAddStorageMethodBody (... methodName: Method:PathInExpression - , storageName: StorageName:String , mapperValueType: MapperValueType:Type , appendParamsInstructions: Append:NonEmptyStatements ) => .K diff --git a/ulm-semantics/main/preprocessing/syntax.md b/ulm-semantics/main/preprocessing/syntax.md index 5e80e05e..294e4f07 100644 --- a/ulm-semantics/main/preprocessing/syntax.md +++ b/ulm-semantics/main/preprocessing/syntax.md @@ -43,7 +43,6 @@ module ULM-PREPROCESSING-SYNTAX-PRIVATE ) | ulmAddStorageMethodBody ( methodName: PathInExpression - , storageName: String , mapperValueType: Type , appendParamsInstructions: NonEmptyStatementsOrError ) diff --git a/ulm-semantics/test/execution.md b/ulm-semantics/test/execution.md index 6f6c0c69..c2c12559 100644 --- a/ulm-semantics/test/execution.md +++ b/ulm-semantics/test/execution.md @@ -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 @@ -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)) ) @@ -251,7 +251,7 @@ module ULM-TEST-EXECUTION ( concat ( let buffer_id = :: bytes_hooks :: empty( .CallParamsList ); .NonEmptyStatements - , encodeStatements + , codegenValuesEncoder ( buffer_id , encodeArgsToEncodeValues(Args) )