diff --git a/kmath-ast/build.gradle.kts b/kmath-ast/build.gradle.kts index 894279695..5b764459c 100644 --- a/kmath-ast/build.gradle.kts +++ b/kmath-ast/build.gradle.kts @@ -33,21 +33,23 @@ kotlin.sourceSets { jsMain { dependencies { - implementation(npm("astring", "1.4.3")) + implementation(npm("astring", "1.7.0")) } } jvmMain { dependencies { - api("com.github.h0tk3y.betterParse:better-parse:0.4.0") - implementation("org.ow2.asm:asm:9.0") - implementation("org.ow2.asm:asm-commons:9.0") + api("com.github.h0tk3y.betterParse:better-parse:0.4.1") + implementation("org.ow2.asm:asm:9.1") + implementation("org.ow2.asm:asm-commons:9.1") } } } //Workaround for https://github.com/Kotlin/dokka/issues/1455 -tasks.getByName("dokkaHtml").dependsOn(tasks.getByName("build")) +tasks.dokkaHtml { + dependsOn(tasks.build) +} readme { maturity = Maturity.PROTOTYPE diff --git a/kmath-ast/src/jvmMain/kotlin/space/kscience/kmath/ast/parser.kt b/kmath-ast/src/jvmMain/kotlin/space/kscience/kmath/ast/parser.kt index 4d8204383..be4aff34f 100644 --- a/kmath-ast/src/jvmMain/kotlin/space/kscience/kmath/ast/parser.kt +++ b/kmath-ast/src/jvmMain/kotlin/space/kscience/kmath/ast/parser.kt @@ -1,4 +1,4 @@ -// TODO move to common when https://github.com/h0tk3y/better-parse/pull/33 is merged +// TODO move to common when https://github.com/h0tk3y/better-parse/pull/37 is merged package space.kscience.kmath.ast @@ -25,8 +25,8 @@ import space.kscience.kmath.operations.SpaceOperations */ public object ArithmeticsEvaluator : Grammar() { // TODO replace with "...".toRegex() when better-parse 0.4.1 is released - private val num: Token by regexToken("[\\d.]+(?:[eE][-+]?\\d+)?") - private val id: Token by regexToken("[a-z_A-Z][\\da-z_A-Z]*") + private val num: Token by regexToken("[\\d.]+(?:[eE][-+]?\\d+)?".toRegex()) + private val id: Token by regexToken("[a-z_A-Z][\\da-z_A-Z]*".toRegex()) private val lpar: Token by literalToken("(") private val rpar: Token by literalToken(")") private val comma: Token by literalToken(",") @@ -35,7 +35,7 @@ public object ArithmeticsEvaluator : Grammar() { private val div: Token by literalToken("/") private val minus: Token by literalToken("-") private val plus: Token by literalToken("+") - private val ws: Token by regexToken("\\s+", ignore = true) + private val ws: Token by regexToken("\\s+".toRegex(), ignore = true) private val number: Parser by num use { MST.Numeric(text.toDouble()) } private val singular: Parser by id use { MST.Symbolic(text) }