changed element access syntax of print_ast functions that take ast types