expression function calls
This commit is contained in:
@@ -200,6 +200,7 @@ public sealed class Generator(List<TypedNodeDefinitionFunc> functions, ModuleGra
|
||||
TypedNodeExpressionMemberAccess expression => EmitExpressionMemberAccess(expression),
|
||||
TypedNodeExpressionLocalIdent expression => expression.Value.Ident,
|
||||
TypedNodeExpressionModuleIdent expression => expression.Value.Ident,
|
||||
TypedNodeExpressionFuncCall expression => EmitExpressionFuncCall(expression),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(node), node, null)
|
||||
};
|
||||
}
|
||||
@@ -263,6 +264,13 @@ public sealed class Generator(List<TypedNodeDefinitionFunc> functions, ModuleGra
|
||||
return $"{target}.{expression.Name.Ident}";
|
||||
}
|
||||
|
||||
private string EmitExpressionFuncCall(TypedNodeExpressionFuncCall expression)
|
||||
{
|
||||
var name = EmitExpression(expression.Target);
|
||||
var parameterValues = expression.Parameters.Select(EmitExpression).ToList();
|
||||
return $"{name}({string.Join(", ", parameterValues)})";
|
||||
}
|
||||
|
||||
private string CType(NubType node, string? varName = null)
|
||||
{
|
||||
return node switch
|
||||
|
||||
Reference in New Issue
Block a user