This is more pjenvey's area of expertise since he's rewritten all the
ast stuff to work wtih Jython/GAE, but it seems like SourceGenerator
is only used in conjunction with the built in _ast module of py 2.5
+. Otherwise its not used and the source generation is done within
Mako (looking at it I can see that's the part I wrote...its been
awhile).
right but, basically there's two ExpressionGenerator classes. one
uses SourceGenerator and the other doesn't. Both should in theory be
usable. Also SourceGenerator, for our purposes, really only has to
generate Python expressions. It doesn't need to generate code
blocks. Mako's unit tests are pretty thorough and if you can get
all the lexer/template/compiler/defs tests to pass, and run the
documentation generator, you're in pretty good shape.
>
>> Mako's unit tests are pretty thorough and if you can get
>> all the lexer/template/compiler/defs tests to pass, and run the
>> documentation generator, you're in pretty good shape.
>
> That's the plan. What's the documentation generator though, and why is
> it important here?
its in doc/build/genhtml.py, and its just another big elaborate set of
templates to make sure they work.
Very cool to hear about your porting work Eloff. Adding _ast support
to IronPython must be no small task.
_ast_utils originally came came from the initial version of Armin's
ast module, just straight from his sandbox repository. Then like you
said, the version of it in 2.6 is stripped down to only the basic
Visitor classes (i.e. no SourceGenerator).
I've fixed a couple bugs in SourceGenerator but I didn't know there
were more. As Mike said mako only uses it to generate a few things,
and its doubtful any of its bugs actually affect mako. I suppose we
should at least add a comment to the code about its flakyness, though.
--
Philip Jenvey
>
> Do you folks currently run tests on Jython after making changes? Would
> you run them on IronPython, assuming I bundled everything needed into
> a zip? I'm worried about fixing all these little things and then
> coming back in a few months to find dozens more have crept in.
I just run against cPython. pjenvey might run against Jython. If
you were maintaining IronPython compatibility, then we'd trust that
you're running tests on that platform.