mirror of
https://github.com/irmen/prog8.git
synced 2026-04-19 20:16:51 +00:00
vm: support non-unary functions in pipe expressions
This commit is contained in:
@@ -85,12 +85,14 @@ internal class ExpressionGen(private val codeGen: CodeGen) {
|
||||
return when (segment) {
|
||||
is PtFunctionCall -> {
|
||||
val segWithArg = PtFunctionCall(segment.functionName, segment.void, segment.type, segment.position)
|
||||
segWithArg.children.add(0, PtMachineRegister(sourceReg, sourceDt, segment.position))
|
||||
segWithArg.children.add(PtMachineRegister(sourceReg, sourceDt, segment.position))
|
||||
segWithArg.children.addAll(segment.args)
|
||||
segWithArg
|
||||
}
|
||||
is PtBuiltinFunctionCall -> {
|
||||
val segWithArg = PtBuiltinFunctionCall(segment.name, segment.void, segment.hasNoSideEffects, segment.type, segment.position)
|
||||
segWithArg.children.add(0, PtMachineRegister(sourceReg, sourceDt, segment.position))
|
||||
segWithArg.children.add(PtMachineRegister(sourceReg, sourceDt, segment.position))
|
||||
segWithArg.children.addAll(segment.args)
|
||||
segWithArg
|
||||
}
|
||||
else -> throw AssemblyError("weird segment type")
|
||||
|
||||
Reference in New Issue
Block a user