implement more parsers

This commit is contained in:
2026-01-01 00:25:56 +01:00
parent 0dc064b8cf
commit 7b9e39f9d0
7 changed files with 140 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
package com.infendro.cli.parser
import com.infendro.cli.exception.run.ParseException
object FloatParser : Parser<Float> {
override fun parse(text: String): Float = try {
text.toFloat()
} catch (_: Exception) {
throw ParseException(text, "Float")
}
}