Experimental macro processor alternative to m4


I wanted to try out some ideas with the macro processor m4, and so I wrote my own to experiment with. It's not complete (still experimental, and might stay that way), and not a drop-in replacement, but it's here for those who are interested.

Mokvino has the following features:

  • Hard quotes and Unicode escape sequences are supported through the use of a preprocessor, which converts the input string into a hierarchical structure according to the level of soft quoting.

    There are also quotes which strip leading and trailing internal white space.

  • Named arguments are supported to allow flexibility in the order of arguments. Named arguments can also be given default values, or be initialized from the initial positional arguments.

  • Most of the built-in macros, those which generate output for further processing, have a default argument which allows the output to be surrounded by extra quotes.

  • There are new replacement marks (such as $$!?@) to help to deal with named arguments and other improvements.

  • Output can be switched to different files during the processing. External post-processors can be applied to each of these files, controlled by the input script.

  • Mokvino can automatically generate dependency rules by keeping track of input and output files. It can also be made to write a file only if its contents have changed, list generated files, and remove files it generated previously if not regenerated.

Mokvino is used by Mokvino Web to construct and maintain websites.


File Size Last modified Description Requirements and recommendations
Source documentation