经过一周编写 实现了一个json 指令集 并且用js 实现了运行
let program = {
['mainfunuuid']: {
name: 'mainfun',
codes: [
['__registerFun', ['somfunuuid']],
['__runFun', ['somfunuuid', [], {debugflag: 'somefun'}]],
['__runloop', ['arr', 'loop1blockuuid']],
['__runFun', [ 'console.log', [`"main outer"`, 'outer']]],
['__switch', [
['2 > 1', 'cond1blockuuid']
]]
],
props: function() {
return {
outer: 'main',
arr: [1,2,3]
}
}
}
}
展开
评论