refactor(ir): drop the dead call-statement representation
The pre-RFC link-form block-quote call was removed by RFC-LANG-0002, but the IR still carried Stmt::Call, CallSite and CallTarget with matching branches in the runtime, infer, call validation, loader, analysis projection and JSON output. No mapper produces that variant any more, so it was a second call representation that could never be reached. - remove Stmt::Call, CallSite and CallTarget from marqdo-ir - remove the runtime exec_call_site path and every exhaustive match arm - remove the 'call_site' Analysis node and its JSON helpers - state in spec/analysis-v2.md that calls are expressions; keep v1 as history with a note that call_site is not produced by the current language Verified: cargo clippy --workspace --all-targets -D warnings clean and cargo test --workspace --locked green (62 targets).
This commit is contained in:
1 parent
b38b769932
commit
361a6cc341
8 files changed
+10
-123
No files matched your search
@@ -12,7 +12,7 @@
|
||||
use std::collections::BTreeMap;
|
||||
use std::fmt;
|
||||
|
||||
use marqdo_expression::{Arg, Expr};
|
||||
use marqdo_expression::Expr;
|
||||
use marqdo_span::Span;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -283,13 +283,6 @@ pub enum Stmt {
|
||||
/// Span of the whole statement.
|
||||
span: Span,
|
||||
},
|
||||
/// Markdown-link call form from a block quote.
|
||||
Call {
|
||||
/// Resolved call site.
|
||||
call: CallSite,
|
||||
/// Span of the whole statement.
|
||||
span: Span,
|
||||
},
|
||||
/// Ordered list: first matching condition wins.
|
||||
Branch {
|
||||
/// Arms in AST order.
|
||||
@@ -323,7 +316,6 @@ impl Stmt {
|
||||
match self {
|
||||
Stmt::Assign { span, .. }
|
||||
| Stmt::Eval { span, .. }
|
||||
| Stmt::Call { span, .. }
|
||||
| Stmt::Branch { span, .. }
|
||||
| Stmt::Loop { span, .. }
|
||||
| Stmt::Return { span, .. } => *span,
|
||||
@@ -344,42 +336,6 @@ pub struct BranchArm {
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
/// Target of a call statement.
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(tag = "target", rename_all = "snake_case")]
|
||||
pub enum CallTarget {
|
||||
/// Unqualified function in the current module.
|
||||
Function {
|
||||
/// Canonical function name.
|
||||
name: String,
|
||||
},
|
||||
/// Function reached through an imported module alias.
|
||||
Qualified {
|
||||
/// Local import alias.
|
||||
module_alias: String,
|
||||
/// Canonical function name.
|
||||
function: String,
|
||||
},
|
||||
/// Function resolved from a Markdown link target.
|
||||
Resolved {
|
||||
/// Canonical module identity.
|
||||
module: ModuleId,
|
||||
/// Canonical function name.
|
||||
function: String,
|
||||
},
|
||||
}
|
||||
|
||||
/// A call statement with evaluated arguments.
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CallSite {
|
||||
/// Callee target.
|
||||
pub target: CallTarget,
|
||||
/// Arguments in source order.
|
||||
pub args: Vec<Arg>,
|
||||
/// Span of the call.
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
/// One explicit import declared in front matter.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct ImportDecl {
|
||||
|
||||
Reference in new issue
Block a user