fix |#|# double closing comment

svn: r3240
This commit is contained in:
Matthew Flatt 2006-06-05 23:18:53 +00:00
parent d50969a663
commit e291edb2eb
2 changed files with 3 additions and 0 deletions

View File

@ -198,6 +198,7 @@
(test '(5) readstr "(#| #| #| #| hi |# |# |# |# 5)")
(test '(10 1) readstr "(10 #|z#|#f|#z|# 1)")
(test 17 readstr "#|z#|#f|#z|# 17")
(test 17 readstr "#|#|x|#|# 17")
(err/rt-test (readstr "#\\silly") exn:fail:read?)
(err/rt-test (readstr "#\\nully") exn:fail:read?)

View File

@ -1200,6 +1200,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
return NULL;
goto start_over;
}
ch = 0; /* So we don't count '#' toward an opening "#|" */
} else if ((ch2 == '#') && (ch == '|')) {
depth++;
ch = 0; /* So we don't count '|' toward a closing "|#" */
@ -3521,6 +3522,7 @@ skip_whitespace_comments(Scheme_Object *port, Scheme_Object *stxsrc,
if ((ch2 == blockc_2) && (ch == blockc_1)) {
if (!(depth--))
goto start_over;
ch = 0; /* So we don't count '#' toward an opening "#|" */
} else if ((ch2 == blockc_1) && (ch == blockc_2)) {
depth++;
ch = 0; /* So we don't count '|' toward a closing "|#" */