Mercurial > emacs
changeset 39976:fa2e20b1440c
(scan_c_file): Handle `new style' doc strings in comments [with `doc:'
keyword prefix].
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 16 Oct 2001 13:05:28 +0000 |
parents | d8c67e075687 |
children | 51c2b8f7aa5a |
files | lib-src/make-docfile.c |
diffstat | 1 files changed, 24 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/lib-src/make-docfile.c Tue Oct 16 09:25:44 2001 +0000 +++ b/lib-src/make-docfile.c Tue Oct 16 13:05:28 2001 +0000 @@ -401,6 +401,8 @@ c = '\n'; while (!feof (infile)) { + int doc_keyword = 0; + if (c != '\n' && c != '\r') { c = getc (infile); @@ -467,8 +469,9 @@ continue; 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) commas = 5; @@ -507,7 +510,7 @@ goto eof; c = getc (infile); } - + while (c == ' ' || c == '\n' || c == '\r' || c == '\t') c = getc (infile); @@ -518,9 +521,18 @@ c = getc (infile); if (c == ',') { - c = getc (infile); - while (c == ' ' || c == '\n' || c == '\r' || c == '\t') - c = getc (infile); + c = getc (infile); + while (c == ' ' || c == '\n' || c == '\r' || c == '\t') + 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 == '"' @@ -544,13 +556,16 @@ won't give the names of the arguments, so we shouldn't bother trying to find them. - Old: DEFUN (..., "DOC") (args) - New: DEFUN (..., /\* DOC *\/ (args)) */ + Various doc-string styles: + 0: DEFUN (..., "DOC") (args) [!comment] + 1: DEFUN (..., /\* DOC *\/ (args)) [comment && !doc_keyword] + 2: DEFUN (..., doc: /\* DOC *\/) (args) [comment && doc_keyword] + */ if (defunflag && maxargs != -1) { char argbuf[1024], *p = argbuf; - if (!comment) + if (!comment || doc_keyword) while (c != ')') { if (c < 0)