Skip to content

Commit e5f7b80

Browse files
authored
Merge pull request #579 from ratmice/consistent_underline
Consistently underline error spans with '^'
2 parents da567b8 + 43a5f58 commit e5f7b80

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lrpar/src/lib/diagnostics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl<'a> SpannedDiagnosticFormatter<'a> {
185185
}
186186
_ => "Unrecognized spanskind".to_string(),
187187
};
188-
out.push_str(&self.prefixed_underline_span_with_text(dots, *span, s, '-'));
188+
out.push_str(&self.prefixed_underline_span_with_text(dots, *span, s, '^'));
189189
}
190190
}
191191
out
@@ -293,9 +293,9 @@ impl<'a> SpannedDiagnosticFormatter<'a> {
293293
),
294294
);
295295
out.pushln(self.underline_span_with_text(r1_span, "First reduce".to_string(), '^'));
296-
out.pushln(self.underline_span_with_text(r2_span, "Second reduce".to_string(), '-'));
296+
out.pushln(self.underline_span_with_text(r2_span, "Second reduce".to_string(), '^'));
297297
if let Some(t_span) = t_span {
298-
out.pushln(self.underline_span_with_text(t_span, "Lookahead".to_string(), '+'));
298+
out.pushln(self.underline_span_with_text(t_span, "Lookahead".to_string(), '^'));
299299
}
300300
out.push('\n');
301301
}
@@ -319,7 +319,7 @@ impl<'a> SpannedDiagnosticFormatter<'a> {
319319
);
320320

321321
out.pushln(self.underline_span_with_text(s_tok_span, "Shift".to_string(), '^'));
322-
out.pushln(self.underline_span_with_text(r_rule_span, "Reduced rule".to_string(), '+'));
322+
out.pushln(self.underline_span_with_text(r_rule_span, "Reduced rule".to_string(), '^'));
323323

324324
if r_prod_spans.is_empty() {
325325
r_prod_spans.push(fallback_span);

0 commit comments

Comments
 (0)