diff options
author | Martin Odersky <odersky@gmail.com> | 2013-05-24 16:39:53 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-05-24 16:39:59 +0200 |
commit | 991860936cbbedf6087a2e13ef69a61b69b3fa86 (patch) | |
tree | cd849b0090d876ded77d00c49beeea0db3249ce6 /src/dotty/tools/dotc/util/Positions.scala | |
parent | acc2b198692687394c9f8f84b16a0bec9ae12ee3 (diff) | |
download | dotty-991860936cbbedf6087a2e13ef69a61b69b3fa86.tar.gz dotty-991860936cbbedf6087a2e13ef69a61b69b3fa86.tar.bz2 dotty-991860936cbbedf6087a2e13ef69a61b69b3fa86.zip |
Parser tweaks to handling new and templates.
Diffstat (limited to 'src/dotty/tools/dotc/util/Positions.scala')
-rw-r--r-- | src/dotty/tools/dotc/util/Positions.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/util/Positions.scala b/src/dotty/tools/dotc/util/Positions.scala index 00d4e30ab..0a0a52e51 100644 --- a/src/dotty/tools/dotc/util/Positions.scala +++ b/src/dotty/tools/dotc/util/Positions.scala @@ -84,10 +84,11 @@ object Positions { def endPos = Position(end) /** A copy of this position with a different start */ - def withStart(start: Int) = fromOffsets(start, this.end, this.point - start) + def withStart(start: Int) = + fromOffsets(start, this.end, if (isSynthetic) SyntheticPointDelta else this.point - start) /** A copy of this position with a different end */ - def withEnd(end: Int) = fromOffsets(this.start, end, this.point - this.start) + def withEnd(end: Int) = fromOffsets(this.start, end, pointDelta) /** A copy of this position with a different point */ def withPoint(point: Int) = fromOffsets(this.start, this.end, point - this.start) |