octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55766] properties function should not return


From: ImadES
Subject: [Octave-bug-tracker] [bug #55766] properties function should not return Hidden properties
Date: Fri, 14 Jun 2019 06:53:01 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0

Follow-up Comment #1, bug #55766 (project octave):

Hi,

This very simple change:


diff -r 2d9decd77e58 libinterp/octave-value/cdef-class.cc
--- a/libinterp/octave-value/cdef-class.cc      Thu Jun 13 17:40:36 2019 -0500
+++ b/libinterp/octave-value/cdef-class.cc      Fri Jun 14 12:47:51 2019 +0200
@@ -434,6 +434,10 @@
 
         if (props.find (nm) == props.end ())
           {
+            octave_value hid = it->second.get ("Hidden");
+            if (hid.is_bool_scalar () && hid.bool_value ()) {
+              continue;
+            }
             if (mode == property_inherited)
               {
                 octave_value acc = it->second.get ("GetAccess");
@@ -824,6 +828,8 @@
               return std::string ("protected");
             else if (s == "private")
               return std::string ("private");
+            else if (s == "true")
+              return octave_value (true);
           }
 
         return tw.evaluate (expr);


has the desired effect. But something does not feel quite right. I wonder why


+            else if (s == "true")
+              return octave_value (true);


is required. I would have expected the function


  static octave_value
  compute_attribute_value (tree_evaluator& tw,
                           tree_classdef_attribute *t)


to return 'octave_value (true)' when reaching the line


        return tw.evaluate (expr);


with the tree_expression 'expr' corresponding to the string 'true'... I wonder
why this is not the case, and whether there might be another prior problem at
the parsing level, which lead me to have to explicitly handle the 'true'
case...

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55766>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]