diff options
Diffstat (limited to 'location.c')
-rw-r--r-- | location.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -8,15 +8,15 @@ static Location const LOCATION_NONE = {0}; /* for debugging */ static void fprint_location(FILE *out, Location location) { - if (!location.first) { + if (!location.start) { fprintf(out, "No location available."); return; } /* TODO: show end */ - char *str = location.first->pos.ctx->str + location.first->pos.start; + 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.first->pos.line, str); + fprintf(out, "Line %ld: %s\n", (long)location.start->pos.line, str); if (newline) *newline = '\n'; } @@ -26,5 +26,6 @@ static void print_location(Location location) { static bool location_is_ctx_disabled(Location location) { - return location.first && !location.first->pos.ctx->enabled; + if (!location.start) return true; + return !location.start->pos.ctx->enabled; } |