Skip to content

Commit 058ce7a

Browse files
authored
Merge pull request #39 from laelath/clang-error-parsing
Remove offending line logic
2 parents f2bef67 + 42bc8d2 commit 058ce7a

1 file changed

Lines changed: 1 addition & 22 deletions

File tree

a86/interp.rkt

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -215,30 +215,9 @@
215215
"if you did and still get this error; please share with course staff."))
216216

217217
(define (clang:error msg)
218-
(raise (exn:clang (format "~a\n\n~a~a" assembly-error-msg msg (assembly-offending-line msg))
218+
(raise (exn:clang (format "~a\n\n~a" assembly-error-msg msg)
219219
(current-continuation-marks))))
220220

221-
(define (assembly-offending-line msg)
222-
(match (regexp-match
223-
"(.*):([0-9]+):([0-9]+): error: " msg)
224-
[(list _ (app string->path file) (app string->number line) (app string->number offset))
225-
(define line-text
226-
(with-input-from-file file
227-
(thunk
228-
(let loop ([l (read-line)]
229-
[i line])
230-
(if (= i 1)
231-
l
232-
(loop (read-line) (sub1 i)))))))
233-
(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-
242221
;; run clang on t.s to create t.o
243222
(define (clang t.s t.o)
244223
(define err-port (open-output-string))

0 commit comments

Comments
 (0)