Introduce SyntaxErrorKind and TextRange in SyntaxError

This commit is contained in:
Adolfo Ochagavía 2018-11-04 16:45:22 +01:00
parent 576b9a0727
commit 3b42ddae60
10 changed files with 159 additions and 68 deletions

View file

@ -103,8 +103,8 @@ pub fn diagnostics(file: &File) -> Vec<Diagnostic> {
file.errors()
.into_iter()
.map(|err| Diagnostic {
range: TextRange::offset_len(err.offset, 1.into()),
msg: "Syntax Error: ".to_string() + &err.msg,
range: err.range,
msg: format!("Syntax Error: {}", err.kind),
})
.collect()
}