File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 3
3
package inox
4
4
5
5
import utils ._
6
+ import Position .smartPos
6
7
7
8
abstract class DebugSection (val name : String )
8
9
@@ -166,20 +167,6 @@ class DefaultReporter(debugSections: Set[DebugSection]) extends Reporter(debugSe
166
167
case DEBUG (_) => " [" + Console .MAGENTA + " Debug " + Console .RESET + " ]"
167
168
}
168
169
169
- def smartPos (p : Position ): String = {
170
- if (p == NoPosition ) {
171
- " "
172
- } else {
173
- val target = p.file.getAbsolutePath()
174
- val here = new java.io.File (" ." ).getAbsolutePath().stripSuffix(" ." )
175
- val diff = target.stripPrefix(here)
176
-
177
- val filePos = diff+ " :"
178
-
179
- filePos + p + " : "
180
- }
181
- }
182
-
183
170
def emit (msg : Message ) = synchronized {
184
171
println(reline(severityToPrefix(msg.severity), smartPos(msg.position) + msg.msg.toString))
185
172
printLineContent(msg.position, false )
Original file line number Diff line number Diff line change @@ -35,6 +35,21 @@ abstract class Position extends Ordered[Position] {
35
35
}
36
36
37
37
object Position {
38
+
39
+ def smartPos (p : Position ): String = {
40
+ if (p == NoPosition ) {
41
+ " "
42
+ } else {
43
+ val target = p.file.getAbsolutePath()
44
+ val here = new java.io.File (" ." ).getAbsolutePath().stripSuffix(" ." )
45
+ val diff = target.stripPrefix(here)
46
+
47
+ val filePos = diff+ " :"
48
+
49
+ filePos + p + " : "
50
+ }
51
+ }
52
+
38
53
def between (a : Position , b : Position ): Position = {
39
54
if (a.file == b.file) {
40
55
if (a.line == b.line && a.col == b.col) {
You can’t perform that action at this time.
0 commit comments