Skip to content

Commit

Permalink
Fix unnecessary parentheses codestyle issues
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgio committed Jul 30, 2024
1 parent f88529d commit 3658a11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3658a11

Please sign in to comment.