Add preconditions for AST templates.
Merge pull request #615 from concavelenz/master

Add preconditions for AST templates.