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
@@ -367,6 +367,19 @@ impl Interpreter {
|
||||
let _ = self.eval_call(module, fun, env, call)?;
|
||||
Ok(None)
|
||||
}
|
||||
Stmt::Expr { value, span } => {
|
||||
self.current_span = *span;
|
||||
if self.trace {
|
||||
emit_trace(
|
||||
self.path.as_deref(),
|
||||
Some(*span),
|
||||
"stmt",
|
||||
&[("kind", "expr")],
|
||||
);
|
||||
}
|
||||
let _ = self.eval_expr(module, fun, env, value)?;
|
||||
Ok(None)
|
||||
}
|
||||
Stmt::Branch { arms, span } => {
|
||||
self.current_span = *span;
|
||||
if self.trace {
|
||||
@@ -1248,6 +1261,7 @@ fn stmt_span(stmt: &Stmt) -> Span {
|
||||
Stmt::Assign { span, .. }
|
||||
| Stmt::Return { span, .. }
|
||||
| Stmt::Call { span, .. }
|
||||
| Stmt::Expr { span, .. }
|
||||
| Stmt::Branch { span, .. }
|
||||
| Stmt::While { span, .. }
|
||||
| Stmt::ForEach { span, .. } => *span,
|
||||
|
||||
Reference in new issue
Block a user