From f275d1e030730eb7b048b10ec6e4f296789272f6 Mon Sep 17 00:00:00 2001 From: cflmy Date: Mon, 17 Aug 2026 17:22:45 +0800 Subject: [PATCH] =?UTF-8?q?Drop=20redundant=20backticks=20in=20*=E2=80=A6*?= =?UTF-8?q?=20/=20**=E2=80=A6**=20code=20segments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Value-expression variables inside *…* / **…** segments no longer need backticks (the segment markers already mark code). Drop trailing spaces and de-tick value-expression variable names in tests and skill docs; keep backticks for string interpolation, call args, and method receivers. Co-authored-by: Cursor --- .cursor/skills/marqdo/SKILL.md | 19 ++-- .cursor/skills/marqdo/examples.md | 38 ++++---- .cursor/skills/marqdo/reference.md | 2 +- tests/errors/bad-int.mq.md | 2 +- tests/errors/bad-split-sep.mq.md | 2 +- tests/errors/div-zero.mq.md | 2 +- tests/errors/footnote-missing-key.mq.md | 2 +- tests/errors/footnote-oob.mq.md | 2 +- tests/errors/footnote-zero.mq.md | 2 +- tests/ext/agent-inspect-fixture.mq.md | 20 ++--- tests/ext/agent-kb-alias.mq.md | 64 +++++++------- tests/ext/agent-kb-near.mq.md | 44 +++++----- tests/ext/agent-kb-reuse.mq.md | 40 ++++----- tests/ext/agent-lib-call.mq.md | 34 ++++---- tests/ext/agent-plan-confirm.mq.md | 20 ++--- tests/ext/agent-plan-decision.mq.md | 92 ++++++++++---------- tests/ext/agent-plan-live.mq.md | 24 ++--- tests/ext/agent-plan-observe.mq.md | 24 ++--- tests/ext/agent-plan-stream-offline.mq.md | 66 +++++++------- tests/ext/agent-run-live.mq.md | 28 +++--- tests/ext/agent-smoke.mq.md | 54 ++++++------ tests/ext/agent-soft-match.mq.md | 26 +++--- tests/ext/fs-text-patch.mq.md | 16 ++-- tests/ext/llm-complete.mq.md | 4 +- tests/ext/llm-ctor-offline.mq.md | 2 +- tests/ext/llm-stream-live.mq.md | 8 +- tests/ext/llm-stream-offline.mq.md | 6 +- tests/ext/quantum-amp-damp-smoke.mq.md | 10 +-- tests/ext/quantum-amp-damp-zh-smoke.mq.md | 10 +-- tests/ext/quantum-author-api-smoke.mq.md | 28 +++--- tests/ext/quantum-author-api-zh-smoke.mq.md | 28 +++--- tests/ext/quantum-bell-smoke.mq.md | 20 ++--- tests/ext/quantum-custom-gate-smoke.mq.md | 14 +-- tests/ext/quantum-custom-gate-zh-smoke.mq.md | 14 +-- tests/ext/quantum-draw-smoke.mq.md | 14 +-- tests/ext/quantum-gate-heatmap-smoke.mq.md | 6 +- tests/ext/quantum-gate-matrix-smoke.mq.md | 10 +-- tests/ext/quantum-gates-smoke.mq.md | 40 ++++----- tests/ext/quantum-noise-smoke.mq.md | 10 +-- tests/ext/quantum-noise-zh-smoke.mq.md | 10 +-- tests/ext/quantum-steps-smoke.mq.md | 14 +-- tests/ext/quantum-zh-smoke.mq.md | 14 +-- tests/ext/web-admin-smoke.mq.md | 40 ++++----- tests/ext/web-fixtures/components/foot.mq.md | 2 +- tests/ext/web-fixtures/components/nav.mq.md | 2 +- tests/ext/web-fixtures/components/side.mq.md | 2 +- tests/ext/web-fixtures/db/articles.mq.md | 4 +- tests/ext/web-fixtures/styles/shell.mq.md | 8 +- tests/ext/web-form-embed-smoke.mq.md | 12 +-- tests/ext/web-form-smoke.mq.md | 24 ++--- tests/ext/web-part-smoke.mq.md | 30 +++---- tests/ext/web-route-smoke.mq.md | 18 ++-- tests/ext/web-select-smoke.mq.md | 16 ++-- tests/ext/web-smoke.mq.md | 32 +++---- tests/ext/web-static-smoke.mq.md | 14 +-- tests/ext/web-zh-smoke.mq.md | 32 +++---- tests/keywords/bool-logic.mq.md | 6 +- tests/keywords/input-escape.mq.md | 2 +- tests/keywords/input.mq.md | 2 +- tests/keywords/quoted-string.mq.md | 2 +- tests/keywords/stdlib-more.mq.md | 14 +-- tests/keywords/stdlib.mq.md | 12 +-- tests/keywords/zh-bool.mq.md | 6 +- tests/keywords/zh-builtins.mq.md | 8 +- tests/lib/foreign-python.mq.md | 2 +- tests/lib/foreign-run-lang.mq.md | 2 +- tests/lib/fs-read.mq.md | 4 +- tests/lib/json-quote.mq.md | 2 +- tests/lib/json-roundtrip.mq.md | 10 +-- tests/lib/math-formula-chain.mq.md | 8 +- tests/lib/math-formula.mq.md | 8 +- tests/lib/math-plot.mq.md | 4 +- tests/lib/math-random.mq.md | 6 +- tests/lib/net-encode.mq.md | 2 +- tests/lib/net-openai-sse-reasoning.mq.md | 24 ++--- tests/lib/net-openai-sse.mq.md | 10 +-- tests/lib/plugin-demo.mq.md | 6 +- tests/lib/subtask-fn.mq.md | 8 +- tests/lib/subtask-foreign.mq.md | 4 +- tests/lib/subtask-quiet-io.mq.md | 10 +-- tests/lib/subtask-spawn.mq.md | 16 ++-- tests/lib/sys-cwd.mq.md | 4 +- tests/lib/sys-dotenv.mq.md | 2 +- tests/lib/table-collections.mq.md | 26 +++--- tests/lib/time-format.mq.md | 4 +- tests/lib/writeback-async.mq.md | 6 +- tests/lib/writeback-get.mq.md | 2 +- tests/lib/外联-python.mq.md | 2 +- tests/lib/数学-数值.mq.md | 6 +- tests/lib/文件-读.mq.md | 4 +- tests/lib/表-集合.mq.md | 8 +- tests/structure/bare-id-italic-bold.mq.md | 10 +-- tests/structure/branch-consecutive.mq.md | 4 +- tests/structure/branch.mq.md | 2 +- tests/structure/collection-cell-expr.mq.md | 4 +- tests/structure/collection-map-list.mq.md | 6 +- tests/structure/collection-map.mq.md | 6 +- tests/structure/collection-records-at.mq.md | 4 +- tests/structure/collection-records.mq.md | 6 +- tests/structure/footnote-index.mq.md | 6 +- tests/structure/footnote-map-digits.mq.md | 4 +- tests/structure/import-lib.mq.md | 6 +- tests/structure/import/main.mq.md | 2 +- tests/structure/import/utils.mq.md | 2 +- tests/structure/inherit-explicit-super.mq.md | 20 ++--- tests/structure/inherit-override.mq.md | 16 ++-- tests/structure/inherit-parent-method.mq.md | 10 +-- tests/structure/loop.mq.md | 4 +- tests/structure/ns/helpers.mq.md | 4 +- tests/structure/ns/path3.mq.md | 4 +- tests/structure/ns/use.mq.md | 2 +- tests/structure/object-handle.mq.md | 38 ++++---- 112 files changed, 762 insertions(+), 761 deletions(-) diff --git a/.cursor/skills/marqdo/SKILL.md b/.cursor/skills/marqdo/SKILL.md index b221845..11e96a9 100644 --- a/.cursor/skills/marqdo/SKILL.md +++ b/.cursor/skills/marqdo/SKILL.md @@ -20,7 +20,7 @@ Canonical design (repo): `doc/design/markdown-mapping.md`, `doc/design/keywords. 2. **Output is not `**bold**`.** Print with `> print text=…` (or `> 打印 内容=…`). Bold `**…**` is **return value only**. 3. **Prose vs code:** after a blank line, an unmarked first line starts a **comment paragraph**; every following non-blank line stays comment until the next blank line. Put a **blank line** between narration and executable lines. 4. **Do not invent keywords** `if` / `else` / `while` / `for` / `def` / `return`. Control flow is Markdown: **`+` params** (under heading), **`1.` `2.` … branches**, **`-` loops**, arm `N. *` = else, `#` = **object/type**, `##`+ = **function/method**, `**…**` = return. -5. **Identifiers use backticks** — params `` + `name` ``. **Exemptions:** foreach `` - [item](coll) ``; footnote `` name[^key] ``; **inside italic `*…*` / bold `**…**`**, bare ids are variables (strings need `"…"` / `'…'`; ticks still ok). +5. **Identifiers use backticks** — params `` + `name` ``. **Exemptions:** foreach `` - [item](coll) ``; footnote `` name[^key] ``; **inside italic `*…*` / bold `**…**`**, bare ids are variables (strings need `"…"` / `'…'`; ticks still ok). **Drop the backticks on value-expression variable names inside `*…*` / `**…**`** — they are redundant once the `*…*`/`**…**` markers mark the segment as code: `*分类 = 分类[^苹果]*`, `**n * 2**`. **Still required** where a bare word is *not* a variable: inside `"…"` / `'…'` interpolation (`` "Hello, `who`!" ``), inside `> call args` (`` > str `n` ``), and on method-call receivers (`` > `obj`.method ``). **No trailing space** inside `*…*` / `**…**` wrapped code: the closing marker must touch the last token directly (`*`a` = 1*`, `**n**`), never `` *`a` = 1 * ``. 6. **Structure lines are not wrapped in italics.** `#` `>` `+` `-` `|` lines stand alone; use `*…*` only for general statements (bindings / expressions). 7. **Paths:** In bare *expressions* `/` is division. In **call args / param defaults**, unspaced `a/b` and quoted `".marqdo/agent-kb"` are path text — no `json.parse` needed. 8. Prefer ending side-effect-only function bodies with a lone `---` or `***` line (or `****` empty return) so later siblings are not swallowed. @@ -41,8 +41,8 @@ Canonical design (repo): `doc/design/markdown-mapping.md`, `doc/design/keywords. | Frontmatter `import bind:path.mq.md` / `导入` | Import file (bind library name) | | Frontmatter `import bind:lib.member` / `导入` | Short name for a library member (same keyword; no separate `use`) | | `> lib.member …` / `> lib.Type.member …` | Call via bare dotted path (instance methods need `` `var`.m ``) | -| `*…*` | Statement (bind / expr) | -| `**…**` | Return value | +| `*…*` | Statement (bind / expr) — closing `*` touches last token, **no trailing space**; bare ids are variables | +| `**…**` | Return value — closing `**` touches last token, **no trailing space**; bare ids are variables | | `****` or `**` + spaces + `**` | Return `None` and end function body | | Lone `---` / `***` in function body | End function body (no value) | | GFM table after empty RHS bind | Collection (1-col list / ≥2-col map / `@`·`行`·`row` → list of maps); `` `x`[^1] `` / `` `m`[^key] `` | @@ -90,17 +90,17 @@ Chinese builtins (same functions, no import): ## Statements, returns, branches ```markdown -*`x` = 1* -*`y` = `x` + 2* +*x = 1* +*y = x + 2* ## add_one + `n` -**`n` + 1** +**n + 1** ``` ```markdown -*`n` = 0* +*n = 0* 1. `n` > 0 > print text=positive @@ -123,9 +123,9 @@ import clock:lib/time.mq.md # main -*`xs` = > text.split value=a,b,c sep=,* +*xs = > text.split value=a,b,c sep=,* > print text=`xs` -*`t` = > clock.now_unix * +*t = > clock.now_unix* ``` - Import **English** or **Chinese** library file; call that file’s API names via `lib.member` (do not mix languages). @@ -155,6 +155,7 @@ Stdlib map: [reference.md](reference.md). | `# main` then prose then code with no blank line | Blank line before code | | `if x > 0:` | `1. `x` > 0` | | `* > print text=hi *` | `> print text=hi` | +| `` *`a` = 1 * `` (trailing space) | `` *`a` = 1* `` — no trailing space before `*` / `**` | | Forgetting `---` after nested `##` helper | Add `---` / `***` / `****` | | Import `lib/text` then call bare `split` | `> text.split …` (qualified) | | Import `lib/text` then call `拆分` | Match file language (`text.split`, not 文本) | diff --git a/.cursor/skills/marqdo/examples.md b/.cursor/skills/marqdo/examples.md index 47c520e..c789050 100644 --- a/.cursor/skills/marqdo/examples.md +++ b/.cursor/skills/marqdo/examples.md @@ -38,14 +38,14 @@ Greeting via a nested function: ```markdown # main -*`a` = 2* -*`b` = > add_one n=`a`* +*a = 2* +*b = > add_one n=`a`* > print text=`b` ## add_one + `n` -**`n` + 1** +**n + 1** ``` ## 5. Branch with else @@ -53,7 +53,7 @@ Greeting via a nested function: ```markdown # main -*`n` = 0* +*n = 0* 1. `n` > 0 > print text=positive @@ -89,10 +89,10 @@ Greeting via a nested function: |------|------| | 水果 | 蔬菜 | -*`种` = 分类[^苹果] * +*种 = 分类[^苹果]* > print text=`种` -*`第一` = 篮子[^1] * +*第一 = 篮子[^1]* ``` One column → list; ≥2 columns + one data row → map; ≥2 columns + many rows → map of lists. Data cells are expressions (same as call-arg values): bare words, numbers, `` `var` ``, quoted strings; URLs and `gpt-4o-mini` stay text via path/hyphen folding. Footnotes: lists use 1-based digit indices; maps use key text (including digit keys like `[^00]`). Foreach on a map walks **keys**. @@ -106,7 +106,7 @@ Row-oriented records (SQL-like): first header `@` / `行` / `row` → list of ma |----|------|------| | 1 | 苹果 | 2 | -*`名` = `订单`[^1][^品名] * +*名 = 订单[^1][^品名]* ``` ## 7. Import text stdlib @@ -119,7 +119,7 @@ import text:lib/text.mq.md # main -*`parts` = > split value=a,b,c sep=,* +*parts = > split value=a,b,c sep=,* > print text=`parts` ``` @@ -129,7 +129,7 @@ import text:lib/text.mq.md # main This whole paragraph is a comment, including lines that look like code: -*`not_executed` = 1* +*not_executed = 1* > print text=also still comment After a blank line, code runs: @@ -147,7 +147,7 @@ import math:lib/math.mq.md # main -*`t` = > num value=3.5* +*t = > num value=3.5* > print text=`t` ``` @@ -163,16 +163,16 @@ See `tests/structure/object-handle.mq.md` and `ext/llm.mq.md`: `# Type` construc ## hello + `who` -*`msg` = "Hello, `who`!" * -**`msg`** +*msg = "Hello, `who`!"* +**msg** # Loud = > Greeter ## hello + `who` -*`msg` = "HELLO, `who`!" * -**`msg`** +*msg = "HELLO, `who`!"* +**msg** ``` `_type` stays the most specific name (`Loud`). Methods walk the base chain; same-name `##` on the child overrides. **No implicit super** — if the child needs parent fields, call the parent explicitly: @@ -181,9 +181,9 @@ See `tests/structure/object-handle.mq.md` and `ext/llm.mq.md`: `# Type` construc # Child = > Parent + `name` -*`self` = > Parent name=`name` * -*`self` = > json.set map=`self` key=extra value=1 * -**`self`** +*self = > Parent name=`name`* +*self = > json.set map=`self` key=extra value=1* +**self** ``` ## 11. Agent layout (ABI) @@ -197,8 +197,8 @@ import agent:ext/agent.mq.md > load_native -*`ws` = > agent * -*`n` = > `ws`.ensure_layout * +*ws = > agent* +*n = > `ws`.ensure_layout* > print text=`n` ``` diff --git a/.cursor/skills/marqdo/reference.md b/.cursor/skills/marqdo/reference.md index d195569..a1c1944 100644 --- a/.cursor/skills/marqdo/reference.md +++ b/.cursor/skills/marqdo/reference.md @@ -71,7 +71,7 @@ $$ x^2 - 2 $$ -*`_svg` = > plot formula=`f` var=x min=-3 max=3 * +*_svg = > plot formula=`f` var=x min=-3 max=3* ``` Empty RHS assignment + following `$$…$$` binds a formula value. Narrative-only `$$` without binding is display, not assignment. diff --git a/tests/errors/bad-int.mq.md b/tests/errors/bad-int.mq.md index a89dc3d..d1cbf9a 100644 --- a/tests/errors/bad-int.mq.md +++ b/tests/errors/bad-int.mq.md @@ -4,4 +4,4 @@ title: bad int # main -*`x` = > int not-a-number* +*x = > int not-a-number* diff --git a/tests/errors/bad-split-sep.mq.md b/tests/errors/bad-split-sep.mq.md index 086a568..d2667c3 100644 --- a/tests/errors/bad-split-sep.mq.md +++ b/tests/errors/bad-split-sep.mq.md @@ -4,4 +4,4 @@ title: empty split sep # main -*`xs` = > split value=ab sep=* +*xs = > split value=ab sep=* diff --git a/tests/errors/div-zero.mq.md b/tests/errors/div-zero.mq.md index 6177ab1..e5e5905 100644 --- a/tests/errors/div-zero.mq.md +++ b/tests/errors/div-zero.mq.md @@ -4,6 +4,6 @@ title: division by zero # main -*`x` = 1 / 0* +*x = 1 / 0* > print text=`x` diff --git a/tests/errors/footnote-missing-key.mq.md b/tests/errors/footnote-missing-key.mq.md index 05934d4..214662a 100644 --- a/tests/errors/footnote-missing-key.mq.md +++ b/tests/errors/footnote-missing-key.mq.md @@ -10,6 +10,6 @@ title: footnote missing map key |------|------| | 水果 | 蔬菜 | -*`x` = `分类`[^香蕉] * +*x = 分类[^香蕉]* > print text=`x` diff --git a/tests/errors/footnote-oob.mq.md b/tests/errors/footnote-oob.mq.md index e9202e1..6633d79 100644 --- a/tests/errors/footnote-oob.mq.md +++ b/tests/errors/footnote-oob.mq.md @@ -10,6 +10,6 @@ title: footnote list out of range |----| | 苹果 | -*`x` = `篮子`[^2] * +*x = 篮子[^2]* > print text=`x` diff --git a/tests/errors/footnote-zero.mq.md b/tests/errors/footnote-zero.mq.md index df01ace..a91a618 100644 --- a/tests/errors/footnote-zero.mq.md +++ b/tests/errors/footnote-zero.mq.md @@ -10,6 +10,6 @@ title: footnote [^0] invalid |----| | 苹果 | -*`x` = `篮子`[^0] * +*x = 篮子[^0]* > print text=`x` diff --git a/tests/ext/agent-inspect-fixture.mq.md b/tests/ext/agent-inspect-fixture.mq.md index 6ed2d93..d9ed87e 100644 --- a/tests/ext/agent-inspect-fixture.mq.md +++ b/tests/ext/agent-inspect-fixture.mq.md @@ -8,23 +8,23 @@ import fs:lib/fs.mq.md # main -*`paths` = > json.parse text={"f":".marqdo/agent-runs/inspect-fixture.mq.md"} * -*`fixture` = > json.get value=`paths` key=f * -*`body` = > json.parse text={"t":"# main\n\n> print text=hi\n\n\n"} * -*`t` = > json.get value=`body` key=t * +*paths = > json.parse text={"f":".marqdo/agent-runs/inspect-fixture.mq.md"}* +*fixture = > json.get value=`paths` key=f* +*body = > json.parse text={"t":"# main\n\n> print text=hi\n\n\n"}* +*t = > json.get value=`body` key=t* > fs.write_text path=`fixture` text=`t` -*`obs` = > agent.inspect_workbook path=`fixture` exit_code=0 * -*`code` = > json.get value=`obs` key=exit_code * +*obs = > agent.inspect_workbook path=`fixture` exit_code=0* +*code = > json.get value=`obs` key=exit_code* > print text=`code` -*`ok` = > json.get value=`obs` key=last_ok * -*`has` = > split value=`ok` sep=done * -*`n` = > len value=`has` * +*ok = > json.get value=`obs` key=last_ok* +*has = > split value=`ok` sep=done* +*n = > len value=`has`* 1. `n` > 1 > print text=ok-slot 2. * > print text=ok-missing -*`err` = > json.get value=`obs` key=last_error * +*err = > json.get value=`obs` key=last_error* > print text=`err` diff --git a/tests/ext/agent-kb-alias.mq.md b/tests/ext/agent-kb-alias.mq.md index 55a1b6d..6182bc7 100644 --- a/tests/ext/agent-kb-alias.mq.md +++ b/tests/ext/agent-kb-alias.mq.md @@ -10,83 +10,83 @@ import sys:lib/sys.mq.md # main -*`p` = > plugin.native_path name=agent * +*p = > plugin.native_path name=agent* 1. `p` > plugin.load path=`p` 2. * > print text=no-agent-plugin > sys.exit code=1 -*`kb` = ".marqdo/agent-kb-alias-test" * -*`wb` = ".marqdo/agent-runs/alias-pong.mq.md" * -*`goal` = "Reply with exactly the word pong and nothing else." * -*`alias` = "say pong only" * -*`body` = "---\ntitle: pong skill\n---\n\n# main\n\n*msg = \"pong\"*\n\n**msg**\n" * +*kb = ".marqdo/agent-kb-alias-test"* +*wb = ".marqdo/agent-runs/alias-pong.mq.md"* +*goal = "Reply with exactly the word pong and nothing else."* +*alias = "say pong only"* +*body = "---\ntitle: pong skill\n---\n\n# main\n\n*msg = \"pong\"*\n\n**msg**\n"* > fs.write_text path=`wb` text=`body` -*`prom` = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb` aliases=`alias` * -*`okp` = > json.get value=`prom` key=promoted * +*prom = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb` aliases=`alias`* +*okp = > json.get value=`prom` key=promoted* 1. `okp` > print text=promoted 2. * > print text=promote-fail -*`slug` = > json.get value=`prom` key=slug * -*`parts` = > json.parse text={"a":"/concepts/tasks/","b":".md"} * -*`a` = > json.get value=`parts` key=a * -*`b` = > json.get value=`parts` key=b * -*`task` = `kb` + `a` + `slug` + `b` * -*`src` = > fs.read_text path=`task` * -*`has` = > split value=`src` sep=say pong only * -*`hn` = > len value=`has` * +*slug = > json.get value=`prom` key=slug* +*parts = > json.parse text={"a":"/concepts/tasks/","b":".md"}* +*a = > json.get value=`parts` key=a* +*b = > json.get value=`parts` key=b* +*task = kb + a + slug + b* +*src = > fs.read_text path=`task`* +*has = > split value=`src` sep=say pong only* +*hn = > len value=`has`* 1. `hn` > 1 > print text=alias-written 2. * > print text=alias-missing -*`hit` = > agent_kb_lookup kb_dir=`kb` goal=`alias` * +*hit = > agent_kb_lookup kb_dir=`kb` goal=`alias`* 1. `hit` > print text=alias-ok 2. * > print text=alias-miss -*`mk` = > json.get value=`hit` key=match * +*mk = > json.get value=`hit` key=match* > print text=`mk` -*`slug_hit` = > json.get value=`hit` key=slug * +*slug_hit = > json.get value=`hit` key=slug* 1. `slug` == `slug_hit` > print text=same-slug 2. * > print text=slug-drift -*`exact` = > agent_kb_lookup kb_dir=`kb` goal=`goal` * -*`mk2` = > json.get value=`exact` key=match * +*exact = > agent_kb_lookup kb_dir=`kb` goal=`goal`* +*mk2 = > json.get value=`exact` key=match* > print text=`mk2` -*`g_trip` = "帮我规划明天的行程" * -*`wb2` = ".marqdo/agent-runs/alias-trip.mq.md" * -*`body2` = "---\ntitle: trip\n---\n\n# main\n\n*msg = \"trip-ok\"*\n\n**msg**\n" * +*g_trip = "帮我规划明天的行程"* +*wb2 = ".marqdo/agent-runs/alias-trip.mq.md"* +*body2 = "---\ntitle: trip\n---\n\n# main\n\n*msg = \"trip-ok\"*\n\n**msg**\n"* > fs.write_text path=`wb2` text=`body2` -*`prom2` = > agent_kb_promote kb_dir=`kb` goal=`g_trip` workbook=`wb2` * -*`ok2` = > json.get value=`prom2` key=promoted * +*prom2 = > agent_kb_promote kb_dir=`kb` goal=`g_trip` workbook=`wb2`* +*ok2 = > json.get value=`prom2` key=promoted* 1. `ok2` > print text=trip-promoted 2. * > print text=trip-promote-fail -*`g_canon` = "你是一个智能体,帮我规划明天的行程" * -*`c` = > agent_kb_canonicalize goal=`g_canon` * +*g_canon = "你是一个智能体,帮我规划明天的行程"* +*c = > agent_kb_canonicalize goal=`g_canon`* > print text=`c` -*`hit_c` = > agent_kb_lookup kb_dir=`kb` goal=`g_canon` * +*hit_c = > agent_kb_lookup kb_dir=`kb` goal=`g_canon`* 1. `hit_c` > print text=canonical-ok 2. * > print text=canonical-miss -*`mk3` = > json.get value=`hit_c` key=match * +*mk3 = > json.get value=`hit_c` key=match* > print text=`mk3` -*`listed` = > agent_kb_list_tasks kb_dir=`kb` * -*`tc` = > json.get value=`listed` key=count * +*listed = > agent_kb_list_tasks kb_dir=`kb`* +*tc = > json.get value=`listed` key=count* 1. `tc` > 1 > print text=list-ok 2. * diff --git a/tests/ext/agent-kb-near.mq.md b/tests/ext/agent-kb-near.mq.md index 0fe8e8e..d2c6df5 100644 --- a/tests/ext/agent-kb-near.mq.md +++ b/tests/ext/agent-kb-near.mq.md @@ -10,67 +10,67 @@ import sys:lib/sys.mq.md # main -*`p` = > plugin.native_path name=agent * +*p = > plugin.native_path name=agent* 1. `p` > plugin.load path=`p` 2. * > print text=no-agent-plugin > sys.exit code=1 -*`kb` = ".marqdo/agent-kb-near-test" * -*`wb` = ".marqdo/agent-runs/near-trip.mq.md" * -*`goal` = "帮我规划明天的行程" * -*`body` = "---\ntitle: trip\n---\n\n# main\n\n*msg = \"trip-ok\"*\n\n**msg**\n" * +*kb = ".marqdo/agent-kb-near-test"* +*wb = ".marqdo/agent-runs/near-trip.mq.md"* +*goal = "帮我规划明天的行程"* +*body = "---\ntitle: trip\n---\n\n# main\n\n*msg = \"trip-ok\"*\n\n**msg**\n"* > fs.write_text path=`wb` text=`body` -*`prom` = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb` * -*`okp` = > json.get value=`prom` key=promoted * +*prom = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb`* +*okp = > json.get value=`prom` key=promoted* 1. `okp` > print text=promoted 2. * > print text=promote-fail -*`slug` = > json.get value=`prom` key=slug * +*slug = > json.get value=`prom` key=slug* -*`g1` = "帮我规划明天行程" * -*`hit1` = > agent_kb_lookup kb_dir=`kb` goal=`g1` near_match=True near_threshold=0.78 * +*g1 = "帮我规划明天行程"* +*hit1 = > agent_kb_lookup kb_dir=`kb` goal=`g1` near_match=True near_threshold=0.78* 1. `hit1` > print text=near-ok 2. * > print text=near-miss -*`mk1` = > json.get value=`hit1` key=match * +*mk1 = > json.get value=`hit1` key=match* > print text=`mk1` -*`slug1` = > json.get value=`hit1` key=slug * +*slug1 = > json.get value=`hit1` key=slug* 1. `slug` == `slug1` > print text=same-slug 2. * > print text=slug-drift -*`off` = > agent_kb_lookup kb_dir=`kb` goal=`g1` near_match=False * +*off = > agent_kb_lookup kb_dir=`kb` goal=`g1` near_match=False* 1. `off` > print text=off-hit 2. * > print text=off-miss -*`g2` = "明天做什么好" * -*`hit2` = > agent_kb_lookup kb_dir=`kb` goal=`g2` near_match=True near_threshold=0.78 * +*g2 = "明天做什么好"* +*hit2 = > agent_kb_lookup kb_dir=`kb` goal=`g2` near_match=True near_threshold=0.78* 1. `hit2` > print text=neg-hit 2. * > print text=neg-miss -*`ranked` = > agent_kb_near_match kb_dir=`kb` goal=`g1` * -*`best` = > json.get value=`ranked` key=best * -*`bs` = > json.get value=`best` key=slug * +*ranked = > agent_kb_near_match kb_dir=`kb` goal=`g1`* +*best = > json.get value=`ranked` key=best* +*bs = > json.get value=`best` key=slug* 1. `bs` == `slug` > print text=rank-ok 2. * > print text=rank-bad -*`tasks` = > json.get value=`ranked` key=candidates * -*`prompt` = > agent.build_soft_match_prompt goal=`g1` tasks=`tasks` * -*`has` = > split value=`prompt` sep=score= * -*`hn` = > len value=`has` * +*tasks = > json.get value=`ranked` key=candidates* +*prompt = > agent.build_soft_match_prompt goal=`g1` tasks=`tasks`* +*has = > split value=`prompt` sep=score=* +*hn = > len value=`has`* 1. `hn` > 1 > print text=prompt-score-ok 2. * diff --git a/tests/ext/agent-kb-reuse.mq.md b/tests/ext/agent-kb-reuse.mq.md index 9bd6b1e..c37751f 100644 --- a/tests/ext/agent-kb-reuse.mq.md +++ b/tests/ext/agent-kb-reuse.mq.md @@ -11,56 +11,56 @@ import sys:lib/sys.mq.md # main -*`p` = > plugin.native_path name=agent * +*p = > plugin.native_path name=agent* 1. `p` > plugin.load path=`p` 2. * > print text=no-agent-plugin > sys.exit code=1 -*`paths` = > json.parse text={"kb":".marqdo/agent-kb","wb":".marqdo/agent-runs/pong-solid.mq.md","goal":"Reply with exactly the word pong and nothing else.","body":"---\ntitle: pong skill\n---\n\n# main\n\n*msg = \"pong\"*\n\n**msg**\n"} * -*`kb` = > json.get value=`paths` key=kb * -*`wb` = > json.get value=`paths` key=wb * -*`goal` = > json.get value=`paths` key=goal * -*`body` = > json.get value=`paths` key=body * +*paths = > json.parse text={"kb":".marqdo/agent-kb","wb":".marqdo/agent-runs/pong-solid.mq.md","goal":"Reply with exactly the word pong and nothing else.","body":"---\ntitle: pong skill\n---\n\n# main\n\n*msg = \"pong\"*\n\n**msg**\n"}* +*kb = > json.get value=`paths` key=kb* +*wb = > json.get value=`paths` key=wb* +*goal = > json.get value=`paths` key=goal* +*body = > json.get value=`paths` key=body* > fs.write_text path=`wb` text=`body` -*`sig` = > agent_goal_sig goal=`goal` * +*sig = > agent_goal_sig goal=`goal`* > print text=`sig` -*`slug0` = > agent_goal_slug goal=`goal` * +*slug0 = > agent_goal_slug goal=`goal`* > print text=`slug0` -*`prom` = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb` * -*`okp` = > json.get value=`prom` key=promoted * +*prom = > agent_kb_promote kb_dir=`kb` goal=`goal` workbook=`wb`* +*okp = > json.get value=`prom` key=promoted* 1. `okp` > print text=promoted 2. * > print text=promote-fail -*`st` = > json.get value=`prom` key=status * +*st = > json.get value=`prom` key=status* > print text=`st` -*`slug` = > json.get value=`prom` key=slug * +*slug = > json.get value=`prom` key=slug* > print text=`slug` -*`hit` = > agent_kb_lookup kb_dir=`kb` goal=`goal` * +*hit = > agent_kb_lookup kb_dir=`kb` goal=`goal`* 1. `hit` > print text=lookup-ok 2. * > print text=lookup-miss -*`res` = > json.get value=`hit` key=resource * -*`id` = > subtask.spawn path=`res` * -*`waited` = > subtask.wait id=`id` * -*`code` = > json.get value=`waited` key=code * -*`val` = > json.get value=`waited` key=value * +*res = > json.get value=`hit` key=resource* +*id = > subtask.spawn path=`res`* +*waited = > subtask.wait id=`id`* +*code = > json.get value=`waited` key=code* +*val = > json.get value=`waited` key=value* > print text=`code` > print text=`val` -*`hit2` = > agent_kb_lookup kb_dir=`kb` goal=`goal` * -*`res2` = > json.get value=`hit2` key=resource * +*hit2 = > agent_kb_lookup kb_dir=`kb` goal=`goal`* +*res2 = > json.get value=`hit2` key=resource* 1. `res` == `res2` > print text=stable-path 2. * diff --git a/tests/ext/agent-lib-call.mq.md b/tests/ext/agent-lib-call.mq.md index d4edad9..821ebbd 100644 --- a/tests/ext/agent-lib-call.mq.md +++ b/tests/ext/agent-lib-call.mq.md @@ -9,36 +9,36 @@ import sys:lib/sys.mq.md # main -*`parts` = > json.parse text={"a":"CALL:lib.fs.exists","b":"ARGS:{\"path\":\".\"}","nl":"\n"} * -*`a` = > json.get value=`parts` key=a * -*`b` = > json.get value=`parts` key=b * -*`nl` = > json.get value=`parts` key=nl * -*`t_ok` = `a` + `nl` + `b` + `nl` * -*`act` = > agent.extract_plan_act reply=`t_ok` * -*`kind` = > json.get value=`act` key=kind * -*`name` = > json.get value=`act` key=name * +*parts = > json.parse text={"a":"CALL:lib.fs.exists","b":"ARGS:{\"path\":\".\"}","nl":"\n"}* +*a = > json.get value=`parts` key=a* +*b = > json.get value=`parts` key=b* +*nl = > json.get value=`parts` key=nl* +*t_ok = a + nl + b + nl* +*act = > agent.extract_plan_act reply=`t_ok`* +*kind = > json.get value=`act` key=kind* +*name = > json.get value=`act` key=name* > print text=`kind` > print text=`name` -*`out` = > agent.run_parent_tool name=`name` path=. reply=`t_ok` * +*out = > agent.run_parent_tool name=`name` path=. reply=`t_ok`* 1. `out` > print text=exists-ok 2. * > print text=exists-bad -*`deny` = > agent.run_parent_tool name=lib.net.get path=. reply=CALL:lib.net.get * -*`sep` = > json.parse text={"s":"not allowed"} * -*`s` = > json.get value=`sep` key=s * -*`dparts` = > split value=`deny` sep=`s` * -*`pn` = > len value=`dparts` * +*deny = > agent.run_parent_tool name=lib.net.get path=. reply=CALL:lib.net.get* +*sep = > json.parse text={"s":"not allowed"}* +*s = > json.get value=`sep` key=s* +*dparts = > split value=`deny` sep=`s`* +*pn = > len value=`dparts`* 1. `pn` > 1 > print text=deny-ok 2. * > print text=deny-bad -*`cat` = > agent.lib_catalog * -*`callable` = > json.get value=`cat` key=callable * -*`cn` = > len value=`callable` * +*cat = > agent.lib_catalog* +*callable = > json.get value=`cat` key=callable* +*cn = > len value=`callable`* 1. `cn` > 3 > print text=callable-ok 2. * diff --git a/tests/ext/agent-plan-confirm.mq.md b/tests/ext/agent-plan-confirm.mq.md index 78dae74..41e5aad 100644 --- a/tests/ext/agent-plan-confirm.mq.md +++ b/tests/ext/agent-plan-confirm.mq.md @@ -11,25 +11,25 @@ import fs:lib/fs.mq.md > llm.load_env path=.env -*`model` = > llm.llm * -*`tools` = > json.parse text=[] * -*`助手` = > agent.agent model=`model` tools=`tools` standing=offline plan confirm * +*model = > llm.llm* +*tools = > json.parse text=[]* +*助手 = > agent.agent model=`model` tools=`tools` standing=offline plan confirm* -*`out` = > `助手`.plan goal=say hi confirm=True workbook_dir=".marqdo/agent-runs" writeback=False * +*out = > `助手`.plan goal=say hi confirm=True workbook_dir=".marqdo/agent-runs" writeback=False* -*`st` = > json.get value=`out` key=status * +*st = > json.get value=`out` key=status* > print text=`st` -*`path` = > json.get value=`out` key=workbook * -*`ex` = > fs.exists path=`path` * +*path = > json.get value=`out` key=workbook* +*ex = > fs.exists path=`path`* 1. `ex` > print text=workbook-ok 2. * > print text=workbook-missing -*`src` = > fs.read_text path=`path` * -*`parts` = > split value=`src` sep=agent.agent * -*`n` = > len value=`parts` * +*src = > fs.read_text path=`path`* +*parts = > split value=`src` sep=agent.agent* +*n = > len value=`parts`* 1. `n` > 1 > print text=skeleton-ok 2. * diff --git a/tests/ext/agent-plan-decision.mq.md b/tests/ext/agent-plan-decision.mq.md index 605ae60..fa704f8 100644 --- a/tests/ext/agent-plan-decision.mq.md +++ b/tests/ext/agent-plan-decision.mq.md @@ -8,97 +8,97 @@ import fs:lib/fs.mq.md # main -*`samples` = > json.parse text={"done":"DECISION: DONE\nSUMMARY: all good\n","cont":"DECISION: CONTINUE\nPATCH:\n<<<\nFIND\nold\n===\nREPLACE\nnew\n>>>\n","zh":"决定:完成\n汇总:好了\n","run":"DECISION: RUN\n","zh_run":"决定:运行\n"} * -*`d1` = > json.get value=`samples` key=done * -*`r1` = > agent.extract_plan_decision reply=`d1` * +*samples = > json.parse text={"done":"DECISION: DONE\nSUMMARY: all good\n","cont":"DECISION: CONTINUE\nPATCH:\n<<<\nFIND\nold\n===\nREPLACE\nnew\n>>>\n","zh":"决定:完成\n汇总:好了\n","run":"DECISION: RUN\n","zh_run":"决定:运行\n"}* +*d1 = > json.get value=`samples` key=done* +*r1 = > agent.extract_plan_decision reply=`d1`* > print text=`r1` -*`s1` = > agent.extract_plan_summary reply=`d1` * +*s1 = > agent.extract_plan_summary reply=`d1`* > print text=`s1` -*`d2` = > json.get value=`samples` key=cont * -*`r2` = > agent.extract_plan_decision reply=`d2` * +*d2 = > json.get value=`samples` key=cont* +*r2 = > agent.extract_plan_decision reply=`d2`* > print text=`r2` -*`d3` = > json.get value=`samples` key=zh * -*`r3` = > agent.extract_plan_decision reply=`d3` * +*d3 = > json.get value=`samples` key=zh* +*r3 = > agent.extract_plan_decision reply=`d3`* > print text=`r3` -*`d4` = > json.get value=`samples` key=run * -*`r4` = > agent.extract_plan_decision reply=`d4` * +*d4 = > json.get value=`samples` key=run* +*r4 = > agent.extract_plan_decision reply=`d4`* > print text=`r4` -*`d5` = > json.get value=`samples` key=zh_run * -*`r5` = > agent.extract_plan_decision reply=`d5` * +*d5 = > json.get value=`samples` key=zh_run* +*r5 = > agent.extract_plan_decision reply=`d5`* > print text=`r5` -*`d6` = "DECISION: DONE\nSUMMARY: first wins\nDECISION: CONTINUE\nPATCH:\nbogus\n" * -*`r6` = > agent.extract_plan_decision reply=`d6` * +*d6 = "DECISION: DONE\nSUMMARY: first wins\nDECISION: CONTINUE\nPATCH:\nbogus\n"* +*r6 = > agent.extract_plan_decision reply=`d6`* > print text=`r6` -*`act_call` = "CALL:lib_catalog" * -*`a1` = > agent.extract_plan_act reply=`act_call` * -*`a1k` = > json.get value=`a1` key=kind * -*`a1n` = > json.get value=`a1` key=name * +*act_call = "CALL:lib_catalog"* +*a1 = > agent.extract_plan_act reply=`act_call`* +*a1k = > json.get value=`a1` key=kind* +*a1n = > json.get value=`a1` key=name* > print text=`a1k` > print text=`a1n` -*`act_read` = "READ:stderr" * -*`a2` = > agent.extract_plan_act reply=`act_read` * -*`a2k` = > json.get value=`a2` key=kind * -*`a2n` = > json.get value=`a2` key=name * +*act_read = "READ:stderr"* +*a2 = > agent.extract_plan_act reply=`act_read`* +*a2k = > json.get value=`a2` key=kind* +*a2n = > json.get value=`a2` key=name* > print text=`a2k` > print text=`a2n` -*`act_dec` = > json.get value=`samples` key=done * -*`a3` = > agent.extract_plan_act reply=`act_dec` * -*`a3k` = > json.get value=`a3` key=kind * +*act_dec = > json.get value=`samples` key=done* +*a3 = > agent.extract_plan_act reply=`act_dec`* +*a3k = > json.get value=`a3` key=kind* > print text=`a3k` -*`cat` = > agent.lib_catalog * -*`files` = > json.get value=`cat` key=files * -*`nf` = > len value=`files` * +*cat = > agent.lib_catalog* +*files = > json.get value=`cat` key=files* +*nf = > len value=`files`* 1. `nf` > 5 > print text=catalog-ok 2. * > print text=catalog-bad -*`dual` = > agent.render_workbook_skeleton goal=demo skeleton=dual * -*`has_r` = > split value=`dual` sep=research * -*`n_r` = > len value=`has_r` * +*dual = > agent.render_workbook_skeleton goal=demo skeleton=dual* +*has_r = > split value=`dual` sep=research* +*n_r = > len value=`has_r`* 1. `n_r` > 1 > print text=dual-ok 2. * > print text=dual-missing -*`has_s` = > split value=`dual` sep=Solidify * -*`n_s` = > len value=`has_s` * +*has_s = > split value=`dual` sep=Solidify* +*n_s = > len value=`has_s`* 1. `n_s` > 1 > print text=solidify-ok 2. * > print text=solidify-missing -*`has_imp` = > split value=`dual` sep=import llm:ext/ai/llm.mq.md * -*`n_imp` = > len value=`has_imp` * +*has_imp = > split value=`dual` sep=import llm:ext/ai/llm.mq.md* +*n_imp = > len value=`has_imp`* 1. `n_imp` > 1 > print text=import-ok 2. * > print text=import-missing -*`paths` = > json.parse text={"p":".marqdo/agent-runs/decision-patch.md","t":"keep old keep","fence":"alpha beta","p2":".marqdo/agent-runs/decision-fence.md"} * -*`path` = > json.get value=`paths` key=p * -*`seed` = > json.get value=`paths` key=t * +*paths = > json.parse text={"p":".marqdo/agent-runs/decision-patch.md","t":"keep old keep","fence":"alpha beta","p2":".marqdo/agent-runs/decision-fence.md"}* +*path = > json.get value=`paths` key=p* +*seed = > json.get value=`paths` key=t* > fs.write_text path=`path` text=`seed` -*`n` = > fs.apply_patch_blocks path=`path` text=`d2` * +*n = > fs.apply_patch_blocks path=`path` text=`d2`* > print text=`n` -*`out` = > fs.read_text path=`path` * +*out = > fs.read_text path=`path`* > print text=`out` -*`path2` = > json.get value=`paths` key=p2 * -*`seed2` = > json.get value=`paths` key=fence * +*path2 = > json.get value=`paths` key=p2* +*seed2 = > json.get value=`paths` key=fence* > fs.write_text path=`path2` text=`seed2` -*`fence_pack` = > json.parse text={"t":"DECISION: CONTINUE\n\u0060\u0060\u0060find\nalpha\n\u0060\u0060\u0060\n\u0060\u0060\u0060replace\nALPHA\n\u0060\u0060\u0060\n"} * -*`fence_reply` = > json.get value=`fence_pack` key=t * -*`n2` = > fs.apply_patch_blocks path=`path2` text=`fence_reply` * +*fence_pack = > json.parse text={"t":"DECISION: CONTINUE\n\u0060\u0060\u0060find\nalpha\n\u0060\u0060\u0060\n\u0060\u0060\u0060replace\nALPHA\n\u0060\u0060\u0060\n"}* +*fence_reply = > json.get value=`fence_pack` key=t* +*n2 = > fs.apply_patch_blocks path=`path2` text=`fence_reply`* > print text=`n2` -*`out2` = > fs.read_text path=`path2` * +*out2 = > fs.read_text path=`path2`* > print text=`out2` diff --git a/tests/ext/agent-plan-live.mq.md b/tests/ext/agent-plan-live.mq.md index 8b3298e..6730d5d 100644 --- a/tests/ext/agent-plan-live.mq.md +++ b/tests/ext/agent-plan-live.mq.md @@ -11,33 +11,33 @@ import fs:lib/fs.mq.md > llm.load_env path=.env -*`model` = > llm.llm * -*`tools` = > json.parse text=[] * -*`助手` = > agent.agent model=`model` tools=`tools` standing=You are a Marqdo agent-development master. Prefer DONE when the workbook already satisfies the goal. * +*model = > llm.llm* +*tools = > json.parse text=[]* +*助手 = > agent.agent model=`model` tools=`tools` standing=You are a Marqdo agent-development master. Prefer DONE when the workbook already satisfies the goal.* -*`out` = > `助手`.plan goal=Reply with exactly the word pong and nothing else. max_rounds=3 writeback=False * +*out = > `助手`.plan goal=Reply with exactly the word pong and nothing else. max_rounds=3 writeback=False* -*`st` = > json.get value=`out` key=status * +*st = > json.get value=`out` key=status* > print text=`st` -*`sum` = > json.get value=`out` key=summary * +*sum = > json.get value=`out` key=summary* 1. `sum` > print text=`sum` 2. * > print text=no-summary -*`cache` = > json.get value=`out` key=cache * +*cache = > json.get value=`out` key=cache* > print text=`cache` -*`path` = > json.get value=`out` key=workbook * -*`ex` = > fs.exists path=`path` * +*path = > json.get value=`out` key=workbook* +*ex = > fs.exists path=`path`* 1. `ex` > print text=workbook-ok 2. * > print text=workbook-missing -*`out2` = > `助手`.plan goal=Reply with exactly the word pong and nothing else. max_rounds=3 writeback=False * -*`st2` = > json.get value=`out2` key=status * +*out2 = > `助手`.plan goal=Reply with exactly the word pong and nothing else. max_rounds=3 writeback=False* +*st2 = > json.get value=`out2` key=status* > print text=`st2` -*`cache2` = > json.get value=`out2` key=cache * +*cache2 = > json.get value=`out2` key=cache* > print text=`cache2` diff --git a/tests/ext/agent-plan-observe.mq.md b/tests/ext/agent-plan-observe.mq.md index 7fbfe38..c518895 100644 --- a/tests/ext/agent-plan-observe.mq.md +++ b/tests/ext/agent-plan-observe.mq.md @@ -7,30 +7,30 @@ import fs:lib/fs.mq.md # main -*`paths` = > json.parse text={"p":".marqdo/agent-runs/observe-fixture.mq.md"} * -*`path` = > json.get value=`paths` key=p * -*`seed` = > json.parse text={"t":"---\ntitle: fixture\n---\n\n# main\n\n\n\n*msg = \"ok\"*\n\n**msg**\n"} * -*`text` = > json.get value=`seed` key=t * +*paths = > json.parse text={"p":".marqdo/agent-runs/observe-fixture.mq.md"}* +*path = > json.get value=`paths` key=p* +*seed = > json.parse text={"t":"---\ntitle: fixture\n---\n\n# main\n\n\n\n*msg = \"ok\"*\n\n**msg**\n"}* +*text = > json.get value=`seed` key=t* > fs.write_text path=`path` text=`text` -*`obs` = > agent.inspect_workbook path=`path` exit_code=0 value=ok * -*`compact` = > agent.compact_plan_observation observation=`obs` * -*`ex` = > json.get value=`compact` key=source_excerpt * -*`parts` = > split value=`ex` sep=HUGE_BODY * -*`n` = > len value=`parts` * +*obs = > agent.inspect_workbook path=`path` exit_code=0 value=ok* +*compact = > agent.compact_plan_observation observation=`obs`* +*ex = > json.get value=`compact` key=source_excerpt* +*parts = > split value=`ex` sep=HUGE_BODY* +*n = > len value=`parts`* 1. `n` == 1 > print text=excerpt-stripped 2. * > print text=excerpt-leak -*`has` = > json.get value=`compact` key=has_value * +*has = > json.get value=`compact` key=has_value* 1. `has` > print text=has-value-ok 2. * > print text=has-value-bad -*`deep` = > agent.plan_read_deepen observation=`obs` kind=source path=`path` * -*`ex2` = > json.get value=`deep` key=source_excerpt * +*deep = > agent.plan_read_deepen observation=`obs` kind=source path=`path`* +*ex2 = > json.get value=`deep` key=source_excerpt* 1. `ex2` > print text=read-source-ok 2. * diff --git a/tests/ext/agent-plan-stream-offline.mq.md b/tests/ext/agent-plan-stream-offline.mq.md index f17cbab..9d21609 100644 --- a/tests/ext/agent-plan-stream-offline.mq.md +++ b/tests/ext/agent-plan-stream-offline.mq.md @@ -9,63 +9,63 @@ import fs:lib/fs.mq.md # main -*`events` = > json.parse text=[] * -*`events` = > agent.plan_append_round events=`events` round=1 workbook=wb.mq.md exit_code=0 stream=True * -*`from` = > json.parse text=[{"type":"delta","text":"Hi"},{"type":"done","result":"Hi"}] * -*`events` = > agent.plan_merge_deltas events=`events` from=`from` stream=True * -*`events` = > agent.plan_append_decision events=`events` decision=DONE stream=True summary=ok * -*`out` = > json.parse text={"status":"ok"} * -*`out` = > agent.plan_finish_stream out=`out` events=`events` stream=True result=child * +*events = > json.parse text=[]* +*events = > agent.plan_append_round events=`events` round=1 workbook=wb.mq.md exit_code=0 stream=True* +*from = > json.parse text=[{"type":"delta","text":"Hi"},{"type":"done","result":"Hi"}]* +*events = > agent.plan_merge_deltas events=`events` from=`from` stream=True* +*events = > agent.plan_append_decision events=`events` decision=DONE stream=True summary=ok* +*out = > json.parse text={"status":"ok"}* +*out = > agent.plan_finish_stream out=`out` events=`events` stream=True result=child* -*`evs` = > json.get value=`out` key=events * -*`n` = > len value=`evs` * +*evs = > json.get value=`out` key=events* +*n = > len value=`evs`* > print text=`n` -*`e0` = > at value=`evs` index=0 * -*`t0` = > json.get value=`e0` key=type * +*e0 = > at value=`evs` index=0* +*t0 = > json.get value=`e0` key=type* > print text=`t0` -*`e1` = > at value=`evs` index=1 * -*`t1` = > json.get value=`e1` key=type * -*`x1` = > json.get value=`e1` key=text * +*e1 = > at value=`evs` index=1* +*t1 = > json.get value=`e1` key=type* +*x1 = > json.get value=`e1` key=text* > print text=`t1` > print text=`x1` -*`e2` = > at value=`evs` index=2 * -*`t2` = > json.get value=`e2` key=type * +*e2 = > at value=`evs` index=2* +*t2 = > json.get value=`e2` key=type* > print text=`t2` -*`e3` = > at value=`evs` index=3 * -*`t3` = > json.get value=`e3` key=type * -*`r3` = > json.get value=`e3` key=result * +*e3 = > at value=`evs` index=3* +*t3 = > json.get value=`e3` key=type* +*r3 = > json.get value=`e3` key=result* > print text=`t3` > print text=`r3` > llm.load_env path=.env -*`model` = > llm.llm * -*`tools` = > json.parse text=[] * -*`助手` = > agent.agent model=`model` tools=`tools` standing=offline plan stream * +*model = > llm.llm* +*tools = > json.parse text=[]* +*助手 = > agent.agent model=`model` tools=`tools` standing=offline plan stream* -*`pout` = > `助手`.plan goal=say hi confirm=True workbook_dir=".marqdo/agent-runs" writeback=False stream=True * +*pout = > `助手`.plan goal=say hi confirm=True workbook_dir=".marqdo/agent-runs" writeback=False stream=True* -*`st` = > json.get value=`pout` key=status * +*st = > json.get value=`pout` key=status* > print text=`st` -*`pevs` = > json.get value=`pout` key=events * -*`pn` = > len value=`pevs` * +*pevs = > json.get value=`pout` key=events* +*pn = > len value=`pevs`* > print text=`pn` -*`plast` = > at value=`pevs` index=0 * -*`pt` = > json.get value=`plast` key=type * +*plast = > at value=`pevs` index=0* +*pt = > json.get value=`plast` key=type* > print text=`pt` -*`aev` = > agent.plan_echo_await round=2 workbook=wb.mq.md stream=True * -*`at` = > json.get value=`aev` key=type * +*aev = > agent.plan_echo_await round=2 workbook=wb.mq.md stream=True* +*at = > json.get value=`aev` key=type* > print text=`at` -*`ar` = > json.get value=`aev` key=round * +*ar = > json.get value=`aev` key=round* > print text=`ar` -*`dev` = > agent.plan_echo_decompose workbook=wb.mq.md stream=True * -*`dt` = > json.get value=`dev` key=type * +*dev = > agent.plan_echo_decompose workbook=wb.mq.md stream=True* +*dt = > json.get value=`dev` key=type* > print text=`dt` diff --git a/tests/ext/agent-run-live.mq.md b/tests/ext/agent-run-live.mq.md index d28084e..bb57e61 100644 --- a/tests/ext/agent-run-live.mq.md +++ b/tests/ext/agent-run-live.mq.md @@ -10,46 +10,46 @@ import agent:ext/ai/agent.mq.md ## 获取时间 -*`u` = > time.now_unix * -*`s` = > time.format unix=`u` pattern=%Y-%m-%d * -**`s`** +*u = > time.now_unix* +*s = > time.format unix=`u` pattern=%Y-%m-%d* +**s** # main > llm.load_env path=.env -*`模型` = > llm.llm * +*模型 = > llm.llm* `工具表` = | 工具 | |------| | 获取时间 | -*`助手` = > agent.agent model=`模型` tools=`工具表` standing=You are a Marqdo agent. When you need the current date, reply with exactly one line CALL:获取时间 and nothing else. * +*助手 = > agent.agent model=`模型` tools=`工具表` standing=You are a Marqdo agent. When you need the current date, reply with exactly one line CALL:获取时间 and nothing else.* -*`out` = > `助手`.step task=请调用获取时间工具,然后用一句话告诉用户今天的日期。 * +*out = > `助手`.step task=请调用获取时间工具,然后用一句话告诉用户今天的日期。* -*`status` = > json.get value=`out` key=status * -*`回复` = > json.get value=`out` key=result * +*status = > json.get value=`out` key=status* +*回复 = > json.get value=`out` key=result* > print text=`回复` -*`cached` = > writeback.get key=ok * +*cached = > writeback.get key=ok* 1. `cached` > print text=writeback-ok 2. * > print text=writeback-missing -*`id` = > json.get value=`助手` key=id * -*`历史` = > agent_history_get id=`id` * -*`条数` = > len value=`历史` * +*id = > json.get value=`助手` key=id* +*历史 = > agent_history_get id=`id`* +*条数 = > len value=`历史`* > print text=`条数` > `助手`.clear_history -*`历史2` = > agent_history_get id=`id` * -*`条数2` = > len value=`历史2` * +*历史2 = > agent_history_get id=`id`* +*条数2 = > len value=`历史2`* > print text=`条数2` diff --git a/tests/ext/agent-smoke.mq.md b/tests/ext/agent-smoke.mq.md index 7b21fdf..f092145 100644 --- a/tests/ext/agent-smoke.mq.md +++ b/tests/ext/agent-smoke.mq.md @@ -8,7 +8,7 @@ import agent:ext/ai/agent.mq.md ## 获取时间 -*`esc` = > json.parse text={"v":"ok-time"} * +*esc = > json.parse text={"v":"ok-time"}* **> json.get value=`esc` key=v** # main @@ -20,68 +20,68 @@ import agent:ext/ai/agent.mq.md |------| | 获取时间 | -*`模型` = > llm.llm * -*`助手` = > agent.agent model=`模型` tools=`工具表` standing=you are a readable Marqdo agent * +*模型 = > llm.llm* +*助手 = > agent.agent model=`模型` tools=`工具表` standing=you are a readable Marqdo agent* -*`id` = > json.get value=`助手` key=id * +*id = > json.get value=`助手` key=id* -*`ctx` = > agent.build_step_context agent=`助手` task=probe * +*ctx = > agent.build_step_context agent=`助手` task=probe* -*`has_skill` = > split value=`ctx` sep=Marqdo * -*`sk_n` = > len value=`has_skill` * +*has_skill = > split value=`ctx` sep=Marqdo* +*sk_n = > len value=`has_skill`* 1. `sk_n` > 1 > print text=skill-ok 2. * > print text=skill-missing -*`has_tools` = > split value=`ctx` sep=获取时间 * -*`tool_n` = > len value=`has_tools` * +*has_tools = > split value=`ctx` sep=获取时间* +*tool_n = > len value=`has_tools`* 1. `tool_n` > 1 > print text=tools-ok 2. * > print text=tools-missing -*`has_src` = > split value=`ctx` sep=probe * -*`src_n` = > len value=`has_src` * +*has_src = > split value=`ctx` sep=probe* +*src_n = > len value=`has_src`* 1. `src_n` > 1 > print text=source-ok 2. * > print text=source-missing -*`has_act` = > split value=`ctx` sep=CALL: * -*`act_n` = > len value=`has_act` * +*has_act = > split value=`ctx` sep=CALL:* +*act_n = > len value=`has_act`* 1. `act_n` > 1 > print text=protocol-ok 2. * > print text=protocol-missing -*`samples` = > json.parse text={"r":"CALL:获取时间","m":"think\nCALL:获取时间"} * -*`raw1` = > json.get value=`samples` key=r * -*`name1` = > agent.extract_tool_name reply=`raw1` * +*samples = > json.parse text={"r":"CALL:获取时间","m":"think\nCALL:获取时间"}* +*raw1 = > json.get value=`samples` key=r* +*name1 = > agent.extract_tool_name reply=`raw1`* > print text=`name1` -*`raw2` = > json.get value=`samples` key=m * -*`name2` = > agent.extract_tool_name reply=`raw2` * +*raw2 = > json.get value=`samples` key=m* +*name2 = > agent.extract_tool_name reply=`raw2`* > print text=`name2` -*`tool_out` = > agent.run_tool tools=`工具表` name=获取时间 * +*tool_out = > agent.run_tool tools=`工具表` name=获取时间* > print text=`tool_out` -*`turn` = > json.parse text={"role":"user","content":"one"} * +*turn = > json.parse text={"role":"user","content":"one"}* > agent_history_append id=`id` item=`turn` -*`turn2` = > json.parse text={"role":"assistant","content":"two"} * +*turn2 = > json.parse text={"role":"assistant","content":"two"}* > agent_history_append id=`id` item=`turn2` -*`h1` = > agent_history_get id=`id` * -*`n1` = > len value=`h1` * +*h1 = > agent_history_get id=`id`* +*n1 = > len value=`h1`* > print text=`n1` > `助手`.clear_history -*`h2` = > agent_history_get id=`id` * -*`n2` = > len value=`h2` * +*h2 = > agent_history_get id=`id`* +*n2 = > len value=`h2`* > print text=`n2` -*`site` = > agent_call_site * -*`fn` = > json.get value=`site` key=function * +*site = > agent_call_site* +*fn = > json.get value=`site` key=function* > print text=`fn` diff --git a/tests/ext/agent-soft-match.mq.md b/tests/ext/agent-soft-match.mq.md index a90c98d..85cf2da 100644 --- a/tests/ext/agent-soft-match.mq.md +++ b/tests/ext/agent-soft-match.mq.md @@ -7,27 +7,27 @@ import json:lib/json.mq.md # main -*`samples` = > json.parse text={"reuse":"DECISION: REUSE\nSLUG: trip-plan\n","new":"DECISION: NEW\n","zh":"决定:复用\n标识:行程-a\n"} * -*`r1` = > json.get value=`samples` key=reuse * -*`d1` = > agent.extract_plan_decision reply=`r1` * +*samples = > json.parse text={"reuse":"DECISION: REUSE\nSLUG: trip-plan\n","new":"DECISION: NEW\n","zh":"决定:复用\n标识:行程-a\n"}* +*r1 = > json.get value=`samples` key=reuse* +*d1 = > agent.extract_plan_decision reply=`r1`* > print text=`d1` -*`s1` = > agent.extract_soft_match_slug reply=`r1` * +*s1 = > agent.extract_soft_match_slug reply=`r1`* > print text=`s1` -*`r2` = > json.get value=`samples` key=new * -*`d2` = > agent.extract_plan_decision reply=`r2` * +*r2 = > json.get value=`samples` key=new* +*d2 = > agent.extract_plan_decision reply=`r2`* > print text=`d2` -*`r3` = > json.get value=`samples` key=zh * -*`d3` = > agent.extract_plan_decision reply=`r3` * +*r3 = > json.get value=`samples` key=zh* +*d3 = > agent.extract_plan_decision reply=`r3`* > print text=`d3` -*`s3` = > agent.extract_soft_match_slug reply=`r3` * +*s3 = > agent.extract_soft_match_slug reply=`r3`* > print text=`s3` -*`tasks` = > json.parse text=[{"slug":"a","title":"Alpha"},{"slug":"b","title":"Beta"}] * -*`prompt` = > agent.build_soft_match_prompt goal=demo tasks=`tasks` * -*`has` = > split value=`prompt` sep=DECISION: REUSE * -*`n` = > len value=`has` * +*tasks = > json.parse text=[{"slug":"a","title":"Alpha"},{"slug":"b","title":"Beta"}]* +*prompt = > agent.build_soft_match_prompt goal=demo tasks=`tasks`* +*has = > split value=`prompt` sep=DECISION: REUSE* +*n = > len value=`has`* 1. `n` > 1 > print text=prompt-ok 2. * diff --git a/tests/ext/fs-text-patch.mq.md b/tests/ext/fs-text-patch.mq.md index bba776a..0105d2e 100644 --- a/tests/ext/fs-text-patch.mq.md +++ b/tests/ext/fs-text-patch.mq.md @@ -6,18 +6,18 @@ import json:lib/json.mq.md # main -*`paths` = > json.parse text={"p":".marqdo/agent-runs/patch-demo.md","t":"alpha beta gamma"} * -*`path` = > json.get value=`paths` key=p * -*`seed` = > json.get value=`paths` key=t * +*paths = > json.parse text={"p":".marqdo/agent-runs/patch-demo.md","t":"alpha beta gamma"}* +*path = > json.get value=`paths` key=p* +*seed = > json.get value=`paths` key=t* > fs.write_text path=`path` text=`seed` > fs.text_patch path=`path` find=beta replace=BETA -*`s1` = > fs.read_text path=`path` * +*s1 = > fs.read_text path=`path`* > print text=`s1` -*`reply` = > json.parse text={"t":"DECISION: CONTINUE\n<<<\nFIND\nalpha\n===\nREPLACE\nALPHA\n>>>\n<<<\nFIND\ngamma\n===\nREPLACE\nGAMMA\n>>>\n"} * -*`t` = > json.get value=`reply` key=t * -*`n` = > fs.apply_patch_blocks path=`path` text=`t` * +*reply = > json.parse text={"t":"DECISION: CONTINUE\n<<<\nFIND\nalpha\n===\nREPLACE\nALPHA\n>>>\n<<<\nFIND\ngamma\n===\nREPLACE\nGAMMA\n>>>\n"}* +*t = > json.get value=`reply` key=t* +*n = > fs.apply_patch_blocks path=`path` text=`t`* > print text=`n` -*`s2` = > fs.read_text path=`path` * +*s2 = > fs.read_text path=`path`* > print text=`s2` diff --git a/tests/ext/llm-complete.mq.md b/tests/ext/llm-complete.mq.md index b46711f..b596d86 100644 --- a/tests/ext/llm-complete.mq.md +++ b/tests/ext/llm-complete.mq.md @@ -8,8 +8,8 @@ import llm:ext/ai/llm.mq.md > llm.load_env path=.env -*`model` = > llm.llm * +*model = > llm.llm* -*`reply` = > `model`.complete prompt=Reply with exactly one English word: pong * +*reply = > `model`.complete prompt=Reply with exactly one English word: pong* > print text=`reply` diff --git a/tests/ext/llm-ctor-offline.mq.md b/tests/ext/llm-ctor-offline.mq.md index ee96ab2..f3a425d 100644 --- a/tests/ext/llm-ctor-offline.mq.md +++ b/tests/ext/llm-ctor-offline.mq.md @@ -6,6 +6,6 @@ import llm:ext/ai/llm.mq.md # main -*`model` = > llm.llm * +*model = > llm.llm* > print text=`model`[^model] > print text=`model`[^suffix] diff --git a/tests/ext/llm-stream-live.mq.md b/tests/ext/llm-stream-live.mq.md index 207e778..1ea5226 100644 --- a/tests/ext/llm-stream-live.mq.md +++ b/tests/ext/llm-stream-live.mq.md @@ -9,11 +9,11 @@ import json:lib/json.mq.md > llm.load_env path=.env -*`model` = > llm.llm * +*model = > llm.llm* -*`events` = > `model`.complete prompt=Reply with exactly one English word: pong stream=True echo=True * -*`n` = > len value=`events` * +*events = > `model`.complete prompt=Reply with exactly one English word: pong stream=True echo=True* +*n = > len value=`events`* > print text=`n` -*`answer` = > llm.stream_result events=`events` * +*answer = > llm.stream_result events=`events`* > print text=`answer` diff --git a/tests/ext/llm-stream-offline.mq.md b/tests/ext/llm-stream-offline.mq.md index 37c9afe..d681754 100644 --- a/tests/ext/llm-stream-offline.mq.md +++ b/tests/ext/llm-stream-offline.mq.md @@ -7,8 +7,8 @@ import net:lib/net.mq.md # main -*`fixture` = "data: {\"choices\":[{\"delta\":{\"content\":\"Hi\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"!\"}}]}\n\ndata: [DONE]\n" * +*fixture = "data: {\"choices\":[{\"delta\":{\"content\":\"Hi\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"!\"}}]}\n\ndata: [DONE]\n"* -*`events` = > net.openai_sse_parse text=`fixture` * -*`answer` = > llm.stream_result events=`events` * +*events = > net.openai_sse_parse text=`fixture`* +*answer = > llm.stream_result events=`events`* > print text=`answer` diff --git a/tests/ext/quantum-amp-damp-smoke.mq.md b/tests/ext/quantum-amp-damp-smoke.mq.md index 2b14de2..5087341 100644 --- a/tests/ext/quantum-amp-damp-smoke.mq.md +++ b/tests/ext/quantum-amp-damp-smoke.mq.md @@ -6,11 +6,11 @@ import quantum:ext/quantum/quantum.mq.md # main -*`qc` = > quantum.circuit qubits=1 * -*`qc` = > `qc`.x qubit=0 * -*`qc` = > `qc`.noise kind=amplitude_damping p=1 * -*`r` = > `qc`.run shots=32 seed=7 * -*`c0` = `r`[^counts][^0] * +*qc = > quantum.circuit qubits=1* +*qc = > `qc`.x qubit=0* +*qc = > `qc`.noise kind=amplitude_damping p=1* +*r = > `qc`.run shots=32 seed=7* +*c0 = r[^counts][^0]* 1. `c0` == 32 > print text=amp-ok diff --git a/tests/ext/quantum-amp-damp-zh-smoke.mq.md b/tests/ext/quantum-amp-damp-zh-smoke.mq.md index f3d7091..0cd3ba2 100644 --- a/tests/ext/quantum-amp-damp-zh-smoke.mq.md +++ b/tests/ext/quantum-amp-damp-zh-smoke.mq.md @@ -6,11 +6,11 @@ description: 泡利X 后 振幅阻尼 p=1 全部落回 |0⟩. # main -*`qc` = > 量子.电路 比特数=1 * -*`qc` = > `qc`.泡利X 比特=0 * -*`qc` = > `qc`.噪声 种类=振幅阻尼 概率=1 * -*`r` = > `qc`.运行 次数=32 种子=7 * -*`c0` = `r`[^counts][^0] * +*qc = > 量子.电路 比特数=1* +*qc = > `qc`.泡利X 比特=0* +*qc = > `qc`.噪声 种类=振幅阻尼 概率=1* +*r = > `qc`.运行 次数=32 种子=7* +*c0 = r[^counts][^0]* 1. `c0` == 32 > print text=amp-ok diff --git a/tests/ext/quantum-author-api-smoke.mq.md b/tests/ext/quantum-author-api-smoke.mq.md index a629d2f..4b122d4 100644 --- a/tests/ext/quantum-author-api-smoke.mq.md +++ b/tests/ext/quantum-author-api-smoke.mq.md @@ -6,31 +6,31 @@ import quantum:ext/quantum/quantum.mq.md # main -*`qc` = > quantum.circuit qubits=2 * -*`qc` = > `qc`.h qubit=0 * -*`qc` = > `qc`.barrier * -*`qc` = > `qc`.cx control=0 target=1 * -*`qc` = > `qc`.measure * +*qc = > quantum.circuit qubits=2* +*qc = > `qc`.h qubit=0* +*qc = > `qc`.barrier* +*qc = > `qc`.cx control=0 target=1* +*qc = > `qc`.measure* -*`st` = > `qc`.state * -*`dim` = `st`[^dim] * +*st = > `qc`.state* +*dim = st[^dim]* 1. `dim` == 4 > print text=state-ok 2. * > print text=state-fail -*`img` = > `qc`.draw path=quantum-author-draw.svg * -*`kind` = `img`[^kind] * +*img = > `qc`.draw path=quantum-author-draw.svg* +*kind = img[^kind]* 1. `kind` == circuit > print text=draw-ok 2. * > print text=draw-fail -*`other` = > quantum.circuit qubits=2 * -*`other` = > `other`.x qubit=1 * -*`qc2` = > `qc`.append op=`other` * -*`ops` = `qc2`[^ops] * -*`n` = > len `ops` * +*other = > quantum.circuit qubits=2* +*other = > `other`.x qubit=1* +*qc2 = > `qc`.append op=`other`* +*ops = qc2[^ops]* +*n = > len `ops`* 1. `n` == 5 > print text=append-ok 2. * diff --git a/tests/ext/quantum-author-api-zh-smoke.mq.md b/tests/ext/quantum-author-api-zh-smoke.mq.md index 68883ba..e4a5297 100644 --- a/tests/ext/quantum-author-api-zh-smoke.mq.md +++ b/tests/ext/quantum-author-api-zh-smoke.mq.md @@ -6,31 +6,31 @@ description: 屏障 / 测量 / 追加 / 态 / 绘图. # main -*`qc` = > 量子.电路 比特数=2 * -*`qc` = > `qc`.哈达玛 比特=0 * -*`qc` = > `qc`.屏障 * -*`qc` = > `qc`.控非 控制=0 目标=1 * -*`qc` = > `qc`.测量 * +*qc = > 量子.电路 比特数=2* +*qc = > `qc`.哈达玛 比特=0* +*qc = > `qc`.屏障* +*qc = > `qc`.控非 控制=0 目标=1* +*qc = > `qc`.测量* -*`st` = > `qc`.态 * -*`dim` = `st`[^dim] * +*st = > `qc`.态* +*dim = st[^dim]* 1. `dim` == 4 > print text=state-ok 2. * > print text=state-fail -*`img` = > `qc`.绘图 路径=quantum-author-zh-draw.svg * -*`kind` = `img`[^kind] * +*img = > `qc`.绘图 路径=quantum-author-zh-draw.svg* +*kind = img[^kind]* 1. `kind` == circuit > print text=draw-ok 2. * > print text=draw-fail -*`other` = > 量子.电路 比特数=2 * -*`other` = > `other`.泡利X 比特=1 * -*`qc2` = > `qc`.追加 操作=`other` * -*`ops` = `qc2`[^ops] * -*`n` = > len `ops` * +*other = > 量子.电路 比特数=2* +*other = > `other`.泡利X 比特=1* +*qc2 = > `qc`.追加 操作=`other`* +*ops = qc2[^ops]* +*n = > len `ops`* 1. `n` == 5 > print text=append-ok 2. * diff --git a/tests/ext/quantum-bell-smoke.mq.md b/tests/ext/quantum-bell-smoke.mq.md index f173325..59f04c6 100644 --- a/tests/ext/quantum-bell-smoke.mq.md +++ b/tests/ext/quantum-bell-smoke.mq.md @@ -7,15 +7,15 @@ import math:lib/math.mq.md # main -*`qc` = > quantum.circuit qubits=2 * -*`qc` = > `qc`.h qubit=0 * -*`qc` = > `qc`.cx control=0 target=1 * -*`p` = > `qc`.probabilities * +*qc = > quantum.circuit qubits=2* +*qc = > `qc`.h qubit=0* +*qc = > `qc`.cx control=0 target=1* +*p = > `qc`.probabilities* -*`p00` = `p`[^00] * -*`p11` = `p`[^11] * -*`lo` = > math.div a=2 b=5 * -*`hi` = > math.div a=3 b=5 * +*p00 = p[^00]* +*p11 = p[^11]* +*lo = > math.div a=2 b=5* +*hi = > math.div a=3 b=5* 1. `p00` > `lo` 1. `p00` < `hi` @@ -33,8 +33,8 @@ import math:lib/math.mq.md 2. * > print text=p11-fail -*`ping` = > quantum_ping * -*`ok` = `ping`[^ok] * +*ping = > quantum_ping* +*ok = ping[^ok]* 1. `ok` > print text=ping-ok 2. * diff --git a/tests/ext/quantum-custom-gate-smoke.mq.md b/tests/ext/quantum-custom-gate-smoke.mq.md index 5eefb67..6abc85a 100644 --- a/tests/ext/quantum-custom-gate-smoke.mq.md +++ b/tests/ext/quantum-custom-gate-smoke.mq.md @@ -12,13 +12,13 @@ $$ \frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix} $$ -*`U` = > quantum.gate matrix=`H_matrix` name=U * -*`qc` = > quantum.circuit qubits=1 * -*`qc` = > `qc`.apply gate=`U` qubits=0 * -*`p` = > `qc`.probabilities * -*`p0` = `p`[^0] * -*`lo` = > math.div a=4 b=10 * -*`hi` = > math.div a=6 b=10 * +*U = > quantum.gate matrix=`H_matrix` name=U* +*qc = > quantum.circuit qubits=1* +*qc = > `qc`.apply gate=`U` qubits=0* +*p = > `qc`.probabilities* +*p0 = p[^0]* +*lo = > math.div a=4 b=10* +*hi = > math.div a=6 b=10* 1. `p0` > `lo` 1. `p0` < `hi` diff --git a/tests/ext/quantum-custom-gate-zh-smoke.mq.md b/tests/ext/quantum-custom-gate-zh-smoke.mq.md index 86bd874..f9c7f03 100644 --- a/tests/ext/quantum-custom-gate-zh-smoke.mq.md +++ b/tests/ext/quantum-custom-gate-zh-smoke.mq.md @@ -12,13 +12,13 @@ $$ \frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix} $$ -*`U` = > 量子.门 矩阵=`H矩阵` 名=U * -*`qc` = > 量子.电路 比特数=1 * -*`qc` = > `qc`.施加 门=`U` 比特=0 * -*`p` = > `qc`.概率 * -*`p0` = `p`[^0] * -*`lo` = > math.div a=4 b=10 * -*`hi` = > math.div a=6 b=10 * +*U = > 量子.门 矩阵=`H矩阵` 名=U* +*qc = > 量子.电路 比特数=1* +*qc = > `qc`.施加 门=`U` 比特=0* +*p = > `qc`.概率* +*p0 = p[^0]* +*lo = > math.div a=4 b=10* +*hi = > math.div a=6 b=10* 1. `p0` > `lo` 1. `p0` < `hi` diff --git a/tests/ext/quantum-draw-smoke.mq.md b/tests/ext/quantum-draw-smoke.mq.md index 87b4fcc..5569a80 100644 --- a/tests/ext/quantum-draw-smoke.mq.md +++ b/tests/ext/quantum-draw-smoke.mq.md @@ -13,19 +13,19 @@ import quantum:ext/quantum/quantum.mq.md | 1 | H | 0 | | 2 | CX | 0,1 | -*`qc` = > quantum.circuit qubits=2 steps=`steps` * -*`img` = > `qc`.draw kind=probs path=quantum-draw-probs.svg * -*`kind` = `img`[^kind] * +*qc = > quantum.circuit qubits=2 steps=`steps`* +*img = > `qc`.draw kind=probs path=quantum-draw-probs.svg* +*kind = img[^kind]* 1. `kind` == probs > print text=probs-ok 2. * > print text=probs-fail -*`qc1` = > quantum.circuit qubits=1 * -*`qc1` = > `qc1`.h qubit=0 * -*`bloch` = > `qc1`.draw kind=bloch path=quantum-draw-bloch.svg * -*`bk` = `bloch`[^kind] * +*qc1 = > quantum.circuit qubits=1* +*qc1 = > `qc1`.h qubit=0* +*bloch = > `qc1`.draw kind=bloch path=quantum-draw-bloch.svg* +*bk = bloch[^kind]* 1. `bk` == bloch > print text=bloch-ok diff --git a/tests/ext/quantum-gate-heatmap-smoke.mq.md b/tests/ext/quantum-gate-heatmap-smoke.mq.md index d1a8999..bb8e228 100644 --- a/tests/ext/quantum-gate-heatmap-smoke.mq.md +++ b/tests/ext/quantum-gate-heatmap-smoke.mq.md @@ -6,9 +6,9 @@ import quantum:ext/quantum/quantum.mq.md # main -*`H` = > quantum.gate name=H * -*`img` = > `H`.draw kind=matrix path=quantum-gate-heatmap.svg * -*`kind` = `img`[^kind] * +*H = > quantum.gate name=H* +*img = > `H`.draw kind=matrix path=quantum-gate-heatmap.svg* +*kind = img[^kind]* 1. `kind` == matrix > print text=heatmap-ok diff --git a/tests/ext/quantum-gate-matrix-smoke.mq.md b/tests/ext/quantum-gate-matrix-smoke.mq.md index 21a6579..c50cafb 100644 --- a/tests/ext/quantum-gate-matrix-smoke.mq.md +++ b/tests/ext/quantum-gate-matrix-smoke.mq.md @@ -7,17 +7,17 @@ import json:lib/json.mq.md # main -*`H_matrix` = > json.parse text=[[0.7071067811865475,0.7071067811865475],[0.7071067811865475,-0.7071067811865475]] * -*`H` = > quantum.gate name=H * -*`ok` = > `H`.matches_matrix matrix=`H_matrix` * +*H_matrix = > json.parse text=[[0.7071067811865475,0.7071067811865475],[0.7071067811865475,-0.7071067811865475]]* +*H = > quantum.gate name=H* +*ok = > `H`.matches_matrix matrix=`H_matrix`* 1. `ok` > print text=match-ok 2. * > print text=match-fail -*`bad` = > json.parse text=[[1,0],[0,1]] * -*`no` = > `H`.matches_matrix matrix=`bad` * +*bad = > json.parse text=[[1,0],[0,1]]* +*no = > `H`.matches_matrix matrix=`bad`* 1. not `no` > print text=reject-ok diff --git a/tests/ext/quantum-gates-smoke.mq.md b/tests/ext/quantum-gates-smoke.mq.md index f166d60..cc55049 100644 --- a/tests/ext/quantum-gates-smoke.mq.md +++ b/tests/ext/quantum-gates-smoke.mq.md @@ -9,13 +9,13 @@ import math:lib/math.mq.md H-Z-H on |0⟩ → |1⟩. -*`qc` = > quantum.circuit qubits=1 * -*`qc` = > `qc`.h qubit=0 * -*`qc` = > `qc`.z qubit=0 * -*`qc` = > `qc`.h qubit=0 * -*`p` = > `qc`.probabilities * -*`p1` = `p`[^1] * -*`lo` = > math.div a=9 b=10 * +*qc = > quantum.circuit qubits=1* +*qc = > `qc`.h qubit=0* +*qc = > `qc`.z qubit=0* +*qc = > `qc`.h qubit=0* +*p = > `qc`.probabilities* +*p1 = p[^1]* +*lo = > math.div a=9 b=10* 1. `p1` > `lo` > print text=z-sandwich-ok @@ -24,11 +24,11 @@ H-Z-H on |0⟩ → |1⟩. Ry(π) on |0⟩ → |1⟩. -*`pi` = > math.pi * -*`ry` = > quantum.circuit qubits=1 * -*`ry` = > `ry`.ry qubit=0 theta=`pi` * -*`rp` = > `ry`.probabilities * -*`rp1` = `rp`[^1] * +*pi = > math.pi* +*ry = > quantum.circuit qubits=1* +*ry = > `ry`.ry qubit=0 theta=`pi`* +*rp = > `ry`.probabilities* +*rp1 = rp[^1]* 1. `rp1` > `lo` > print text=ry-ok @@ -37,14 +37,14 @@ Ry(π) on |0⟩ → |1⟩. Bell run with fixed seed: both 00 and 11 appear; shots sum. -*`bell` = > quantum.circuit qubits=2 * -*`bell` = > `bell`.h qubit=0 * -*`bell` = > `bell`.cx control=0 target=1 * -*`res` = > `bell`.run shots=200 seed=42 * -*`counts` = `res`[^counts] * -*`c00` = `counts`[^00] * -*`c11` = `counts`[^11] * -*`shots` = `res`[^shots] * +*bell = > quantum.circuit qubits=2* +*bell = > `bell`.h qubit=0* +*bell = > `bell`.cx control=0 target=1* +*res = > `bell`.run shots=200 seed=42* +*counts = res[^counts]* +*c00 = counts[^00]* +*c11 = counts[^11]* +*shots = res[^shots]* 1. `c00` 1. `c11` diff --git a/tests/ext/quantum-noise-smoke.mq.md b/tests/ext/quantum-noise-smoke.mq.md index 542e155..5491594 100644 --- a/tests/ext/quantum-noise-smoke.mq.md +++ b/tests/ext/quantum-noise-smoke.mq.md @@ -6,11 +6,11 @@ import quantum:ext/quantum/quantum.mq.md # main -*`qc` = > quantum.circuit qubits=1 * -*`qc` = > `qc`.i qubit=0 * -*`qc` = > `qc`.noise kind=bitflip p=1 * -*`r` = > `qc`.run shots=32 seed=3 * -*`c1` = `r`[^counts][^1] * +*qc = > quantum.circuit qubits=1* +*qc = > `qc`.i qubit=0* +*qc = > `qc`.noise kind=bitflip p=1* +*r = > `qc`.run shots=32 seed=3* +*c1 = r[^counts][^1]* 1. `c1` == 32 > print text=noise-ok diff --git a/tests/ext/quantum-noise-zh-smoke.mq.md b/tests/ext/quantum-noise-zh-smoke.mq.md index ef941cd..07e80d6 100644 --- a/tests/ext/quantum-noise-zh-smoke.mq.md +++ b/tests/ext/quantum-noise-zh-smoke.mq.md @@ -6,11 +6,11 @@ description: 噪声 bitflip p=1 后 I 使全部射中 |1⟩. # main -*`qc` = > 量子.电路 比特数=1 * -*`qc` = > `qc`.单位 比特=0 * -*`qc` = > `qc`.噪声 种类=bitflip 概率=1 * -*`r` = > `qc`.运行 次数=32 种子=3 * -*`c1` = `r`[^counts][^1] * +*qc = > 量子.电路 比特数=1* +*qc = > `qc`.单位 比特=0* +*qc = > `qc`.噪声 种类=bitflip 概率=1* +*r = > `qc`.运行 次数=32 种子=3* +*c1 = r[^counts][^1]* 1. `c1` == 32 > print text=noise-ok diff --git a/tests/ext/quantum-steps-smoke.mq.md b/tests/ext/quantum-steps-smoke.mq.md index 8516799..eb13cea 100644 --- a/tests/ext/quantum-steps-smoke.mq.md +++ b/tests/ext/quantum-steps-smoke.mq.md @@ -14,11 +14,11 @@ import math:lib/math.mq.md | 1 | H | 0 | | 2 | CX | 0,1 | -*`qc` = > quantum.circuit qubits=2 steps=`steps` * -*`p` = > `qc`.probabilities * -*`p00` = `p`[^00] * -*`lo` = > math.div a=2 b=5 * -*`hi` = > math.div a=3 b=5 * +*qc = > quantum.circuit qubits=2 steps=`steps`* +*p = > `qc`.probabilities* +*p00 = p[^00]* +*lo = > math.div a=2 b=5* +*hi = > math.div a=3 b=5* 1. `p00` > `lo` 1. `p00` < `hi` @@ -28,8 +28,8 @@ import math:lib/math.mq.md 2. * > print text=steps-fail -*`img` = > `qc`.draw path=quantum-steps-draw.svg * -*`kind` = `img`[^kind] * +*img = > `qc`.draw path=quantum-steps-draw.svg* +*kind = img[^kind]* 1. `kind` == circuit > print text=draw-ok diff --git a/tests/ext/quantum-zh-smoke.mq.md b/tests/ext/quantum-zh-smoke.mq.md index a0ba549..fcadd6d 100644 --- a/tests/ext/quantum-zh-smoke.mq.md +++ b/tests/ext/quantum-zh-smoke.mq.md @@ -7,13 +7,13 @@ import math:lib/math.mq.md # main -*`电路` = > 量子.电路 比特数=1 * -*`电路` = > `电路`.哈达玛 比特=0 * -*`电路` = > `电路`.泡利Z 比特=0 * -*`电路` = > `电路`.哈达玛 比特=0 * -*`概率` = > `电路`.概率 * -*`p1` = `概率`[^1] * -*`lo` = > math.div a=9 b=10 * +*电路 = > 量子.电路 比特数=1* +*电路 = > `电路`.哈达玛 比特=0* +*电路 = > `电路`.泡利Z 比特=0* +*电路 = > `电路`.哈达玛 比特=0* +*概率 = > `电路`.概率* +*p1 = 概率[^1]* +*lo = > math.div a=9 b=10* 1. `p1` > `lo` > print text=zh-ok diff --git a/tests/ext/web-admin-smoke.mq.md b/tests/ext/web-admin-smoke.mq.md index a4a42f3..710761c 100644 --- a/tests/ext/web-admin-smoke.mq.md +++ b/tests/ext/web-admin-smoke.mq.md @@ -8,24 +8,24 @@ import json:lib/json.mq.md # main -*`store` = > web.db url="sqlite:web-fixtures/data/admin-smoke.db" * -*`schema` = > articles.schema * +*store = > web.db url="sqlite:web-fixtures/data/admin-smoke.db"* +*schema = > articles.schema* > `store`.init name=articles fields=`schema` > `store`.exec sql="DELETE FROM articles" > `store`.exec sql="DELETE FROM sqlite_sequence WHERE name='articles'" -*`url` = > json.get value=`store` key=url * +*url = > json.get value=`store` key=url* -*`info` = > web_db_table_info url=`url` table=articles * -*`cols` = > json.get value=`info` key=columns * -*`n` = > len value=`cols` * +*info = > web_db_table_info url=`url` table=articles* +*cols = > json.get value=`info` key=columns* +*n = > len value=`cols`* 1. `n` >= 2 > print text=schema-ok 2. * > print text=schema-fail -*`fnew` = > web_form_from_schema url=`url` table=articles action=insert * -*`fields` = > json.get value=`fnew` key=fields * -*`nf` = > len value=`fields` * +*fnew = > web_form_from_schema url=`url` table=articles action=insert* +*fields = > json.get value=`fnew` key=fields* +*nf = > len value=`fields`* 1. `nf` >= 1 > print text=new-form-ok 2. * @@ -37,36 +37,36 @@ import json:lib/json.mq.md |-------|------| | Admin create | via schema form | -*`sub` = > web_form_submit form=`fnew` data=`row` url=`url` * -*`sok` = > json.get value=`sub` key=ok * +*sub = > web_form_submit form=`fnew` data=`row` url=`url`* +*sok = > json.get value=`sub` key=ok* 1. `sok` > print text=insert-ok 2. * > print text=insert-fail -*`got` = > `store`.get table=articles id=1 * -*`title` = > json.get value=`got` key=title * +*got = > `store`.get table=articles id=1* +*title = > json.get value=`got` key=title* 1. `title` == "Admin create" > print text=get-ok 2. * > print text=get-fail -*`fedit` = > web_form_from_schema url=`url` table=articles action=update id=1 * +*fedit = > web_form_from_schema url=`url` table=articles action=update id=1* `patch` = | title | body | |-------|------| | Admin edited | body updated | -*`up` = > web_form_submit form=`fedit` data=`patch` url=`url` * -*`uok` = > json.get value=`up` key=ok * +*up = > web_form_submit form=`fedit` data=`patch` url=`url`* +*uok = > json.get value=`up` key=ok* 1. `uok` > print text=update-ok 2. * > print text=update-fail -*`got2` = > `store`.get table=articles id=1 * -*`title2` = > json.get value=`got2` key=title * +*got2 = > `store`.get table=articles id=1* +*title2 = > json.get value=`got2` key=title* 1. `title2` == "Admin edited" > print text=edit-ok 2. * @@ -78,8 +78,8 @@ import json:lib/json.mq.md |-------|------| | | | -*`bad` = > web_form_submit form=`fnew` data=`empty` url=`url` * -*`bok` = > json.get value=`bad` key=ok * +*bad = > web_form_submit form=`fnew` data=`empty` url=`url`* +*bok = > json.get value=`bad` key=ok* 1. `bok` > print text=required-should-fail 2. * diff --git a/tests/ext/web-fixtures/components/foot.mq.md b/tests/ext/web-fixtures/components/foot.mq.md index 2817405..277dcda 100644 --- a/tests/ext/web-fixtures/components/foot.mq.md +++ b/tests/ext/web-fixtures/components/foot.mq.md @@ -6,4 +6,4 @@ |------|-----|------| | Foot | / | | -**`foot`** +**foot** diff --git a/tests/ext/web-fixtures/components/nav.mq.md b/tests/ext/web-fixtures/components/nav.mq.md index cc8b431..b9eb045 100644 --- a/tests/ext/web-fixtures/components/nav.mq.md +++ b/tests/ext/web-fixtures/components/nav.mq.md @@ -7,4 +7,4 @@ | Home | / | | | Docs | /docs | | -**`nav`** +**nav** diff --git a/tests/ext/web-fixtures/components/side.mq.md b/tests/ext/web-fixtures/components/side.mq.md index 5854320..b0e4b65 100644 --- a/tests/ext/web-fixtures/components/side.mq.md +++ b/tests/ext/web-fixtures/components/side.mq.md @@ -7,4 +7,4 @@ | Side | / | | | Docs | https://github.com | | -**`side`** +**side** diff --git a/tests/ext/web-fixtures/db/articles.mq.md b/tests/ext/web-fixtures/db/articles.mq.md index 471a84a..f581278 100644 --- a/tests/ext/web-fixtures/db/articles.mq.md +++ b/tests/ext/web-fixtures/db/articles.mq.md @@ -8,7 +8,7 @@ | title | text | false | | body | text | true | -**`fields`** +**fields** ## seed @@ -19,4 +19,4 @@ | 1 | Hello Marqdo | First article from a GFM table. | | 2 | Code as docs | The page table is the program. | -**`rows`** +**rows** diff --git a/tests/ext/web-fixtures/styles/shell.mq.md b/tests/ext/web-fixtures/styles/shell.mq.md index 999405a..0984027 100644 --- a/tests/ext/web-fixtures/styles/shell.mq.md +++ b/tests/ext/web-fixtures/styles/shell.mq.md @@ -6,7 +6,7 @@ |------|-----| | background | #fff | -**`topnav`** +**topnav** ## side_panel @@ -16,7 +16,7 @@ |------|-----| | background | #f5f5f4 | -**`side_panel`** +**side_panel** ## card_title @@ -26,7 +26,7 @@ |------|-----| | font-weight | 600 | -**`card_title`** +**card_title** ## card_body @@ -36,4 +36,4 @@ |------|-----| | color | #57534e | -**`card_body`** +**card_body** diff --git a/tests/ext/web-form-embed-smoke.mq.md b/tests/ext/web-form-embed-smoke.mq.md index e0e248b..bef4fca 100644 --- a/tests/ext/web-form-embed-smoke.mq.md +++ b/tests/ext/web-form-embed-smoke.mq.md @@ -14,19 +14,19 @@ import json:lib/json.mq.md | title | Title | text | true | | | body | Body | textarea | false | | -*`f` = > web.form table=articles action=insert * -*`f` = > `f`.fields fields=`fields` * +*f = > web.form table=articles action=insert* +*f = > `f`.fields fields=`fields`* -*`page` = > web.page title="Compose" intro="

Compose

" * -*`page` = > `page`.compose_form id=article form=`f` * +*page = > web.page title="Compose" intro="

Compose

"* +*page = > `page`.compose_form id=article form=`f`* -*`fid` = > json.get value=`page` key=form_id * +*fid = > json.get value=`page` key=form_id* 1. `fid` > print text=form-id-ok 2. * > print text=form-id-fail -*`html` = > `page`.render * +*html = > `page`.render* 1. `html` > print text=render-ok 2. * diff --git a/tests/ext/web-form-smoke.mq.md b/tests/ext/web-form-smoke.mq.md index 2e6ce46..c80967f 100644 --- a/tests/ext/web-form-smoke.mq.md +++ b/tests/ext/web-form-smoke.mq.md @@ -8,8 +8,8 @@ import json:lib/json.mq.md # main -*`store` = > web.db url="sqlite:web-fixtures/data/form-smoke.db" * -*`schema` = > articles.schema * +*store = > web.db url="sqlite:web-fixtures/data/form-smoke.db"* +*schema = > articles.schema* > `store`.init name=articles fields=`schema` `fields` = @@ -26,9 +26,9 @@ import json:lib/json.mq.md | title | required | Title is required | | title | max:120 | Title is too long | -*`f` = > web.form table=articles action=insert * -*`f` = > `f`.fields fields=`fields` * -*`f` = > `f`.rules rules=`rules` * +*f = > web.form table=articles action=insert* +*f = > `f`.fields fields=`fields`* +*f = > `f`.rules rules=`rules`* `bad` = @@ -36,8 +36,8 @@ import json:lib/json.mq.md |-------|------| | | hello | -*`v` = > `f`.validate data=`bad` * -*`ok` = > json.get value=`v` key=ok * +*v = > `f`.validate data=`bad`* +*ok = > json.get value=`v` key=ok* 1. `ok` > print text=validate-should-fail 2. * @@ -49,21 +49,21 @@ import json:lib/json.mq.md |-------|------| | From form | Body via submit | -*`sub` = > `f`.submit data=`good` db=`store` * -*`sok` = > json.get value=`sub` key=ok * +*sub = > `f`.submit data=`good` db=`store`* +*sok = > json.get value=`sub` key=ok* 1. `sok` > print text=submit-ok 2. * > print text=submit-fail -*`rows` = > `store`.select table=articles limit=10 * -*`n` = > len value=`rows` * +*rows = > `store`.select table=articles limit=10* +*n = > len value=`rows`* 1. `n` >= 1 > print text=db-ok 2. * > print text=db-fail -*`html` = > `f`.render id=article * +*html = > `f`.render id=article* 1. `html` > print text=render-ok 2. * diff --git a/tests/ext/web-part-smoke.mq.md b/tests/ext/web-part-smoke.mq.md index b2f9206..7943a0a 100644 --- a/tests/ext/web-part-smoke.mq.md +++ b/tests/ext/web-part-smoke.mq.md @@ -18,34 +18,34 @@ import json:lib/json.mq.md | side.`side` | | | foot.`foot` | | -*`home` = > web.page title="Home" intro="

Home

" * -*`home` = > `home`.compose_components components=`layout` * +*home = > web.page title="Home" intro="

Home

"* +*home = > `home`.compose_components components=`layout`* -*`about` = > web.page title="About" intro="

About

" * -*`about` = > `about`.compose_components components=`layout` * +*about = > web.page title="About" intro="

About

"* +*about = > `about`.compose_components components=`layout`* -*`app` = > web.app page=`home` host=127.0.0.1 port=18081 * -*`app` = > `app`.route path=/about page=`about` * +*app = > web.app page=`home` host=127.0.0.1 port=18081* +*app = > `app`.route path=/about page=`about`* -*`routes` = > json.get value=`app` key=routes * -*`routed` = > json.get value=`routes` key="/about" * -*`route` = > json.get value=`routed` key=_route * +*routes = > json.get value=`app` key=routes* +*routed = > json.get value=`routes` key="/about"* +*route = > json.get value=`routed` key=_route* 1. `route` == "/about" > print text=route-stamp-ok 2. * > print text=route-stamp-fail -*`home_html` = > `home`.render * -*`home_chunks` = > split value=`home_html` sep=/_part/ * -*`hn` = > len value=`home_chunks` * +*home_html = > `home`.render* +*home_chunks = > split value=`home_html` sep=/_part/* +*hn = > len value=`home_chunks`* 1. `hn` >= 2 > print text=home-part-ok 2. * > print text=home-part-fail -*`about_html` = > `routed`.render * -*`about_chunks` = > split value=`about_html` sep=/about/_part/ * -*`an` = > len value=`about_chunks` * +*about_html = > `routed`.render* +*about_chunks = > split value=`about_html` sep=/about/_part/* +*an = > len value=`about_chunks`* 1. `an` >= 2 > print text=route-part-ok 2. * diff --git a/tests/ext/web-route-smoke.mq.md b/tests/ext/web-route-smoke.mq.md index f411da6..ab36a5b 100644 --- a/tests/ext/web-route-smoke.mq.md +++ b/tests/ext/web-route-smoke.mq.md @@ -7,15 +7,15 @@ import json:lib/json.mq.md # main -*`home` = > web.page title="Home" intro="

Home

" * -*`about` = > web.page title="About" intro="

About

" * -*`app` = > web.app page=`home` host=127.0.0.1 port=18081 * -*`app` = > `app`.route path=/about page=`about` * -*`app` = > `app`.route path=docs page=`about` * +*home = > web.page title="Home" intro="

Home

"* +*about = > web.page title="About" intro="

About

"* +*app = > web.app page=`home` host=127.0.0.1 port=18081* +*app = > `app`.route path=/about page=`about`* +*app = > `app`.route path=docs page=`about`* -*`routes` = > json.get value=`app` key=routes * -*`about_page` = > json.get value=`routes` key="/about" * -*`docs_page` = > json.get value=`routes` key="/docs" * +*routes = > json.get value=`app` key=routes* +*about_page = > json.get value=`routes` key="/about"* +*docs_page = > json.get value=`routes` key="/docs"* 1. `about_page` > print text=about-ok @@ -27,7 +27,7 @@ import json:lib/json.mq.md 2. * > print text=docs-fail -*`html` = > `about`.render * +*html = > `about`.render* 1. `html` > print text=render-ok 2. * diff --git a/tests/ext/web-select-smoke.mq.md b/tests/ext/web-select-smoke.mq.md index d80383b..3462a2b 100644 --- a/tests/ext/web-select-smoke.mq.md +++ b/tests/ext/web-select-smoke.mq.md @@ -8,8 +8,8 @@ import json:lib/json.mq.md # main -*`store` = > web.db url="sqlite:web-fixtures/data/select-smoke.db" * -*`schema` = > articles.schema * +*store = > web.db url="sqlite:web-fixtures/data/select-smoke.db"* +*schema = > articles.schema* > `store`.init name=articles fields=`schema` > `store`.exec sql="DELETE FROM articles" @@ -29,8 +29,8 @@ import json:lib/json.mq.md |-------|------| | Alpha | first | -*`hit` = > `store`.select table=articles where=`eq` limit=50 * -*`n` = > len value=`hit` * +*hit = > `store`.select table=articles where=`eq` limit=50* +*n = > len value=`hit`* 1. `n` == 1 > print text=map-where-ok 2. * @@ -42,15 +42,15 @@ import json:lib/json.mq.md |------|------|-----| | title | like | %Alpha% | -*`like_rows` = > `store`.select table=articles where=`filt` limit=50 * -*`ln` = > len value=`like_rows` * +*like_rows = > `store`.select table=articles where=`filt` limit=50* +*ln = > len value=`like_rows`* 1. `ln` == 2 > print text=like-ok 2. * > print text=like-fail -*`all` = > `store`.select table=articles limit=50 * -*`an` = > len value=`all` * +*all = > `store`.select table=articles limit=50* +*an = > len value=`all`* 1. `an` == 3 > print text=all-ok 2. * diff --git a/tests/ext/web-smoke.mq.md b/tests/ext/web-smoke.mq.md index 7259302..2f58ad2 100644 --- a/tests/ext/web-smoke.mq.md +++ b/tests/ext/web-smoke.mq.md @@ -13,14 +13,14 @@ import json:lib/json.mq.md # main -*`store` = > web.db url="sqlite:web-fixtures/data/smoke.db" * -*`fields` = > articles.schema * +*store = > web.db url="sqlite:web-fixtures/data/smoke.db"* +*fields = > articles.schema* > `store`.init name=articles fields=`fields` -*`rows` = > `store`.select table=articles limit=1 * +*rows = > `store`.select table=articles limit=1* 1. `rows` - *`_` = 1* + *_ = 1* 2. * - *`seed` = > articles.seed * + *seed = > articles.seed* > `store`.insert table=articles rows=`seed` `home` = @@ -38,43 +38,43 @@ import json:lib/json.mq.md | title | articles.`articles`.title | shell.`card_title` | | body | articles.`articles`.body | shell.`card_body` | -*`page` = > web.page title="smoke" intro="

smoke

" * -*`page` = > `page`.compose_components components=`home` * -*`page` = > `page`.compose_main main=`index` * -*`html` = > `page`.render db=`store` * +*page = > web.page title="smoke" intro="

smoke

"* +*page = > `page`.compose_components components=`home`* +*page = > `page`.compose_main main=`index`* +*html = > `page`.render db=`store`* 1. `html` > print text=render-ok 2. * > print text=render-fail -*`nav` = > json.get value=`page` key=nav * +*nav = > json.get value=`page` key=nav* 1. `nav` > print text=compose-nav-ok 2. * > print text=compose-nav-fail -*`side` = > json.get value=`page` key=sidebar * +*side = > json.get value=`page` key=sidebar* 1. `side` > print text=compose-side-ok 2. * > print text=compose-side-fail -*`css` = > json.get value=`page` key=styles_css * +*css = > json.get value=`page` key=styles_css* 1. `css` > print text=styles-ok 2. * > print text=styles-fail -*`parts` = > json.get value=`page` key=parts * -*`index_part` = > json.get value=`parts` key=index * +*parts = > json.get value=`page` key=parts* +*index_part = > json.get value=`parts` key=index* 1. `index_part` > print text=compose-ok 2. * > print text=compose-fail -*`got` = > `store`.get table=articles id=1 * -*`title` = > json.get value=`got` key=title * +*got = > `store`.get table=articles id=1* +*title = > json.get value=`got` key=title* 1. `title` == "Hello Marqdo" > print text=db-ok 2. * diff --git a/tests/ext/web-static-smoke.mq.md b/tests/ext/web-static-smoke.mq.md index 44881a6..ff0b7f5 100644 --- a/tests/ext/web-static-smoke.mq.md +++ b/tests/ext/web-static-smoke.mq.md @@ -7,24 +7,24 @@ import json:lib/json.mq.md # main -*`home` = > web.page title="Home" * -*`app` = > web.app page=`home` host=127.0.0.1 port=18081 * -*`app` = > `app`.static dir=web-fixtures/public mount=/static * +*home = > web.page title="Home"* +*app = > web.app page=`home` host=127.0.0.1 port=18081* +*app = > `app`.static dir=web-fixtures/public mount=/static* -*`dir` = > json.get value=`app` key=static_dir * +*dir = > json.get value=`app` key=static_dir* 1. `dir` == "web-fixtures/public" > print text=dir-ok 2. * > print text=dir-fail -*`mount` = > json.get value=`app` key=static_mount * +*mount = > json.get value=`app` key=static_mount* 1. `mount` == "/static" > print text=mount-ok 2. * > print text=mount-fail -*`app2` = > `app`.static dir=assets mount=/assets * -*`m2` = > json.get value=`app2` key=static_mount * +*app2 = > `app`.static dir=assets mount=/assets* +*m2 = > json.get value=`app2` key=static_mount* 1. `m2` == "/assets" > print text=custom-ok 2. * diff --git a/tests/ext/web-zh-smoke.mq.md b/tests/ext/web-zh-smoke.mq.md index 7d7ae2d..ac01295 100644 --- a/tests/ext/web-zh-smoke.mq.md +++ b/tests/ext/web-zh-smoke.mq.md @@ -11,8 +11,8 @@ import json:lib/json.mq.md # main -*`store` = > 网页.数据库 地址="sqlite:web-fixtures/data/zh-smoke.db" * -*`schema` = > articles.schema * +*store = > 网页.数据库 地址="sqlite:web-fixtures/data/zh-smoke.db"* +*schema = > articles.schema* > `store`.初始化 名=articles 字段=`schema` > `store`.执行 sql="DELETE FROM articles" > `store`.执行 sql="DELETE FROM sqlite_sequence WHERE name='articles'" @@ -40,17 +40,17 @@ import json:lib/json.mq.md > `store`.插入 表=articles 行=`seed` -*`page` = > 网页.页面 标题="中文烟测" 引言="

中文

" * -*`page` = > `page`.组件装配 组件=`layout` * -*`page` = > `page`.主体装配 主体=`index` * +*page = > 网页.页面 标题="中文烟测" 引言="

中文

"* +*page = > `page`.组件装配 组件=`layout`* +*page = > `page`.主体装配 主体=`index`* -*`html` = > `page`.渲染 数据库=`store` * +*html = > `page`.渲染 数据库=`store`* 1. `html` > print text=render-ok 2. * > print text=render-fail -*`nav` = > json.get value=`page` key=nav * +*nav = > json.get value=`page` key=nav* 1. `nav` > print text=compose-ok 2. * @@ -62,20 +62,20 @@ import json:lib/json.mq.md |------|------|------|------|------| | title | 标题 | text | true | | -*`f` = > 网页.表单 表=articles 动作=插入 * -*`f` = > `f`.字段 字段=`fields` * -*`page` = > `page`.表单装配 id=article 表单=`f` * -*`fid` = > json.get value=`page` key=form_id * +*f = > 网页.表单 表=articles 动作=插入* +*f = > `f`.字段 字段=`fields`* +*page = > `page`.表单装配 id=article 表单=`f`* +*fid = > json.get value=`page` key=form_id* 1. `fid` == "article" > print text=form-ok 2. * > print text=form-fail -*`app` = > 网页.应用 页面=`page` 数据库=`store` 主机=127.0.0.1 端口=18082 * -*`about` = > 网页.页面 标题="关于" 引言="

关于

" * -*`app` = > `app`.路由 路径=/about 页面=`about` * -*`routes` = > json.get value=`app` key=routes * -*`routed` = > json.get value=`routes` key="/about" * +*app = > 网页.应用 页面=`page` 数据库=`store` 主机=127.0.0.1 端口=18082* +*about = > 网页.页面 标题="关于" 引言="

关于

"* +*app = > `app`.路由 路径=/about 页面=`about`* +*routes = > json.get value=`app` key=routes* +*routed = > json.get value=`routes` key="/about"* 1. `routed` > print text=route-ok 2. * diff --git a/tests/keywords/bool-logic.mq.md b/tests/keywords/bool-logic.mq.md index 0b0745c..a23146d 100644 --- a/tests/keywords/bool-logic.mq.md +++ b/tests/keywords/bool-logic.mq.md @@ -4,15 +4,15 @@ title: 布尔与逻辑关键字 # main -*`a` = True* -*`b` = False* +*a = True* +*b = False* 1. `a` and not `b` > print text=ok 2. * > print text=fail -*`probe` = 1* +*probe = 1* 1. None > print text=none-truthy diff --git a/tests/keywords/input-escape.mq.md b/tests/keywords/input-escape.mq.md index 37400f5..1276b79 100644 --- a/tests/keywords/input-escape.mq.md +++ b/tests/keywords/input-escape.mq.md @@ -5,6 +5,6 @@ stdin: Ada # main -*`name` = > input prompt="Name:\n"* +*name = > input prompt="Name:\n"* > print text=Hello `name`! diff --git a/tests/keywords/input.mq.md b/tests/keywords/input.mq.md index 1e1f959..475be85 100644 --- a/tests/keywords/input.mq.md +++ b/tests/keywords/input.mq.md @@ -5,6 +5,6 @@ description: Read one stdin line (optional prompt) # main -*`name` = > input prompt=Name: * +*name = > input prompt=Name:* > print text=Hello `name`! diff --git a/tests/keywords/quoted-string.mq.md b/tests/keywords/quoted-string.mq.md index ef79fbd..cff3b4f 100644 --- a/tests/keywords/quoted-string.mq.md +++ b/tests/keywords/quoted-string.mq.md @@ -4,6 +4,6 @@ title: quoted string literal # main -*`s` = "a\nb"* +*s = "a\nb"* > print text=`s` diff --git a/tests/keywords/stdlib-more.mq.md b/tests/keywords/stdlib-more.mq.md index 7361e36..431444b 100644 --- a/tests/keywords/stdlib-more.mq.md +++ b/tests/keywords/stdlib-more.mq.md @@ -5,26 +5,26 @@ description: trim split join at type + lib imports # main -*`raw` = " hi " * +*raw = " hi "* -*`t` = > trim `raw`* +*t = > trim `raw`* > print text=`t` -*`parts` = > split value=a,b,c sep=,* +*parts = > split value=a,b,c sep=,* -*`n` = > len `parts`* +*n = > len `parts`* > print text=`n` -*`mid` = > at value=`parts` index=1* +*mid = > at value=`parts` index=1* > print text=`mid` -*`joined` = > join value=`parts` sep=-* +*joined = > join value=`parts` sep=-* > print text=`joined` -*`ty` = > type `parts`* +*ty = > type `parts`* > print text=`ty` diff --git a/tests/keywords/stdlib.mq.md b/tests/keywords/stdlib.mq.md index df53582..bcc1571 100644 --- a/tests/keywords/stdlib.mq.md +++ b/tests/keywords/stdlib.mq.md @@ -5,9 +5,9 @@ description: Built-in conversions and length # main -*`s` = "hello"* +*s = "hello"* -*`n` = > len `s`* +*n = > len `s`* > print text=`n` @@ -19,18 +19,18 @@ description: Built-in conversions and length | b | | c | -*`m` = > len `xs`* +*m = > len `xs`* > print text=`m` -*`t` = > str 42* +*t = > str 42* > print text=`t` -*`i` = > int `t`* +*i = > int `t`* > print text=`i` -*`j` = > int True* +*j = > int True* > print text=`j` diff --git a/tests/keywords/zh-bool.mq.md b/tests/keywords/zh-bool.mq.md index ef96009..a02db2a 100644 --- a/tests/keywords/zh-bool.mq.md +++ b/tests/keywords/zh-bool.mq.md @@ -4,15 +4,15 @@ title: 中文布尔与逻辑 # main -*`a` = 真* -*`b` = 假* +*a = 真* +*b = 假* 1. `a` 且 非 `b` > 打印 内容=ok 2. * > 打印 内容=fail -*`probe` = 1* +*probe = 1* 1. 空 > 打印 内容=none-truthy diff --git a/tests/keywords/zh-builtins.mq.md b/tests/keywords/zh-builtins.mq.md index 8d62c2b..9aaef63 100644 --- a/tests/keywords/zh-builtins.mq.md +++ b/tests/keywords/zh-builtins.mq.md @@ -5,14 +5,14 @@ description: 打印 / 长度 / 文本 / 整数(与英文别名等价) # main -*`s` = "hello"* +*s = "hello"* -*`n` = > 长度 值=`s`* +*n = > 长度 值=`s`* > 打印 内容=`n` -*`t` = > 文本 值=7* +*t = > 文本 值=7* -*`i` = > 整数 值=`t`* +*i = > 整数 值=`t`* > 打印 内容=`i` diff --git a/tests/lib/foreign-python.mq.md b/tests/lib/foreign-python.mq.md index b91efe2..5f4bc6d 100644 --- a/tests/lib/foreign-python.mq.md +++ b/tests/lib/foreign-python.mq.md @@ -10,6 +10,6 @@ import foreign:lib/foreign.mq.md print("hello-from-python") ``` -*`out` = > foreign.run code=`hi` * +*out = > foreign.run code=`hi`* > print text=`out` diff --git a/tests/lib/foreign-run-lang.mq.md b/tests/lib/foreign-run-lang.mq.md index 5feda24..e61bfab 100644 --- a/tests/lib/foreign-run-lang.mq.md +++ b/tests/lib/foreign-run-lang.mq.md @@ -5,6 +5,6 @@ import foreign:lib/foreign.mq.md # main -*`out` = > foreign.run_lang lang=python source=print(2+2) * +*out = > foreign.run_lang lang=python source=print(2+2)* > print text=`out` diff --git a/tests/lib/fs-read.mq.md b/tests/lib/fs-read.mq.md index 999d259..eead508 100644 --- a/tests/lib/fs-read.mq.md +++ b/tests/lib/fs-read.mq.md @@ -5,13 +5,13 @@ import fs:lib/fs.mq.md # main -*`ok` = > fs.exists path=hello.txt * +*ok = > fs.exists path=hello.txt* 1. `ok` > print text=exists 2. * > print text=missing -*`t` = > fs.read_text path=hello.txt * +*t = > fs.read_text path=hello.txt* > print text=`t` diff --git a/tests/lib/json-quote.mq.md b/tests/lib/json-quote.mq.md index ed7f8ae..e6e300e 100644 --- a/tests/lib/json-quote.mq.md +++ b/tests/lib/json-quote.mq.md @@ -5,6 +5,6 @@ import json:lib/json.mq.md # main -*`q` = > json.quote text=hi * +*q = > json.quote text=hi* > print text=`q` diff --git a/tests/lib/json-roundtrip.mq.md b/tests/lib/json-roundtrip.mq.md index b9b7599..036b3f7 100644 --- a/tests/lib/json-roundtrip.mq.md +++ b/tests/lib/json-roundtrip.mq.md @@ -6,18 +6,18 @@ import json:lib/json.mq.md # main -*`raw` = > fs.read_text path=sample.json * +*raw = > fs.read_text path=sample.json* -*`obj` = > json.parse text=`raw` * +*obj = > json.parse text=`raw`* -*`ty` = > type `obj` * +*ty = > type `obj`* > print text=`ty` -*`a` = > json.get value=`obj` key=a * +*a = > json.get value=`obj` key=a* > print text=`a` -*`out` = > json.stringify value=`obj` * +*out = > json.stringify value=`obj`* > print text=`out` diff --git a/tests/lib/math-formula-chain.mq.md b/tests/lib/math-formula-chain.mq.md index b403ef6..2e11404 100644 --- a/tests/lib/math-formula-chain.mq.md +++ b/tests/lib/math-formula-chain.mq.md @@ -10,16 +10,16 @@ $$ x^3 $$ -*`df` = > math.diff formula=`f` var=x * +*df = > math.diff formula=`f` var=x* -*`ty` = > type `df` * +*ty = > type `df`* > print text=`ty` -*`df2` = > math.diff formula=`df` var=x * +*df2 = > math.diff formula=`df` var=x* > print text=`df2` -*`y` = > math.eval formula=`df` var=x value=2 * +*y = > math.eval formula=`df` var=x value=2* > print text=`y` diff --git a/tests/lib/math-formula.mq.md b/tests/lib/math-formula.mq.md index 914b94a..3ee512f 100644 --- a/tests/lib/math-formula.mq.md +++ b/tests/lib/math-formula.mq.md @@ -10,18 +10,18 @@ $$ x^2 - 2 $$ -*`ty` = > type `f` * +*ty = > type `f`* > print text=`ty` -*`df` = > math.diff formula=`f` var=x * +*df = > math.diff formula=`f` var=x* > print text=`df` -*`roots` = > math.solve formula=`f` var=x * +*roots = > math.solve formula=`f` var=x* > print text=`roots` -*`y` = > math.eval formula=`f` var=x value=3 * +*y = > math.eval formula=`f` var=x value=3* > print text=`y` diff --git a/tests/lib/math-plot.mq.md b/tests/lib/math-plot.mq.md index 086f097..2c05834 100644 --- a/tests/lib/math-plot.mq.md +++ b/tests/lib/math-plot.mq.md @@ -10,8 +10,8 @@ $$ x^2 $$ -*`svg` = > math.plot formula=`f` var=x min=-2 max=2 * +*svg = > math.plot formula=`f` var=x min=-2 max=2* -*`ok` = > type `svg` * +*ok = > type `svg`* > print text=`ok` diff --git a/tests/lib/math-random.mq.md b/tests/lib/math-random.mq.md index 550eb53..8d93b0b 100644 --- a/tests/lib/math-random.mq.md +++ b/tests/lib/math-random.mq.md @@ -7,13 +7,13 @@ import math:lib/math.mq.md > math.seed value=42 -*`a` = > math.random_int min=1 max=10 * +*a = > math.random_int min=1 max=10* -*`b` = > math.random_int min=1 max=10 * +*b = > math.random_int min=1 max=10* > math.seed value=42 -*`c` = > math.random_int min=1 max=10 * +*c = > math.random_int min=1 max=10* > print text=`a` diff --git a/tests/lib/net-encode.mq.md b/tests/lib/net-encode.mq.md index 0c5e6c3..4d6ec0b 100644 --- a/tests/lib/net-encode.mq.md +++ b/tests/lib/net-encode.mq.md @@ -5,6 +5,6 @@ import net:lib/net.mq.md # main -*`e` = > net.url_encode text=a b * +*e = > net.url_encode text=a b* > print text=`e` diff --git a/tests/lib/net-openai-sse-reasoning.mq.md b/tests/lib/net-openai-sse-reasoning.mq.md index 909d727..c2a3152 100644 --- a/tests/lib/net-openai-sse-reasoning.mq.md +++ b/tests/lib/net-openai-sse-reasoning.mq.md @@ -7,26 +7,26 @@ import json:lib/json.mq.md # main -*`fixture` = "data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"think\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"Hi\"}}]}\n\ndata: [DONE]\n" * +*fixture = "data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"think\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"Hi\"}}]}\n\ndata: [DONE]\n"* -*`events` = > net.openai_sse_parse text=`fixture` * -*`n` = > len value=`events` * +*events = > net.openai_sse_parse text=`fixture`* +*n = > len value=`events`* > print text=`n` -*`e0` = > at value=`events` index=0 * -*`t0` = > json.get value=`e0` key=type * -*`x0` = > json.get value=`e0` key=text * +*e0 = > at value=`events` index=0* +*t0 = > json.get value=`e0` key=type* +*x0 = > json.get value=`e0` key=text* > print text=`t0` > print text=`x0` -*`e1` = > at value=`events` index=1 * -*`t1` = > json.get value=`e1` key=type * -*`x1` = > json.get value=`e1` key=text * +*e1 = > at value=`events` index=1* +*t1 = > json.get value=`e1` key=type* +*x1 = > json.get value=`e1` key=text* > print text=`t1` > print text=`x1` -*`e2` = > at value=`events` index=2 * -*`t2` = > json.get value=`e2` key=type * -*`r2` = > json.get value=`e2` key=result * +*e2 = > at value=`events` index=2* +*t2 = > json.get value=`e2` key=type* +*r2 = > json.get value=`e2` key=result* > print text=`t2` > print text=`r2` diff --git a/tests/lib/net-openai-sse.mq.md b/tests/lib/net-openai-sse.mq.md index af19f29..4f5a988 100644 --- a/tests/lib/net-openai-sse.mq.md +++ b/tests/lib/net-openai-sse.mq.md @@ -6,17 +6,17 @@ import json:lib/json.mq.md # main -*`fixture` = "data: {\"choices\":[{\"delta\":{\"content\":\"Hel\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"lo\"}}]}\n\ndata: [DONE]\n" * +*fixture = "data: {\"choices\":[{\"delta\":{\"content\":\"Hel\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"lo\"}}]}\n\ndata: [DONE]\n"* -*`events` = > net.openai_sse_parse text=`fixture` * +*events = > net.openai_sse_parse text=`fixture`* - [`ev`](`events`) - *`t` = > json.get value=`ev` key=type * + *t = > json.get value=`ev` key=type* 1. `t` == "delta" - *`chunk` = > json.get value=`ev` key=text * + *chunk = > json.get value=`ev` key=text* > print text=`chunk` 2. `t` == "done" - *`answer` = > json.get value=`ev` key=result * + *answer = > json.get value=`ev` key=result* > print text=`answer` 3. * > print text=bad diff --git a/tests/lib/plugin-demo.mq.md b/tests/lib/plugin-demo.mq.md index bc5daaf..bfe2cc6 100644 --- a/tests/lib/plugin-demo.mq.md +++ b/tests/lib/plugin-demo.mq.md @@ -7,14 +7,14 @@ import sys:lib/sys.mq.md # main -*`p` = > sys.env_get name=MARQDO_TEST_PLUGIN * +*p = > sys.env_get name=MARQDO_TEST_PLUGIN* > plugin.load path=`p` -*`sum` = > demo_add a=1 b=2 * +*sum = > demo_add a=1 b=2* > print text=`sum` -*`echo` = > demo_echo text=ok * +*echo = > demo_echo text=ok* > print text=`echo` diff --git a/tests/lib/subtask-fn.mq.md b/tests/lib/subtask-fn.mq.md index 00aafe6..cfb31f5 100644 --- a/tests/lib/subtask-fn.mq.md +++ b/tests/lib/subtask-fn.mq.md @@ -6,11 +6,11 @@ import json:lib/json.mq.md # main -*`args` = > json.parse text={"n":21} * +*args = > json.parse text={"n":21}* -*`id` = > subtask.spawn fn=worker args=`args` * +*id = > subtask.spawn fn=worker args=`args`* -*`v` = > subtask.wait id=`id` * +*v = > subtask.wait id=`id`* > print text=`v` @@ -19,4 +19,4 @@ import json:lib/json.mq.md ## worker + `n` -**`n` * 2** +**n * 2** diff --git a/tests/lib/subtask-foreign.mq.md b/tests/lib/subtask-foreign.mq.md index 0b3440b..ced8060 100644 --- a/tests/lib/subtask-foreign.mq.md +++ b/tests/lib/subtask-foreign.mq.md @@ -10,8 +10,8 @@ import subtask:lib/subtask.mq.md print(7 + 8) ``` -*`id` = > subtask.spawn code=`py` * +*id = > subtask.spawn code=`py`* -*`out` = > subtask.wait id=`id` * +*out = > subtask.wait id=`id`* > print text=`out` diff --git a/tests/lib/subtask-quiet-io.mq.md b/tests/lib/subtask-quiet-io.mq.md index 45a33c5..230c7d5 100644 --- a/tests/lib/subtask-quiet-io.mq.md +++ b/tests/lib/subtask-quiet-io.mq.md @@ -6,11 +6,11 @@ import json:lib/json.mq.md # main -*`id` = > subtask.spawn path=subtask-child-print.mq.md * -*`waited` = > subtask.wait id=`id` * -*`code` = > json.get value=`waited` key=code * -*`val` = > json.get value=`waited` key=value * -*`stdout` = > json.get value=`waited` key=stdout * +*id = > subtask.spawn path=subtask-child-print.mq.md* +*waited = > subtask.wait id=`id`* +*code = > json.get value=`waited` key=code* +*val = > json.get value=`waited` key=value* +*stdout = > json.get value=`waited` key=stdout* 1. `code` == 0 1. `val` == "child_ok" diff --git a/tests/lib/subtask-spawn.mq.md b/tests/lib/subtask-spawn.mq.md index bad5102..9822b89 100644 --- a/tests/lib/subtask-spawn.mq.md +++ b/tests/lib/subtask-spawn.mq.md @@ -6,11 +6,11 @@ import json:lib/json.mq.md # main -*`id` = > subtask.spawn path=subtask-child.mq.md quiet=False * +*id = > subtask.spawn path=subtask-child.mq.md quiet=False* -*`waited` = > subtask.wait id=`id` * -*`code` = > json.get value=`waited` key=code * -*`val` = > json.get value=`waited` key=value * +*waited = > subtask.wait id=`id`* +*code = > json.get value=`waited` key=code* +*val = > json.get value=`waited` key=value* 1. `code` == 0 > print text=`val` @@ -19,11 +19,11 @@ import json:lib/json.mq.md > print text=done -*`id2` = > subtask.spawn path=subtask-child.mq.md * +*id2 = > subtask.spawn path=subtask-child.mq.md* -*`waited2` = > subtask.wait id=`id2` * -*`code2` = > json.get value=`waited2` key=code * -*`val2` = > json.get value=`waited2` key=value * +*waited2 = > subtask.wait id=`id2`* +*code2 = > json.get value=`waited2` key=code* +*val2 = > json.get value=`waited2` key=value* 1. `code2` == 0 1. `val2` == "child_ok" diff --git a/tests/lib/sys-cwd.mq.md b/tests/lib/sys-cwd.mq.md index 622147c..428505d 100644 --- a/tests/lib/sys-cwd.mq.md +++ b/tests/lib/sys-cwd.mq.md @@ -5,9 +5,9 @@ import sys:lib/sys.mq.md # main -*`d` = > sys.cwd * +*d = > sys.cwd* -*`n` = > len `d` * +*n = > len `d`* 1. `n` > 0 > print text=cwd-ok diff --git a/tests/lib/sys-dotenv.mq.md b/tests/lib/sys-dotenv.mq.md index d77ab8c..bc5453a 100644 --- a/tests/lib/sys-dotenv.mq.md +++ b/tests/lib/sys-dotenv.mq.md @@ -10,6 +10,6 @@ import fs:lib/fs.mq.md > sys.load_dotenv path=dotenv-fixture.env -*`v` = > sys.env_get name=MARQDO_DOTENV_FIXTURE * +*v = > sys.env_get name=MARQDO_DOTENV_FIXTURE* > print text=`v` diff --git a/tests/lib/table-collections.mq.md b/tests/lib/table-collections.mq.md index ba12a0a..0c61095 100644 --- a/tests/lib/table-collections.mq.md +++ b/tests/lib/table-collections.mq.md @@ -6,7 +6,7 @@ import table:lib/table.mq.md # main -*`h` = > table.put in=None at=Authorization value=Bearer-x* +*h = > table.put in=None at=Authorization value=Bearer-x* > print text=`h`[^Authorization] `xs` = @@ -16,7 +16,7 @@ import table:lib/table.mq.md | a | | b | -*`xs` = > table.put in=`xs` at=1 value=A* +*xs = > table.put in=`xs` at=1 value=A* > print text=`xs`[^1] > print text=`xs`[^2] @@ -26,22 +26,22 @@ import table:lib/table.mq.md |-------|----------| | m1 | None | -*`msg` = > table.put in=None at=role value=user* -*`msg` = > table.put in=`msg` at=content value=hi* -*`messages` = > table.append list=None item=`msg`* -*`req` = > table.put in=`req` at=messages value=`messages`* -*`req` = > table.put in=`req` at=stream value=True* +*msg = > table.put in=None at=role value=user* +*msg = > table.put in=`msg` at=content value=hi* +*messages = > table.append list=None item=`msg`* +*req = > table.put in=`req` at=messages value=`messages`* +*req = > table.put in=`req` at=stream value=True* > print text=`req`[^messages][^1][^content] > print text=`req`[^stream] -*`xs` = > table.append list=`xs` item=c* -*`n` = > table.len xs=`xs`* +*xs = > table.append list=`xs` item=c* +*n = > table.len xs=`xs`* > print text=`n` -*`m` = > table.merge a=`h` b=`msg`* -*`ks` = > table.keys map=`m`* +*m = > table.merge a=`h` b=`msg`* +*ks = > table.keys map=`m`* > print text=`ks` -*`empty` = > table.empty_map* -*`sz` = > table.size map=`empty`* +*empty = > table.empty_map* +*sz = > table.size map=`empty`* > print text=`sz` diff --git a/tests/lib/time-format.mq.md b/tests/lib/time-format.mq.md index 8162ddc..096f535 100644 --- a/tests/lib/time-format.mq.md +++ b/tests/lib/time-format.mq.md @@ -5,11 +5,11 @@ import time:lib/time.mq.md # main -*`s` = > time.format unix=0 pattern=%Y-%m-%d * +*s = > time.format unix=0 pattern=%Y-%m-%d* > print text=`s` -*`u` = > time.parse text=1970-01-01 00:00:00 pattern=%Y-%m-%d %H:%M:%S * +*u = > time.parse text=1970-01-01 00:00:00 pattern=%Y-%m-%d %H:%M:%S* > print text=`u` diff --git a/tests/lib/writeback-async.mq.md b/tests/lib/writeback-async.mq.md index 68af3ee..e725f05 100644 --- a/tests/lib/writeback-async.mq.md +++ b/tests/lib/writeback-async.mq.md @@ -18,7 +18,7 @@ import json:lib/json.mq.md # main -*`anchor` = > host_outer_call_line * +*anchor = > host_outer_call_line* @@ -30,8 +30,8 @@ async-ok pending --> -*`wb` = > json.parse text={"key":"ok","value":"async-ok"} * -*`wb` = > json.set map=`wb` key=line value=`anchor` * +*wb = > json.parse text={"key":"ok","value":"async-ok"}* +*wb = > json.set map=`wb` key=line value=`anchor`* > subtask.spawn fn=persist_slot args=`wb` > print text=spawned diff --git a/tests/lib/writeback-get.mq.md b/tests/lib/writeback-get.mq.md index 97c7569..3283416 100644 --- a/tests/lib/writeback-get.mq.md +++ b/tests/lib/writeback-get.mq.md @@ -5,7 +5,7 @@ import writeback:lib/writeback.mq.md # main -*`out` = > writeback.get * +*out = > writeback.get*