Mercurial > octave
diff libinterp/parse-tree/pt-classdef.h @ 30259:03ff3f1020cf
store file name in classdef class object
* ov-classdef.h, ov-classdef.cc (octave_classdef_meta::file_name):
New function.
* pt-classdef.h, pt-classdef.cc (tree_classdef::m_file_name):
New data member.
(tree_classdef::tree_classdef): Also accept file name in constructor
argument list.
(tree_classdef::file_name): New function.
* oct-parse.yy (base_parser::make_classdef): Store full file name in
created tree_classdef object.
* cdef-class.h, cdef-class.cc (cdef_class_rep::file_name,
cdef_class::file_name): New functions.
(cdef_class:make_meta_class): Store file name in returned class object.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 30 Oct 2021 09:45:23 -0400 |
parents | 255fa40977c0 |
children | 796f54d4ddbf |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-classdef.h Sat Oct 30 13:03:02 2021 +0200 +++ b/libinterp/parse-tree/pt-classdef.h Sat Oct 30 09:45:23 2021 -0400 @@ -768,10 +768,10 @@ tree_classdef_superclass_list *sc, tree_classdef_body *b, comment_list *lc, comment_list *tc, const std::string& pn = "", - int l = -1, int c = -1) + const std::string& fn = "", int l = -1, int c = -1) : tree_command (l, c), m_scope (scope), m_attr_list (a), m_id (i), m_supclass_list (sc), m_element_list (b), m_lead_comm (lc), - m_trail_comm (tc), m_pack_name (pn) + m_trail_comm (tc), m_pack_name (pn), m_file_name (fn) { } // No copying! @@ -807,6 +807,8 @@ std::string package_name (void) const { return m_pack_name; } + std::string file_name (void) const { return m_file_name; } + octave_value make_meta_class (interpreter& interp, bool is_at_folder = false); @@ -840,6 +842,7 @@ comment_list *m_trail_comm; std::string m_pack_name; + std::string m_file_name; }; }