0

I'm writing a natural language generator (NLG) system based on pug - it's called FreeNLG.

I had to add new syntaxic elements to Pug, for instance to declare synonyms:

span
  synz
    syn
      | some text
    syn
      | another text

(which generates randomly 'some text' or 'another text').

I have forked Pug to be able to customize the lexer parser walker and code-gen. It works all fine.

But

I wonder if I could have done the same thing (adding new syntaxic elements) without forking, just with plugins - because I don't really like the idea of having to maintain my own fork of some parts of Pug.

Is it possible to add new syntaxic elements to Pug only via plugins, without a fork ?

0 Answers0