Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ea315ed6
Commit
ea315ed6
authored
May 31, 1997
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(back_comment): Detect 2-char comment starts properly.
New arg COMSTYLE; callers changed.
parent
5509c7ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
src/syntax.c
src/syntax.c
+15
-9
No files found.
src/syntax.c
View file @
ea315ed6
...
...
@@ -341,8 +341,8 @@ find_defun_start (pos)
the search was not successful). */
static
int
back_comment
(
from
,
stop
)
int
from
,
stop
;
back_comment
(
from
,
stop
,
comstyle
)
int
from
,
stop
,
comstyle
;
{
/* Look back, counting the parity of string-quotes,
and recording the comment-starters seen.
...
...
@@ -361,7 +361,7 @@ back_comment (from, stop)
int
comstart_parity
=
0
;
int
scanstart
=
from
-
1
;
register
enum
syntaxcode
code
;
int
c
,
comstyle
=
0
;
int
c
;
/* At beginning of range to scan, we're outside of strings;
that determines quote parity to the comment-end. */
...
...
@@ -388,10 +388,16 @@ back_comment (from, stop)
/* If this char starts a 2-char comment start sequence,
treat it like a 1-char comment starter. */
if
(
from
<
scanstart
&&
SYNTAX_COMSTART_FIRST
(
c
)
&&
SYNTAX_COMSTART_SECOND
(
FETCH_CHAR
(
from
+
1
))
&&
comstyle
==
SYNTAX_COMMENT_STYLE
(
FETCH_CHAR
(
from
+
1
)))
code
=
Scomment
;
if
(
from
<
scanstart
&&
SYNTAX_COMSTART_SECOND
(
c
)
&&
SYNTAX_COMSTART_FIRST
(
FETCH_CHAR
(
from
-
1
))
&&
comstyle
==
SYNTAX_COMMENT_STYLE
(
c
))
{
code
=
Scomment
;
DEC_POS
(
from
);
/* This is apparently the best we can do: */
UPDATE_SYNTAX_TABLE_BACKWARD
(
from
);
c
=
FETCH_CHAR
(
from
);
}
/* Ignore escaped characters. */
if
(
char_quoted
(
from
))
...
...
@@ -1585,7 +1591,7 @@ between them, return t; otherwise return nil.")
break;
}
#endif /* 0 */
found
=
back_comment
(
from
,
stop
);
found
=
back_comment
(
from
,
stop
,
comstyle
);
if
(
found
!=
-
1
)
from
=
found
;
#if 0
/* Look back, counting the parity of string-quotes,
...
...
@@ -2032,7 +2038,7 @@ scan_lists (from, count, depth, sexpflag)
break;
}
#endif /* 0 */
found
=
back_comment
(
from
,
stop
);
found
=
back_comment
(
from
,
stop
,
comstyle
);
if
(
found
!=
-
1
)
from
=
found
;
#if 0
/* Look back, counting the parity of string-quotes,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment