Skip to content

Commit

Permalink
Renamee encodeStatements to codegenValuesEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
virgil-serbanuta committed Nov 20, 2024
1 parent 9d4d036 commit 6428a44
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions ulm-semantics/main/encoding/encoder.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,20 @@ module ULM-CALLDATA-ENCODER
| "ulm#head" [token]
| "ulm#tail" [token]
syntax NonEmptyStatementsOrError ::= #encodeStatements
syntax NonEmptyStatementsOrError ::= #codegenValuesEncoder
( bufferId: Identifier
, headSize: ExpressionOrError
, append: NonEmptyStatementsOrError
) [function, total]
rule encodeStatements(... bufferId: BufferId:Identifier, values: Values:EncodeValues)
=> #encodeStatements(BufferId, totalHeadSize(Values), appendValues(Values, ulm#head_size, ulm#head, ulm#tail))
rule codegenValuesEncoder(... bufferId: BufferId:Identifier, values: Values:EncodeValues)
=> #codegenValuesEncoder(BufferId, totalHeadSize(Values), appendValues(Values, ulm#head_size, ulm#head, ulm#tail))
rule #encodeStatements(_BufferId:Identifier, e(HeadSize:SemanticsError), _AppendValues:NonEmptyStatementsOrError)
rule #codegenValuesEncoder(_BufferId:Identifier, e(HeadSize:SemanticsError), _AppendValues:NonEmptyStatementsOrError)
=> HeadSize
rule #encodeStatements(_BufferId:Identifier, v(_HeadSize:Expression), AppendValues:SemanticsError)
rule #codegenValuesEncoder(_BufferId:Identifier, v(_HeadSize:Expression), AppendValues:SemanticsError)
=> AppendValues
rule #encodeStatements(BufferId:Identifier, v(HeadSize:Expression), AppendValues:NonEmptyStatements)
rule #codegenValuesEncoder(BufferId:Identifier, v(HeadSize:Expression), AppendValues:NonEmptyStatements)
=> concatNonEmptyStatements
( let ulm#head_size = HeadSize;
let ulm#head = :: bytes_hooks :: empty ( .CallParamsList );
Expand Down
2 changes: 1 addition & 1 deletion ulm-semantics/main/encoding/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module ULM-ENCODING-SYNTAX
syntax EncodeValues ::= List{EncodeValue, ","}
// assumes that bufferId points to an empty buffer.
syntax NonEmptyStatementsOrError ::= encodeStatements(bufferId: Identifier, values: EncodeValues) [function, total]
syntax NonEmptyStatementsOrError ::= codegenValuesEncoder(bufferId: Identifier, values: EncodeValues) [function, total]
syntax EncodeValue ::= paramToEncodeValue(NormalizedFunctionParameter) [function, total]
syntax EncodeValues ::= paramsToEncodeValues(NormalizedFunctionParameterList) [function, total]
Expand Down
2 changes: 1 addition & 1 deletion ulm-semantics/main/preprocessing/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module ULM-PREPROCESSING-ENDPOINTS
(... wrapperMethod: WrapperMethod
, params: Params
, method: ImplementationMethod
, appendReturn: encodeStatements(buffer_id, (return_value : ReturnType , .EncodeValues))
, appendReturn: codegenValuesEncoder(buffer_id, (return_value : ReturnType , .EncodeValues))
, decodeStatements: decodeParams(0, Params)
)
Expand Down
2 changes: 1 addition & 1 deletion ulm-semantics/main/preprocessing/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module ULM-PREPROCESSING-EVENTS
// but the last one are indexed. We should handle generic events.
=> #ulmPreprocessEvent
( Method
, encodeStatements
, codegenValuesEncoder
( data
, paramsToEncodeValues
( last(Param, Params)
Expand Down

0 comments on commit 6428a44

Please sign in to comment.