changeset 30325:f18f5cae2b06

deprecate/eliminate additional instances of '**', '.**', '**=', and '.*==' * lex.ll, pt-eval.cc: Eliminate or mark as deprecated additional instances of Fortran-style exponentiation operators that were missed in the previous change.
author John W. Eaton <jwe@octave.org>
date Tue, 23 Nov 2021 12:28:40 -0500
parents 49c8538c64c4
children cd7c824f3f22
files libinterp/corefcn/help.cc libinterp/parse-tree/lex.ll libinterp/parse-tree/pt-eval.cc
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/help.cc	Tue Nov 23 09:57:51 2021 -0500
+++ b/libinterp/corefcn/help.cc	Tue Nov 23 12:28:40 2021 -0500
@@ -96,7 +96,6 @@
     "(",
     ")",
     "*",
-    "**",
     "^",
     "+",
     "++",
@@ -105,7 +104,6 @@
     "--",
     ".'",
     ".*",
-    ".**",
     ".^",
     "./",
     "/",
--- a/libinterp/parse-tree/lex.ll	Tue Nov 23 09:57:51 2021 -0500
+++ b/libinterp/parse-tree/lex.ll	Tue Nov 23 12:28:40 2021 -0500
@@ -1823,9 +1823,9 @@
 "./="  { CMD_OR_OP ("./=", EDIV_EQ, false); }
 ".\\=" { CMD_OR_OP (".\\=", ELEFTDIV_EQ, false); }
 "^="   { CMD_OR_OP ("^=", POW_EQ, false); }
-"**="  { CMD_OR_OP ("^=", POW_EQ, false); }
+"**="  { CMD_OR_DEPRECATED_OP ("**=", "^=", 7, POW_EQ); }
 ".^="  { CMD_OR_OP (".^=", EPOW_EQ, false); }
-".**=" { CMD_OR_OP (".^=", EPOW_EQ, false); }
+".**=" { CMD_OR_DEPRECATED_OP (".**=", ".^=", 7, EPOW_EQ); }
 "&="   { CMD_OR_OP ("&=", AND_EQ, false); }
 "|="   { CMD_OR_OP ("|=", OR_EQ, false); }
 
--- a/libinterp/parse-tree/pt-eval.cc	Tue Nov 23 09:57:51 2021 -0500
+++ b/libinterp/parse-tree/pt-eval.cc	Tue Nov 23 12:28:40 2021 -0500
@@ -1478,9 +1478,13 @@
     // the corresponding function name.  At least try to do it without N
     // string compares.
 
+    // FIXME: ** and .** are deprecated but still need to be handled
+    // here until they are removed.
+
     std::size_t len = name.length ();
 
     if (len == 3 && name == ".**")
+      // deprecated
       return "power";
     else if (len == 2)
       {
@@ -1535,6 +1539,7 @@
               }
           }
         else if (name == "**")
+          // deprecated
           return "mpower";
       }
     else if (len == 1)