ParseContext: Smarter Template Building with Build-Time Knowledge
FreshMarker has always optimised constant expressions during template parsing. The expression 2 + 3 becomes 5 before the first process(…) call is ever made. That optimisation, however, had a hard boundary: anything involving the ~~ operator, registered formatters, or context-free built-ins was left untouched because the parser had no access to the configuration that governs them. This post describes the ParseContext, a new concept that hands build-time knowledge to the template builders and what that unlocks.