Small items, round 4: the editor's unknown rule name said once, a warning channel for the walk, inline aggregate override arguments, comment slots inside delay lists
ci / checks (push) Successful in 1m1s
ci / corpus (push) Successful in 32s

TODO §45 (docs/features/small-items-4). Closes topo §2.9-17, 29, 30 and
adds the delay-list bar to §2.9-22.

45.1 `settings::rules` records every dropped `lucisv.lint.select`/`ignore`
name as `lucisv.lint.<setting>: unknown rule: <name>`; `apply_settings`
logs what the previous settings value did not already say — once per
(setting, name), re-armed by a changed list.
45.2 `walk::collect_files` takes a `&mut dyn FnMut(Warning)` sink: an
unreadable directory, an unreadable `.gitignore` and a dangling source
link are warned about and the walk continues; the CLI prints
`warning: <path>: <message>` on stderr before the report with the exit
code unchanged, the server logs once per scan through `report_scope`.
45.3 `parse_expr_or_type` accepts a `struct`/`union`/`enum` head as a
type argument, so `m #(.T(struct packed { logic a; })) u ();` parses and
`instantiation_plan` emits a one-line `parameter type` aggregate default.
45.4 Comment slots for `#(1:2:3)` and gate delay lists
(`MinTypMaxComments`, `DelayValue`, `ContAssign`/`GateInstantiation`/
`GateInstance` slots); `EXPECTED_RTL_GAPS` 374 → 419 at zero failures.
Review rework (QA's MEDIUM): a line comment after a gate instance's `,`
now ends the line, the next instance one level in.

Byte-identity vs 0.43.0: 0 of 820 corpus files and 0 opentitan outcomes
differ.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5.1 committed 2026-09-05 07:12:54 -05:00
1 parent f302b471a7
commit f7956060b3
27 files changed
+1698 -144

No files matched your search

+23
View File
@@ -259,9 +259,32 @@ pub enum ExprKind {
min: Box<Expr>,
typ: Box<Expr>,
max: Box<Expr>,
/// What was written around the two `:`.
comments: Box<MinTypMaxComments>,
},
}
/// Comments written around the two `:` of a `min : typ : max` delay
/// (IEEE 1800 §28.14):
///
/// ```text
/// min /*before_typ*/ : /*after_typ*/ typ /*before_max*/ : /*after_max*/ max
/// ```
///
/// Boxed by its holder for the reason every expression-level slot is: `Expr`
/// is walked recursively and its size is pinned at 96 bytes.
#[derive(Debug, Clone, Default)]
pub struct MinTypMaxComments {
/// Between `min` and the first `:`.
pub before_typ: Vec<Comment>,
/// Just after the first `:`.
pub after_typ: Vec<Comment>,
/// Between `typ` and the second `:`.
pub before_max: Vec<Comment>,
/// Just after the second `:`.
pub after_max: Vec<Comment>,
}
/// Comments written in the fixed slots of a **postfix segment** or a
/// **bracketed range** — the one shape the grammar writes in five places:
///
+36 -1
View File
@@ -162,8 +162,15 @@ pub struct ContAssign {
/// Drive strength: the `(weak0, pull1)` in
/// `assign (weak0, pull1) x = y;` (IEEE 1800 §10.3.1), in source order.
pub strength: Option<DriveStrength>,
/// Comments written between the `#` and the delay itself.
pub after_hash: Vec<Comment>,
/// Delay expression: the `5` in `assign #5 x = y;`
pub delay: Option<Expr>,
/// Comments written between that delay and the first left-hand side.
/// Without a slot here they would join the first pair's `meta.leading`,
/// which prints straight after the `assign` — in front of the delay the
/// source wrote them behind.
pub after_delay: Vec<Comment>,
pub assigns: Vec<AssignPair>,
}
@@ -363,12 +370,37 @@ pub struct GateInstantiation {
/// The `(weak1)` in `pullup (weak1) p (x);` (IEEE 1800 §28.3), or the
/// `(strong0, strong1)` pair every driving gate also accepts.
pub strength: Option<DriveStrength>,
/// Comments written between the gate (or its drive strength) and the `#`
/// of the delay: the `/* c */` of `and /* c */ #(2, 3) g (y, a, b);`.
pub before_hash: Vec<Comment>,
/// Comments written between that `#` and the delay itself.
pub after_hash: Vec<Comment>,
/// The delay written after `#`: empty when there is none, one element for
/// every spelling a net or a continuous assignment also accepts, and two
/// or three for the `(rise, fall[, turn-off])` list that only a gate
/// takes (IEEE 1800 §28.14, `top_earlgrey/ip/ast/rtl/aon_osc.sv:41`).
pub delay: Vec<Expr>,
pub delay: Vec<DelayValue>,
pub instances: Vec<GateInstance>,
/// Comments written between the last instance and the `;`.
pub before_semi: Vec<Comment>,
}
/// One value of a delay list, with the comments written on either side of the
/// separator that reaches it.
///
/// A one-value delay keeps its comments in its own [`ExprKind::Paren`], which
/// has had the two slots all along; this shape exists for the multi-value
/// `#(rise, fall[, turn-off])` list, whose parentheses and commas the printer
/// writes itself and which therefore has nowhere else to put them. The first
/// value's `leading` is what stood just inside the `(`, and the last value's
/// `trailing` is what stood just before the `)`.
#[derive(Debug)]
pub struct DelayValue {
/// Comments between the `(` or the `,` before this value and the value.
pub leading: Vec<Comment>,
pub expr: Expr,
/// Comments between the value and the `,` or `)` that follows it.
pub trailing: Vec<Comment>,
}
#[derive(Debug)]
@@ -377,6 +409,9 @@ pub struct GateInstance {
pub name: Option<String>,
/// Byte range of `name`.
pub name_span: Option<TextRange>,
/// Comments written between the instance name and the `(` of its
/// terminal list.
pub before_args: Vec<Comment>,
pub args: Vec<ExprItem>,
/// Code extent of the gate instance.
pub span: TextRange,