Skip to content

Commit 5f93dba

Browse files
committed
updated python translator
1 parent c3b53fc commit 5f93dba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/scala/org/polystat/Python.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ object Python:
1313
tmp <- cfg.tempDir
1414
_ <- readCodeFromInput(".py", cfg.input)
1515
.evalMap { case (path, code) =>
16+
val fileName = path.fileName.toString
1617
for
17-
maybeCode <- IO.blocking(Transpile(path.toString, code))
18+
maybeCode <- IO(
19+
Transpile(fileName.splitAt(fileName.indexOf("."))._1, code)
20+
)
1821
_ <- maybeCode match
1922
case Some(code) =>
2023
writeOutputTo(tmp / path.replaceExt(".eo"))(code)
2124
case None => IO.println(s"Couldn't analyze $path...")
2225
yield ()
26+
end for
2327
}
2428
.compile
2529
.drain

0 commit comments

Comments
 (0)