tweak codegen of inline sub

This commit is contained in:
Irmen de Jong
2023-02-09 21:53:35 +01:00
parent 694d088160
commit fe29d8a23f
7 changed files with 18 additions and 48 deletions
+1 -2
View File
@@ -86,8 +86,7 @@ fun printAst(root: PtNode, output: (text: String) -> Unit) {
}
is PtSub -> {
val params = if (node.parameters.isEmpty()) "" else "...TODO ${node.parameters.size} PARAMS..."
var str = if(node.inline) "inline " else ""
str += "sub ${node.name}($params) "
var str = "sub ${node.name}($params) "
if(node.returntype!=null)
str += "-> ${node.returntype.name.lowercase()}"
str
@@ -26,7 +26,6 @@ class PtSub(
name: String,
val parameters: List<PtSubroutineParameter>,
val returntype: DataType?,
val inline: Boolean,
position: Position
) : PtNamedNode(name, position), IPtSubroutine {
override fun printProperties() {