fix escaping in generation
make the AST go from left to right, rather than right to left