Unify bare-identifier semantics in *…* / **…** (Python namespace)
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>
This commit is contained in:
1 parent
f275d1e030
commit
bd5555afaa
86 files changed
+1539
-1467
No files matched your search
@@ -6,7 +6,7 @@ title: import official lib (Chinese)
|
||||
|
||||
# main
|
||||
|
||||
*t = > 文本.去空白 s= x*
|
||||
*t = > 文本.去空白 s=" x"*
|
||||
|
||||
> 打印 内容=`t`
|
||||
|
||||
|
||||
@@ -7,22 +7,22 @@ import json:lib/json.mq.md
|
||||
+ `name`
|
||||
|
||||
*out = > json.parse text={"role":"parent"}*
|
||||
*out = > json.set map=`out` key=name value=`name`*
|
||||
*out = > json.set map=`out` key="name" value=`name`*
|
||||
**out**
|
||||
|
||||
# Child = > Parent
|
||||
+ `name`
|
||||
|
||||
*self = > Parent name=`name`*
|
||||
*self = > json.set map=`self` key=role value=child*
|
||||
*self = > json.set map=`self` key="role" value="child"*
|
||||
**self**
|
||||
|
||||
# main
|
||||
|
||||
*c = > Child name=Ada*
|
||||
*ty = > json.get value=`c` key=_type*
|
||||
*role = > json.get value=`c` key=role*
|
||||
*name = > json.get value=`c` key=name*
|
||||
*c = > Child name="Ada"*
|
||||
*ty = > json.get value=`c` key="_type"*
|
||||
*role = > json.get value=`c` key="role"*
|
||||
*name = > json.get value=`c` key="name"*
|
||||
> print text=`ty`
|
||||
> print text=`role`
|
||||
> print text=`name`
|
||||
@@ -21,8 +21,8 @@ title: inherit method override
|
||||
# main
|
||||
|
||||
*g = > Greeter*
|
||||
*m = > `g`.hello who=world*
|
||||
*m = > `g`.hello who="world"*
|
||||
> print text=`m`
|
||||
*l = > Loud*
|
||||
*m2 = > `l`.hello who=world*
|
||||
*m2 = > `l`.hello who="world"*
|
||||
> print text=`m2`
|
||||
@@ -16,7 +16,7 @@ import json:lib/json.mq.md
|
||||
# main
|
||||
|
||||
*l = > Loud*
|
||||
*ty = > json.get value=`l` key=_type*
|
||||
*ty = > json.get value=`l` key="_type"*
|
||||
> print text=`ty`
|
||||
*m = > `l`.hello who=world*
|
||||
*m = > `l`.hello who="world"*
|
||||
> print text=`m`
|
||||
@@ -5,7 +5,7 @@ import helpers:helpers.mq.md
|
||||
|
||||
# main
|
||||
|
||||
*v = > helpers.pack.label s=ok*
|
||||
*v = > helpers.pack.label s="ok"*
|
||||
|
||||
> print text=`v`
|
||||
|
||||
|
||||
@@ -6,6 +6,6 @@ import trim_text:text.str_trim
|
||||
|
||||
# main
|
||||
|
||||
*t = > trim_text s= hi*
|
||||
*t = > trim_text s=" hi"*
|
||||
|
||||
> print text=`t`
|
||||
@@ -8,19 +8,19 @@ import json:lib/json.mq.md
|
||||
|
||||
*t = > json.parse text={"p":"{\"n\":","s":"}"}*
|
||||
*qn = > str `n`*
|
||||
*p = > json.get value=`t` key=p*
|
||||
*s = > json.get value=`t` key=s*
|
||||
*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*
|
||||
*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*
|
||||
*p = > json.get value=`t` key="p"*
|
||||
*s = > json.get value=`t` key="s"*
|
||||
*raw = p + qn + s*
|
||||
*m = > json.parse text=`raw`*
|
||||
**m**
|
||||
@@ -28,10 +28,10 @@ import json:lib/json.mq.md
|
||||
# main
|
||||
|
||||
*c = > counter n=3*
|
||||
*ty = > json.get value=`c` key=_type*
|
||||
*ty = > json.get value=`c` key="_type"*
|
||||
> print text=`ty`
|
||||
*n = > json.get value=`c` key=n*
|
||||
*n = > json.get value=`c` key="n"*
|
||||
> print text=`n`
|
||||
*c2 = > `c`.bump*
|
||||
*n2 = > json.get value=`c2` key=n*
|
||||
*n2 = > json.get value=`c2` key="n"*
|
||||
> print text=`n2`
|
||||
Reference in new issue
Block a user