@@ -90,7 +90,8 @@ class StandardErrorListener implements ErrorListener {
9090
9191 @Override
9292 void onError (SyntaxException error , String filename , SourceUnit source ) {
93- term. bold(). a(filename). reset()
93+ term. reset(). fg(Ansi.Color . RED ). a(" Error" ). reset()
94+ term. bold(). a(" ${ filename} " ). reset()
9495 term. a(" :${ error.getStartLine()} :${ error.getStartColumn()} : " )
9596 term = highlightString(error. getOriginalMessage(), term)
9697 if ( mode != ' concise' ) {
@@ -103,9 +104,10 @@ class StandardErrorListener implements ErrorListener {
103104 @Override
104105 void onWarning (WarningMessage warning , String filename , SourceUnit source ) {
105106 final token = warning. getContext(). getRoot()
106- term. bold(). a(filename). reset()
107+ term. reset(). fg(Ansi.Color . YELLOW ). a(" Warn" ). reset()
108+ term. bold(). a(" ${ filename} " ). reset()
107109 term. a(" :${ token.getStartLine()} :${ token.getStartColumn()} : " )
108- term. fg( Ansi.Color . YELLOW ) . a( warning. getMessage()) . fg( Ansi.Color . DEFAULT )
110+ term = highlightString( warning. getMessage(), term )
109111 if ( mode != ' concise' ) {
110112 term. newline()
111113 term = printCodeBlock(source, Range . of(warning), term, Ansi.Color . YELLOW )
@@ -172,6 +174,10 @@ class StandardErrorListener implements ErrorListener {
172174 int adjStart = Math . max(0 , start - windowStart)
173175 int adjEnd = Math . max(adjStart + 1 , Math . min(end - windowStart, line. length()))
174176
177+ // Left border
178+ if (i == toLine && i != = startLine) term. fg(color). a(" ╰" ). reset(). a(" " )
179+ else term. fg(color). a(" │" ). reset(). a(" " )
180+
175181 // Line number
176182 term. fg(Ansi.Color . BLUE ). a(String . format(" %3d | " , i)). reset()
177183
@@ -181,6 +187,10 @@ class StandardErrorListener implements ErrorListener {
181187 term. fg(color). a(line. substring(adjStart, adjEnd)). reset()
182188 term. a(Ansi.Attribute . INTENSITY_FAINT ). a(line. substring(adjEnd)). reset(). newline()
183189
190+ // Left border
191+ if (i == toLine) term. fg(color). a(" ╰" ). reset(). a(" " )
192+ else term. fg(color). a(" │" ). reset(). a(" " )
193+
184194 // Print carets underneath the range
185195 String marker = ' ' * adjStart
186196 String carets = ' ^' * Math . max(1 , adjEnd - adjStart)
@@ -221,7 +231,7 @@ class StandardErrorListener implements ErrorListener {
221231 @Override
222232 void afterAll (ErrorSummary summary ) {
223233 final term = ansi()
224- term. cursorUp(1 ). eraseLine(). cursorUp( 1 ) . eraseLine()
234+ term. cursorUp(1 ). eraseLine()
225235 // print extra newline if no code is being shown
226236 if ( mode == ' concise' )
227237 term. newline()
0 commit comments