changeset 30833:449e26c26b41 stable

new is_colon_expression predicate for parse tree expression objects * pt-exp.h (is_colon_expression): New virtual function. * pt-colon.h (is_colon_expression): New function.
author John W. Eaton <jwe@octave.org>
date Mon, 07 Mar 2022 15:02:34 -0500
parents df6668419bfa
children f1a9e55d850c
files libinterp/parse-tree/pt-colon.h libinterp/parse-tree/pt-exp.h
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-colon.h	Tue Mar 15 16:48:43 2022 +0100
+++ b/libinterp/parse-tree/pt-colon.h	Mon Mar 07 15:02:34 2022 -0500
@@ -89,6 +89,8 @@
 
     tree_expression * dup (symbol_scope& scope) const;
 
+    bool is_colon_expression (void) const { return true; }
+
     octave_value evaluate (tree_evaluator&, int nargout = 1);
 
     octave_value_list evaluate_n (tree_evaluator& tw, int nargout = 1)
--- a/libinterp/parse-tree/pt-exp.h	Tue Mar 15 16:48:43 2022 +0100
+++ b/libinterp/parse-tree/pt-exp.h	Mon Mar 07 15:02:34 2022 -0500
@@ -81,6 +81,8 @@
 
     virtual bool is_boolean_expression (void) const { return false; }
 
+    virtual bool is_colon_expression (void) const { return false; }
+
     virtual bool lvalue_ok (void) const { return false; }
 
     virtual bool rvalue_ok (void) const { return false; }