antlr/stringtemplate4 — pull request #71 by sharwell (2014-02-25 13:33:34+00:00)
Title: Fix 70

When arguments are passed to templates that do not contain formal argument lists, the interpreter creates formal arguments on the individual template instance. Prior to modifying `CompiledST.formalArguments` the `ST.impl` field is cloned to ensure that the original `CompiledST` instance is not modified.

This behavior results in a substantial performance overhead (the `CompiledST` is cloned once for *every argument* passed to *every template* that does not declare formal arguments). However, the performance limitation *only* applies to cases where templates are used without declaring formal arguments, a feature that only exists in ST4 for limited legacy support.

This change fixes #70, but does not change the fact that `STRawGroupDir`, and `ST` instances created without formal arguments, should be avoided in production code.