comparison src/syntax.c @ 4953:7545290052bf

(Fforward_comment): On backward scan, exit inner loop after we reach beginning of a comment. Check the SYNTAX_COMMENT_STYLE of a one-character comment ender. (scan_lists): Check the SYNTAX_COMMENT_STYLE of a one-character comment ender.
author Richard M. Stallman <rms@gnu.org>
date Wed, 10 Nov 1993 19:45:50 +0000
parents 1fc792473491
children b589e807c0b3
comparison
equal deleted inserted replaced
4952:0c973730e476 4953:7545290052bf
603 from++; 603 from++;
604 comstyle = 0; 604 comstyle = 0;
605 if (from < stop && SYNTAX_COMSTART_FIRST (c) 605 if (from < stop && SYNTAX_COMSTART_FIRST (c)
606 && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from))) 606 && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from)))
607 { 607 {
608 /* we have encountered a comment start sequence and we 608 /* We have encountered a comment start sequence and we
609 are ignoring all text inside comments. we must record 609 are ignoring all text inside comments. We must record
610 the comment style this sequence begins so that later, 610 the comment style this sequence begins so that later,
611 only a comment end of the same style actually ends 611 only a comment end of the same style actually ends
612 the comment section */ 612 the comment section. */
613 code = Scomment; 613 code = Scomment;
614 comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from)); 614 comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from));
615 from++; 615 from++;
616 } 616 }
617 617
668 if (quoted) 668 if (quoted)
669 from--; 669 from--;
670 c = FETCH_CHAR (from); 670 c = FETCH_CHAR (from);
671 code = SYNTAX (c); 671 code = SYNTAX (c);
672 comstyle = 0; 672 comstyle = 0;
673 if (code == Sendcomment)
674 comstyle = SYNTAX_COMMENT_STYLE (c);
673 if (from > stop && SYNTAX_COMEND_SECOND (c) 675 if (from > stop && SYNTAX_COMEND_SECOND (c)
674 && SYNTAX_COMEND_FIRST (FETCH_CHAR (from - 1)) 676 && SYNTAX_COMEND_FIRST (FETCH_CHAR (from - 1))
675 && !char_quoted (from - 1)) 677 && !char_quoted (from - 1))
676 { 678 {
677 /* we must record the comment style encountered so that 679 /* We must record the comment style encountered so that
678 later, we can match only the proper comment begin 680 later, we can match only the proper comment begin
679 sequence of the same style */ 681 sequence of the same style. */
680 code = Sendcomment; 682 code = Sendcomment;
681 comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from - 1)); 683 comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from - 1));
682 from--; 684 from--;
683 } 685 }
684 686
817 else 819 else
818 /* We can't grok this as a comment; scan it normally. */ 820 /* We can't grok this as a comment; scan it normally. */
819 from = comment_end; 821 from = comment_end;
820 } 822 }
821 } 823 }
824 /* We have skipped one comment. */
825 break;
822 } 826 }
823 else if ((code != Swhitespace && code != Scomment) || quoted) 827 else if ((code != Swhitespace && code != Scomment) || quoted)
824 { 828 {
825 immediate_quit = 0; 829 immediate_quit = 0;
826 SET_PT (from + 1); 830 SET_PT (from + 1);
1011 from--; 1015 from--;
1012 if (quoted = char_quoted (from)) 1016 if (quoted = char_quoted (from))
1013 from--; 1017 from--;
1014 c = FETCH_CHAR (from); 1018 c = FETCH_CHAR (from);
1015 code = SYNTAX (c); 1019 code = SYNTAX (c);
1020 comstyle = 0;
1021 if (code == Sendcomment)
1022 comstyle = SYNTAX_COMMENT_STYLE (c);
1016 if (from > stop && SYNTAX_COMEND_SECOND (c) 1023 if (from > stop && SYNTAX_COMEND_SECOND (c)
1017 && SYNTAX_COMEND_FIRST (FETCH_CHAR (from - 1)) 1024 && SYNTAX_COMEND_FIRST (FETCH_CHAR (from - 1))
1018 && !char_quoted (from - 1) 1025 && !char_quoted (from - 1)
1019 && parse_sexp_ignore_comments) 1026 && parse_sexp_ignore_comments)
1020 { 1027 {