ease undefined check for expression args that can come from function args

Issue #191 resolved
Michael Bayer
repo owner created an issue

from mako.template import Template

t = Template( """ <%def name="layout(foo)" cached="True" cache_key="${foo}"> foo: ${foo} </%def>

${layout(3)} """, strict_undefined=True )

print t.render()

patch:

diff -r 4b622e16dbdd55b85608103a9a9e33a9f7f7b830 mako/parsetree.py --- a/mako/parsetree.py Wed May 16 10:38:44 2012 -0400 +++ b/mako/parsetree.py Tue Jun 05 12:37:53 2012 +0800 @@ -439,12 +439,15 @@ for c in self.function_decl.defaults: res += list(ast.PythonCode(c, self.exception_kwargs). undeclared_identifiers) + return set(res).union( self.filter_args.\ undeclared_identifiers.\ difference(filters.DEFAULT_ESCAPES.keys()) ).union( self.expression_undeclared_identifiers + ).difference( + self.function_decl.argnames )

class BlockTag(Tag):