multiline validation

This commit is contained in:
JT
2021-09-22 17:29:53 +12:00
parent 9f9bec38e1
commit 0ccbebee7a
6 changed files with 47 additions and 13 deletions

View File

@ -21,7 +21,7 @@ pub enum ParseError {
#[error("Unexpected end of code.")]
#[diagnostic(code(nu::parser::unexpected_eof), url(docsrs))]
UnexpectedEof(String, #[label("expected {0}")] Span),
UnexpectedEof(String, #[label("expected closing {0}")] Span),
#[error("Unclosed delimiter.")]
#[diagnostic(code(nu::parser::unclosed_delimiter), url(docsrs))]

View File

@ -181,7 +181,13 @@ pub fn lex_item(
// correct information from the non-lite parse.
return (
span,
Some(ParseError::UnexpectedEof((delim as char).to_string(), span)),
Some(ParseError::UnexpectedEof(
(delim as char).to_string(),
Span {
start: span.end,
end: span.end,
},
)),
);
}