changeset 11020:a2773763e3ff

Remove requirement for PCRE to build doc-cache.
author Rik <octave@nomad.inbox5.com>
date Sat, 25 Sep 2010 02:34:01 -0700
parents 630dc1933fe6
children 0ee74d581c00
files doc/ChangeLog doc/interpreter/mk_doc_cache.m
diffstat 2 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,10 +1,16 @@
+2010-08-15  Rik <octave@nomad.inbox5.com>
+
+	* interpreter/mk_doc_cache.m: Remove requirement for PCRE to build
+	doc cache.  Correctly parse first sentence from docstrings with 
+	multiple @deftypefn lines.
+
 2010-09-15  John W. Eaton  <jwe@octave.org>
 
 	* interpreter/Makefile.am (EXTRA_DIST): Add images.awk to the list.
 
 2010-08-15  Rik <octave@nomad.inbox5.com>
 
-	* interpreter/matrx.txi: Add documentation for randi function.
+	* interpreter/matrix.txi: Add documentation for randi function.
 
 2010-08-13  Rik <octave@nomad.inbox5.com>
 
--- a/doc/interpreter/mk_doc_cache.m
+++ b/doc/interpreter/mk_doc_cache.m
@@ -45,8 +45,8 @@
 text = [text{:}, doc_delim];
 
 ## Modify Octave-specific macros before passing to makeinfo
-text = regexprep (text, "@seealso *{([^}]*)}", "See also: $1.");
-text = regexprep (text, "@nospell *{([^}]*)}", "$1");
+text = regexprep (text, "@seealso *\\{([^}]*)\\}", "See also: $1.");
+text = regexprep (text, "@nospell *\\{([^}]*)\\}", "$1");
 text = regexprep (text, "-\\*- texinfo -\\*-[ \t]*[\r\n]*", "");
 text = regexprep (text, "@", "@@");
 
@@ -97,15 +97,20 @@
     continue;
   endif
 
-  [s, e] = regexp (doc, "^ -- [^\r\n]*[\r\n]", "lineanchors");
+  tmp = doc;
+  found = 0;
+  do
+    [s, e] = regexp (tmp, "^ -- [^\r\n]*[\r\n]");
+    if (! isempty(s))
+      found = 1;
+      tmp = tmp(e+1:end);
+    endif
+  until (isempty (s))
 
-  if (isempty (s))
+  if (! found)
     continue;
   endif
 
-  start_of_first_sentence = e(end);
-
-  tmp = doc(start_of_first_sentence:end);
   end_of_first_sentence = regexp (tmp, '(\.|[\r\n][\r\n])', "once");
   if (isempty (end_of_first_sentence))
     end_of_first_sentence = length (tmp);