mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-10-01 12:39:37 +00:00
17 lines
564 B
Kotlin
17 lines
564 B
Kotlin
package gay.pizza.pork.minimal
|
|
|
|
import gay.pizza.dough.fs.FsPath
|
|
import gay.pizza.dough.fs.readString
|
|
import gay.pizza.pork.frontend.ContentSource
|
|
import gay.pizza.pork.frontend.FsContentSource
|
|
import gay.pizza.pork.parser.CharSource
|
|
import gay.pizza.pork.parser.StringCharSource
|
|
|
|
class FileTool(val path: FsPath) : Tool() {
|
|
override fun createCharSource(): CharSource =
|
|
StringCharSource(path.readString())
|
|
override fun createContentSource(): ContentSource =
|
|
FsContentSource(path.parent!!)
|
|
override fun rootFilePath(): String = path.fullPathString
|
|
}
|