On Sun, Jun 02, 2024 at 11:58:46PM +0100, Gavin Smith wrote: > I agree that it is undefined behaviour. makeinfo could flag it as an > error. It may not be possible to modify texinfo.tex to stop reading > the line at the end of the first line for input line > > @cindex aaa@ > bbb > > Perhaps a warning like this (of course the same change would have to > be made to the XS parser):
Looks good to me. > > diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm > index d39b0b14bd..a6bfab8014 100644 > --- a/tp/Texinfo/ParserNonXS.pm > +++ b/tp/Texinfo/ParserNonXS.pm > @@ -5428,6 +5428,12 @@ sub _handle_other_command($$$$$) > $command), $source_info); > } > if ($command eq "\n") { > + if ($self->_top_context() eq 'ct_line') { > + $self->_line_warn( > + "\@ should not occur at end of argument to line command", > + $source_info); > + } > + > $current = _end_line($self, $current, $source_info); > $retval = $GET_A_NEW_LINE; > }