1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

(scan_c_file): Handle new style' doc strings in comments [with doc:'

keyword prefix].
This commit is contained in:
Miles Bader 2001-10-16 13:05:28 +00:00
parent 3ddf952f8b
commit a5979c0e89

View file

@ -401,6 +401,8 @@ scan_c_file (filename, mode)
c = '\n'; c = '\n';
while (!feof (infile)) while (!feof (infile))
{ {
int doc_keyword = 0;
if (c != '\n' && c != '\r') if (c != '\n' && c != '\r')
{ {
c = getc (infile); c = getc (infile);
@ -467,8 +469,9 @@ scan_c_file (filename, mode)
continue; continue;
c = read_c_string_or_comment (infile, -1, 0); c = read_c_string_or_comment (infile, -1, 0);
/* DEFVAR_LISP ("name", addr /\* doc *\/) /* DEFVAR_LISP ("name", addr, "doc")
DEFVAR_LISP ("name", addr, doc) */ DEFVAR_LISP ("name", addr /\* doc *\/)
DEFVAR_LISP ("name", addr, doc: /\* doc *\/) */
if (defunflag) if (defunflag)
commas = 5; commas = 5;
@ -507,7 +510,7 @@ scan_c_file (filename, mode)
goto eof; goto eof;
c = getc (infile); c = getc (infile);
} }
while (c == ' ' || c == '\n' || c == '\r' || c == '\t') while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
c = getc (infile); c = getc (infile);
@ -518,9 +521,18 @@ scan_c_file (filename, mode)
c = getc (infile); c = getc (infile);
if (c == ',') if (c == ',')
{ {
c = getc (infile); c = getc (infile);
while (c == ' ' || c == '\n' || c == '\r' || c == '\t') while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
c = getc (infile); c = getc (infile);
while ((c >= 'a' && c <= 'z') || (c >= 'Z' && c <= 'Z'))
c = getc (infile);
if (c == ':')
{
doc_keyword = 1;
c = getc (infile);
while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
c = getc (infile);
}
} }
if (c == '"' if (c == '"'
@ -544,13 +556,16 @@ scan_c_file (filename, mode)
won't give the names of the arguments, so we shouldn't bother won't give the names of the arguments, so we shouldn't bother
trying to find them. trying to find them.
Old: DEFUN (..., "DOC") (args) Various doc-string styles:
New: DEFUN (..., /\* DOC *\/ (args)) */ 0: DEFUN (..., "DOC") (args) [!comment]
1: DEFUN (..., /\* DOC *\/ (args)) [comment && !doc_keyword]
2: DEFUN (..., doc: /\* DOC *\/) (args) [comment && doc_keyword]
*/
if (defunflag && maxargs != -1) if (defunflag && maxargs != -1)
{ {
char argbuf[1024], *p = argbuf; char argbuf[1024], *p = argbuf;
if (!comment) if (!comment || doc_keyword)
while (c != ')') while (c != ')')
{ {
if (c < 0) if (c < 0)