help-gawk
[Top][All Lists]
Advanced

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

Re: Make awk more friendly to multiline function declaration


From: Wolfgang Laun
Subject: Re: Make awk more friendly to multiline function declaration
Date: Wed, 30 Mar 2022 06:24:04 +0200

On Tue, 29 Mar 2022 at 20:43, Peng Yu <pengyu.ut@gmail.com> wrote:

> Many other programming languages don't have this problem of being
> unable to allow arbitrary positions of commas in function declaration
> without the backslash.
>
Please name the ones that let you separate statements by a line feed
in addition to a semicolon.


>
> Is that a big deal to add this support in awk?
>
Try it, send in the patch.

Wolfgang

>
> On Mon, Mar 28, 2022 at 9:45 PM Neil R. Ormos
> <ormos-gnulists17@ormos.org> wrote:
> >
> > Peng Yu wrote:
> >
> > >> The comma mover could be run manually or as a
> > >> preprocessor.  The Gawk manual describes a
> > >> preprocessor for include directives which
> > >> could be modified to add the comma moving
> > >> feature.
> >
> > > Wouldn't this be context-sensitive (as mentioned
> > > by Wolfgang Laun)?  Could you show an example of
> > > how to preprocess the code so that commas in
> > > paratheses can be moved to the previous lines
> > > robustly? I don't see an easy way to make this
> > > robust. For example, you could have some legal
> > > awk code in a string, then the preprocessor
> > > needs know to what is a string so that it will
> > > not make the change.
> >
> > Yes, it would be context-sensitive.
> >
> > The point was that the context-sensitive elements
> > could be in a user-written program, rather than in
> > the Gawk interpreter, freeing the implementors of
> > Gawk from the consequences Wolfgang Laun
> > described.
> >
> > In that case, the comma-mover code need only be as
> > generalized, robust, and concomitantly complex, as
> > is required to accommodate the particular user's
> > coding style.
> >
>
>
> --
> Regards,
> Peng
>
>

-- 
Wolfgang Laun


reply via email to

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