Report import ending syntax error

This commit is contained in:
Agus Zubiaga 2024-05-06 22:22:00 -03:00
parent 8418610dd9
commit bfb77b78cb
No known key found for this signature in database
3 changed files with 53 additions and 4 deletions

View file

@ -1475,14 +1475,37 @@ fn to_import_report<'a>(
.indent(4),
]),
),
IndentAs(pos) | As(pos) | IndentExposing(pos) | Exposing(pos) | EndNewline(pos) => {
to_unfinished_import_report(
alloc,
lines,
filename,
*pos,
start,
alloc.stack([
alloc.concat([
alloc.reflow("I was expecting to see the "),
alloc.keyword("as"),
alloc.reflow(" keyword, like:"),
]),
alloc
.parser_suggestion("import svg.Path as SvgPath")
.indent(4),
alloc.concat([
alloc.reflow("Or the "),
alloc.keyword("exposing"),
alloc.reflow(" keyword, like:"),
]),
alloc
.parser_suggestion("import svg.Path exposing [arc, rx]")
.indent(4),
]),
)
}
Annotation(problem, pos) => to_type_report(alloc, lines, filename, problem, *pos),
Space(problem, pos) => to_space_report(alloc, lines, filename, problem, *pos),
IndentAs(_) => todo!(),
As(_) => todo!(),
IndentAlias(_) => todo!(),
Alias(_) => todo!(),
IndentExposing(_) => todo!(),
Exposing(_) => todo!(),
ExposingListStart(_) => todo!(),
ExposedName(_) => todo!(),
ExposingListEnd(_) => todo!(),