aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2004-10-27 20:15:05 +0000
committerStefan Monnier <[email protected]>2004-10-27 20:15:05 +0000
commitc5d4b96fe234bdf7eac5a751c23bf5f5a8e2a0b8 (patch)
tree1e564a7b2157f4baf58c105284eb5a5270727a8f
parent46119710895211b4bebc46e766ac56bda82706fb (diff)
(scan_sexps_forward): Prefer 2-char comment-starter over a 1-char one.
-rw-r--r--src/syntax.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 272e9cf1b1..8bfa62b49f 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2799,12 +2799,23 @@ do { prev_from = from; \
INC_FROM;
code = prev_from_syntax & 0xff;
- if (code == Scomment)
+ if (from < end
+ && SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax)
+ && (c1 = FETCH_CHAR (from_byte),
+ SYNTAX_COMSTART_SECOND (c1)))
+ /* Duplicate code to avoid a complex if-expression
+ which causes trouble for the SGI compiler. */
{
- state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (prev_from_syntax);
- state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ?
- 1 : -1);
+ /* Record the comment style we have entered so that only
+ the comment-end sequence of the same style actually
+ terminates the comment section. */
+ state.comstyle = SYNTAX_COMMENT_STYLE (c1);
+ comnested = SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax);
+ comnested = comnested || SYNTAX_COMMENT_NESTED (c1);
+ state.incomment = comnested ? 1 : -1;
state.comstr_start = prev_from;
+ INC_FROM;
+ code = Scomment;
}
else if (code == Scomment_fence)
{
@@ -2816,24 +2827,13 @@ do { prev_from = from; \
state.comstr_start = prev_from;
code = Scomment;
}
- else if (from < end)
- if (SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax))
- if (c1 = FETCH_CHAR (from_byte),
- SYNTAX_COMSTART_SECOND (c1))
- /* Duplicate code to avoid a complex if-expression
- which causes trouble for the SGI compiler. */
- {
- /* Record the comment style we have entered so that only
- the comment-end sequence of the same style actually
- terminates the comment section. */
- state.comstyle = SYNTAX_COMMENT_STYLE (c1);
- comnested = SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax);
- comnested = comnested || SYNTAX_COMMENT_NESTED (c1);
- state.incomment = comnested ? 1 : -1;
- state.comstr_start = prev_from;
- INC_FROM;
- code = Scomment;
- }
+ else if (code == Scomment)
+ {
+ state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (prev_from_syntax);
+ state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ?
+ 1 : -1);
+ state.comstr_start = prev_from;
+ }
if (SYNTAX_FLAGS_PREFIX (prev_from_syntax))
continue;