Mercurial > emacs
comparison src/syntax.c @ 9475:c15caadae3c4
(scan_sexps_forward): At startincomment,
do notice a 2-char comment ender that straddles FROM.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 12 Oct 1994 08:24:47 +0000 |
parents | 0b9c70f56cf8 |
children | f918fd077a9f |
comparison
equal
deleted
inserted
replaced
9474:9791aad17859 | 9475:c15caadae3c4 |
---|---|
1509 } | 1509 } |
1510 symdone: | 1510 symdone: |
1511 curlevel->prev = curlevel->last; | 1511 curlevel->prev = curlevel->last; |
1512 break; | 1512 break; |
1513 | 1513 |
1514 startincomment: | |
1515 if (commentstop) | |
1516 goto done; | |
1517 if (from != BEGV) | |
1518 { | |
1519 /* Enter the loop in the middle so that we find | |
1520 a 2-char comment ender if we start in the middle of it. */ | |
1521 prev = FETCH_CHAR (from - 1); | |
1522 goto startincomment_1; | |
1523 } | |
1524 /* At beginning of buffer, enter the loop the ordinary way. */ | |
1525 | |
1514 case Scomment: | 1526 case Scomment: |
1515 state.incomment = 1; | 1527 state.incomment = 1; |
1516 startincomment: | |
1517 if (commentstop) | 1528 if (commentstop) |
1518 goto done; | 1529 goto done; |
1519 while (1) | 1530 while (1) |
1520 { | 1531 { |
1521 if (from == end) goto done; | 1532 if (from == end) goto done; |
1525 /* Only terminate the comment section if the endcomment | 1536 /* Only terminate the comment section if the endcomment |
1526 of the same style as the start sequence has been | 1537 of the same style as the start sequence has been |
1527 encountered. */ | 1538 encountered. */ |
1528 break; | 1539 break; |
1529 from++; | 1540 from++; |
1541 startincomment_1: | |
1530 if (from < end && SYNTAX_COMEND_FIRST (prev) | 1542 if (from < end && SYNTAX_COMEND_FIRST (prev) |
1531 && SYNTAX_COMEND_SECOND (FETCH_CHAR (from)) | 1543 && SYNTAX_COMEND_SECOND (FETCH_CHAR (from)) |
1532 && SYNTAX_COMMENT_STYLE (prev) == state.comstyle) | 1544 && SYNTAX_COMMENT_STYLE (prev) == state.comstyle) |
1533 /* Only terminate the comment section if the end-comment | 1545 /* Only terminate the comment section if the end-comment |
1534 sequence of the same style as the start sequence has | 1546 sequence of the same style as the start sequence has |