Def kw arg default value incorrect when negative

Issue #26 resolved
Anonymous created an issue

Looks like the lexer is passing over the sign for keyword args with a negative default value.

Template: <%def name="test(x=-1)"> ${x} </%def>

Compiled: def test(x=1): return render_test(context.locals_(locals),x)

Comments (1)

  1. Michael Bayer repo owner

    one tricky section of mako is that we have to re-generate python expressions using AST traversal. so a lot of nodes were missing. I think i have just about all of them that would be in an expression in [changeset:235], including `UnarySub` which fixes this.

  2. Log in to comment