I see. It seems the Fortran rewrite might be more difficult. So I think for now we should simply depend on fypp to be in PATH and fpm will call it automatically on .fypp files and take care of everything else, so you just do fpm build or fpm test and things will re-generate / recompile automatically under the hood.
Just a quick comment on that: fypp is only 3000 lines of code, because it uses Pythons eval() to parse all expressions in the directives. Writing that in Fortran would take several thousands of lines more IMO. If one wanted to rewrite it in Fortran, one should probably first collect the expressions used in various projects (especially in stdlib), prioritize them and try to implement in Fortran. Here a couple of examples I use in various projects and would require some effort to parse and interprete:
Additionally, I am heavily using Python constructs (regular expressions, lists, dictionaries) in the implementation. It all can be for sure implemented differently and more Fortran-like, but it could take a while, I fear…
Based on the use cases, it seems the main reason we use fypp is due to the lack of generics in Fortran, both for any integer/real/complex type and kind, and also any array rank. If we design a pre-processor to handle just that, that might take care of almost all of the use cases in stdlib.