NewList 列表构造器
1. 结构声明
- TS Declaration
- JSON Schema
class NewList extends LogicItem {
typeAnnotation?: TypeAnnotation;
items: Array<LogicItem>;
}
{
"type": "object",
"properties": {
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"folded": {
"type": "boolean"
},
"offsetX": {
"type": "number"
},
"offsetY": {
"type": "number"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/LogicItem"
}
}
},
"required": [
"items"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "NewList",
"items": [
{
"concept": "StringLiteral",
"value": "选项1"
},
{
"concept": "StringLiteral",
"value": "选项2"
},
{
"concept": "StringLiteral",
"value": "选项3"
}
]
}
concept: NewList
items:
- concept: StringLiteral
value: 选项1
- concept: StringLiteral
value: 选项2
- concept: StringLiteral
value: 选项3