Skip to content

Commit a503868

Browse files
committed
report an error when the parsing fails
1 parent d0101dd commit a503868

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/run.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,17 @@ pub(crate) fn run_repl(
242242
working_set.add_file(name.clone(), content);
243243
let end = working_set.next_span_start();
244244

245-
let (block, module, comments, _) = parse_module_block(
245+
let (block, module, comments, parse_error) = parse_module_block(
246246
&mut working_set,
247247
Span::new(start, end),
248248
name.as_bytes(),
249249
&[],
250250
);
251251

252+
if let Some(err) = parse_error {
253+
report_error(&working_set, &err);
254+
}
255+
252256
// TODO: change this when #8505 is merged
253257
// NOTE: remove the assert and uncomment the `help`s
254258
let prelude = vec![

0 commit comments

Comments
 (0)