blockly 11.2.1 → 11.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,9 +54,9 @@ def ${b.FUNCTION_NAME_PLACEHOLDER_}(my_list, type, reverse):
54
54
  return sorted(list_cpy, key=key_func, reverse=reverse)
55
55
  `)+"("+c+', "'+d+'", '+a+")",Order$$module$build$src$generators$python$python_generator.FUNCTION_CALL]},lists_split$$module$build$src$generators$python$lists=function(a,b){var c=a.getFieldValue("MODE");if("SPLIT"===c)c=b.valueToCode(a,"INPUT",Order$$module$build$src$generators$python$python_generator.MEMBER)||"''",a=b.valueToCode(a,"DELIM",Order$$module$build$src$generators$python$python_generator.NONE),a=c+".split("+a+")";else if("JOIN"===c)c=b.valueToCode(a,"INPUT",Order$$module$build$src$generators$python$python_generator.NONE)||
56
56
  "[]",a=(b.valueToCode(a,"DELIM",Order$$module$build$src$generators$python$python_generator.MEMBER)||"''")+".join("+c+")";else throw Error("Unknown mode: "+c);return[a,Order$$module$build$src$generators$python$python_generator.FUNCTION_CALL]},lists_reverse$$module$build$src$generators$python$lists=function(a,b){return["list(reversed("+(b.valueToCode(a,"LIST",Order$$module$build$src$generators$python$python_generator.NONE)||"[]")+"))",Order$$module$build$src$generators$python$python_generator.FUNCTION_CALL]},
57
- controls_if$$module$build$src$generators$python$logic=function(a,b){let c=0,d="",e,f;b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));do f=b.valueToCode(a,"IF"+c,Order$$module$build$src$generators$python$python_generator.NONE)||"False",e=b.statementToCode(a,"DO"+c)||b.PASS,b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=(0===c?"if ":"elif ")+f+":\n"+e,c++;while(a.getInput("IF"+c));if(a.getInput("ELSE")||b.STATEMENT_SUFFIX)e=b.statementToCode(a,"ELSE")||
58
- b.PASS,b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+="else:\n"+e;return d},logic_compare$$module$build$src$generators$python$logic=function(a,b){const c={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],d=Order$$module$build$src$generators$python$python_generator.RELATIONAL,e=b.valueToCode(a,"A",d)||"0";a=b.valueToCode(a,"B",d)||"0";return[e+" "+c+" "+a,d]},logic_operation$$module$build$src$generators$python$logic=function(a,b){const c=
59
- "AND"===a.getFieldValue("OP")?"and":"or",d="and"===c?Order$$module$build$src$generators$python$python_generator.LOGICAL_AND:Order$$module$build$src$generators$python$python_generator.LOGICAL_OR;let e=b.valueToCode(a,"A",d);a=b.valueToCode(a,"B",d);e||a?(b="and"===c?"True":"False",e||(e=b),a||(a=b)):a=e="False";return[e+" "+c+" "+a,d]},logic_negate$$module$build$src$generators$python$logic=function(a,b){return["not "+(b.valueToCode(a,"BOOL",Order$$module$build$src$generators$python$python_generator.LOGICAL_NOT)||
57
+ controls_if$$module$build$src$generators$python$logic=function(a,b){let c=0,d="",e,f;b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));do f=b.valueToCode(a,"IF"+c,Order$$module$build$src$generators$python$python_generator.NONE)||"False",e=b.statementToCode(a,"DO"+c)||b.PASS,b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=(0===c?"if ":"elif ")+f+":\n"+e,c++;while(a.getInput("IF"+c));if(a.getInput("ELSE")||b.STATEMENT_SUFFIX)e=a.getInput("ELSE")?b.statementToCode(a,
58
+ "ELSE")||b.PASS:b.PASS,b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+="else:\n"+e;return d},logic_compare$$module$build$src$generators$python$logic=function(a,b){const c={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],d=Order$$module$build$src$generators$python$python_generator.RELATIONAL,e=b.valueToCode(a,"A",d)||"0";a=b.valueToCode(a,"B",d)||"0";return[e+" "+c+" "+a,d]},logic_operation$$module$build$src$generators$python$logic=function(a,
59
+ b){const c="AND"===a.getFieldValue("OP")?"and":"or",d="and"===c?Order$$module$build$src$generators$python$python_generator.LOGICAL_AND:Order$$module$build$src$generators$python$python_generator.LOGICAL_OR;let e=b.valueToCode(a,"A",d);a=b.valueToCode(a,"B",d);e||a?(b="and"===c?"True":"False",e||(e=b),a||(a=b)):a=e="False";return[e+" "+c+" "+a,d]},logic_negate$$module$build$src$generators$python$logic=function(a,b){return["not "+(b.valueToCode(a,"BOOL",Order$$module$build$src$generators$python$python_generator.LOGICAL_NOT)||
60
60
  "True"),Order$$module$build$src$generators$python$python_generator.LOGICAL_NOT]},logic_boolean$$module$build$src$generators$python$logic=function(a,b){return["TRUE"===a.getFieldValue("BOOL")?"True":"False",Order$$module$build$src$generators$python$python_generator.ATOMIC]},logic_null$$module$build$src$generators$python$logic=function(a,b){return["None",Order$$module$build$src$generators$python$python_generator.ATOMIC]},logic_ternary$$module$build$src$generators$python$logic=function(a,b){const c=
61
61
  b.valueToCode(a,"IF",Order$$module$build$src$generators$python$python_generator.CONDITIONAL)||"False",d=b.valueToCode(a,"THEN",Order$$module$build$src$generators$python$python_generator.CONDITIONAL)||"None";a=b.valueToCode(a,"ELSE",Order$$module$build$src$generators$python$python_generator.CONDITIONAL)||"None";return[d+" if "+c+" else "+a,Order$$module$build$src$generators$python$python_generator.CONDITIONAL]},controls_repeat_ext$$module$build$src$generators$python$loops=function(a,b){let c;c=a.getField("TIMES")?
62
62
  String(parseInt(a.getFieldValue("TIMES"),10)):b.valueToCode(a,"TIMES",Order$$module$build$src$generators$python$python_generator.NONE)||"0";c=$.isNumber$$module$build$src$core$utils$string(c)?parseInt(c,10):"int("+c+")";let d=b.statementToCode(a,"DO");d=b.addLoopTrap(d,a)||b.PASS;return"for "+b.nameDB_.getDistinctName("count",$.NameType$$module$build$src$core$names.VARIABLE)+" in range("+c+"):\n"+d},controls_whileUntil$$module$build$src$generators$python$loops=function(a,b){const c="UNTIL"===a.getFieldValue("MODE");