[Top][All Lists]

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

[Bug-indent] indent (2.2.6-2.2.9) INDENT-OFF/INDENT-ON line break bug

From: Bruce Lilly
Subject: [Bug-indent] indent (2.2.6-2.2.9) INDENT-OFF/INDENT-ON line break bug
Date: Sun, 29 Dec 2002 11:47:05 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130

I'm trying to use indent to format the C code sections of
lex and yacc source files.  That involves use of
INDENT-OFF and INDENT-ON comments because indent can't
handle the lex- and yacc-specific constructs. One
problem that I have found is that if indent decides to
break a long line, then encounters an INDENT-OFF
comment on the subsequent input line, the first part
of the long line is output before the comment, but the
remainder is not output until after the next INDENT-ON
comment.  That changes the program semantics drastically!

A simple sample test file is attached. Indent breaks
the (long) first declaration, but doues not immediately
output the continuation line.  While the original file
will compile, the indent-modified source contains syntax
errors due to the bug.

This bug exists in 2.2.6 and 2.2.9, possibly in other
versions also.
int main(int argc, char **argv)
  int this_is_a_long_line_which_indent_should_break = 1234567, grimbleputty, 
qwertyuiop, asdfghjkl, zxcvbnm;
  /* *INDENT-OFF* */
  double d = 0.123;
  /* *INDENT-ON* */

  return 0;

reply via email to

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