That's putting it lightly, since Mediawiki templates are Turing-complete.
I'm not up to speed on my parsers anymore, but I believe Parsoid remains the most complete implementation, while mwlib is a reasonable compromise.
https://www.mediawiki.org/wiki/Alternative_parsers#Known_imp...