We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 53a0427 + 140ab1e commit e01e3fdCopy full SHA for e01e3fd
1 file changed
a86/interp.rkt
@@ -220,17 +220,22 @@
220
221
(define (assembly-offending-line msg)
222
(match (regexp-match
223
- "(.*):([0-9]+): error: " msg)
224
- [(list _ (app string->path file) (app string->number line))
225
- (format
226
- "\noffending line: ~a"
+ "(.*):([0-9]+):([0-9]+): error: " msg)
+ [(list _ (app string->path file) (app string->number line) (app string->number offset))
+ (define line-text
227
(with-input-from-file file
228
(thunk
229
(let loop ([l (read-line)]
230
[i line])
231
(if (= i 1)
232
l
233
- (loop (read-line) (sub1 i)))))))]
+ (loop (read-line) (sub1 i)))))))
+ (match (regexp-match "[ ]*(.*)" line-text)
234
+ [(list _ trimmed-line)
235
+ (format
236
+ "\noffending line: ~a\n ~a^"
237
+ trimmed-line
238
+ (make-string offset #\space))])]
239
[_ ""]))
240
241
0 commit comments