Add explicit toRegex call to have better IDE support

This commit is contained in:
Iaroslav 2020-06-26 21:39:39 +07:00
parent ec46f5cf22
commit 37ef3a1879
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7

View File

@ -16,15 +16,15 @@ import scientifik.kmath.operations.SpaceOperations
* TODO move to common * TODO move to common
*/ */
private object ArithmeticsEvaluator : Grammar<MST>() { private object ArithmeticsEvaluator : Grammar<MST>() {
val num by token("-?[\\d.]+(?:[eE]-?\\d+)?") val num by token("-?[\\d.]+(?:[eE]-?\\d+)?".toRegex())
val lpar by token("\\(") val lpar by token("\\(".toRegex())
val rpar by token("\\)") val rpar by token("\\)".toRegex())
val mul by token("\\*") val mul by token("\\*".toRegex())
val pow by token("\\^") val pow by token("\\^".toRegex())
val div by token("/") val div by token("/".toRegex())
val minus by token("-") val minus by token("-".toRegex())
val plus by token("\\+") val plus by token("\\+".toRegex())
val ws by token("\\s+", ignore = true) val ws by token("\\s+".toRegex(), ignore = true)
val number: Parser<MST> by num use { MST.Numeric(text.toDouble()) } val number: Parser<MST> by num use { MST.Numeric(text.toDouble()) }