summaryrefslogtreecommitdiff
path: root/location.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-12-02 21:54:06 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2019-12-02 21:54:06 -0500
commit9c891f2fbeb2837de3260b86c0055ddc9c6485db (patch)
treeeb5f76e8014a4aed39c4d7abb19d62f7db13aa09 /location.c
parent38dd2a6e3389db247ce15faafb5ffc75a82ae50d (diff)
fixed type ret vals bug!
Diffstat (limited to 'location.c')
-rw-r--r--location.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/location.c b/location.c
index 48fd269..d3ad5b8 100644
--- a/location.c
+++ b/location.c
@@ -2,3 +2,10 @@ static bool location_after(Location a, Location b) { /* a is after b? */
assert(a.ctx == b.ctx);
return a.code > b.code;
}
+
+static void fprint_location(FILE *out, Location location) {
+ char *newline = strchr(location.code, '\n');
+ if (newline) *newline = 0;
+ fprintf(out, "Line %ld: %s\n", (long)location.line, location.code);
+ if (newline) *newline = '\n';
+}