Mercurial > emacs
comparison src/syntax.c @ 6142:2dbc79d01191
(Fforward_comment): Do the right thing at eob.
| author | Karl Heuer <kwzh@gnu.org> |
|---|---|
| date | Wed, 02 Mar 1994 05:31:15 +0000 |
| parents | 5b77773166f7 |
| children | cd81dba38a49 |
comparison
equal
deleted
inserted
replaced
| 6141:fefa088fc7f9 | 6142:2dbc79d01191 |
|---|---|
| 597 from = PT; | 597 from = PT; |
| 598 | 598 |
| 599 while (count1 > 0) | 599 while (count1 > 0) |
| 600 { | 600 { |
| 601 stop = ZV; | 601 stop = ZV; |
| 602 while (from < stop) | 602 do |
| 603 { | 603 { |
| 604 if (from == stop) | |
| 605 { | |
| 606 SET_PT (from); | |
| 607 return Qnil; | |
| 608 } | |
| 604 c = FETCH_CHAR (from); | 609 c = FETCH_CHAR (from); |
| 605 code = SYNTAX (c); | 610 code = SYNTAX (c); |
| 606 from++; | 611 from++; |
| 607 comstyle = 0; | 612 comstyle = 0; |
| 608 if (from < stop && SYNTAX_COMSTART_FIRST (c) | 613 if (from < stop && SYNTAX_COMSTART_FIRST (c) |
| 615 the comment section. */ | 620 the comment section. */ |
| 616 code = Scomment; | 621 code = Scomment; |
| 617 comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from)); | 622 comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from)); |
| 618 from++; | 623 from++; |
| 619 } | 624 } |
| 620 | 625 } |
| 621 if (code == Scomment) | 626 while (code == Swhitespace || code == Sendcomment); |
| 622 { | 627 if (code != Scomment) |
| 623 while (1) | 628 { |
| 624 { | 629 immediate_quit = 0; |
| 625 if (from == stop) | 630 SET_PT (from - 1); |
| 626 { | 631 return Qnil; |
| 627 immediate_quit = 0; | 632 } |
| 628 SET_PT (from); | 633 /* We're at the start of a comment. */ |
| 629 return Qnil; | 634 while (1) |
| 630 } | 635 { |
| 631 c = FETCH_CHAR (from); | 636 if (from == stop) |
| 632 if (SYNTAX (c) == Sendcomment | |
| 633 && SYNTAX_COMMENT_STYLE (c) == comstyle) | |
| 634 /* we have encountered a comment end of the same style | |
| 635 as the comment sequence which began this comment | |
| 636 section */ | |
| 637 break; | |
| 638 from++; | |
| 639 if (from < stop && SYNTAX_COMEND_FIRST (c) | |
| 640 && SYNTAX_COMEND_SECOND (FETCH_CHAR (from)) | |
| 641 && SYNTAX_COMMENT_STYLE (c) == comstyle) | |
| 642 /* we have encountered a comment end of the same style | |
| 643 as the comment sequence which began this comment | |
| 644 section */ | |
| 645 { from++; break; } | |
| 646 } | |
| 647 /* We have skipped one comment. */ | |
| 648 break; | |
| 649 } | |
| 650 else if (code != Swhitespace && code != Sendcomment) | |
| 651 { | 637 { |
| 652 immediate_quit = 0; | 638 immediate_quit = 0; |
| 653 SET_PT (from - 1); | 639 SET_PT (from); |
| 654 return Qnil; | 640 return Qnil; |
| 655 } | 641 } |
| 642 c = FETCH_CHAR (from); | |
| 643 if (SYNTAX (c) == Sendcomment | |
| 644 && SYNTAX_COMMENT_STYLE (c) == comstyle) | |
| 645 /* we have encountered a comment end of the same style | |
| 646 as the comment sequence which began this comment | |
| 647 section */ | |
| 648 break; | |
| 649 from++; | |
| 650 if (from < stop && SYNTAX_COMEND_FIRST (c) | |
| 651 && SYNTAX_COMEND_SECOND (FETCH_CHAR (from)) | |
| 652 && SYNTAX_COMMENT_STYLE (c) == comstyle) | |
| 653 /* we have encountered a comment end of the same style | |
| 654 as the comment sequence which began this comment | |
| 655 section */ | |
| 656 { from++; break; } | |
| 656 } | 657 } |
| 657 | 658 /* We have skipped one comment. */ |
| 658 /* End of comment reached */ | |
| 659 count1--; | 659 count1--; |
| 660 } | 660 } |
| 661 | 661 |
| 662 while (count1 < 0) | 662 while (count1 < 0) |
| 663 { | 663 { |
