diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-01-25 04:43:34 -0800 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-01-25 04:43:34 -0800 |
commit | 84a4f64cc68e776ea92d601afcf0cf5a3f8d1e69 (patch) | |
tree | afe78a01bdb3edfb56289db8b8bd328ed45df1e3 | |
parent | 6eb55d47a28d06e2cbc3430dcbdbc7649a514d1c (diff) | |
parent | 48413b4afb6436eedb0d4a4fe4089cb45d7fb493 (diff) | |
download | scala-84a4f64cc68e776ea92d601afcf0cf5a3f8d1e69.tar.gz scala-84a4f64cc68e776ea92d601afcf0cf5a3f8d1e69.tar.bz2 scala-84a4f64cc68e776ea92d601afcf0cf5a3f8d1e69.zip |
Merge pull request #3411 from som-snytt/issue/7919-si-nl
Newline after empty string interp
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Scanners.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t7919.scala | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index 8011abc1ed..e8d46704c3 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -475,14 +475,17 @@ trait Scanners extends ScannersCommon { if (token == INTERPOLATIONID) { nextRawChar() if (ch == '\"') { - nextRawChar() - if (ch == '\"') { + val lookahead = lookaheadReader + lookahead.nextChar() + if (lookahead.ch == '\"') { + nextRawChar() // now eat it offset += 3 nextRawChar() getStringPart(multiLine = true) sepRegions = STRINGPART :: sepRegions // indicate string part sepRegions = STRINGLIT :: sepRegions // once more to indicate multi line string part } else { + nextChar() token = STRINGLIT strVal = "" } diff --git a/test/files/pos/t7919.scala b/test/files/pos/t7919.scala new file mode 100644 index 0000000000..64f261ec16 --- /dev/null +++ b/test/files/pos/t7919.scala @@ -0,0 +1,6 @@ + +object X { + val x = s"" + val y = true +} + |