Ignore underscore-prefixed fields in record builders

This commit is contained in:
Sam Mohr 2024-08-04 03:34:39 -07:00
parent 13f60cde09
commit cb8040f629
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
16 changed files with 336 additions and 140 deletions

View file

@ -545,7 +545,7 @@ fn to_expr_report<'a>(
to_record_report(alloc, lines, filename, erecord, *pos, start)
}
EExpr::OptionalValueInRecordBuilder(region) => {
EExpr::OptionalValueInOldRecordBuilder(region) => {
let surroundings = Region::new(start, region.end());
let region = lines.convert_region(*region);
@ -565,7 +565,7 @@ fn to_expr_report<'a>(
}
}
EExpr::RecordUpdateAccumulator(region) => {
EExpr::RecordUpdateOldBuilderField(region) => {
let surroundings = Region::new(start, region.end());
let region = lines.convert_region(*region);
@ -1580,6 +1580,25 @@ fn to_import_report<'a>(
severity,
}
}
Params(EImportParams::RecordIgnoredFieldFound(region), _) => {
let surroundings = Region::new(start, region.end());
let region = lines.convert_region(*region);
let doc = alloc.stack([
alloc.reflow("I was partway through parsing module params, but I got stuck here:"),
alloc.region_with_subregion(lines.convert_region(surroundings), region, severity),
alloc.reflow(
"This is an ignored record field, but those are not allowed in module params.",
),
]);
Report {
filename,
doc,
title: "IGNORED RECORD FIELD IN MODULE PARAMS".to_string(),
severity,
}
}
Params(EImportParams::RecordUpdateFound(region), _) => {
let surroundings = Region::new(start, region.end());
let region = lines.convert_region(*region);