There is an XXX just before the definition of ast_error. Wouldn't it be useful?

The idea is to merge ast_error() and ast_error_finish().
This requires redefinition of most functions in ast.c, adding "const char *filename" to their parameters.