fixed longstanding paren matching bug

original commit: e6181472fad95c9a7e51d4f5922f0c2e62265080
This commit is contained in:
Robby Findler 2001-09-24 19:56:35 +00:00
parent 0c136456f6
commit 769a63d8fb

View File

@ -135,21 +135,22 @@
(ormap
(lambda (comment-start)
(let loop ([f (find-string comment-start 'backward position)])
(if f
(cond
[(= (position-line f) line)
(let ([f-1 (- f 2)]) ;; -1 to go back one, -1 to be before char
(cond
[(< f-1 0)
#t]
[(and (= (position-line f-1) line)
(not (char=? (get-character f-1) #\\ )))
#t]
[else
(loop (find-string comment-start 'backward f-1))]))]
[else
#f])
#f)))
(cond
[(not f)
#f]
[(= (position-line f) line)
(let ([f-1 (- f 2)]) ;; -1 to go back one, -1 to be before char
(cond
[(< f-1 0)
#t]
[(not (= (position-line f-1) line))
#t]
[(not (char=? (get-character f-1) #\\ ))
#t]
[else
(loop (find-string comment-start 'backward f-1))]))]
[else
#f])))
(scheme-paren:get-comments))))
@ -247,8 +248,7 @@
(let ([semi-pos (find-string ";" 'backward paren-pos)])
(cond
[(or (not semi-pos)
(< semi-pos (paragraph-start-position
(position-paragraph paren-pos))))
(semi-pos . < . (paragraph-start-position (position-paragraph paren-pos))))
paren-pos]
[else (loop (- semi-pos 1))]))]))))