Inside italic/bold code segments every bare word is a variable — including call arguments and method-call receivers — so text literals must be quoted and receivers no longer need backticks. A bare dotted callee `a.b` resolves as a method call when `a` is a local variable, otherwise as a library path (Python-style unified namespace), in both the tree-walk and bytecode backends. Migrate ~70 tests plus ext/web, ext/quantum, ext/ai and the example projects to the new idiom; update SKILL.md and the design docs; fix the web/quantum example data model (db/index.mq.md). Unit and gold suites pass; only the 3 network-live tests fail offline. Co-authored-by: Cursor <cursoragent@cursor.com>
1.4 KiB
1.4 KiB
title: web part smoke description: Routed pages stamp _route and emit {path}/_part/{id} slot sources. import web:ext/web/web.mq.md import nav:web-fixtures/components/nav.mq.md import side:web-fixtures/components/side.mq.md import foot:web-fixtures/components/foot.mq.md import json:lib/json.mq.md
main
layout =
| 组件 | 样式 |
|---|---|
nav.nav |
|
side.side |
|
foot.foot |
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
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"
route== "/about"
print text=route-stamp-ok
print text=route-stamp-fail
home_html = > home.render
home_chunks = > split value=home_html sep="/_part/"
hn = > len value=home_chunks
hn>= 2
print text=home-part-ok
print text=home-part-fail
about_html = > routed.render
about_chunks = > split value=about_html sep="/about/_part/"
an = > len value=about_chunks
an>= 2
print text=route-part-ok
print text=route-part-fail