m4-discuss
[Top][All Lists]
Advanced

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

Re: How to not expand in strings


From: Mike Gran
Subject: Re: How to not expand in strings
Date: Fri, 1 Oct 2010 10:11:20 -0700 (PDT)

> From: Eric Blake <address@hidden>
> The ONLY way to represent an m4 close-quote sequence within an m4
> string is to temporarily change quotes to some other string for
> the duration of quoting the problem character.
> 
> > I guess I could just temporarily change the quote characters
> > again, but, is there some more compact way to not expand just that
> > one string that contains the curly bracket?
> 
> Sorry, there isn't.  There have been some proposals for adding
> some additional syntax abilities in m4 2.0 to make it possible,
> but no code has materialized for it yet.

OK. I can work around it.  Scheme lets you escape characters in strings
as hex numbers, and that'll work in this case.

> You may also want to consider how both autoconf and bison do
> things - they have a post-processing step and a specific character
> sequence that maps to a few specific characters that are otherwise
> difficult to represent directly in m4; in autoconf, they are>
> quadrigraphs (quoting characters [ and ], so @:>@ maps to ]
> and @<:@ maps to ]); in bison, they are digraphs (quoting
> characters [ and ], so @{ maps to [ and @} maps to ]).  Again,
> making a post-processing step a built-in part of m4 would be nice,
> but no one has contributed code.

Hmmm.  'Turtles all the way down.' :-)

Thanks,

Mike Gran



reply via email to

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