From 37ef3a187921e7bd30f04902bba65a7818332ea0 Mon Sep 17 00:00:00 2001 From: Iaroslav Date: Fri, 26 Jun 2020 21:39:39 +0700 Subject: [PATCH] Add explicit toRegex call to have better IDE support --- .../kotlin/scientifik/kmath/ast/parser.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kmath-ast/src/commonMain/kotlin/scientifik/kmath/ast/parser.kt b/kmath-ast/src/commonMain/kotlin/scientifik/kmath/ast/parser.kt index cec61a8ff..30a92c5ae 100644 --- a/kmath-ast/src/commonMain/kotlin/scientifik/kmath/ast/parser.kt +++ b/kmath-ast/src/commonMain/kotlin/scientifik/kmath/ast/parser.kt @@ -16,15 +16,15 @@ import scientifik.kmath.operations.SpaceOperations * TODO move to common */ private object ArithmeticsEvaluator : Grammar() { - val num by token("-?[\\d.]+(?:[eE]-?\\d+)?") - val lpar by token("\\(") - val rpar by token("\\)") - val mul by token("\\*") - val pow by token("\\^") - val div by token("/") - val minus by token("-") - val plus by token("\\+") - val ws by token("\\s+", ignore = true) + val num by token("-?[\\d.]+(?:[eE]-?\\d+)?".toRegex()) + val lpar by token("\\(".toRegex()) + val rpar by token("\\)".toRegex()) + val mul by token("\\*".toRegex()) + val pow by token("\\^".toRegex()) + val div by token("/".toRegex()) + val minus by token("-".toRegex()) + val plus by token("\\+".toRegex()) + val ws by token("\\s+".toRegex(), ignore = true) val number: Parser by num use { MST.Numeric(text.toDouble()) }