aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorMiles Bader2001-10-16 13:05:28 +0000
committerMiles Bader2001-10-16 13:05:28 +0000
commita5979c0e89d170b418e5db4535b6bf6db8fd1514 (patch)
tree720bdee6894647e187f6f44efeef854a9838e2e5 /lib-src
parent3ddf952f8bb765cee261493f2a3287dc49ef4a8b (diff)
downloademacs-a5979c0e89d170b418e5db4535b6bf6db8fd1514.tar.gz
emacs-a5979c0e89d170b418e5db4535b6bf6db8fd1514.zip
(scan_c_file): Handle `new style' doc strings in comments [with `doc:'
keyword prefix].
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/make-docfile.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index fb371db710f..cfa7878d6f5 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -401,6 +401,8 @@ scan_c_file (filename, mode)
401 c = '\n'; 401 c = '\n';
402 while (!feof (infile)) 402 while (!feof (infile))
403 { 403 {
404 int doc_keyword = 0;
405
404 if (c != '\n' && c != '\r') 406 if (c != '\n' && c != '\r')
405 { 407 {
406 c = getc (infile); 408 c = getc (infile);
@@ -467,8 +469,9 @@ scan_c_file (filename, mode)
467 continue; 469 continue;
468 c = read_c_string_or_comment (infile, -1, 0); 470 c = read_c_string_or_comment (infile, -1, 0);
469 471
470 /* DEFVAR_LISP ("name", addr /\* doc *\/) 472 /* DEFVAR_LISP ("name", addr, "doc")
471 DEFVAR_LISP ("name", addr, doc) */ 473 DEFVAR_LISP ("name", addr /\* doc *\/)
474 DEFVAR_LISP ("name", addr, doc: /\* doc *\/) */
472 475
473 if (defunflag) 476 if (defunflag)
474 commas = 5; 477 commas = 5;
@@ -507,7 +510,7 @@ scan_c_file (filename, mode)
507 goto eof; 510 goto eof;
508 c = getc (infile); 511 c = getc (infile);
509 } 512 }
510 513
511 while (c == ' ' || c == '\n' || c == '\r' || c == '\t') 514 while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
512 c = getc (infile); 515 c = getc (infile);
513 516
@@ -518,9 +521,18 @@ scan_c_file (filename, mode)
518 c = getc (infile); 521 c = getc (infile);
519 if (c == ',') 522 if (c == ',')
520 { 523 {
521 c = getc (infile); 524 c = getc (infile);
522 while (c == ' ' || c == '\n' || c == '\r' || c == '\t') 525 while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
523 c = getc (infile); 526 c = getc (infile);
527 while ((c >= 'a' && c <= 'z') || (c >= 'Z' && c <= 'Z'))
528 c = getc (infile);
529 if (c == ':')
530 {
531 doc_keyword = 1;
532 c = getc (infile);
533 while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
534 c = getc (infile);
535 }
524 } 536 }
525 537
526 if (c == '"' 538 if (c == '"'
@@ -544,13 +556,16 @@ scan_c_file (filename, mode)
544 won't give the names of the arguments, so we shouldn't bother 556 won't give the names of the arguments, so we shouldn't bother
545 trying to find them. 557 trying to find them.
546 558
547 Old: DEFUN (..., "DOC") (args) 559 Various doc-string styles:
548 New: DEFUN (..., /\* DOC *\/ (args)) */ 560 0: DEFUN (..., "DOC") (args) [!comment]
561 1: DEFUN (..., /\* DOC *\/ (args)) [comment && !doc_keyword]
562 2: DEFUN (..., doc: /\* DOC *\/) (args) [comment && doc_keyword]
563 */
549 if (defunflag && maxargs != -1) 564 if (defunflag && maxargs != -1)
550 { 565 {
551 char argbuf[1024], *p = argbuf; 566 char argbuf[1024], *p = argbuf;
552 567
553 if (!comment) 568 if (!comment || doc_keyword)
554 while (c != ')') 569 while (c != ')')
555 { 570 {
556 if (c < 0) 571 if (c < 0)