[Top][All Lists]

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

Re: Make awk more friendly to multiline function declaration

From: Peng Yu
Subject: Re: Make awk more friendly to multiline function declaration
Date: Tue, 29 Mar 2022 13:42:57 -0500

Many other programming languages don't have this problem of being
unable to allow arbitrary positions of commas in function declaration
without the backslash.

Is that a big deal to add this support in awk?

On Mon, Mar 28, 2022 at 9:45 PM Neil R. Ormos
<> 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.


reply via email to

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