One Markdown-to-program mapping, no version selector or legacy mapper. Frontend/runtime: - resolve @exec/@knowledge heading declarations with nearest-ancestor inheritance; only an Exec H2 is callable; add UnitKind::Knowledge and sem.* diagnostics (mode marker, unit name, exec-without-function, payload nesting/empty, syntax, control stack, params position, version directive, inferred-signature lint) - extract Strong/Emph/inline Code as one-statement carriers, refuse nested carriers, and honour heading segment boundaries so an if/while cannot be closed across a heading - lower if/else/while/end to the existing Branch/Loop/Return IR with a compile-time control stack; keep payload-relative source spans through expression parsing and rewrite them onto the file - accept params(...) only as the first direct Exec H2 payload; keep the existing free-variable inference and named-only rule for inferred signatures; fix duplicate-mode/else/end and Knowledge-body inertness - reject marqdo_semantics/syntax front matter directives Data and tests: - migrate stdlib/**/*.mq.md, regenerate stdlib.json digest - migrate examples and the full semantics/negative/runtime corpus to the only current syntax; expected values/runtime codes preserved - migrate Rust-embedded .mq.md fixtures, init template, CLI help and security-lane fixtures Verified: cargo fmt --check, cargo clippy -D warnings and cargo test --workspace --locked (green).
marqdo-stdlib (bundled first slice)
This directory is the official, offline marqdo-stdlib bundle consumed by
std:<path> imports. The CLI verifies stdlib.json.digest before loading any
module; a mismatch is a hard error.
Migration status (RFC-LANG-0002): the sources here are still pre-RFC and do not yet use the current language syntax. Every
.mq.mdmodule in this directory is written in the superseded mapping (unmarked H2 as function,Strongas execution,Emphas return, ordered-list branches, bullet-list loops, block-quote calls, first code-span signatures). They are not valid sources for the target language and are not syntax examples to copy. The bundled stdlib will be migrated together with the Rust frontend and expression parser;stdlib.jsonand this digest will then be regenerated in the same change. Do not claim the stdlib already uses the new syntax. Authority:docs/architecture/RFC-LANG-0002-unified-semantics.md, normative summaryspec/mapping.md, statusdocs/STATUS.md.
format.mq.md— value formatting (显示, list/map/table display, escaping)text.mq.md— compatibility UTF-8 encoding intoMemorytext/utf8.mq.md—.mq.mdUTF-8 encoder and validating decoderio.mq.md— compatibility facade overstreamandconsolefs/file.mq.md— bounded project-file read/write/copy overresource.*io/stream.mq.md—写全部/写文本with short-write and close checkingio/console.mq.md—读取行/打印overstdio/stdinandstdio/stdoutdemo.mq.md— side-by-side comparison with builtin打印data/json.mq.md— recursive JSON parser/formatter, 128-depth bound, multi-valuedata/csv.mq.md— quoted single/multi-row CSV parser and formatterdata/table.mq.md— value-returning table select/filter/sort/append/set/join/group/GFMenv.mq.md— explicitly grantedenv.getnames overresource.requestprocess.mq.md— explicitly grantedprocess.runwith timeout/output capscompress.mq.md— deterministic gzip compress/decompress over byte listsrandom.mq.md— explicitly granted OS entropy bytes/integersdatetime.mq.md— UTC ISO-8601 format/parse over Unix milliseconds (pure)clock.mq.md— project-modeclock.nowoverresource.requestpath.mq.md— lexical join/basename/dirname/extension/normalize (no I/O)regex.mq.md— pure subset matcher + host-backed groups/alternation/capturesnet/http.mq.md— byte-exact HTTP/1.1 parsing (chunked) and request buildertests/— product self-tests for every public module (clock,compress,console,csv,datetime,demo,env,format,fs,http,io,json,path,process,random,regex,stream,table,text,utf8)
The digest is a SHA-256 over sorted *.mq.md relative paths, a NUL, file
bytes, and a NUL. It excludes stdlib.json and non-.mq.md files. After any
module change, regenerate it with:
python3 - stdlib <<'PY'
import hashlib, json, sys
from pathlib import Path
root=Path(sys.argv[1])
h=hashlib.sha256()
for p in sorted(root.rglob('*.mq.md'), key=lambda p: p.relative_to(root).as_posix()):
h.update(p.relative_to(root).as_posix().encode()); h.update(b'\0')
h.update(p.read_bytes()); h.update(b'\0')
manifest=json.loads((root/'stdlib.json').read_text())
manifest['digest']='sha256:'+h.hexdigest()
(root/'stdlib.json').write_text(json.dumps(manifest, indent=2)+'\n')
PY
The version/digest are part of each stdlib module's package instance id, so a different bundle cannot silently masquerade as the one a project was checked against.