summaryrefslogtreecommitdiff
path: root/location.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-01-24 22:50:50 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-01-24 22:50:50 -0500
commita8e52c1e13a6cea5cf4197393002c0da206a99d4 (patch)
treeea2f0d314e6d92dd71649de99020cb24bef9bc73 /location.c
parent56464a272cac9e3dfa7d4c702faa23155b3d0134 (diff)
fixed return declarations
Diffstat (limited to 'location.c')
-rw-r--r--location.c9
1 files changed, 3 insertions, 6 deletions
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) {