Open kimsseTheWolf opened 8 months ago
New ideas about how to process the data.
Here is a clip from the template file:
"basic.cf.for": {
"id": "basic.cf.for",
"visualize": {
"default": "Do <[0]{accept:{var&value}}> times <[1]{accept:{nested}}>",
"en-US": "Do <[0]{accept:{var&value}}> times <[1]{accept:{nested}}>",
"zh-CN": "重复执行<[0]{accept:{var&value}}>次 <[1]{accept:{nested}}>"
},
"exposes": {
"iterateIndicator": {
"default": "Current Iterate times",
"en-US": "Current Iterate times",
"zh-CN": "当前循环次数"
}
},
"code": "for <expose:iterateIndicator> in range(<0>)"
}
When the block drag and drop into the CommandPanel.vue, the pre-processor will generate a uuid for all of the exposes:
"basic.cf.for": {
"id": "basic.cf.for",
"visualize": {
"default": "Do <[0]{accept:{var&value}}> times <[1]{accept:{nested}}>",
"en-US": "Do <[0]{accept:{var&value}}> times <[1]{accept:{nested}}>",
"zh-CN": "重复执行<[0]{accept:{var&value}}>次 <[1]{accept:{nested}}>"
},
"exposes": {
"iterateIndicator": {
"id": "<THE UUID OF iterateInidcator>"
"default": "Current Iterate times",
"en-US": "Current Iterate times",
"zh-CN": "当前循环次数"
}
},
"code": "for <expose:iterateIndicator> in range(<0>)"
}
When the program is generating the code, and when it is reading <expose:iterateIndicator>
, the program will ONLY find the exposes called iterateIndicator
from the block information, NOT the exposes pool.
After exposes are processed, the block will throw it into its nest section, the nestedCommandPanel, if it has one. So that the blocks inside the nestedCommandPanel could use those exposes again.
Also, in the exposes pool, if there are names that are the same, the program will automatically add a prefix to help users distinguish them.
Context values like iteration indicator for loop and etc. building on template grammar, activation, and generating