aboutsummaryrefslogtreecommitdiff
path: root/src/runMain/kotlin/Loader.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/runMain/kotlin/Loader.kt')
-rw-r--r--src/runMain/kotlin/Loader.kt11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/runMain/kotlin/Loader.kt b/src/runMain/kotlin/Loader.kt
index 7cec0a5..3aef50a 100644
--- a/src/runMain/kotlin/Loader.kt
+++ b/src/runMain/kotlin/Loader.kt
@@ -1,15 +1,12 @@
-import kotlinx.cinterop.ByteVar
-import kotlinx.cinterop.allocArray
-import kotlinx.cinterop.memScoped
-import kotlinx.cinterop.toKString
+import kotlinx.cinterop.*
import platform.posix.*
class Loader(path: String) {
private val inputString = read(path)
// TODO: Add preprocessor managing imports and comments
- fun load(): String {
- return inputString
+ fun preprocess(): String {
+ return inputString.replace("\n", "")
}
private fun read(path: String): String {
@@ -17,7 +14,7 @@ class Loader(path: String) {
val file = fopen(path, "r")
if (file == null) {
- perror("cannot open input file $path")
+ perror("Couldn't open file: $path")
}
memScoped {