Mercurial > hg > octave-nkf
diff src/pt-pr-code.cc @ 3484:8b1f46ac2b64
[project @ 2000-01-27 23:30:45 by jwe]
author | jwe |
---|---|
date | Thu, 27 Jan 2000 23:30:48 +0000 |
parents | 32dd5d5e8c8f |
children | e5d5848370c9 |
line wrap: on
line diff
--- a/src/pt-pr-code.cc +++ b/src/pt-pr-code.cc @@ -1101,6 +1101,66 @@ os << "endwhile"; } +void +tree_print_code::visit_do_while_command (tree_do_while_command& cmd) +{ + indent (); + + os << "do"; + + newline (); + + tree_statement_list *list = cmd.body (); + + if (list) + { + increment_indent_level (); + list->accept (*this); + decrement_indent_level (); + } + + indent (); + + os << "while"; + + tree_expression *expr = cmd.condition (); + + if (expr) + expr->accept (*this); + + newline (); +} + +void +tree_print_code::visit_do_until_command (tree_do_until_command& cmd) +{ + indent (); + + os << "do"; + + newline (); + + tree_statement_list *list = cmd.body (); + + if (list) + { + increment_indent_level (); + list->accept (*this); + decrement_indent_level (); + } + + indent (); + + os << "until"; + + tree_expression *expr = cmd.condition (); + + if (expr) + expr->accept (*this); + + newline (); +} + // Current indentation. int tree_print_code::curr_print_indent_level = 0;