summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-17 04:09:15 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-17 04:09:15 +0000
commitfc986e7f19a7dd43f369df6c0d86a5e01b795448 (patch)
tree566a29442a1ae4a98eb4e82aea572afcdecd701f /src/syntax.c
parentfa2f1d94eb363899fd15b737501b5b07796fa52c (diff)
downloademacs-fc986e7f19a7dd43f369df6c0d86a5e01b795448.tar.gz
(scan_lists, Fforward_comment): #if 0 the code
to treat two-character comment enders with a special shortcut. (scan_sexps_forward): Set state.comstart to before the comment starter, not after.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 89e5f753ba5..67a14f8923c 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -684,6 +684,7 @@ between them, return t; otherwise return nil.")
if (code == Sendcomment && !quoted)
{
+#if 0
if (code != SYNTAX (c))
/* For a two-char comment ender, we can assume
it does end a comment. So scan back in a simple way. */
@@ -709,6 +710,7 @@ between them, return t; otherwise return nil.")
}
break;
}
+#endif /* 0 */
/* Look back, counting the parity of string-quotes,
and recording the comment-starters seen.
@@ -1076,6 +1078,7 @@ scan_lists (from, count, depth, sexpflag)
case Sendcomment:
if (!parse_sexp_ignore_comments)
break;
+#if 0
if (code != SYNTAX (c))
/* For a two-char comment ender, we can assume
it does end a comment. So scan back in a simple way. */
@@ -1096,6 +1099,7 @@ scan_lists (from, count, depth, sexpflag)
}
break;
}
+#endif /* 0 */
/* Look back, counting the parity of string-quotes,
and recording the comment-starters seen.
@@ -1410,14 +1414,18 @@ scan_sexps_forward (stateptr, from, end, targetdepth,
{
code = SYNTAX (FETCH_CHAR (from));
from++;
- if (from < end && SYNTAX_COMSTART_FIRST (FETCH_CHAR (from - 1))
- && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from)))
+ if (code == Scomment)
+ state.comstart = from-1;
+
+ else if (from < end && SYNTAX_COMSTART_FIRST (FETCH_CHAR (from - 1))
+ && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from)))
{
/* Record the comment style we have entered so that only
the comment-end sequence of the same style actually
terminates the comment section. */
code = Scomment;
state.comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from));
+ state.comstart = from-1;
from++;
}
@@ -1471,7 +1479,6 @@ scan_sexps_forward (stateptr, from, end, targetdepth,
case Scomment:
state.incomment = 1;
- state.comstart = from;
startincomment:
if (commentstop)
goto done;