Hi onf,

At 2024-10-05T23:32:33+0200, onf wrote:
> Here is a short example of the sort of thing I am trying to get
> to work:
[...]
>   sit \*[1 A "\\*[2 "B\\\\*[3 C D]E" F]G" H] amet.
> 
> Once I change it to be an actual macro, though, it reports this:
>   troff: backtrace: 'FILE.tr':17: macro '1'
>   troff: backtrace: file 'FILE.tr':25
>   troff:FILE.tr:25: error: missing ']'
> 
> The thing is that this happens even though the opening & closing
> braces are balanced and all the parameters which contain nested
> string escapes are quoted. The way in which it breaks slightly
> changes depending on how many backslashes I put in front of the
> escapes, but I haven't found any amount that works correctly.
> 
> What am I doing wrong?

This is a tough one.  I spent some time in GDB with it but didn't see
exactly where it was going wrong.

My guess is that either (1) there is subtle syntax error in the specimen
above (but you've looked, and it's not jumping out at me, either); or
(2) there is a bug in the parser--probably a very old one.

Unless...hmm.  Unless maybe the problem that this trick of punning a
macro to a string won't work when quotation marks surround the macro
interpolation, because quotation marks can't span lines in GNU troff.
Or any roff, really.  (But only in GNU troff can string interpolations
take arguments, so it probably arises only for us.)

If that's the case then it's a limitation we should document in the
manual.

I'll have to spend more time in GDB with this before I can give you an
answer.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to