diff libinterp/parse-tree/pt-eval.cc @ 28518:b8ab8b58547d

accept spmd command blocks as language elements (bug #58676) * pt-spmd.h, pt-spmd.cc: New files. * libinterp/parse-tree/module.mk: Update. * parse.h, oct-parse.yy (base_parser::make_spmd_command): New function. (spmd_command): New non-terminal. (command): Include spmd_command in list of possible commands. * pt-all.h: Also include pt-spmd.h. * pt-walk.h, pt-walk.cc (tree_walker::visit_spmd_command): New virtual function. * pt-eval.h, pt-eval.cc (tree_evaluator::visit_spmd_command): New function. * pt-pr-code.h, pt-pr-code.cc (tree_print_code::visit_spmd_command): New function.
author John W. Eaton <jwe@octave.org>
date Tue, 30 Jun 2020 15:52:25 -0400
parents 1be719d8b375
children 1151ed869686
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-eval.cc	Tue Jun 30 09:34:14 2020 -0700
+++ b/libinterp/parse-tree/pt-eval.cc	Tue Jun 30 15:52:25 2020 -0400
@@ -2669,6 +2669,16 @@
       }
   }
 
+  void tree_evaluator::visit_spmd_command (tree_spmd_command& cmd)
+  {
+    // For now, we just execute the commands serially.
+
+    tree_statement_list *body = cmd.body ();
+
+    if (body)
+      body->accept (*this);
+  }
+
   void
   tree_evaluator::visit_octave_user_script (octave_user_script&)
   {