Parse `` `var`[^key] `` in `` *…* `` segments and quoted strings as an Index part (chained `` [^a][^b] `` folds into one part) in both the tree-walk interpreter and the bytecode compiler, and render it back in `view`. Also make bytecode `_type` stamping always overwrite like the interpreter does, so child constructors yield the most specific type. Adds gold/unit tests for interp footnote indexing and a bytecode inherit-explicit-super case. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
655 B
Markdown
35 lines
655 B
Markdown
---
|
||
title: 插值中脚注取元(前缀 + `var`[^key])
|
||
description: 独立 > 调用实参与引号字符串内,`前缀`var`[^key]` 的取元应生效。
|
||
---
|
||
|
||
# main
|
||
|
||
`水果价格` =
|
||
|
||
| 苹果 | 香蕉 |
|
||
|------|------|
|
||
| 5 | 3 |
|
||
|
||
> print text=苹果单价:`水果价格`[^苹果]
|
||
|
||
`货架` =
|
||
|
||
| 苹果 | 黄瓜 |
|
||
|------|------|
|
||
| 红富士 | 青瓜 |
|
||
| 嘎啦 | 黄瓜条 |
|
||
|
||
> print text=第一种:`货架`[^苹果][^1] 结尾
|
||
|
||
> print text=引号内:"价 `水果价格`[^香蕉] 元"
|
||
|
||
`订单` =
|
||
|
||
| 行 | 品名 | 数量 |
|
||
|----|------|------|
|
||
| 1 | 苹果 | 2 |
|
||
| 2 | 梨 | 3 |
|
||
|
||
> print text=`订单`[^2][^品名] × `订单`[^2][^数量]
|