From 097fb4be8869babb8d6c90b1f13ca21192f5dae6 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Wed, 21 Feb 2007 00:01:41 +0000 Subject: [PATCH] fixed another bug in the language recognization code svn: r5651 --- collects/drscheme/private/unit.ss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/collects/drscheme/private/unit.ss b/collects/drscheme/private/unit.ss index 5d0761cabb..6bb1c4a026 100644 --- a/collects/drscheme/private/unit.ss +++ b/collects/drscheme/private/unit.ss @@ -463,7 +463,9 @@ module browser threading seems wrong. (with-handlers ((exn:fail:read? void)) (let ([found-language? #f]) (let* ([tp (open-input-text-editor this)] - [l (read-line tp)]) + [l (with-handlers ([exn:fail:contract? (λ (x) eof)]) + ;; catch exceptions that occur with GUI syntax in the beginning of the buffer + (read-line tp))]) (unless (eof-object? l) (unless (regexp-match #rx"[;#]" l) ;; no comments on the first line (when (equal? #\) (get-character (- (last-position) 1)))