changeset 32119:6870df38af9c

new predicate to identify braindead short circuit parse tree elements * pt-binop.h (tree_binary_expression::is_braindead): New virtual function. (tree_braindead_shortcircuit_binary_expression::is_braindead): New function.
author Petter T. <petter.vilhelm@gmail.com>
date Wed, 14 Jun 2023 16:07:25 -0400
parents 61d014959a8b
children 0bce463a9b1a
files libinterp/parse-tree/pt-binop.h
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-binop.h	Wed Jun 14 16:02:51 2023 -0400
+++ b/libinterp/parse-tree/pt-binop.h	Wed Jun 14 16:07:25 2023 -0400
@@ -107,6 +107,7 @@
 
   void matlab_style_short_circuit_warning (const char *op);
 
+  virtual bool is_braindead () const { return false; }
 protected:
 
   // The operands for the expression.
@@ -143,6 +144,8 @@
   octave_value evaluate (tree_evaluator&, int nargout = 1);
 
   using tree_binary_expression::evaluate_n;
+
+  bool is_braindead () const { return true; }
 };
 
 // Boolean expressions.