mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9026 from ethereum/sol-yul-refactor-new-conditional-whiskers-syntax-in-internal-dispatch
[Sol->Yul] New whiskers conditionals in internal dispatch template (refactor)
This commit is contained in:
commit
b7aa6cb1f7
@ -126,22 +126,19 @@ string IRGenerationContext::generateInternalDispatchFunction(YulArity const& _ar
|
||||
string funName = IRNames::internalDispatch(_arity);
|
||||
return m_functions.createFunction(funName, [&]() {
|
||||
Whiskers templ(R"(
|
||||
function <functionName>(fun <comma> <in>) <arrow> <out> {
|
||||
function <functionName>(fun<?+in>, <in></+in>) <?+out>-> <out></+out> {
|
||||
switch fun
|
||||
<#cases>
|
||||
case <funID>
|
||||
{
|
||||
<out> <assignment_op> <name>(<in>)
|
||||
<?+out> <out> :=</+out> <name>(<in>)
|
||||
}
|
||||
</cases>
|
||||
default { invalid() }
|
||||
}
|
||||
)");
|
||||
templ("functionName", funName);
|
||||
templ("comma", _arity.in > 0 ? "," : "");
|
||||
templ("in", suffixedVariableNameList("in_", 0, _arity.in));
|
||||
templ("arrow", _arity.out > 0 ? "->" : "");
|
||||
templ("assignment_op", _arity.out > 0 ? ":=" : "");
|
||||
templ("out", suffixedVariableNameList("out_", 0, _arity.out));
|
||||
|
||||
vector<map<string, string>> cases;
|
||||
|
Loading…
Reference in New Issue
Block a user