aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2000-06-20 22:49:34 +0000
committerStefan Monnier2000-06-20 22:49:34 +0000
commitd355bd8ae6a26c50277d2fb24aba38a0b657dcbb (patch)
tree51434413c89c4309ea34de5fea6e92e7ba869d44 /src
parente6365855ebf0afae2ced986eb705aa515b62fa2a (diff)
downloademacs-d355bd8ae6a26c50277d2fb24aba38a0b657dcbb.tar.gz
emacs-d355bd8ae6a26c50277d2fb24aba38a0b657dcbb.zip
(scan_sexps_forward):
Check the comstyle of single-char comment-starters. Clarify control-flow around the Scomment case.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/syntax.c18
2 files changed, 10 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d2fb087ce16..0947598060b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -5,11 +5,13 @@
5 Check the comstyle of single-char comment-starters. 5 Check the comstyle of single-char comment-starters.
6 (scan_sexps_forward): Don't try to recognize `half comment-enders' if 6 (scan_sexps_forward): Don't try to recognize `half comment-enders' if
7 we're just at the beginning of the comment (f.ex with (*) ... (*)). 7 we're just at the beginning of the comment (f.ex with (*) ... (*)).
8 Check the comstyle of single-char comment-starters.
9 Clarify control-flow around the Scomment case.
8 10
92000-06-20 Dave Love <fx@gnu.org> 112000-06-20 Dave Love <fx@gnu.org>
10 12
11 * fns.c (make_hash_table, maybe_resize_hash_table): Cast arg of 13 * fns.c (make_hash_table, maybe_resize_hash_table):
12 next_almost_prime. 14 Cast arg of next_almost_prime.
13 15
14 * tparam.c [emacs]: Include lisp.h. 16 * tparam.c [emacs]: Include lisp.h.
15 17
@@ -60,8 +62,7 @@
60 62
61 * m/ibmrt-aix.h: Don't declare HAVE_GETTIMEOFDAY, HAVE_VFORK. 63 * m/ibmrt-aix.h: Don't declare HAVE_GETTIMEOFDAY, HAVE_VFORK.
62 64
63 * m/ibmrs6000.h, m/ibmps2-aix.h, m/dpx2.h: Don't declare 65 * m/ibmrs6000.h, m/ibmps2-aix.h, m/dpx2.h: Don't declare HAVE_GETWD.
64 HAVE_GETWD.
65 66
66 * m/alpha.h: Don't declare xmalloc, xrealloc. 67 * m/alpha.h: Don't declare xmalloc, xrealloc.
67 68
diff --git a/src/syntax.c b/src/syntax.c
index eedec27d549..656d567b1a5 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2567,6 +2567,7 @@ do { prev_from = from; \
2567 2567
2568 if (code == Scomment) 2568 if (code == Scomment)
2569 { 2569 {
2570 state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (prev_from_syntax);
2570 state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ? 2571 state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ?
2571 1 : -1); 2572 1 : -1);
2572 state.comstr_start = prev_from; 2573 state.comstr_start = prev_from;
@@ -2642,22 +2643,13 @@ do { prev_from = from; \
2642 curlevel->prev = curlevel->last; 2643 curlevel->prev = curlevel->last;
2643 break; 2644 break;
2644 2645
2645 startincomment:
2646 if (commentstop == 1)
2647 goto done;
2648 goto commentloop;
2649
2650 case Scomment: 2646 case Scomment:
2651 if (! state.incomment)
2652 abort ();
2653 if (commentstop || boundary_stop) goto done; 2647 if (commentstop || boundary_stop) goto done;
2654 commentloop: 2648 startincomment:
2655 /* The (from == BEGV) test is to enter the loop in the middle so 2649 /* The (from == BEGV) test was to enter the loop in the middle so
2656 that we find a 2-char comment ender even if we start in the 2650 that we find a 2-char comment ender even if we start in the
2657 middle of it. We don't want to do that if we're just at the 2651 middle of it. We don't want to do that if we're just at the
2658 beginning of the comment (think of (*) ... (*)). 2652 beginning of the comment (think of (*) ... (*)). */
2659 Actually, the current code still doesn't handle such cases right
2660 when the comment style allows nesting. */
2661 found = forw_comment (from, from_byte, end, 2653 found = forw_comment (from, from_byte, end,
2662 state.incomment, state.comstyle, 2654 state.incomment, state.comstyle,
2663 (from == BEGV || from < state.comstr_start + 3) 2655 (from == BEGV || from < state.comstr_start + 3)
@@ -2668,7 +2660,7 @@ do { prev_from = from; \
2668 Luckily, the `done' doesn't use them and the INC_FROM 2660 Luckily, the `done' doesn't use them and the INC_FROM
2669 sets them to a sane value without looking at them. */ 2661 sets them to a sane value without looking at them. */
2670 if (!found) goto done; 2662 if (!found) goto done;
2671 INC_FROM; 2663 INC_FROM;
2672 state.incomment = 0; 2664 state.incomment = 0;
2673 state.comstyle = 0; /* reset the comment style */ 2665 state.comstyle = 0; /* reset the comment style */
2674 if (boundary_stop) goto done; 2666 if (boundary_stop) goto done;