small steps

This commit is contained in:
Folkert 2021-02-28 02:00:13 +01:00
parent d3bf8d73e7
commit 43550bf18e
3 changed files with 60 additions and 56 deletions

View file

@ -276,6 +276,28 @@ fn to_expr_report<'a>(
}
}
EExpr::Colon(row, col) => {
let surroundings = Region::from_rows_cols(start_row, start_col, *row, *col);
let region = Region::from_row_col(*row, *col);
let doc = alloc.stack(vec![
alloc.reflow(r"I am in the middle of parsing a definition, but I got stuck here:"),
alloc.region_with_subregion(surroundings, region),
alloc.concat(vec![
alloc.reflow("Looks like you are trying to define a function. "),
alloc.reflow("In roc, functions are always written as a lambda, like "),
alloc.parser_suggestion("increment = \\n -> n + 1"),
alloc.reflow("."),
]),
]);
Report {
filename,
doc,
title: "ARGUMENTS BEFORE EQUALS".to_string(),
}
}
_ => todo!("unhandled parse error: {:?}", parse_problem),
}
}