use ast_*alloc and don't create duplicated error messages.