Add explicit toRegex call to have better IDE support
This commit is contained in:
parent
ec46f5cf22
commit
37ef3a1879
@ -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()) }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user