octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47091] string representation of a colon expre


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #47091] string representation of a colon expression may be missing parentheses
Date: Fri, 17 Jun 2016 05:35:56 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #3, bug #47091 (project octave):

I don't think this is about the printing, but about the construction of the
parse tree.

First: for functions in files, the parentheses are printed correctly with
"echo on all".

Second:  The printing code starts


tree_print_code::visit_colon_expression (tree_colon_expression& expr)
{
  indent ();

  print_parens (expr, "(");


and print_parens is


tree_print_code::print_parens (const tree_expression& expr, const char *txt)
{
  int n = expr.paren_count ();

  for (int i = 0; i < n; i++)
    os << txt;
}


It seems to me that  num_parens  [the variable behind paren_count()]  isn't
getting set for colon expressions in anonymous functions.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47091>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]