feat(markup): bracket-marked calls with pre_modifiers
Stabilize `mod… [callee] args` (modifiers → name=True) alongside link-index disambiguation; expand in interp/bytecode, show in view, and document lib/view code-as-docs waves before stdlib rewrite. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
5058f5ddcf
commit
0e0655b316
17 files changed
+676
-56
No files matched your search
@@ -284,6 +284,29 @@ fn structure_link_index() {
|
||||
assert_out("tests/structure/link-index.mq.md", "28\n18\n桃");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn structure_bracket_call() {
|
||||
assert_out(
|
||||
"tests/structure/bracket-call.mq.md",
|
||||
"True, Marqdo!
|
||||
False, Ada!
|
||||
False, Hi Bo!!
|
||||
28",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bytecode_bracket_call() {
|
||||
assert_out_backend(
|
||||
"tests/structure/bracket-call.mq.md",
|
||||
"bytecode",
|
||||
"True, Marqdo!
|
||||
False, Ada!
|
||||
False, Hi Bo!!
|
||||
28",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn structure_footnote_map_digits() {
|
||||
assert_out(
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: 方括号标记调用与前置修饰语
|
||||
description: 礼貌 [问候] …;嵌套 ([…]);与 [键](集合) 取元消歧
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
**打印 内容=(礼貌 [问候] "Marqdo")**
|
||||
**打印 内容=([问候] "Ada")**
|
||||
**打印 内容=([问候] ([格式化] "Bo"))**
|
||||
|
||||
`菜单` =
|
||||
|
||||
| 美式 | 拿铁 |
|
||||
|------|------|
|
||||
| 18 | 28 |
|
||||
|
||||
**价 = [拿铁](菜单)**
|
||||
**打印 内容=`价`**
|
||||
|
||||
## 问候
|
||||
+ `谁`
|
||||
+ `礼貌`=False
|
||||
|
||||
**出 = `礼貌` + ", " + `谁` + "!"**
|
||||
*出*
|
||||
|
||||
## 格式化
|
||||
+ `名`
|
||||
|
||||
**出 = "Hi " + `名` + "!"**
|
||||
*出*
|
||||
Reference in new issue
Block a user