Merge remote-tracking branch 'origin/main' into more-dollars

This commit is contained in:
Richard Feldman 2024-02-26 23:03:14 -05:00
commit 6f84e24fa5
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
450 changed files with 14625 additions and 29764 deletions

View file

@ -3910,6 +3910,28 @@ fn to_packages_report<'a>(
severity: Severity::RuntimeError,
}
}
EPackages::ListEnd(pos) => {
let surroundings = Region::new(start, pos);
let region = LineColumnRegion::from_pos(lines.convert_pos(pos));
let doc = alloc.stack([
alloc.reflow(
r"I am partway through parsing a list of packages, but I got stuck here:",
),
alloc.region_with_subregion(lines.convert_region(surroundings), region),
alloc.concat([alloc.reflow("I am expecting a comma or end of list, like")]),
alloc
.parser_suggestion("packages { package_name: \"url-or-path\", }")
.indent(4),
]);
Report {
filename,
doc,
title: "WEIRD PACKAGES LIST".to_string(),
severity: Severity::RuntimeError,
}
}
EPackages::Space(error, pos) => to_space_report(alloc, lines, filename, &error, pos),