diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-01-24 11:40:52 -0800 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-01-24 11:40:52 -0800 |
commit | 48413b4afb6436eedb0d4a4fe4089cb45d7fb493 (patch) | |
tree | d82478305940781a212db0e6982ddb8af48253fc /src/compiler | |
parent | b75a84bedacd8588d2cf955900af80fd767a7d20 (diff) | |
download | scala-48413b4afb6436eedb0d4a4fe4089cb45d7fb493.tar.gz scala-48413b4afb6436eedb0d4a4fe4089cb45d7fb493.tar.bz2 scala-48413b4afb6436eedb0d4a4fe4089cb45d7fb493.zip |
SI-7919 Newline after empty string interp
Consume the newline non-raw for safe handling after
single-line interpolation.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Scanners.scala | 7 |
1 files changed, 5 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 = "" } |