Re: Process only sections of a file? (newbie)

Tom Browder <[email protected]>
Newsgroups gmane.comp.gnu.m4.general
Message-ID <[email protected]>
On Fri, Sep 17, 2010 at 10:40, Gary <[email protected]> wrote:
> Eric Blake wrote:
>> On 09/15/2010 03:49 AM, Gary wrote:
>>> Sorry if this is obviously documented somewhere, but I couldn't find it
>>> (or perhaps found it and didn't understand it...).
>>>
>>> What I would like to do is only have m4 process certain sections of a
>>> file delimited by some given sequence (in my case outside<?php ... ?>
>>> tags). Is that possible?
>>
>> changecom(`<?php', `?>') will treat all <?php...?> sequences as
>> comments, and thus not do any m4 processing of that portion of the text.
>
> Oh heck. TFM says "the first newline after a # ends the comment", so I
> don't think I can use this.
>
> I've got the problem that m4's include macro clashes with php's include
> statement. Any ideas how I can get around it? Could I, say, tell m4 that
> it should use #include instead of include?

Would undefining the m4 include macro do part of what you need?

With help from Eric I was able to work around cpp '#<word>' problems
to enable m4 filtering of c header files.

-Tom

Thomas M. Browder, Jr.
Niceville, Florida
USA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.