Mercurial > octave
diff libinterp/octave-value/cdef-utils.cc @ 26794:287eba9ed14b
refactor predicates for classdef methods/constructors
* ov-fcn.h (octave_function::is_classdef_method,
octave_function::is_legacy_method,
octave_function::is_legacy_constructor): New virtual functions.
(octave_function::is_class_method): No longer virtual.
Return true if either is_classdef_method or is_legacy_method is true.
(octave_function::is_class_constructor): Likewise, for constructors.
* ov-usr-fcn.h, ov-usr-fcn.cc: Define separate functions for marking
and checking for legacy and classdef functions.
(octave_user_function::mark_as_legacy_constructor, ):
(octave_user_function::class_method_type): Rename from class_ctor_type.
(octave_user_function)::method_type_str): New function.
* oct-parse.yy (base_parser::start_function): Distinguish between
legacy and classdef methods and constructors when marking function
types.
* cdef-untils.cc (make_function_of_class): Mark function as classdef
constructor or method.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 25 Feb 2019 20:10:06 +0000 |
parents | 568c2ab2782d |
children | 392b14b0c085 |
line wrap: on
line diff
--- a/libinterp/octave-value/cdef-utils.cc Mon Feb 25 14:32:35 2019 +0000 +++ b/libinterp/octave-value/cdef-utils.cc Mon Feb 25 20:10:06 2019 +0000 @@ -61,12 +61,9 @@ if (uf) { if (get_base_name (class_name) == uf->name ()) - { - uf->mark_as_class_constructor (); - uf->mark_as_classdef_constructor (); - } + uf->mark_as_classdef_constructor (); else - uf->mark_as_class_method (); + uf->mark_as_classdef_method (); } }