Fix for auto-language.ss: if first line of program contains a snip, read-line fails and needs to be handled.
svn: r10074
This commit is contained in:
parent
a5049573a3
commit
516231c1f9
|
@ -55,6 +55,8 @@
|
||||||
|
|
||||||
(define (looks-like-new-module-style? text)
|
(define (looks-like-new-module-style? text)
|
||||||
(let* ([tp (open-input-text-editor text 0 'end (lambda (s) s) text #t)]
|
(let* ([tp (open-input-text-editor text 0 'end (lambda (s) s) text #t)]
|
||||||
[l1 (read-line tp)])
|
[l1 (with-handlers ([exn:fail? (lambda (exn) eof)])
|
||||||
|
;; If tp contains a snip, read-line fails.
|
||||||
|
(read-line tp))])
|
||||||
(and (string? l1)
|
(and (string? l1)
|
||||||
(regexp-match #rx"#lang .*$" l1)))))
|
(regexp-match #rx"#lang .*$" l1)))))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user