During recursively_improve_ast(), now adding children in a specific way (topological order of dependency).
During prune_unused_children(), now taking care to not drop contains nodes.
The above two allow us to call ast.tofortran() and now it's a valid code, which we can compile (and we do in the tests) with gfortran -Wall -c!
That allows us to avoid matchers, which are awkward to use (but can be a necessary evil, when there isn't a good way to compare ASTs). So, the tests now can just assert that a certain valid (and "canonically constructed") Fortran code was produced.
Additionally:
recursively_improve_ast()
, now adding children in a specific way (topological order of dependency).prune_unused_children()
, now taking care to not dropcontains
nodes.ast.tofortran()
and now it's a valid code, which we can compile (and we do in the tests) withgfortran -Wall -c
!