iter ct.4.3-tidy: drop dated prefixes from new prose comments

This commit is contained in:
2026-05-11 10:01:29 +02:00
parent 06bc5f017c
commit b651b1e8fc
+16 -17
View File
@@ -54,11 +54,11 @@ fn write_module(out: &mut String, m: &Module) {
} }
} }
// Ct.4.3: the file's own module name is the owner-qualifier that // The file's own module name is the owner-qualifier that the
// the prose surface trims when it appears on intra-module // prose surface trims when it appears on intra-module
// `Type::Con.name`. Cross-module qualifiers (any other owner) // `Type::Con.name`. Cross-module qualifiers round-trip verbatim.
// round-trip verbatim. Threaded through every recursive write_* // Threaded through every recursive write_* that can reach a
// that can reach a `Type::Con`. // `Type::Con`.
let owning_module = m.name.as_str(); let owning_module = m.name.as_str();
for def in &m.defs { for def in &m.defs {
@@ -470,12 +470,11 @@ fn write_type(out: &mut String, t: &Type, owning_module: &str) {
match t { match t {
Type::Var { name } => out.push_str(name), Type::Var { name } => out.push_str(name),
Type::Con { name, args } => { Type::Con { name, args } => {
// Ct.4.3: trim a qualifier whose owner matches the current // Trim a qualifier whose owner matches the current file's
// file's module: `prelude.Ordering` printed from inside // module: `prelude.Ordering` printed from inside `prelude`
// `prelude` becomes bare `Ordering`. Cross-module qualifiers // becomes bare `Ordering`. Cross-module qualifiers survive
// (any other owner) survive verbatim. Mirrors the post-ct.1 // verbatim. Mirrors the canonical-form rule "bare = local,
// canonical-form rule "bare = local, qualified = cross- // qualified = cross-module" on the prose surface.
// module" on the prose surface.
let display_name = match name.split_once('.') { let display_name = match name.split_once('.') {
Some((owner, suffix)) if owner == owning_module => suffix, Some((owner, suffix)) if owner == owning_module => suffix,
_ => name.as_str(), _ => name.as_str(),
@@ -800,12 +799,12 @@ fn write_term_prec(out: &mut String, t: &Term, level: usize, parent_prec: u8, ow
ctor, ctor,
args, args,
} => { } => {
// Ct.4.3: the Ctor `type_name` field is intentionally // The Ctor `type_name` field is intentionally elided from
// elided from the prose surface — the type is recoverable // the prose surface — the type is recoverable from
// from typecheck context, and showing it on every Ctor // typecheck context, and showing it on every Ctor would
// would clutter the read. The qualifier-trim that applies // clutter the read. The qualifier-trim that applies to
// to `Type::Con.name` therefore has no analogue here: // `Type::Con.name` therefore has no analogue here: there
// there is no `out.push_str(type_name)` site to trim. // is no `out.push_str(type_name)` site to trim.
out.push_str(ctor); out.push_str(ctor);
if !args.is_empty() { if !args.is_empty() {
out.push('('); out.push('(');