Skip to content

Commit

Permalink
ScalametaParser: constrain NL before block in arg
Browse files Browse the repository at this point in the history
Turns out it's only in scala2 and only after parens.
  • Loading branch information
kitbellew committed May 29, 2023
1 parent a6256d7 commit 78287b1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2312,7 +2312,10 @@ class ScalametaParser(input: Input)(implicit dialect: Dialect) { parser =>
}
token match {
case _: Dot | _: OpenDelim | _: Underscore => getRest()
case _: LF if peekToken.is[LeftBrace] => next(); getRest()
// see ArgumentExprs in:
// https://scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html#context-free-syntax
case _: LF if !isBrace && !dialect.allowSignificantIndentation && tryAhead[LeftBrace] =>
getRest()
case _ =>
makeTupleTerm { arg =>
val res = maybeAnonymousFunction(arg)
Expand Down

0 comments on commit 78287b1

Please sign in to comment.