You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.