diff libinterp/parse-tree/pt-walk.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 ac87763b1949
children 7854d5752dd2
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-walk.cc	Tue Jun 30 09:34:14 2020 -0700
+++ b/libinterp/parse-tree/pt-walk.cc	Tue Jun 30 15:52:25 2020 -0400
@@ -174,6 +174,14 @@
       list->accept (*this);
   }
 
+  void tree_walker::visit_spmd_command (tree_spmd_command& cmd)
+  {
+    tree_statement_list *body = cmd.body ();
+
+    if (body)
+      body->accept (*this);
+  }
+
   void tree_walker::visit_octave_user_script (octave_user_script& fcn)
   {
     tree_statement_list *cmd_list = fcn.body ();