ast parses statements in the right order