#include <stdbool.h>
#include "scan.h"
+#include "error.h"
#include "cdecl.h"
#define FAIL(msg) do { \
}
%code provides {
+void cdecl__free(struct cdecl *);
void cdecl__yyerror(YYLTYPE *, void *, struct cdecl **, const char *);
int cdecl__yyparse(void *scanner, struct cdecl **out);
}
}
}
-void cdecl_free(struct cdecl *decl)
+void cdecl__free(struct cdecl *decl)
{
free_decl(decl);
}
if (strstr(err, "T_LEX_ERROR"))
return;
- fprintf(stderr, "%s\n", err);
+ cdecl__set_error(&(const struct cdecl_error){
+ .code = CDECL_ENOPARSE,
+ .str = err,
+ });
}