Add a few operators. Needs parser work

This commit is contained in:
JT
2021-08-26 07:29:36 +12:00
parent 739425431a
commit 35c3622405
6 changed files with 546 additions and 21 deletions

View File

@ -273,6 +273,15 @@ pub fn report_shell_error(
.with_labels(vec![Label::primary(diag_file_id, diag_range)
.with_message(format!("can't convert to {}", s))])
}
ShellError::DivisionByZero(span) => {
let (diag_file_id, diag_range) = convert_span_to_diag(working_set, span)?;
Diagnostic::error()
.with_message("Division by zero")
.with_labels(vec![
Label::primary(diag_file_id, diag_range).with_message("division by zero")
])
}
};
// println!("DIAG");