Skip to content

Commit 329a87b

Browse files
committed
Blank lines between errors
1 parent 3e06626 commit 329a87b

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/main.rs

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,13 @@ fn main() {
164164
let technique = match parsing::parse(&filename, &content) {
165165
Ok(document) => document,
166166
Err(errors) => {
167-
for error in errors {
167+
for (i, error) in errors
168+
.iter()
169+
.enumerate()
170+
{
171+
if i > 0 {
172+
eprintln!();
173+
}
168174
eprintln!(
169175
"{}",
170176
problem::full_parsing_error(&error, &filename, &content, &Terminal)
@@ -213,12 +219,23 @@ fn main() {
213219
let technique = match parsing::parse(&filename, &content) {
214220
Ok(document) => document,
215221
Err(errors) => {
216-
for error in errors {
222+
for (i, error) in errors
223+
.iter()
224+
.enumerate()
225+
{
226+
if i > 0 {
227+
eprintln!();
228+
}
217229
eprintln!(
218230
"{}",
219231
problem::concise_parsing_error(&error, &filename, &content, &Terminal)
220232
);
221233
}
234+
235+
eprintln!(
236+
"\nUnable to parse input file. Try `technique check {}` for details.",
237+
&filename.to_string_lossy()
238+
);
222239
std::process::exit(1);
223240
}
224241
};
@@ -266,7 +283,14 @@ fn main() {
266283
// into the PDF document rather than crashing here. We'll
267284
// see in the future.
268285

269-
for error in errors {
286+
for (i, error) in errors
287+
.iter()
288+
.enumerate()
289+
{
290+
if i > 0 {
291+
eprintln!();
292+
}
293+
270294
eprintln!(
271295
"{}",
272296
problem::concise_parsing_error(&error, &filename, &content, &Terminal)

0 commit comments

Comments
 (0)