diff options
author | odersky <odersky@gmail.com> | 2016-12-18 16:06:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-18 16:06:02 +0100 |
commit | 46bef7170fb48c0e48d0c5b38fcec29db64f7b13 (patch) | |
tree | f49198e7b34c93d63a235384be31e3458f95c002 /compiler/src/dotty/tools/dotc/parsing/Parsers.scala | |
parent | 7866bc2620098a7a692b68ac9c37e6d8a05ec774 (diff) | |
parent | 2423ada8b32854f13e16bb62cf1f0a07cff6df7a (diff) | |
download | dotty-46bef7170fb48c0e48d0c5b38fcec29db64f7b13.tar.gz dotty-46bef7170fb48c0e48d0c5b38fcec29db64f7b13.tar.bz2 dotty-46bef7170fb48c0e48d0c5b38fcec29db64f7b13.zip |
Merge pull request #1822 from dotty-staging/fix-#1792
Fix #1792: Allow newline in front of `{` for procedure syntax
Diffstat (limited to 'compiler/src/dotty/tools/dotc/parsing/Parsers.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/parsing/Parsers.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 26656aae8..76f82d8af 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1947,6 +1947,7 @@ object Parsers { if (in.token == THIS) { in.nextToken() val vparamss = paramClauses(nme.CONSTRUCTOR) + if (in.isScala2Mode) newLineOptWhenFollowedBy(LBRACE) val rhs = { if (!(in.token == LBRACE && scala2ProcedureSyntax(""))) accept(EQUALS) atPos(in.offset) { constrExpr() } @@ -1958,6 +1959,7 @@ object Parsers { val tparams = typeParamClauseOpt(ParamOwner.Def) val vparamss = paramClauses(name) var tpt = fromWithinReturnType(typedOpt()) + if (in.isScala2Mode) newLineOptWhenFollowedBy(LBRACE) val rhs = if (in.token == EQUALS) { in.nextToken() |