adjust the code that checks to see if a file is in the module language so that it uses

read-language, in the case that the simpler check (that just looks for "#lang") fails.

please include in 5.2
(cherry picked from commit abf722f19a)
This commit is contained in:
Robby Findler 2011-10-16 17:38:50 -05:00 committed by Eli Barzilay
parent 97a1f3cd5c
commit 728153bb07

View File

@ -58,7 +58,11 @@
(: looks-like-module? ((Instance Text%) -> Boolean))
(define (looks-like-module? text)
(or (looks-like-new-module-style? text)
(looks-like-old-module-style? text)))
(looks-like-old-module-style? text)
(with-handlers ((exn:fail? (λ (x) #f)))
(procedure?
(read-language (open-input-text-editor text 0 'end (λ (x) x) text #f)
(λ () #f))))))
(: looks-like-old-module-style? ((Instance Text%) -> Boolean))
(define (looks-like-old-module-style? text)