Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
void yyrestart(FILE * in_str, yyscan_t scanner);
BT_HIDDEN
int yyget_lineno(yyscan_t yyscanner);
void yyrestart(FILE * in_str, yyscan_t scanner);
BT_HIDDEN
int yyget_lineno(yyscan_t yyscanner);
+BT_HIDDEN
+char *yyget_text(yyscan_t yyscanner);
struct gc_string {
struct bt_list_head gc;
struct gc_string {
struct bt_list_head gc;
BT_HIDDEN
void yyerror(struct ctf_scanner *scanner, const char *str)
{
BT_HIDDEN
void yyerror(struct ctf_scanner *scanner, const char *str)
{
- fprintf(stderr, "error at line %d: %s\n",
- yyget_lineno(scanner->scanner), str);
+ fprintf(stderr, "error at line %d, token \"%s\": %s\n",
+ yyget_lineno(scanner->scanner),
+ yyget_text(scanner->scanner), str);