comparison src/syntax.c @ 3087:ea0cb469490e

(Fforward_comment): Fix last change.
author Richard M. Stallman <rms@gnu.org>
date Tue, 25 May 1993 18:49:54 +0000
parents e414a29f8dc8
children ef7d99920f81
comparison
equal deleted inserted replaced
3086:e414a29f8dc8 3087:ea0cb469490e
575 register int from; 575 register int from;
576 register int stop; 576 register int stop;
577 register int c; 577 register int c;
578 register enum syntaxcode code; 578 register enum syntaxcode code;
579 int comstyle = 0; /* style of comment encountered */ 579 int comstyle = 0; /* style of comment encountered */
580 int found;
580 581
581 immediate_quit = 1; 582 immediate_quit = 1;
582 QUIT; 583 QUIT;
583 584
584 from = PT; 585 from = PT;
586 found = from;
585 587
586 while (count > 0) 588 while (count > 0)
587 { 589 {
590 found = from;
588 stop = ZV; 591 stop = ZV;
589 while (from < stop) 592 while (from < stop)
590 { 593 {
591 c = FETCH_CHAR (from); 594 c = FETCH_CHAR (from);
592 code = SYNTAX (c); 595 code = SYNTAX (c);
610 while (1) 613 while (1)
611 { 614 {
612 if (from == stop) 615 if (from == stop)
613 { 616 {
614 immediate_quit = 0; 617 immediate_quit = 0;
615 SET_PT (from); 618 SET_PT (found);
616 return Qnil; 619 return Qnil;
617 } 620 }
618 c = FETCH_CHAR (from); 621 c = FETCH_CHAR (from);
619 if (SYNTAX (c) == Sendcomment 622 if (SYNTAX (c) == Sendcomment
620 && SYNTAX_COMMENT_STYLE (c) == comstyle) 623 && SYNTAX_COMMENT_STYLE (c) == comstyle)
635 break; 638 break;
636 } 639 }
637 else if (code != Swhitespace) 640 else if (code != Swhitespace)
638 { 641 {
639 immediate_quit = 0; 642 immediate_quit = 0;
640 SET_PT (from); 643 SET_PT (found);
641 return Qnil; 644 return Qnil;
642 } 645 }
643 } 646 }
644 647
645 /* End of comment reached */ 648 /* End of comment reached */
646 count--; 649 count--;
647 } 650 }
648 651
649 while (count < 0) 652 while (count < 0)
650 { 653 {
654 found = from;
655
651 stop = BEGV; 656 stop = BEGV;
652 while (from > stop) 657 while (from > stop)
653 { 658 {
654 int quoted; 659 int quoted;
655 660
685 && SYNTAX_COMMENT_STYLE (c) == comstyle) 690 && SYNTAX_COMMENT_STYLE (c) == comstyle)
686 break; 691 break;
687 if (from == stop) 692 if (from == stop)
688 { 693 {
689 immediate_quit = 0; 694 immediate_quit = 0;
690 SET_PT (from); 695 SET_PT (found);
691 return Qnil; 696 return Qnil;
692 } 697 }
693 from--; 698 from--;
694 if (SYNTAX_COMSTART_SECOND (c) 699 if (SYNTAX_COMSTART_SECOND (c)
695 && SYNTAX_COMSTART_FIRST (FETCH_CHAR (from)) 700 && SYNTAX_COMSTART_FIRST (FETCH_CHAR (from))
809 } 814 }
810 } 815 }
811 else if (code != Swhitespace || quoted) 816 else if (code != Swhitespace || quoted)
812 { 817 {
813 immediate_quit = 0; 818 immediate_quit = 0;
814 SET_PT (from); 819 SET_PT (found);
815 return Qnil; 820 return Qnil;
816 } 821 }
817 } 822 }
818 823
819 count++; 824 count++;