File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
compiler/src/dotty/tools/dotc/tasty/internal Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -3,5 +3,16 @@ package dotty.tools.dotc.tasty.internal
33import dotty .tools .dotc .util .SourcePosition
44
55private [tasty] class Position (val pos : SourcePosition ) extends scala.tasty.Position {
6+ override def firstOffset = pos.start
7+ override def lastOffset = pos.end
8+
9+ override def sourceFile = pos.source.file.path
10+
11+ override def startLine = pos.startLine
12+ override def endLine = pos.endLine
13+
14+ override def startColumn = pos.startColumn
15+ override def endColumn = pos.endColumn
16+
617 override def toString : String = s " Position( ${pos.line}, ${pos.column}) "
718}
Original file line number Diff line number Diff line change 11package scala .tasty
22
3- trait Position
3+ trait Position {
4+ def firstOffset : Int
5+ def lastOffset : Int
6+
7+ def sourceFile : String
8+
9+ def startLine : Int
10+ def startColumn : Int
11+ def endLine : Int
12+ def endColumn : Int
13+ }
Original file line number Diff line number Diff line change @@ -25,7 +25,12 @@ object definitions {
2525
2626// ====== Positions ==================================
2727
28- case class Position (firstOffset : Int , lastOffset : Int )
28+ case class Position (firstOffset : Int , lastOffset : Int , sourceFile : String ) {
29+ def startLine : Int = ???
30+ def startColumn : Int = ???
31+ def endLine : Int = ???
32+ def endColumn : Int = ???
33+ }
2934
3035 trait Positioned {
3136 def pos : Position = ???
You can’t perform that action at this time.
0 commit comments