# HG changeset patch # User John W. Eaton # Date 1363029219 14400 # Node ID 8c17cd3704770beda3ff003e2e9d631a1727fbb7 # Parent 8cb65fd721649c0da5890b862e82e23da87e6593# Parent c8bf749fe6f88d054356add815cfc8c8563fe4bd maint: merge recent parser/lexer changes diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -2857,6 +2857,7 @@ AC_CONFIG_FILES([ Makefile doc/Makefile + doc/doxyhtml/Makefile doc/icons/Makefile doc/interpreter/Makefile doc/liboctave/Makefile diff --git a/doc/Makefile.am b/doc/Makefile.am --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -29,5 +29,5 @@ texinfo.tex \ texmf.cnf -SUBDIRS = icons interpreter liboctave refcard +SUBDIRS = doxyhtml icons interpreter liboctave refcard diff --git a/Doxyfile b/doc/doxyhtml/Doxygen.cfg rename from Doxyfile rename to doc/doxyhtml/Doxygen.cfg diff --git a/doc/doxyhtml/Makefile.am b/doc/doxyhtml/Makefile.am new file mode 100644 --- /dev/null +++ b/doc/doxyhtml/Makefile.am @@ -0,0 +1,32 @@ +# Makefile for Octave's doc/doxyhtml directory +# +# Copyright (C) 1993-2012 John W. Eaton +# +# This file is part of Octave. +# +# Octave is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# Octave is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with Octave; see the file COPYING. If not, see +# . + +include $(top_srcdir)/build-aux/common.mk + +doxyhtml: + cd ../..; doxygen doc/doxyhtml/Doxygen.cfg + +EXTRA_DIST = \ + Doxygen.cfg \ + Makefile.am \ + README + +maintainer-clean-local: + rm -rf `ls | $(GREP) -v Doxygen.cfg | $(GREP) -v Makefile.am | $(GREP) -v Makefile.in | $(GREP) -v README` diff --git a/doc/doxyhtml/README b/doc/doxyhtml/README new file mode 100644 --- /dev/null +++ b/doc/doxyhtml/README @@ -0,0 +1,11 @@ +This directory contains documentation in Doxygen format for +Octave's source code. It is not created by default. + +To produce Doxygen documentation use + +make doxyhtml + +Doxygen documentation can be helpful for developers of Octave, but is not +needed by users of Octave. In addition, the documentation requires +approximately 1.2GB of storage space. For these reasons it is not maintained +under version control nor distributed in tarballs. diff --git a/doc/interpreter/testfun.txi b/doc/interpreter/testfun.txi --- a/doc/interpreter/testfun.txi +++ b/doc/interpreter/testfun.txi @@ -41,8 +41,12 @@ Since @code{eval()} will stop at the first error it encounters, you must divide your tests up into blocks, with anything in a separate -block evaluated separately. Blocks are introduced by the keyword -@code{test} immediately following @samp{%!}. For example: +block evaluated separately. Blocks are introduced by valid keywords like +@code{test}, @code{function}, or @code{assert} immediately following @samp{%!}. +A block is defined by indentation as in Python. Lines beginning with +@samp{%!} are part of the preceeding block. + +For example: @example @group @@ -137,7 +141,7 @@ @end example @noindent -Review @file{config.h} or @code{octave_config_info ("DEFS")} to see some +Review @file{config.h} or @code{octave_config_info ("features")} to see some of the possible values to check. Sometimes during development there is a test that should work but is @@ -197,6 +201,24 @@ Note that all previous variables and values are lost when a new shared block is declared. +Remember that @code{%!function} begins a new block and that +@code{%!endfunction} ends this block. Be aware that until a new block +is started, lines starting with @samp{%!} will be discarded as comments. +The following is nearly identical to the example above, but does nothing. + +@example +@group +%!function @var{a} = fn (@var{b}) +%! @var{a} = 2*@var{b}; +%!endfunction +%! assert (fn(2), 4); +@end group +@end example + +@noindent +Because there is a space after @samp{%!} the @code{assert} statement does +not begin a new block and this line is treated as a comment. + Error and warning blocks are like test blocks, but they only succeed if the code generates an error. You can check the text of the error is correct using an optional regular expression @code{}. diff --git a/libinterp/parse-tree/oct-parse.in.yy b/libinterp/parse-tree/oct-parse.in.yy --- a/libinterp/parse-tree/oct-parse.in.yy +++ b/libinterp/parse-tree/oct-parse.in.yy @@ -3199,8 +3199,6 @@ if (ffile) { - bool eof; - // octave_parser constructor sets this for us. frame.protect_var (CURR_LEXER);