Normalize whole tree with cargo fmt under rustfmt.toml

One-time mechanical pass; no behavior change (full test suite green
before and after). From here on, cargo fmt --check is the standard.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-08-18 23:41:18 -07:00
1 parent 8effef9b6b
commit d2cd44c428
8 files changed
+191 -149

No files matched your search

+108 -25
View File
@@ -31,7 +31,12 @@ pub struct Item {
#[derive(Debug)]
pub enum ItemKind {
Module(Module),
Package { kw: String, name: String, items: Vec<Item>, dangling: Vec<Comment> },
Package {
kw: String,
name: String,
items: Vec<Item>,
dangling: Vec<Comment>,
},
Directive(String),
Import(Vec<String>),
Timeunit(String),
@@ -42,13 +47,19 @@ pub enum ItemKind {
PortDecl(PortDecl),
ContAssign(ContAssign),
/// The body statement carries any `@(...)`/`#delay` timing control.
Always { kw: String, stmt: Stmt },
Always {
kw: String,
stmt: Stmt,
},
Initial(Stmt),
Final(Stmt),
Instantiation(Instantiation),
GateInstantiation(GateInstantiation),
Genvar(Vec<String>),
GenerateRegion { items: Vec<Item>, dangling: Vec<Comment> },
GenerateRegion {
items: Vec<Item>,
dangling: Vec<Comment>,
},
GenIf(GenIf),
GenFor(GenFor),
GenCase(GenCase),
@@ -412,11 +423,26 @@ pub enum StmtKind {
step: Vec<ForStep>,
body: Box<Stmt>,
},
While { cond: Expr, body: Box<Stmt> },
DoWhile { body: Box<Stmt>, cond: Expr },
Repeat { count: Expr, body: Box<Stmt> },
Forever { body: Box<Stmt> },
Foreach { target: Expr, vars: Vec<String>, body: Box<Stmt> },
While {
cond: Expr,
body: Box<Stmt>,
},
DoWhile {
body: Box<Stmt>,
cond: Expr,
},
Repeat {
count: Expr,
body: Box<Stmt>,
},
Forever {
body: Box<Stmt>,
},
Foreach {
target: Expr,
vars: Vec<String>,
body: Box<Stmt>,
},
/// Blocking/nonblocking/compound assignment.
Assign {
lhs: Expr,
@@ -426,11 +452,21 @@ pub enum StmtKind {
rhs: Expr,
},
/// `force`/`release`/`deassign` statements, raw pieces.
ForceRelease { kw: String, lhs: Expr, rhs: Option<Expr> },
ForceRelease {
kw: String,
lhs: Expr,
rhs: Option<Expr>,
},
/// Procedural timing control: `#10 stmt;`, `@(posedge clk) stmt;`,
/// `#10;`, `@(ev);`
Timing { control: TimingControl, stmt: Option<Box<Stmt>> },
Wait { cond: Expr, stmt: Option<Box<Stmt>> },
Timing {
control: TimingControl,
stmt: Option<Box<Stmt>>,
},
Wait {
cond: Expr,
stmt: Option<Box<Stmt>>,
},
ExprStmt(Expr),
/// `-> event_name;`
EventTrigger(Expr),
@@ -496,29 +532,76 @@ pub enum Expr {
Str(String),
/// Explicitly empty (used for `.port()` connections).
Empty,
Unary { op: String, expr: Box<Expr> },
Binary { lhs: Box<Expr>, op: String, rhs: Box<Expr> },
Ternary { cond: Box<Expr>, then: Box<Expr>, els: Box<Expr> },
Call { callee: Box<Expr>, args: Vec<Expr> },
Index { base: Box<Expr>, index: Box<Expr> },
Range { base: Box<Expr>, op: String, msb: Box<Expr>, lsb: Box<Expr> },
Member { base: Box<Expr>, name: String },
Scope { base: Box<Expr>, name: String },
Unary {
op: String,
expr: Box<Expr>,
},
Binary {
lhs: Box<Expr>,
op: String,
rhs: Box<Expr>,
},
Ternary {
cond: Box<Expr>,
then: Box<Expr>,
els: Box<Expr>,
},
Call {
callee: Box<Expr>,
args: Vec<Expr>,
},
Index {
base: Box<Expr>,
index: Box<Expr>,
},
Range {
base: Box<Expr>,
op: String,
msb: Box<Expr>,
lsb: Box<Expr>,
},
Member {
base: Box<Expr>,
name: String,
},
Scope {
base: Box<Expr>,
name: String,
},
Concat(Vec<Expr>),
Repl { count: Box<Expr>, inner: Vec<Expr> },
Repl {
count: Box<Expr>,
inner: Vec<Expr>,
},
Paren(Box<Expr>),
/// `ty'(expr)` cast; `ty` kept as raw text.
Cast { ty: String, expr: Box<Expr> },
Cast {
ty: String,
expr: Box<Expr>,
},
/// `'{...}` assignment pattern.
AssignPattern(Vec<PatternItem>),
Postfix { expr: Box<Expr>, op: String },
Inside { lhs: Box<Expr>, ranges: Vec<Expr> },
Postfix {
expr: Box<Expr>,
op: String,
},
Inside {
lhs: Box<Expr>,
ranges: Vec<Expr>,
},
/// `[a:b]` inside an `inside` range list or value range.
ValueRange { lo: Box<Expr>, hi: Box<Expr> },
ValueRange {
lo: Box<Expr>,
hi: Box<Expr>,
},
/// A type used in expression position (`parameter type T = logic [7:0]`).
Type(DataType),
/// `(min : typ : max)` delay expression.
MinTypMax { min: Box<Expr>, typ: Box<Expr>, max: Box<Expr> },
MinTypMax {
min: Box<Expr>,
typ: Box<Expr>,
max: Box<Expr>,
},
}
#[derive(Debug, Clone)]