sumorobot-web/sumorobot_compressed.js
2017-09-25 11:37:41 +02:00

12 lines
4.3 KiB
JavaScript
Executable File

// Do not edit this file; automatically generated by build.py.
'use strict';
Blockly.Sumorobot=new Blockly.Generator("Sumorobot");Blockly.Sumorobot.addReservedWords("setup,loop,if,else,for,switch,case,while,do,break,continue,return,goto,define,include,HIGH,LOW,INPUT,OUTPUT,INPUT_PULLUP,true,false,interger, constants,floating,point,void,bookean,char,unsigned,byte,int,word,long,float,double,string,String,array,static, volatile,const,sizeof,pinMode,digitalWrite,digitalRead,analogReference,analogRead,analogWrite,tone,noTone,shiftOut,shitIn,pulseIn,millis,micros,delay,delayMicroseconds,min,max,abs,constrain,map,pow,sqrt,sin,cos,tan,randomSeed,random,lowByte,highByte,bitRead,bitWrite,bitSet,bitClear,bit,attachInterrupt,detachInterrupt,interrupts,noInterrupts,FORWARD,BACKWARD,LEFT,RIGHT,STOP,isEnemy,isLine,move");
Blockly.Sumorobot.ORDER_ATOMIC=0;Blockly.Sumorobot.ORDER_MEMBER=1;Blockly.Sumorobot.ORDER_NEW=1;Blockly.Sumorobot.ORDER_FUNCTION_CALL=2;Blockly.Sumorobot.ORDER_INCREMENT=3;Blockly.Sumorobot.ORDER_DECREMENT=3;Blockly.Sumorobot.ORDER_LOGICAL_NOT=4;Blockly.Sumorobot.ORDER_BITWISE_NOT=4;Blockly.Sumorobot.ORDER_UNARY_PLUS=4;Blockly.Sumorobot.ORDER_UNARY_NEGATION=4;Blockly.Sumorobot.ORDER_TYPEOF=4;Blockly.Sumorobot.ORDER_VOID=4;Blockly.Sumorobot.ORDER_DELETE=4;Blockly.Sumorobot.ORDER_MULTIPLICATION=5;
Blockly.Sumorobot.ORDER_DIVISION=5;Blockly.Sumorobot.ORDER_MODULUS=5;Blockly.Sumorobot.ORDER_ADDITION=6;Blockly.Sumorobot.ORDER_SUBTRACTION=6;Blockly.Sumorobot.ORDER_BITWISE_SHIFT=7;Blockly.Sumorobot.ORDER_RELATIONAL=8;Blockly.Sumorobot.ORDER_IN=8;Blockly.Sumorobot.ORDER_INSTANCEOF=8;Blockly.Sumorobot.ORDER_EQUALITY=9;Blockly.Sumorobot.ORDER_BITWISE_AND=10;Blockly.Sumorobot.ORDER_BITWISE_XOR=11;Blockly.Sumorobot.ORDER_BITWISE_OR=12;Blockly.Sumorobot.ORDER_LOGICAL_AND=13;
Blockly.Sumorobot.ORDER_LOGICAL_OR=14;Blockly.Sumorobot.ORDER_CONDITIONAL=15;Blockly.Sumorobot.ORDER_ASSIGNMENT=16;Blockly.Sumorobot.ORDER_COMMA=17;Blockly.Sumorobot.ORDER_NONE=99;
Blockly.Sumorobot.init=function(a){Blockly.Sumorobot.definitions_=Object.create(null);Blockly.Sumorobot.functionNames_=Object.create(null);Blockly.Sumorobot.variableDB_?Blockly.Sumorobot.variableDB_.reset():Blockly.Sumorobot.variableDB_=new Blockly.Names(Blockly.Sumorobot.RESERVED_WORDS_);var c=[];a=a.variableList;if(a.length){for(var b=0;b<a.length;b++)c[b]=Blockly.Sumorobot.variableDB_.getName(a[b],Blockly.Variables.NAME_TYPE);Blockly.Sumorobot.definitions_.variables="var "+c.join(", ")+";"}};
Blockly.Sumorobot.finish=function(a){var c=[],b;for(b in Blockly.Sumorobot.definitions_)c.push(Blockly.Sumorobot.definitions_[b]);return c.join("\n\n")+"\n\n\n"+a};Blockly.Sumorobot.scrubNakedValue=function(a){return a+";\n"};Blockly.Sumorobot.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,"\\'");return"'"+a+"'"};
Blockly.Sumorobot.scrub_=function(a,c){var b="";if(!a.outputConnection||!a.outputConnection.targetConnection){var d=a.getCommentText();(d=Blockly.utils.wrap(d,Blockly.Sumorobot.COMMENT_WRAP-3))&&(b=a.getProcedureDef?b+("/**\n"+Blockly.Sumorobot.prefixLines(d+"\n"," * ")+" */\n"):b+Blockly.Sumorobot.prefixLines(d+"\n","// "));for(var e=0;e<a.inputList.length;e++)a.inputList[e].type==Blockly.INPUT_VALUE&&(d=a.inputList[e].connection.targetBlock())&&(d=Blockly.Sumorobot.allNestedComments(d))&&(b+=Blockly.Sumorobot.prefixLines(d,
"// "))}e=a.nextConnection&&a.nextConnection.targetBlock();e=Blockly.Sumorobot.blockToCode(e);return b+c+e};Blockly.Sumorobot.sumorobot={};Blockly.Sumorobot.controls_if=function(a){var c=0,b="",d,e;do e=Blockly.Sumorobot.valueToCode(a,"IF"+c,Blockly.Sumorobot.ORDER_NONE)||"false",d=Blockly.Sumorobot.statementToCode(a,"DO"+c),b+=(0<c?" else ":"")+"if ("+e+") {\n"+d+"}",++c;while(a.getInput("IF"+c));a.getInput("ELSE")&&(d=Blockly.Sumorobot.statementToCode(a,"ELSE"),b+=" else {\n"+d+"}");return b+"\n"};Blockly.Sumorobot.controls_ifelse=Blockly.Sumorobot.controls_if;
Blockly.Sumorobot.sumorobot_delay=function(a){return"sumorobot.delay("+parseFloat(a.getFieldValue("DELAY"))+");\n"};Blockly.Sumorobot.sumorobot_move=function(a){return"sumorobot.move("+a.getFieldValue("MOVE")+");\n"};Blockly.Sumorobot.sumorobot_enemy=function(a){return["sumorobot.isEnemy()",Blockly.Sumorobot.ORDER_ATOMIC]};Blockly.Sumorobot.sumorobot_line=function(a){return["sumorobot.isLine("+a.getFieldValue("LINE")+")",Blockly.Sumorobot.ORDER_ATOMIC]};