Rename Lambda -> Closure for consistency

This commit is contained in:
Joshua Warner 2022-10-06 19:28:59 -07:00
parent 5b40cec4ab
commit ab4e03b05d
4 changed files with 45 additions and 33 deletions

View file

@ -178,7 +178,7 @@ fn to_expr_report<'a>(
match parse_problem {
EExpr::If(if_, pos) => to_if_report(alloc, lines, filename, context, if_, *pos),
EExpr::When(when, pos) => to_when_report(alloc, lines, filename, context, when, *pos),
EExpr::Lambda(lambda, pos) => {
EExpr::Closure(lambda, pos) => {
to_lambda_report(alloc, lines, filename, context, lambda, *pos)
}
EExpr::List(list, pos) => to_list_report(alloc, lines, filename, context, list, *pos),
@ -557,13 +557,13 @@ fn to_lambda_report<'a>(
lines: &LineInfo,
filename: PathBuf,
_context: Context,
parse_problem: &roc_parse::parser::ELambda<'a>,
parse_problem: &roc_parse::parser::EClosure<'a>,
start: Position,
) -> Report<'a> {
use roc_parse::parser::ELambda;
use roc_parse::parser::EClosure;
match *parse_problem {
ELambda::Arrow(pos) => match what_is_next(alloc.src_lines, lines.convert_pos(pos)) {
EClosure::Arrow(pos) => match what_is_next(alloc.src_lines, lines.convert_pos(pos)) {
Next::Token("=>") => {
let surroundings = Region::new(start, pos);
let region = LineColumnRegion::from_pos(lines.convert_pos(pos));
@ -610,7 +610,7 @@ fn to_lambda_report<'a>(
}
},
ELambda::Comma(pos) => match what_is_next(alloc.src_lines, lines.convert_pos(pos)) {
EClosure::Comma(pos) => match what_is_next(alloc.src_lines, lines.convert_pos(pos)) {
Next::Token("=>") => {
let surroundings = Region::new(start, pos);
let region = LineColumnRegion::from_pos(lines.convert_pos(pos));
@ -657,7 +657,7 @@ fn to_lambda_report<'a>(
}
},
ELambda::Arg(pos) => match what_is_next(alloc.src_lines, lines.convert_pos(pos)) {
EClosure::Arg(pos) => match what_is_next(alloc.src_lines, lines.convert_pos(pos)) {
Next::Other(Some(',')) => {
let surroundings = Region::new(start, pos);
let region = LineColumnRegion::from_pos(lines.convert_pos(pos));
@ -702,17 +702,17 @@ fn to_lambda_report<'a>(
}
},
ELambda::Start(_pos) => unreachable!("another branch would have been taken"),
EClosure::Start(_pos) => unreachable!("another branch would have been taken"),
ELambda::Body(expr, pos) => {
EClosure::Body(expr, pos) => {
to_expr_report(alloc, lines, filename, Context::InDef(start), expr, pos)
}
ELambda::Pattern(ref pattern, pos) => {
EClosure::Pattern(ref pattern, pos) => {
to_pattern_report(alloc, lines, filename, pattern, pos)
}
ELambda::Space(error, pos) => to_space_report(alloc, lines, filename, &error, pos),
EClosure::Space(error, pos) => to_space_report(alloc, lines, filename, &error, pos),
ELambda::IndentArrow(pos) => to_unfinished_lambda_report(
EClosure::IndentArrow(pos) => to_unfinished_lambda_report(
alloc,
lines,
filename,
@ -725,7 +725,7 @@ fn to_lambda_report<'a>(
]),
),
ELambda::IndentBody(pos) => to_unfinished_lambda_report(
EClosure::IndentBody(pos) => to_unfinished_lambda_report(
alloc,
lines,
filename,
@ -738,7 +738,7 @@ fn to_lambda_report<'a>(
]),
),
ELambda::IndentArg(pos) => to_unfinished_lambda_report(
EClosure::IndentArg(pos) => to_unfinished_lambda_report(
alloc,
lines,
filename,