feat(parse): bold infix expressions are ExprStmt, not calls
`` **n + 1** `` evaluates and discards (design §6.2); keep assign-first and bare-call fallback. Explicit `` **> …** `` uses standalone bare=text rules. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
114fd53cd1
commit
bccfec86ba
9 files changed
+81
-8
No files matched your search
@@ -86,6 +86,11 @@ pub enum Stmt {
|
||||
call: CallExpr,
|
||||
span: Span,
|
||||
},
|
||||
/// Bold expression statement (`**n + 1**`); value evaluated and discarded.
|
||||
Expr {
|
||||
value: Expr,
|
||||
span: Span,
|
||||
},
|
||||
Branch {
|
||||
arms: Vec<BranchArm>,
|
||||
span: Span,
|
||||
@@ -309,6 +314,9 @@ fn dump_stmt(out: &mut String, stmt: &Stmt, depth: usize) {
|
||||
call.receiver, call.callee, call.args
|
||||
));
|
||||
}
|
||||
Stmt::Expr { value, span } => {
|
||||
out.push_str(&format!("{pad}(expr {value:?} @{span})\n"));
|
||||
}
|
||||
Stmt::Branch { arms, span } => {
|
||||
out.push_str(&format!("{pad}(branch @{span}\n"));
|
||||
for arm in arms {
|
||||
|
||||
Reference in new issue
Block a user