To minimize string manipulation most data is stored as ArgList, BoolFlag, or str objects which are properly converted to strings during evaluation.
Conclusion
I hope this will help with maintainability. Since pretty much everything is iterative, most support additions should just involve dictionary modification.
Flow
The generation process now more closely mirrors the
build.ninja
output itself. The process looks like this:Variables are generated in
The returned object is pretty much exactly what will be exported as variables in the
build.ninja
file.The variables are plugged into an unevaluated outline: a
list
of objects each representing a Ninja statementand extended with the rule and build portions of the outline from
The outline is evaluated in with the variables and written to a buildgen generator (which can be easily swapped out) in
Added classes
To minimize string manipulation most data is stored as
ArgList
,BoolFlag
, orstr
objects which are properly converted to strings during evaluation.Conclusion
I hope this will help with maintainability. Since pretty much everything is iterative, most support additions should just involve dictionary modification.