Cleanup getLabel

This commit is contained in:
Tamas Vajk
2021-09-16 15:03:55 +02:00
committed by Ian Lynagh
parent 48d019ebbe
commit 7ecb3650cb
2 changed files with 9 additions and 14 deletions

View File

@@ -256,6 +256,8 @@ class KotlinFileExtractor(val logger: FileLogger, val tw: FileTrapWriter, val fi
}
}
fun getLabel(element: IrElement) : String? {
when (element) {
is IrFile -> return "@\"${element.path};sourcefile\"" // todo: remove copy-pasted code
@@ -266,13 +268,14 @@ class KotlinFileExtractor(val logger: FileLogger, val tw: FileTrapWriter, val fi
is IrProperty -> return getPropertyLabel(element)
// Fresh entities:
is IrBody -> return "*"
is IrExpression -> return "*"
is IrBody -> return null
is IrExpression -> return null
// todo:
is IrField -> return null
// todo add others:
else -> return null
else -> {
logger.warnElement(Severity.ErrorSevere, "Unhandled element type: ${element::class}", element)
return null
}
}
}