Re: awk gensub documentation

2024-06-19 Thread Alistair Crooks
On Tue, 18 Jun 2024 at 07:57, Valery Ushakov  wrote:

> My eye accidentally caught this phrase in awk(1), that says in the
> description of gensub():
>
>   Note that the ā€˜\nā€™ sequences within replacement string s supported
>   by GNU awk are not supported at this moment.
>
> I assume what it means to say is \ backreferences, not the 0xa NL
> character, but I wanted to ask the audience.
>

In src/external/historical/nawk/dist/run.c around line 2137, this is the
definition of gensub(), which does the work

Cell *gensub(Node **a, int nnn) /* global selective substitute */
/* XXX incomplete - doesn't support backreferences \0 ... \9 */

and, as I should not be commenting with information derived purely from
comments, I took a look and there's no code in gensub() that manipulates
backrefs.

Best,
Alistair


Re: awk gensub documentation

2024-06-19 Thread Valery Ushakov
On Wed, Jun 19, 2024 at 10:26:33 -0700, Alistair Crooks wrote:

> > I assume what it means to say is \ backreferences, not the 0xa NL
> > character, but I wanted to ask the audience.
> >
> 
> In src/external/historical/nawk/dist/run.c around line 2137, this is the
> definition of gensub(), which does the work
> 
> Cell *gensub(Node **a, int nnn) /* global selective substitute */
> /* XXX incomplete - doesn't support backreferences \0 ... \9 */
> 
> and, as I should not be commenting with information derived purely from
> comments, I took a look and there's no code in gensub() that manipulates
> backrefs.

Thanks!


-uwe