diff options
Diffstat (limited to 'location.c')
-rw-r--r-- | location.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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'; +} |