From a8e52c1e13a6cea5cf4197393002c0da206a99d4 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Fri, 24 Jan 2020 22:50:50 -0500 Subject: fixed return declarations --- location.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'location.c') diff --git a/location.c b/location.c index 21e686e..e515af7 100644 --- a/location.c +++ b/location.c @@ -6,6 +6,7 @@ static Location const LOCATION_NONE = {0}; +static void err_print_location_text(Location where); /* for debugging */ static void fprint_location(FILE *out, Location location) { if (!location.start) { @@ -16,12 +17,8 @@ static void fprint_location(FILE *out, Location location) { } return; } - /* TODO: show end */ - char *str = location.start->pos.ctx->str + location.start->pos.start; - char *newline = strchr(str, '\n'); - if (newline) *newline = 0; - fprintf(out, "Line %ld: %s\n", (long)location.start->pos.line, str); - if (newline) *newline = '\n'; + fprintf(out, "Line %ld: ", (long)location.start->pos.line); + err_print_location_text(location); } static void print_location(Location location) { -- cgit v1.2.3