summaryrefslogtreecommitdiff
path: root/location.c
blob: d3ad5b855ba56137a7520510b43feef6c03c528f (plain)
1
2
3
4
5
6
7
8
9
10
11
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';
}