Source-Changes-D archive

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

Re: CVS commit: src/usr.bin/make



On 14.09.2020 21:05, Robert Elz wrote:
     Date:        Mon, 14 Sep 2020 16:16:52 +0000
     From:        "Roland Illig" <rillig%netbsd.org@localhost>
     Message-ID:  <20200914161652.D4EB5FB28%cvs.NetBSD.org@localhost>

   | make(1): inline LPAREN in parse.c
   |
   | It's shorter and more readable, and the other characters don't have
   | named constants as well.

Most likely the reason for that was for parentheses matching editors.

Using '(' creates a ( that (a non C syntax savvy) editor will match
against the next (otherwise unmatched) ')' it finds.   LPAREN doesn't
have that effect.   An alternative is to add a /*)*/ comment on the line,
but that starts getting obtrusive, and difficult to justify.

I've seen all 3 variants in usr.bin/make/*.c, even in the code from
-D2020.01.01.00.00.00, before I started the big rewrite:

$ grep "'[(){}]'" *.c | wc -l
      58

$ grep -Ew 'LPAREN|RPAREN|BROPEN|BRCLOSE|PROPEN|PRCLOSE' *.c \
| wc -l
      19

$ grep '/\*[[:space:]]*[(){}][[:space:]]*\*/' *.c | wc -l
       2

Therefore I had the impression that there was no hard preference, and
that it would be ok to change this.  If it had been consistent over the
majority of the code in usr.bin/make, I would have left it that way.


Home | Main Index | Thread Index | Old Index