stepan-mitkin / drakon.tech

Drakon.Tech is an IDE based on the DRAKON visual language
The Unlicense
62 stars 14 forks source link

Eternal cycle under case #20

Open stepan-mitkin opened 2 years ago

stepan-mitkin commented 2 years ago

If two case icons lead to a foreach loop an eternal cycle is produced.

stepan-mitkin commented 2 years ago

20211201114218

function badCycle(node) { var _20_col, _20_it, _20_length, _sw_17, child; _sw_17 = node.type; if (_sw_17 === "BlockStatement") { _20_it = 0; _20_col = node.body; _20_length = _20_col.length; while (true) { if (_20_it < _20_length) { child = _20_col[_20_it]; console.log(child) _20_it++; } else { break; } } } else { if (_sw_17 === "Program") { _20_it = 0; _20_col = node.body; _20_length = _20_col.length; while (true) { if (_20_it < _20_length) { child = _20_col[_20_it]; console.log(child) _20_it++; } } } else { return undefined } } }