forked from marva/sumorobot-web
fix code processing no if
This commit is contained in:
parent
342d07ee58
commit
c588d70009
@ -116,7 +116,7 @@ window.addEventListener('load', function() {
|
|||||||
var lines = [];
|
var lines = [];
|
||||||
var foundTrue = false;
|
var foundTrue = false;
|
||||||
// Function to process code and highlight blocks and lines
|
// Function to process code and highlight blocks and lines
|
||||||
function processCode(index, highlight) {
|
function processCode(index) {
|
||||||
// When all lines are already processed
|
// When all lines are already processed
|
||||||
if (lines.length == 0) return;
|
if (lines.length == 0) return;
|
||||||
// Split into code and block ID
|
// Split into code and block ID
|
||||||
@ -142,7 +142,7 @@ window.addEventListener('load', function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Some lines don't correspond to any block
|
// Some lines don't correspond to any block
|
||||||
if (temp[1] && index != -1 && ((!isCondition && foundTrue) || isCondition)) {
|
if (temp[1] && index != -1 && ((!isCondition && foundTrue) || isCondition || !/if/.test(lines[0]))) {
|
||||||
// When sleep function, we get the timeout value from the function
|
// When sleep function, we get the timeout value from the function
|
||||||
if (/\d/.test(code)) {
|
if (/\d/.test(code)) {
|
||||||
timeout = parseInt(code.replace(/[a-z\.()]/g, ''));
|
timeout = parseInt(code.replace(/[a-z\.()]/g, ''));
|
||||||
|
Loading…
Reference in New Issue
Block a user