bug-indent
[Top][All Lists]
Advanced

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

[Bug-indent] Incorrect "Error:Unmatched 'else'"


From: Enrique Perez-Terron
Subject: [Bug-indent] Incorrect "Error:Unmatched 'else'"
Date: Mon, 06 Sep 2004 06:14:21 +0200

Here is the output from indent:
  $ indent < qmacro.c
  int
  a (int x)
  {
    TRY (
          {
          printf ("Hello"); if (x == 0) printf (" World!\n");
  indent: Standard input:7: Error:Unmatched 'else'
          else
          printf (" Globe!\n");}
    );
  }

Here is the source:
  $ cat qmacro.c
  int a(int x)
  {
    TRY ({
      printf("Hello");
      if (x == 0)
        printf(" World!\n");
      else
        printf(" Globe!\n");
    });
  }

This does not happen if I remove the line "TRY ({" and the matching
"});"  Here, TRY is a macro, and I suppose that it is impossible to
device indentation rules for macro arguments that make everyone happy.

However, I believe that a macro argument that is a natural piece of
code, with perfectly balanced parens, braces, and brackets -- it might
be worth aiming at handling that, not?

I have no .indent.pro. I have indent-2.2.9-5 (Fedora Core 2)

Thanks,
Enrique





reply via email to

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