File tree 1 file changed +17
-10
lines changed
compiler/src/dotty/tools/dotc/reporting 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,25 @@ class ConsoleReporter(
41
41
}
42
42
43
43
/** Show prompt if `-Xprompt` is passed as a flag to the compiler */
44
- def displayPrompt ()(implicit ctx : Context ): Unit = {
45
- printMessage(" \n a)bort, s)tack, r)esume: " )
46
- flush()
44
+ def displayPrompt (): Unit = {
45
+ writer.println()
46
+ writer.print(" a)bort, s)tack, r)esume: " )
47
+ writer.flush()
47
48
if (reader != null ) {
48
- val response = reader.read().asInstanceOf [Char ].toLower
49
- if (response == 'a' || response == 's' ) {
50
- Thread .dumpStack()
51
- if (response == 'a' )
52
- sys.exit(1 )
49
+ def loop (): Unit = reader.read match {
50
+ case 'a' | 'A' =>
51
+ new Throwable ().printStackTrace(writer)
52
+ System .exit(1 )
53
+ case 's' | 'S' =>
54
+ new Throwable ().printStackTrace(writer)
55
+ writer.println()
56
+ writer.flush()
57
+ case 'r' | 'R' =>
58
+ ()
59
+ case _ =>
60
+ loop()
53
61
}
54
- print(" \n " )
55
- flush()
62
+ loop()
56
63
}
57
64
}
58
65
You can’t perform that action at this time.
0 commit comments