msg_handler = *handler;
}
\f
+/* msg_point. */
+
+/* Takes POINT, adds to it the syntax in SYNTAX, incrementing the line number
+ for each new-line in SYNTAX and the column number for each column, and
+ returns the result. */
+struct msg_point
+msg_point_advance (struct msg_point point, struct substring syntax)
+{
+ for (;;)
+ {
+ size_t newline = ss_find_byte (syntax, '\n');
+ if (newline == SIZE_MAX)
+ break;
+ point.line++;
+ point.column = 1;
+ ss_advance (&syntax, newline + 1);
+ }
+
+ point.column += ss_utf8_count_columns (syntax);
+ return point;
+}
+\f
/* msg_location. */
void
int c0 = ln == l0 ? loc->start.column : 1;
int c1 = ln == l1 ? loc->end.column : ss_utf8_count_columns (line);
- if (c0 > 0 && c1 >= c0)
+ if (c0 > 0 && c1 >= c0 && !loc->omit_underlines)
{
ds_put_cstr (&s, "\n |");
ds_put_byte_multiple (&s, ' ', c0);