Skip to main content
Version: Latest(3.13)

StringInterpolation 字符串插值

1. 结构声明​

class StringInterpolation extends LogicItem {
expressions: Array<LogicItem>;
}

2. 节点示例​

(1) 示例​

AST 如下:​

{
"concept": "StringInterpolation",
"expressions": [
{
"concept": "StringLiteral",
"value": "总数:"
},
{
"concept": "Identifier",
"namespace": "",
"name": "total"
},
{
"concept": "StringLiteral",
"value": "\\n价格:"
},
{
"concept": "Identifier",
"namespace": "",
"name": "price"
}
]
}

对应的代码如下:​

s"总数:\$\{total}
价格:\$\{price}"