diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-24 22:50:50 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-24 22:50:50 -0500 |
commit | a8e52c1e13a6cea5cf4197393002c0da206a99d4 (patch) | |
tree | ea2f0d314e6d92dd71649de99020cb24bef9bc73 /location.c | |
parent | 56464a272cac9e3dfa7d4c702faa23155b3d0134 (diff) |
fixed return declarations
Diffstat (limited to 'location.c')
-rw-r--r-- | location.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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) { |