m4-discuss
[Top][All Lists]
Advanced

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

Re: Make m4 only call macros surrounded by brackets.


From: Zack Piper
Subject: Re: Make m4 only call macros surrounded by brackets.
Date: Sat, 28 Feb 2015 23:21:07 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, Feb 28, 2015 at 09:37:30PM +0000, Zack Piper wrote:
> Hello,
> 
> I'm currently trying to figure out how to make m4 only call macros within 
> certain brackets, for example:
> 
> ```
> define(`test', '2')
> test
> ->test
> 
> <test>
> ->2
> ```
> 
> It would be even better if this was possible.
> 
> ```
> define(`test', '2')
> <test>
> -><test>
> 
> <#test>
> ->2
> ```
> 
> Above is exactly what the `-H` flag does on GPP (Generic Preprocessor) 
> (http://files.nothingisreal.com/software/gpp/gpp.html).
> 
> Any help would be great, thanks!
> -- 
> I have nothing fancy or intelligent to put here.

Hm, I found out how to do it. Unfortuently it seems to segfault when using 
"changeword(`#<\([_a-zA-Z0-9]*\)>)')", and then trying to invoke a macro:

(gdb) run gpp.m4
Starting program: /usr/local/bin/m4 gpp.m4
Got object file from memory but can't read symbols: File truncated.





Program received signal SIGSEGV, Segmentation fault.
next_token (address@hidden, address@hidden) at input.c:918
918           if (regs.start[1] != -1)


-- 
I have nothing fancy or intelligent to put here.

Attachment: pgpkNg8Hvws8k.pgp
Description: PGP signature


reply via email to

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