added some debugging information and some recovery from an error (that, frustratingly, I can't seem to fix )

svn: r17409
This commit is contained in:
Robby Findler 2009-12-28 01:17:37 +00:00
parent 0093bd2f1c
commit 7d79bbf10a

View File

@ -101,6 +101,15 @@
;; FIXME: do something so that we don't
;; have to disable all planet packages.
(read-language port (lambda () #f))))])
;; sometimes I get eof here, but I don't know why and can't seem to
;; make it happen outside of DrScheme
(when (eof-object? info-result)
(fprintf (current-error-port) "file ~s produces eof from read-language\n"
(send this get-filename))
(fprintf (current-error-port) " port-next-location ~s\n" (call-with-values (λ () (port-next-location port)) list))
(fprintf (current-error-port) " str ~s\n" (let ([s (send this get-text)])
(substring s 0 (min 100 (string-length s)))))
(set! info-result #f))
(let-values ([(line col pos) (port-next-location port)])
(unless (equal? (get-text 0 pos) hash-lang-language)
(set! hash-lang-language (get-text 0 pos))