range iteration

This commit is contained in:
JT
2021-09-06 16:07:48 +12:00
parent 9e7d96ea50
commit 96b0edf9b0
5 changed files with 163 additions and 9 deletions

View File

@ -312,6 +312,13 @@ pub fn report_shell_error(
.with_labels(vec![Label::primary(diag_file_id, diag_range)
.with_message(format!("can't convert to {}", s))])
}
ShellError::CannotCreateRange(span) => {
let (diag_file_id, diag_range) = convert_span_to_diag(working_set, span)?;
Diagnostic::error()
.with_message("Can't convert range to countable values")
.with_labels(vec![Label::primary(diag_file_id, diag_range)
.with_message("can't convert to countable values")])
}
ShellError::DivisionByZero(span) => {
let (diag_file_id, diag_range) = convert_span_to_diag(working_set, span)?;