bug-m4
[Top][All Lists]
Advanced

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

Command line options corresponding to changequote and changecom


From: Niels Möller
Subject: Command line options corresponding to changequote and changecom
Date: Wed, 11 Sep 2013 13:58:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (usg-unix-v)

Hi,

I think it would be nice if GNU m4 had some command line options
corresponding to changecom and changequote (there's already an option,
-w, for the experimental changeword feature).

TO give some context, I'm writing an assembler for a toy processor, and
I've just added a feature to have the assembler pass files through m4
for preprocessing (I do this directly with fork/execv, since I don't
want any shell quoting complications, so shell features like HERE
documents are not available). But for this to work well for my assembly
input files, m4 needs to be aware of the comment character, which in
this case is is ';'.

I could arrange to always pass an extra input file containing
changecom(`;') to m4, but that's another file which has to be installed
and located. So it would be more convenient if I could change the
behavior on the command line when spawning the m4 process.

Maybe I'm missing something, but I find no documented way of influencing
the comment character used directly from the command line.

Or generalizing this, a way to pass an arbitrary input fragment directly
on the command line would be nice too. Say,

  m4 -e "changecom(`;')" file.s

I think the semantics for such an -e option should be the same as if the
argument was written to a file, and the -e option (and argument) were
replaced by the name of that file.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.




reply via email to

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