Files
marqdo/tests/structure/object-handle.mq.md
T
cflmyandCursor 687c168014 feat(parse): use nested YAML import: maps instead of one-liner binds
Frontmatter imports are now valid YAML (`import:` / `导入:` with bind→target
entries), removing spaced keys. Add `marqdo migrate imports`, hard-error the
old one-liner form, and migrate lib/ext/examples/tests/docs accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 19:33:58 +08:00

39 lines
766 B
Markdown

---
title: object handle smoke
import:
json: lib/json.mq.md
---
# counter
+ `n`
**t = > json.parse text={"p":"{\"n\":","s":"}"}**
**qn = > str `n`**
**p = > json.get value=`t` key="p"**
**s = > json.get value=`t` key="s"**
**raw = p + qn + s**
*> json.parse text=`raw`*
## bump
**n = > json.get value=`self` key="n"**
**n2 = n + 1**
**t = > json.parse text={"p":"{\"n\":","s":"}"}**
**qn = > str `n2`**
**p = > json.get value=`t` key="p"**
**s = > json.get value=`t` key="s"**
**raw = p + qn + s**
**m = > json.parse text=`raw`**
*m*
# main
**c = > counter n=3**
**ty = > json.get value=`c` key="_type"**
> print text=`ty`
**n = > json.get value=`c` key="n"**
> print text=`n`
**c2 = > `c`.bump**
**n2 = > json.get value=`c2` key="n"**
> print text=`n2`