Skip to content

Commit

Permalink
Scalameta: upgrade to v4.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Jul 8, 2024
1 parent 1d5350d commit 8482946
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._

object Dependencies {
val metaconfigV = "0.12.0"
val scalametaV = "4.9.7"
val scalametaV = "4.9.8"
val scalacheckV = "1.18.0"
val coursier = "2.1.10"
val munitV = "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ object FormatToken {

@inline
def isNL(token: Token): Boolean = token.is[Token.AtEOL]
@inline
def newlines(token: Token): Int = token match {
case t: Token.AtEOL => t.newlines
case _ => 0
}

/** @param between
* The whitespace tokens between left and right.
Expand All @@ -101,9 +106,8 @@ object FormatToken {
def count(idx: Int, maxCount: Int): Int =
if (idx == between.length) maxCount
else {
val token = between(idx)
if (isNL(token)) if (maxCount == 0) count(idx + 1, 1) else 2
else count(idx + 1, maxCount)
val newMaxCount = maxCount + newlines(between(idx))
if (newMaxCount < 2) count(idx + 1, newMaxCount) else 2
}
count(0, 0)
}
Expand Down

0 comments on commit 8482946

Please sign in to comment.