File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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))
You can’t perform that action at this time.
0 commit comments