m4-discuss
[Top][All Lists]
Advanced

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

Make m4 only call macros surrounded by brackets.


From: Demetrios Obenour
Subject: Make m4 only call macros surrounded by brackets.
Date: Sun, 01 Mar 2015 21:16:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

address@hidden writes:

> Send m4-discuss mailing list submissions to
>       address@hidden
>
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.gnu.org/mailman/listinfo/m4-discuss
> or, via email, send a message with subject or body 'help' to
>       address@hidden
>
> You can reach the person managing the list at
>       address@hidden
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of m4-discuss digest..."
>
>
> Today's Topics:
>
>    1. Make m4 only call macros surrounded by brackets. (Zack Piper)
>    2. Re: Make m4 only call macros surrounded by brackets. (Zack Piper)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 28 Feb 2015 21:37:30 +0000
> From: Zack Piper <address@hidden>
> To: address@hidden
> Subject: Make m4 only call macros surrounded by brackets.
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset="us-ascii"
>
> 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.
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 819 bytes
> Desc: not available
> URL: 
> <http://lists.gnu.org/archive/html/m4-discuss/attachments/20150228/69e7800a/attachment.pgp>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 28 Feb 2015 23:21:07 +0000
> From: Zack Piper <address@hidden>
> To: address@hidden
> Subject: Re: Make m4 only call macros surrounded by brackets.
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset="us-ascii"
>
> 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)
Couldn't reproduce with my (old) version. Sounds like regs.start is NULL
or uninitialized.



reply via email to

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