changeset 24073:1c2f34a2c60d

* ov-classdef.h (make_meta_class): Document.
author Piotr Held <pjheld@gmail.com>
date Thu, 21 Sep 2017 11:39:58 -0700
parents dbbc7e5e2294
children ff973f3e17e3
files libinterp/octave-value/ov-classdef.h
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-classdef.h	Thu Sep 21 14:04:22 2017 -0400
+++ b/libinterp/octave-value/ov-classdef.h	Thu Sep 21 11:39:58 2017 -0700
@@ -885,6 +885,26 @@
   void delete_object (cdef_object obj)
   { get_rep ()->delete_object (obj); }
 
+  //! Analyze the tree_classdef tree and transform it to a cdef_class
+  //!
+  //! <b>All attribute validation should occur here.</b>
+  //!
+  //! Classdef attribute values can be given in the form of
+  //! expressions.  These expressions must be evaluated before
+  //! assigning them as attribute values.  Evaluating them as they are
+  //! parsed causes trouble with possible recusion in the parser so we
+  //! do it here.  For example
+  //!
+  //! @code
+  //! classdef recursion_class
+  //!   methods (Access = ?recursion_class)
+  //!   endmethods
+  //! endclassdef
+  //! @endcode
+  //!
+  //! will fail because each attempt to compute the metaclass of
+  //! recursion_class will cause recursion_class to be parsed again.
+
   static cdef_class
   make_meta_class (octave::interpreter& interp, octave::tree_classdef *t,
                    bool is_at_folder = false);