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: Neil R. Ormos
Subject: Re: Make awk more friendly to multiline function declaration
Date: Mon, 28 Mar 2022 21:44:57 -0500 (CDT)

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]