Skip to content

v0.0.7

Compare
Choose a tag to compare
@jwdevantier jwdevantier released this 22 Jul 21:48
· 15 commits to master since this release
  • emitter - ensure_padding_lines(num_lines: int) -- use to guarantee at least n empty lines of spacing between the next line and the prior line (if any). Is a no-op if called with the emitter's buffer being empty (no content written out yet). This method is useful when wanting to ensure a certain amount of spacing between paragraphs/block of code.
  • gcgen.api.tree.py - NodeVisitor and NodeTransformer classes and associated on_visit and on_transform decorators. Collectively, the tree module provides utility code to traverse/visit and transform/rewrite nested object structures (~trees). This is very useful when reading in a model which needs validation (NodeVisitor's), some transformation into a more codegen-friendly format (NodeTransformer's) and finally when writing out the model to code (NodeVisitor). This approach is inspired by multi-pass compilers.