diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/context/ScopeContext.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/context/ScopeContext.kt index 85a2a722..b48f746d 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/context/ScopeContext.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/context/ScopeContext.kt @@ -21,7 +21,7 @@ class ScopeContext(val parent: Context) : MutableContext( get() = parent.documentInfo override val options: MutableContextOptions - get() = (parent.options as? MutableContextOptions) ?: MutableContextOptions() + get() = parent.options as? MutableContextOptions ?: MutableContextOptions() /** * If no matching function is found among this [ScopeContext]'s own [libraries], diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/function/expression/visitor/AppendExpressionVisitor.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/function/expression/visitor/AppendExpressionVisitor.kt index e597b25c..0cddbf8b 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/function/expression/visitor/AppendExpressionVisitor.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/function/expression/visitor/AppendExpressionVisitor.kt @@ -121,19 +121,19 @@ class AppendExpressionVisitor(private val other: Expression) : ExpressionVisitor // [a, b, c] "abc" -> [a, b, c, "abc"] override fun visit(value: OrderedCollectionValue<*>): Expression = OrderedCollectionValue( - value.unwrappedValue + (other.eval() as OutputValue<*>), + value.unwrappedValue + other.eval() as OutputValue<*>, ) // [a, b, c] "abc" -> [a, b, c, "abc"] override fun visit(value: UnorderedCollectionValue<*>): Expression = UnorderedCollectionValue( - value.unwrappedValue + (other.eval() as OutputValue<*>), + value.unwrappedValue + other.eval() as OutputValue<*>, ) // [a, b, c] "abc" -> [a, b, c, "abc"] override fun visit(value: GeneralCollectionValue<*>): GeneralCollectionValue<*> = GeneralCollectionValue( - value.unwrappedValue + (other.eval() as OutputValue<*>), + value.unwrappedValue + other.eval() as OutputValue<*>, ) // CENTER "abc" -> "CENTERabc" diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/walker/WalkerLexer.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/walker/WalkerLexer.kt index 208ba958..7291b85e 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/walker/WalkerLexer.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/walker/WalkerLexer.kt @@ -23,7 +23,7 @@ abstract class WalkerLexer(source: CharSequence, protected val reader: SourceRea fun createTokenDataFromBuffer(): TokenData = TokenData( text = buffer.toString(), - position = (currentIndex - buffer.length) until currentIndex, + position = currentIndex - buffer.length until currentIndex, ).also { buffer.clear() } override val currentIndex: Int