Skip to content

Commit

Permalink
Scalameta: upgrade to v4.5.5
Browse files Browse the repository at this point in the history
Contains a few parsing fixes around scala3 functionality
backported to scala2, and parens in infix expressions.
  • Loading branch information
kitbellew committed May 13, 2022
1 parent 62fbc76 commit eb797c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

object Dependencies {
val metaconfigV = "0.10.0"
val scalametaV = "4.5.4"
val scalametaV = "4.5.5"
val scalacheckV = "1.15.4"
val coursier = "1.0.3"
val munitV = "0.7.29"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1941,7 +1941,7 @@ class Router(formatOps: FormatOps) {
// If/For/While/For with (
case FormatToken(open: T.LeftParen, _, _) if (leftOwner match {
case _: Term.If | _: Term.While | _: Term.For | _: Term.ForYield =>
!isSuperfluousParenthesis(open, leftOwner)
!isFirstToken(open, leftOwner)
case _ => false
}) =>
val close = matching(open)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ object TreeOps {
isSuperfluousParenthesis(open.asInstanceOf[LeftParen], owner)

def isSuperfluousParenthesis(open: LeftParen, owner: Tree): Boolean =
!isTuple(owner) && owner.tokens.headOption.contains(open)
!isTuple(owner) && isFirstToken(open, owner)

@inline
def isFirstOrLastToken(token: Token, owner: Tree): Boolean =
Expand Down

0 comments on commit eb797c3

Please sign in to comment.