docs(code): remove stale pre-RFC role wording and fix review aid

Follow-up cleanup of text left by the concurrent implementation:

- marqdo-markdown AST, marqdo-ir statements/branch arms, frontend units,
  payload and signature module docs now describe RFC-LANG-0002 roles
  (payload carriers, heading modes, if/else groups, while/end, params)
- marqdo-expression public docs list parse_payload_statement and stop
  describing a Markdown-link call that no longer exists
- retired markdown.invalid_construct/markdown.inert_executable constants
  are documented as decode-only history for old Analysis/Trace JSON
- drop the stale 'expected red' comment in the CLI integration test
- the dev-only .mq.md review aid no longer reports semicolons inside
  string literals, and skips AST baselines / expected-invalid negatives

Verified: fmt, clippy -D warnings and cargo test --workspace --locked green.
This commit is contained in:
cflmy committed 2026-11-21 15:44:31 +08:00
1 parent 361a6cc341
commit d5002ac826
9 files changed
+104 -52

No files matched your search

+5 -3
View File
@@ -1,7 +1,9 @@
//! Executable payload extraction with a payload → file span map.
//! Payload extraction with a payload → file span map.
//!
//! A payload is the concatenation of the direct `text` and `code` children of
//! an executable node. The expression parser sees only that concatenated
//! Inside an `@exec` scope, `Strong`, `Emph` and inline `Code` are equivalent
//! one-statement carriers. For `Strong`/`Emph` the payload is the
//! concatenation of their direct `text` and `code` children; a nested carrier
//! is an error. The expression/statement parser sees only the concatenated
//! string, so its spans are payload-relative; this module maps them back to the
//! original file so diagnostics point at real source.
+5 -3
View File
@@ -1,8 +1,10 @@
//! Optional explicit function signatures.
//!
//! `` `(r: Number, precision: Int = 2)` `` as the first paragraph of a
//! function body declares the public parameter list. It is a *declaration*:
//! it does not execute. Without it, parameters are inferred from free reads.
//! `` `params(r: Number, precision: Int = 2)` `` as the first function-wide
//! direct payload of an Exec H2 declares the public parameter list. It is a
//! *declaration*: it does not execute. Without it, parameters are inferred from
//! free reads (and an inferred signature keeps the named-arguments-only rule).
//! See RFC-LANG-0002 and `spec/mapping.md` §6.
use marqdo_expression::{parse_expression, Expr, Statement, StatementKind};
use marqdo_ir::{Param, SignatureKind};
+13 -12
View File
@@ -1,17 +1,19 @@
//! Heading scope index.
//! Heading scope and semantic-mode index (RFC-LANG-0002).
//!
//! Markdown headings are sibling blocks, so function scopes are derived from
//! heading levels, not from container nesting:
//! Markdown headings are sibling blocks, so scopes are derived from heading
//! levels, not from container nesting:
//!
//! * `heading(level=1)` -> namespace / object domain (blueprint 1.2, 2.1)
//! * `heading(level=2)` -> function
//! * `heading(level>=3)` -> named section inside the enclosing unit, never a
//! new callable function
//! * `heading(level=1)` -> namespace / top-level unit
//! * `heading(level=2, mode=Exec)` -> callable function
//! * `heading(level=2, mode=Knowledge)` -> inert knowledge unit
//! * `heading(level>=3)` -> section of the enclosing unit, never a callable
//! function
//!
//! The range of a heading extends to the next heading of the same or a lower
//! level (same or smaller number). Headings inside block quotes, list items or
//! code fences cannot appear as direct children of the document, hence they can
//! never create functions.
//! Each heading declares `@exec`/`@knowledge` or inherits the nearest ancestor
//! heading's mode; the document root is Knowledge. The range of a heading
//! extends to the next heading of the same or a lower level (same or smaller
//! number). Headings inside block quotes, list items or code fences cannot
//! appear as direct children of the document, hence they never create units.
use std::collections::BTreeMap;
@@ -105,7 +107,6 @@ fn has_payload(node: &MdNode) -> bool {
}
}
/// Build the heading/function index for a parsed document.
/// Semantic mode declared or inherited by a heading (RFC-LANG-0002).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SemanticMode {