Re: [dev] Preprocessor

From: Sijmen J. Mulder <>
Date: Thu, 2 May 2019 11:39:51 +0200

Hi Adrian,

Adrian Grigore <> wrote:
> I built a preprocessor. It allows embedding shell code in any type of files.

A tool like this has been on my mind for a while but in a different
form: a more generic template-to-code tool that turns the literal parts
of a template into print statements:

   <h1><% printf("Hello, %s!", "World!); %></h1>
   <p>Lorem ipsum dolor sit amet ...</p>


  int main() {
    printf("Hello, %s!", "World!);
    return 0;

It would need to know a bit about the target language.

For your shell example it could look like:

  <% for p in "$1"/*; do %>
      <td><% echo "$p"; %></td>
  <% done %>

I'm not sure of the best way to deal with the multi language aspect, to
have it built in or configurable in some way.

But mostly I'm sure it must have been done before better than I could.
Or that it's better done with a few lines of awk.

Received on Thu May 02 2019 - 11:39:51 CEST

This archive was generated by hypermail 2.3.0 : Thu May 02 2019 - 11:48:08 CEST