aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-11-10 19:45:50 +0000
committerRichard M. Stallman1993-11-10 19:45:50 +0000
commit7fc8191e8567ec0a5709525b291d3901128c4f19 (patch)
tree1ba39161d3bf6e0c6a32b177613102073b5e0bb0 /src
parenta00d55893e4e19eec3eedf3444923afd02d0202c (diff)
downloademacs-7fc8191e8567ec0a5709525b291d3901128c4f19.tar.gz
emacs-7fc8191e8567ec0a5709525b291d3901128c4f19.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/syntax.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/syntax.c b/src/syntax.c
index fdee86cf44d..50a7c9c250d 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -605,11 +605,11 @@ between them, return t; otherwise return nil.")
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++;
@@ -670,13 +670,15 @@ between them, return t; otherwise return nil.")
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--;
@@ -819,6 +821,8 @@ between them, return t; otherwise return nil.")
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 {
@@ -1013,6 +1017,9 @@ scan_lists (from, count, depth, sexpflag)
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)