bison-patches
[Top][All Lists]
Advanced

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

Re: FYI: Strip blanks from %*-param


From: Alexandre Duret-Lutz
Subject: Re: FYI: Strip blanks from %*-param
Date: Tue, 28 Sep 2004 00:57:58 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

>>> "Paul" == Paul Eggert <address@hidden> writes:

 Paul> !   /* Strip the surrounding '{' and '}', and any blanks just inside
 Paul> !      the braces.  */
 Paul> !   while (*--p == ' ' || *p == '\t')
 Paul> !     continue;
 Paul> !   *p = '\0';
 Paul> !   while (*++decl == ' ' || *decl == '\t')
 Paul> !     continue;

Excellent!  That's far more readable than the backward use of
strchr(), and I'm delighted to discover this elegant use of
`continue'.

So far I've always been writing things like
  while (*++x) /* NOP */;
and never realized `continue' would work as well 
and spare me one keystroke :)
-- 
Alexandre Duret-Lutz





reply via email to

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