main.e0ee3563388774042d6b.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["ivprogCore"] = factory();
  8. else
  9. root["ivprogCore"] = factory();
  10. })(window, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // install a JSONP callback for chunk loading
  13. /******/ function webpackJsonpCallback(data) {
  14. /******/ var chunkIds = data[0];
  15. /******/ var moreModules = data[1];
  16. /******/ var executeModules = data[2];
  17. /******/
  18. /******/ // add "moreModules" to the modules object,
  19. /******/ // then flag all "chunkIds" as loaded and fire callback
  20. /******/ var moduleId, chunkId, i = 0, resolves = [];
  21. /******/ for(;i < chunkIds.length; i++) {
  22. /******/ chunkId = chunkIds[i];
  23. /******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
  24. /******/ resolves.push(installedChunks[chunkId][0]);
  25. /******/ }
  26. /******/ installedChunks[chunkId] = 0;
  27. /******/ }
  28. /******/ for(moduleId in moreModules) {
  29. /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
  30. /******/ modules[moduleId] = moreModules[moduleId];
  31. /******/ }
  32. /******/ }
  33. /******/ if(parentJsonpFunction) parentJsonpFunction(data);
  34. /******/
  35. /******/ while(resolves.length) {
  36. /******/ resolves.shift()();
  37. /******/ }
  38. /******/
  39. /******/ // add entry modules from loaded chunk to deferred list
  40. /******/ deferredModules.push.apply(deferredModules, executeModules || []);
  41. /******/
  42. /******/ // run deferred modules when all chunks ready
  43. /******/ return checkDeferredModules();
  44. /******/ };
  45. /******/ function checkDeferredModules() {
  46. /******/ var result;
  47. /******/ for(var i = 0; i < deferredModules.length; i++) {
  48. /******/ var deferredModule = deferredModules[i];
  49. /******/ var fulfilled = true;
  50. /******/ for(var j = 1; j < deferredModule.length; j++) {
  51. /******/ var depId = deferredModule[j];
  52. /******/ if(installedChunks[depId] !== 0) fulfilled = false;
  53. /******/ }
  54. /******/ if(fulfilled) {
  55. /******/ deferredModules.splice(i--, 1);
  56. /******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
  57. /******/ }
  58. /******/ }
  59. /******/
  60. /******/ return result;
  61. /******/ }
  62. /******/
  63. /******/ // The module cache
  64. /******/ var installedModules = {};
  65. /******/
  66. /******/ // object to store loaded and loading chunks
  67. /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
  68. /******/ // Promise = chunk loading, 0 = chunk loaded
  69. /******/ var installedChunks = {
  70. /******/ "main": 0
  71. /******/ };
  72. /******/
  73. /******/ var deferredModules = [];
  74. /******/
  75. /******/ // The require function
  76. /******/ function __webpack_require__(moduleId) {
  77. /******/
  78. /******/ // Check if module is in cache
  79. /******/ if(installedModules[moduleId]) {
  80. /******/ return installedModules[moduleId].exports;
  81. /******/ }
  82. /******/ // Create a new module (and put it into the cache)
  83. /******/ var module = installedModules[moduleId] = {
  84. /******/ i: moduleId,
  85. /******/ l: false,
  86. /******/ exports: {}
  87. /******/ };
  88. /******/
  89. /******/ // Execute the module function
  90. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  91. /******/
  92. /******/ // Flag the module as loaded
  93. /******/ module.l = true;
  94. /******/
  95. /******/ // Return the exports of the module
  96. /******/ return module.exports;
  97. /******/ }
  98. /******/
  99. /******/
  100. /******/ // expose the modules object (__webpack_modules__)
  101. /******/ __webpack_require__.m = modules;
  102. /******/
  103. /******/ // expose the module cache
  104. /******/ __webpack_require__.c = installedModules;
  105. /******/
  106. /******/ // define getter function for harmony exports
  107. /******/ __webpack_require__.d = function(exports, name, getter) {
  108. /******/ if(!__webpack_require__.o(exports, name)) {
  109. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  110. /******/ }
  111. /******/ };
  112. /******/
  113. /******/ // define __esModule on exports
  114. /******/ __webpack_require__.r = function(exports) {
  115. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  116. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  117. /******/ }
  118. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  119. /******/ };
  120. /******/
  121. /******/ // create a fake namespace object
  122. /******/ // mode & 1: value is a module id, require it
  123. /******/ // mode & 2: merge all properties of value into the ns
  124. /******/ // mode & 4: return value when already ns object
  125. /******/ // mode & 8|1: behave like require
  126. /******/ __webpack_require__.t = function(value, mode) {
  127. /******/ if(mode & 1) value = __webpack_require__(value);
  128. /******/ if(mode & 8) return value;
  129. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  130. /******/ var ns = Object.create(null);
  131. /******/ __webpack_require__.r(ns);
  132. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  133. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  134. /******/ return ns;
  135. /******/ };
  136. /******/
  137. /******/ // getDefaultExport function for compatibility with non-harmony modules
  138. /******/ __webpack_require__.n = function(module) {
  139. /******/ var getter = module && module.__esModule ?
  140. /******/ function getDefault() { return module['default']; } :
  141. /******/ function getModuleExports() { return module; };
  142. /******/ __webpack_require__.d(getter, 'a', getter);
  143. /******/ return getter;
  144. /******/ };
  145. /******/
  146. /******/ // Object.prototype.hasOwnProperty.call
  147. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  148. /******/
  149. /******/ // __webpack_public_path__
  150. /******/ __webpack_require__.p = "";
  151. /******/
  152. /******/ var jsonpArray = window["webpackJsonpivprogCore"] = window["webpackJsonpivprogCore"] || [];
  153. /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
  154. /******/ jsonpArray.push = webpackJsonpCallback;
  155. /******/ jsonpArray = jsonpArray.slice();
  156. /******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
  157. /******/ var parentJsonpFunction = oldJsonpFunction;
  158. /******/
  159. /******/
  160. /******/ // add entry module to deferred list
  161. /******/ deferredModules.push(["./js/main.js","vendors~main"]);
  162. /******/ // run deferred modules when ready
  163. /******/ return checkDeferredModules();
  164. /******/ })
  165. /************************************************************************/
  166. /******/ ({
  167. /***/ "./.ima_version.json":
  168. /*!***************************!*\
  169. !*** ./.ima_version.json ***!
  170. \***************************/
  171. /*! exports provided: version, default */
  172. /***/ (function(module) {
  173. module.exports = JSON.parse("{\"version\":\"2020_12_31 12_10\"}");
  174. /***/ }),
  175. /***/ "./grammar/en/ivprog.g4":
  176. /*!******************************!*\
  177. !*** ./grammar/en/ivprog.g4 ***!
  178. \******************************/
  179. /*! no static exports found */
  180. /***/ (function(module, exports, __webpack_require__) {
  181. module.exports =
  182. /******/ (function(modules) { // webpackBootstrap
  183. /******/ // The module cache
  184. /******/ var installedModules = {};
  185. /******/
  186. /******/ // The require function
  187. /******/ function __webpack_require__(moduleId) {
  188. /******/
  189. /******/ // Check if module is in cache
  190. /******/ if(installedModules[moduleId]) {
  191. /******/ return installedModules[moduleId].exports;
  192. /******/ }
  193. /******/ // Create a new module (and put it into the cache)
  194. /******/ var module = installedModules[moduleId] = {
  195. /******/ i: moduleId,
  196. /******/ l: false,
  197. /******/ exports: {}
  198. /******/ };
  199. /******/
  200. /******/ // Execute the module function
  201. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  202. /******/
  203. /******/ // Flag the module as loaded
  204. /******/ module.l = true;
  205. /******/
  206. /******/ // Return the exports of the module
  207. /******/ return module.exports;
  208. /******/ }
  209. /******/
  210. /******/
  211. /******/ // expose the modules object (__webpack_modules__)
  212. /******/ __webpack_require__.m = modules;
  213. /******/
  214. /******/ // expose the module cache
  215. /******/ __webpack_require__.c = installedModules;
  216. /******/
  217. /******/ // identity function for calling harmony imports with the correct context
  218. /******/ __webpack_require__.i = function(value) { return value; };
  219. /******/
  220. /******/ // define getter function for harmony exports
  221. /******/ __webpack_require__.d = function(exports, name, getter) {
  222. /******/ if(!__webpack_require__.o(exports, name)) {
  223. /******/ Object.defineProperty(exports, name, {
  224. /******/ configurable: false,
  225. /******/ enumerable: true,
  226. /******/ get: getter
  227. /******/ });
  228. /******/ }
  229. /******/ };
  230. /******/
  231. /******/ // getDefaultExport function for compatibility with non-harmony modules
  232. /******/ __webpack_require__.n = function(module) {
  233. /******/ var getter = module && module.__esModule ?
  234. /******/ function getDefault() { return module['default']; } :
  235. /******/ function getModuleExports() { return module; };
  236. /******/ __webpack_require__.d(getter, 'a', getter);
  237. /******/ return getter;
  238. /******/ };
  239. /******/
  240. /******/ // Object.prototype.hasOwnProperty.call
  241. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  242. /******/
  243. /******/ // __webpack_public_path__
  244. /******/ __webpack_require__.p = "";
  245. /******/
  246. /******/ // Load entry module and return exports
  247. /******/ return __webpack_require__(__webpack_require__.s = 1);
  248. /******/ })
  249. /************************************************************************/
  250. /******/ ([
  251. /* 0 */
  252. /***/ (function(module, exports, __webpack_require__) {
  253. // Generated from /tmp/tmp-13432MUgSPlJtQYIu/ivprog.g4 by ANTLR 4.7
  254. // jshint ignore: start
  255. var antlr4 = __webpack_require__(2);
  256. var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
  257. "\u00026\u0207\b\u0001\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004",
  258. "\u0004\t\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t",
  259. "\u0007\u0004\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004",
  260. "\f\t\f\u0004\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010",
  261. "\t\u0010\u0004\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013",
  262. "\u0004\u0014\t\u0014\u0004\u0015\t\u0015\u0004\u0016\t\u0016\u0004\u0017",
  263. "\t\u0017\u0004\u0018\t\u0018\u0004\u0019\t\u0019\u0004\u001a\t\u001a",
  264. "\u0004\u001b\t\u001b\u0004\u001c\t\u001c\u0004\u001d\t\u001d\u0004\u001e",
  265. "\t\u001e\u0004\u001f\t\u001f\u0004 \t \u0004!\t!\u0004\"\t\"\u0004#",
  266. "\t#\u0004$\t$\u0004%\t%\u0004&\t&\u0004\'\t\'\u0004(\t(\u0004)\t)\u0004",
  267. "*\t*\u0004+\t+\u0004,\t,\u0004-\t-\u0004.\t.\u0004/\t/\u00040\t0\u0004",
  268. "1\t1\u00042\t2\u00043\t3\u00044\t4\u00045\t5\u00046\t6\u00047\t7\u0004",
  269. "8\t8\u00049\t9\u0004:\t:\u0004;\t;\u0004<\t<\u0004=\t=\u0004>\t>\u0004",
  270. "?\t?\u0004@\t@\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003",
  271. "\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0003\u0003\u0003\u0003",
  272. "\u0003\u0003\u0003\u0003\u0003\u0003\u0004\u0003\u0004\u0003\u0004\u0003",
  273. "\u0004\u0003\u0004\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003",
  274. "\u0005\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003",
  275. "\u0006\u0003\u0006\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003",
  276. "\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\t\u0003\t\u0003\t\u0003\t\u0003",
  277. "\t\u0003\t\u0003\t\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\u000b",
  278. "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
  279. "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\f\u0003\f\u0003\f\u0003\f",
  280. "\u0003\f\u0003\f\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003",
  281. "\r\u0003\r\u0003\r\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003",
  282. "\u000e\u0003\u000e\u0003\u000e\u0003\u000f\u0003\u000f\u0003\u000f\u0003",
  283. "\u000f\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
  284. "\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
  285. "\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0012\u0003",
  286. "\u0012\u0003\u0012\u0003\u0013\u0003\u0013\u0003\u0013\u0003\u0013\u0003",
  287. "\u0013\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003",
  288. "\u0014\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003",
  289. "\u0015\u0003\u0015\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003",
  290. "\u0016\u0003\u0016\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003",
  291. "\u0017\u0003\u0017\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
  292. "\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
  293. "\u0018\u0003\u0018\u0003\u0018\u0003\u0019\u0003\u0019\u0003\u0019\u0003",
  294. "\u001a\u0003\u001a\u0003\u001a\u0003\u001a\u0003\u001a\u0003\u001b\u0003",
  295. "\u001b\u0003\u001b\u0003\u001b\u0003\u001b\u0003\u001b\u0003\u001c\u0003",
  296. "\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001d\u0003\u001d\u0003",
  297. "\u001d\u0003\u001d\u0003\u001e\u0003\u001e\u0003\u001e\u0003\u001e\u0003",
  298. "\u001f\u0003\u001f\u0003\u001f\u0003 \u0003 \u0003!\u0003!\u0003\"\u0003",
  299. "\"\u0003#\u0003#\u0003$\u0003$\u0003%\u0003%\u0003&\u0003&\u0003\'\u0003",
  300. "\'\u0003(\u0003(\u0003(\u0005(\u0148\n(\u0003)\u0003)\u0003*\u0003*",
  301. "\u0003+\u0003+\u0003,\u0003,\u0003-\u0003-\u0003-\u0003-\u0003-\u0003",
  302. "-\u0003-\u0003-\u0003-\u0005-\u015b\n-\u0003.\u0003.\u0003/\u0003/\u0003",
  303. "0\u00030\u00070\u0163\n0\f0\u000e0\u0166\u000b0\u00031\u00031\u0003",
  304. "1\u00031\u00032\u00062\u016d\n2\r2\u000e2\u016e\u00032\u00032\u0003",
  305. "2\u00032\u00052\u0175\n2\u00032\u00062\u0178\n2\r2\u000e2\u0179\u0003",
  306. "2\u00032\u00032\u00032\u00052\u0180\n2\u00032\u00062\u0183\n2\r2\u000e",
  307. "2\u0184\u00052\u0187\n2\u00033\u00063\u018a\n3\r3\u000e3\u018b\u0003",
  308. "3\u00033\u00063\u0190\n3\r3\u000e3\u0191\u00033\u00063\u0195\n3\r3\u000e",
  309. "3\u0196\u00033\u00033\u00073\u019b\n3\f3\u000e3\u019e\u000b3\u00033",
  310. "\u00053\u01a1\n3\u00034\u00034\u00054\u01a5\n4\u00034\u00064\u01a8\n",
  311. "4\r4\u000e4\u01a9\u00035\u00035\u00075\u01ae\n5\f5\u000e5\u01b1\u000b",
  312. "5\u00035\u00035\u00036\u00036\u00056\u01b7\n6\u00037\u00037\u00037\u0005",
  313. "7\u01bc\n7\u00037\u00037\u00038\u00038\u00038\u00038\u00039\u00039\u0003",
  314. ":\u0006:\u01c7\n:\r:\u000e:\u01c8\u0003:\u0005:\u01cc\n:\u0003;\u0003",
  315. ";\u0003<\u0003<\u0003=\u0003=\u0003=\u0003=\u0005=\u01d6\n=\u0003>\u0003",
  316. ">\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0005",
  317. ">\u01e3\n>\u0003?\u0003?\u0003?\u0003?\u0003?\u0003?\u0003?\u0003@\u0003",
  318. "@\u0003@\u0003@\u0007@\u01f0\n@\f@\u000e@\u01f3\u000b@\u0003@\u0005",
  319. "@\u01f6\n@\u0003@\u0003@\u0003@\u0003@\u0003@\u0007@\u01fd\n@\f@\u000e",
  320. "@\u0200\u000b@\u0003@\u0003@\u0005@\u0204\n@\u0003@\u0003@\u0003\u01fe",
  321. "\u0002A\u0003\u0003\u0005\u0004\u0007\u0005\t\u0006\u000b\u0007\r\b",
  322. "\u000f\t\u0011\n\u0013\u000b\u0015\f\u0017\r\u0019\u000e\u001b\u000f",
  323. "\u001d\u0010\u001f\u0011!\u0012#\u0013%\u0014\'\u0015)\u0016+\u0017",
  324. "-\u0018/\u00191\u001a3\u001b5\u001c7\u001d9\u0002;\u0002=\u0002?\u001e",
  325. "A\u001fC E!G\"I#K$M%O&Q\'S(U)W*Y+[,]-_.a/c0e1g\u0002i2k\u0002m3o4q\u0002",
  326. "s5u\u0002w\u0002y\u0002{\u0002}\u0002\u007f6\u0003\u0002\u0012\u0004",
  327. "\u0002--//\u0005\u0002\'\',,11\u0004\u0002>>@@\u0005\u0002C\\aac|\u0006",
  328. "\u00022;C\\aac|\u0003\u00022;\u0003\u000223\u0004\u0002GGgg\u0006\u0002",
  329. "\f\f\u000f\u000f$$^^\u0006\u0002\f\f\u000f\u000f))^^\u0004\u0002\u000b",
  330. "\u000b\"\"\u0004\u0002\f\f\u000f\u000f\u0005\u00022;CHch\u0003\u0002",
  331. "29\n\u0002$$))^^ddhhppttvv\u0003\u000225\u0002\u021c\u0002\u0003\u0003",
  332. "\u0002\u0002\u0002\u0002\u0005\u0003\u0002\u0002\u0002\u0002\u0007\u0003",
  333. "\u0002\u0002\u0002\u0002\t\u0003\u0002\u0002\u0002\u0002\u000b\u0003",
  334. "\u0002\u0002\u0002\u0002\r\u0003\u0002\u0002\u0002\u0002\u000f\u0003",
  335. "\u0002\u0002\u0002\u0002\u0011\u0003\u0002\u0002\u0002\u0002\u0013\u0003",
  336. "\u0002\u0002\u0002\u0002\u0015\u0003\u0002\u0002\u0002\u0002\u0017\u0003",
  337. "\u0002\u0002\u0002\u0002\u0019\u0003\u0002\u0002\u0002\u0002\u001b\u0003",
  338. "\u0002\u0002\u0002\u0002\u001d\u0003\u0002\u0002\u0002\u0002\u001f\u0003",
  339. "\u0002\u0002\u0002\u0002!\u0003\u0002\u0002\u0002\u0002#\u0003\u0002",
  340. "\u0002\u0002\u0002%\u0003\u0002\u0002\u0002\u0002\'\u0003\u0002\u0002",
  341. "\u0002\u0002)\u0003\u0002\u0002\u0002\u0002+\u0003\u0002\u0002\u0002",
  342. "\u0002-\u0003\u0002\u0002\u0002\u0002/\u0003\u0002\u0002\u0002\u0002",
  343. "1\u0003\u0002\u0002\u0002\u00023\u0003\u0002\u0002\u0002\u00025\u0003",
  344. "\u0002\u0002\u0002\u00027\u0003\u0002\u0002\u0002\u0002?\u0003\u0002",
  345. "\u0002\u0002\u0002A\u0003\u0002\u0002\u0002\u0002C\u0003\u0002\u0002",
  346. "\u0002\u0002E\u0003\u0002\u0002\u0002\u0002G\u0003\u0002\u0002\u0002",
  347. "\u0002I\u0003\u0002\u0002\u0002\u0002K\u0003\u0002\u0002\u0002\u0002",
  348. "M\u0003\u0002\u0002\u0002\u0002O\u0003\u0002\u0002\u0002\u0002Q\u0003",
  349. "\u0002\u0002\u0002\u0002S\u0003\u0002\u0002\u0002\u0002U\u0003\u0002",
  350. "\u0002\u0002\u0002W\u0003\u0002\u0002\u0002\u0002Y\u0003\u0002\u0002",
  351. "\u0002\u0002[\u0003\u0002\u0002\u0002\u0002]\u0003\u0002\u0002\u0002",
  352. "\u0002_\u0003\u0002\u0002\u0002\u0002a\u0003\u0002\u0002\u0002\u0002",
  353. "c\u0003\u0002\u0002\u0002\u0002e\u0003\u0002\u0002\u0002\u0002i\u0003",
  354. "\u0002\u0002\u0002\u0002m\u0003\u0002\u0002\u0002\u0002o\u0003\u0002",
  355. "\u0002\u0002\u0002s\u0003\u0002\u0002\u0002\u0002\u007f\u0003\u0002",
  356. "\u0002\u0002\u0003\u0081\u0003\u0002\u0002\u0002\u0005\u0089\u0003\u0002",
  357. "\u0002\u0002\u0007\u008e\u0003\u0002\u0002\u0002\t\u0093\u0003\u0002",
  358. "\u0002\u0002\u000b\u0098\u0003\u0002\u0002\u0002\r\u009f\u0003\u0002",
  359. "\u0002\u0002\u000f\u00a3\u0003\u0002\u0002\u0002\u0011\u00a8\u0003\u0002",
  360. "\u0002\u0002\u0013\u00af\u0003\u0002\u0002\u0002\u0015\u00b4\u0003\u0002",
  361. "\u0002\u0002\u0017\u00be\u0003\u0002\u0002\u0002\u0019\u00c4\u0003\u0002",
  362. "\u0002\u0002\u001b\u00cd\u0003\u0002\u0002\u0002\u001d\u00d4\u0003\u0002",
  363. "\u0002\u0002\u001f\u00d8\u0003\u0002\u0002\u0002!\u00e3\u0003\u0002",
  364. "\u0002\u0002#\u00e8\u0003\u0002\u0002\u0002%\u00eb\u0003\u0002\u0002",
  365. "\u0002\'\u00f0\u0003\u0002\u0002\u0002)\u00f6\u0003\u0002\u0002\u0002",
  366. "+\u00fd\u0003\u0002\u0002\u0002-\u0103\u0003\u0002\u0002\u0002/\u0109",
  367. "\u0003\u0002\u0002\u00021\u0116\u0003\u0002\u0002\u00023\u0119\u0003",
  368. "\u0002\u0002\u00025\u011e\u0003\u0002\u0002\u00027\u0124\u0003\u0002",
  369. "\u0002\u00029\u0129\u0003\u0002\u0002\u0002;\u012d\u0003\u0002\u0002",
  370. "\u0002=\u0131\u0003\u0002\u0002\u0002?\u0134\u0003\u0002\u0002\u0002",
  371. "A\u0136\u0003\u0002\u0002\u0002C\u0138\u0003\u0002\u0002\u0002E\u013a",
  372. "\u0003\u0002\u0002\u0002G\u013c\u0003\u0002\u0002\u0002I\u013e\u0003",
  373. "\u0002\u0002\u0002K\u0140\u0003\u0002\u0002\u0002M\u0142\u0003\u0002",
  374. "\u0002\u0002O\u0147\u0003\u0002\u0002\u0002Q\u0149\u0003\u0002\u0002",
  375. "\u0002S\u014b\u0003\u0002\u0002\u0002U\u014d\u0003\u0002\u0002\u0002",
  376. "W\u014f\u0003\u0002\u0002\u0002Y\u015a\u0003\u0002\u0002\u0002[\u015c",
  377. "\u0003\u0002\u0002\u0002]\u015e\u0003\u0002\u0002\u0002_\u0160\u0003",
  378. "\u0002\u0002\u0002a\u0167\u0003\u0002\u0002\u0002c\u0186\u0003\u0002",
  379. "\u0002\u0002e\u01a0\u0003\u0002\u0002\u0002g\u01a2\u0003\u0002\u0002",
  380. "\u0002i\u01ab\u0003\u0002\u0002\u0002k\u01b6\u0003\u0002\u0002\u0002",
  381. "m\u01b8\u0003\u0002\u0002\u0002o\u01bf\u0003\u0002\u0002\u0002q\u01c3",
  382. "\u0003\u0002\u0002\u0002s\u01cb\u0003\u0002\u0002\u0002u\u01cd\u0003",
  383. "\u0002\u0002\u0002w\u01cf\u0003\u0002\u0002\u0002y\u01d5\u0003\u0002",
  384. "\u0002\u0002{\u01e2\u0003\u0002\u0002\u0002}\u01e4\u0003\u0002\u0002",
  385. "\u0002\u007f\u0203\u0003\u0002\u0002\u0002\u0081\u0082\u0007r\u0002",
  386. "\u0002\u0082\u0083\u0007t\u0002\u0002\u0083\u0084\u0007q\u0002\u0002",
  387. "\u0084\u0085\u0007i\u0002\u0002\u0085\u0086\u0007t\u0002\u0002\u0086",
  388. "\u0087\u0007c\u0002\u0002\u0087\u0088\u0007o\u0002\u0002\u0088\u0004",
  389. "\u0003\u0002\u0002\u0002\u0089\u008a\u0007t\u0002\u0002\u008a\u008b",
  390. "\u0007g\u0002\u0002\u008b\u008c\u0007c\u0002\u0002\u008c\u008d\u0007",
  391. "n\u0002\u0002\u008d\u0006\u0003\u0002\u0002\u0002\u008e\u008f\u0007",
  392. "x\u0002\u0002\u008f\u0090\u0007q\u0002\u0002\u0090\u0091\u0007k\u0002",
  393. "\u0002\u0091\u0092\u0007f\u0002\u0002\u0092\b\u0003\u0002\u0002\u0002",
  394. "\u0093\u0094\u0007d\u0002\u0002\u0094\u0095\u0007q\u0002\u0002\u0095",
  395. "\u0096\u0007q\u0002\u0002\u0096\u0097\u0007n\u0002\u0002\u0097\n\u0003",
  396. "\u0002\u0002\u0002\u0098\u0099\u0007u\u0002\u0002\u0099\u009a\u0007",
  397. "v\u0002\u0002\u009a\u009b\u0007t\u0002\u0002\u009b\u009c\u0007k\u0002",
  398. "\u0002\u009c\u009d\u0007p\u0002\u0002\u009d\u009e\u0007i\u0002\u0002",
  399. "\u009e\f\u0003\u0002\u0002\u0002\u009f\u00a0\u0007k\u0002\u0002\u00a0",
  400. "\u00a1\u0007p\u0002\u0002\u00a1\u00a2\u0007v\u0002\u0002\u00a2\u000e",
  401. "\u0003\u0002\u0002\u0002\u00a3\u00a4\u0007e\u0002\u0002\u00a4\u00a5",
  402. "\u0007j\u0002\u0002\u00a5\u00a6\u0007c\u0002\u0002\u00a6\u00a7\u0007",
  403. "t\u0002\u0002\u00a7\u0010\u0003\u0002\u0002\u0002\u00a8\u00a9\u0007",
  404. "u\u0002\u0002\u00a9\u00aa\u0007y\u0002\u0002\u00aa\u00ab\u0007k\u0002",
  405. "\u0002\u00ab\u00ac\u0007v\u0002\u0002\u00ac\u00ad\u0007e\u0002\u0002",
  406. "\u00ad\u00ae\u0007j\u0002\u0002\u00ae\u0012\u0003\u0002\u0002\u0002",
  407. "\u00af\u00b0\u0007e\u0002\u0002\u00b0\u00b1\u0007c\u0002\u0002\u00b1",
  408. "\u00b2\u0007u\u0002\u0002\u00b2\u00b3\u0007g\u0002\u0002\u00b3\u0014",
  409. "\u0003\u0002\u0002\u0002\u00b4\u00b5\u0007q\u0002\u0002\u00b5\u00b6",
  410. "\u0007v\u0002\u0002\u00b6\u00b7\u0007j\u0002\u0002\u00b7\u00b8\u0007",
  411. "g\u0002\u0002\u00b8\u00b9\u0007t\u0002\u0002\u00b9\u00ba\u0007y\u0002",
  412. "\u0002\u00ba\u00bb\u0007k\u0002\u0002\u00bb\u00bc\u0007u\u0002\u0002",
  413. "\u00bc\u00bd\u0007g\u0002\u0002\u00bd\u0016\u0003\u0002\u0002\u0002",
  414. "\u00be\u00bf\u0007e\u0002\u0002\u00bf\u00c0\u0007q\u0002\u0002\u00c0",
  415. "\u00c1\u0007p\u0002\u0002\u00c1\u00c2\u0007u\u0002\u0002\u00c2\u00c3",
  416. "\u0007v\u0002\u0002\u00c3\u0018\u0003\u0002\u0002\u0002\u00c4\u00c5",
  417. "\u0007h\u0002\u0002\u00c5\u00c6\u0007w\u0002\u0002\u00c6\u00c7\u0007",
  418. "p\u0002\u0002\u00c7\u00c8\u0007e\u0002\u0002\u00c8\u00c9\u0007v\u0002",
  419. "\u0002\u00c9\u00ca\u0007k\u0002\u0002\u00ca\u00cb\u0007q\u0002\u0002",
  420. "\u00cb\u00cc\u0007p\u0002\u0002\u00cc\u001a\u0003\u0002\u0002\u0002",
  421. "\u00cd\u00ce\u0007t\u0002\u0002\u00ce\u00cf\u0007g\u0002\u0002\u00cf",
  422. "\u00d0\u0007v\u0002\u0002\u00d0\u00d1\u0007w\u0002\u0002\u00d1\u00d2",
  423. "\u0007t\u0002\u0002\u00d2\u00d3\u0007p\u0002\u0002\u00d3\u001c\u0003",
  424. "\u0002\u0002\u0002\u00d4\u00d5\u0007h\u0002\u0002\u00d5\u00d6\u0007",
  425. "q\u0002\u0002\u00d6\u00d7\u0007t\u0002\u0002\u00d7\u001e\u0003\u0002",
  426. "\u0002\u0002\u00d8\u00d9\u0007t\u0002\u0002\u00d9\u00da\u0007g\u0002",
  427. "\u0002\u00da\u00db\u0007r\u0002\u0002\u00db\u00dc\u0007g\u0002\u0002",
  428. "\u00dc\u00dd\u0007c\u0002\u0002\u00dd\u00de\u0007v\u0002\u0002\u00de",
  429. "\u00df\u0007a\u0002\u0002\u00df\u00e0\u0007h\u0002\u0002\u00e0\u00e1",
  430. "\u0007q\u0002\u0002\u00e1\u00e2\u0007t\u0002\u0002\u00e2 \u0003\u0002",
  431. "\u0002\u0002\u00e3\u00e4\u0007h\u0002\u0002\u00e4\u00e5\u0007t\u0002",
  432. "\u0002\u00e5\u00e6\u0007q\u0002\u0002\u00e6\u00e7\u0007o\u0002\u0002",
  433. "\u00e7\"\u0003\u0002\u0002\u0002\u00e8\u00e9\u0007v\u0002\u0002\u00e9",
  434. "\u00ea\u0007q\u0002\u0002\u00ea$\u0003\u0002\u0002\u0002\u00eb\u00ec",
  435. "\u0007r\u0002\u0002\u00ec\u00ed\u0007c\u0002\u0002\u00ed\u00ee\u0007",
  436. "u\u0002\u0002\u00ee\u00ef\u0007u\u0002\u0002\u00ef&\u0003\u0002\u0002",
  437. "\u0002\u00f0\u00f1\u0007d\u0002\u0002\u00f1\u00f2\u0007t\u0002\u0002",
  438. "\u00f2\u00f3\u0007g\u0002\u0002\u00f3\u00f4\u0007c\u0002\u0002\u00f4",
  439. "\u00f5\u0007m\u0002\u0002\u00f5(\u0003\u0002\u0002\u0002\u00f6\u00f7",
  440. "\u0007t\u0002\u0002\u00f7\u00f8\u0007g\u0002\u0002\u00f8\u00f9\u0007",
  441. "r\u0002\u0002\u00f9\u00fa\u0007g\u0002\u0002\u00fa\u00fb\u0007c\u0002",
  442. "\u0002\u00fb\u00fc\u0007v\u0002\u0002\u00fc*\u0003\u0002\u0002\u0002",
  443. "\u00fd\u00fe\u0007w\u0002\u0002\u00fe\u00ff\u0007p\u0002\u0002\u00ff",
  444. "\u0100\u0007v\u0002\u0002\u0100\u0101\u0007k\u0002\u0002\u0101\u0102",
  445. "\u0007n\u0002\u0002\u0102,\u0003\u0002\u0002\u0002\u0103\u0104\u0007",
  446. "y\u0002\u0002\u0104\u0105\u0007j\u0002\u0002\u0105\u0106\u0007k\u0002",
  447. "\u0002\u0106\u0107\u0007n\u0002\u0002\u0107\u0108\u0007g\u0002\u0002",
  448. "\u0108.\u0003\u0002\u0002\u0002\u0109\u010a\u0007t\u0002\u0002\u010a",
  449. "\u010b\u0007g\u0002\u0002\u010b\u010c\u0007r\u0002\u0002\u010c\u010d",
  450. "\u0007g\u0002\u0002\u010d\u010e\u0007c\u0002\u0002\u010e\u010f\u0007",
  451. "v\u0002\u0002\u010f\u0110\u0007a\u0002\u0002\u0110\u0111\u0007y\u0002",
  452. "\u0002\u0111\u0112\u0007j\u0002\u0002\u0112\u0113\u0007k\u0002\u0002",
  453. "\u0113\u0114\u0007n\u0002\u0002\u0114\u0115\u0007g\u0002\u0002\u0115",
  454. "0\u0003\u0002\u0002\u0002\u0116\u0117\u0007k\u0002\u0002\u0117\u0118",
  455. "\u0007h\u0002\u0002\u01182\u0003\u0002\u0002\u0002\u0119\u011a\u0007",
  456. "g\u0002\u0002\u011a\u011b\u0007n\u0002\u0002\u011b\u011c\u0007u\u0002",
  457. "\u0002\u011c\u011d\u0007g\u0002\u0002\u011d4\u0003\u0002\u0002\u0002",
  458. "\u011e\u011f\u0007h\u0002\u0002\u011f\u0120\u0007c\u0002\u0002\u0120",
  459. "\u0121\u0007n\u0002\u0002\u0121\u0122\u0007u\u0002\u0002\u0122\u0123",
  460. "\u0007g\u0002\u0002\u01236\u0003\u0002\u0002\u0002\u0124\u0125\u0007",
  461. "v\u0002\u0002\u0125\u0126\u0007t\u0002\u0002\u0126\u0127\u0007w\u0002",
  462. "\u0002\u0127\u0128\u0007g\u0002\u0002\u01288\u0003\u0002\u0002\u0002",
  463. "\u0129\u012a\u0007p\u0002\u0002\u012a\u012b\u0007q\u0002\u0002\u012b",
  464. "\u012c\u0007v\u0002\u0002\u012c:\u0003\u0002\u0002\u0002\u012d\u012e",
  465. "\u0007C\u0002\u0002\u012e\u012f\u0007P\u0002\u0002\u012f\u0130\u0007",
  466. "F\u0002\u0002\u0130<\u0003\u0002\u0002\u0002\u0131\u0132\u0007Q\u0002",
  467. "\u0002\u0132\u0133\u0007T\u0002\u0002\u0133>\u0003\u0002\u0002\u0002",
  468. "\u0134\u0135\u0007(\u0002\u0002\u0135@\u0003\u0002\u0002\u0002\u0136",
  469. "\u0137\u0007*\u0002\u0002\u0137B\u0003\u0002\u0002\u0002\u0138\u0139",
  470. "\u0007+\u0002\u0002\u0139D\u0003\u0002\u0002\u0002\u013a\u013b\u0007",
  471. "]\u0002\u0002\u013bF\u0003\u0002\u0002\u0002\u013c\u013d\u0007_\u0002",
  472. "\u0002\u013dH\u0003\u0002\u0002\u0002\u013e\u013f\u0007}\u0002\u0002",
  473. "\u013fJ\u0003\u0002\u0002\u0002\u0140\u0141\u0007\u007f\u0002\u0002",
  474. "\u0141L\u0003\u0002\u0002\u0002\u0142\u0143\u0007.\u0002\u0002\u0143",
  475. "N\u0003\u0002\u0002\u0002\u0144\u0145\u0007>\u0002\u0002\u0145\u0148",
  476. "\u0007/\u0002\u0002\u0146\u0148\u0007\u2192\u0002\u0002\u0147\u0144",
  477. "\u0003\u0002\u0002\u0002\u0147\u0146\u0003\u0002\u0002\u0002\u0148P",
  478. "\u0003\u0002\u0002\u0002\u0149\u014a\t\u0002\u0002\u0002\u014aR\u0003",
  479. "\u0002\u0002\u0002\u014b\u014c\t\u0003\u0002\u0002\u014cT\u0003\u0002",
  480. "\u0002\u0002\u014d\u014e\u0005;\u001e\u0002\u014eV\u0003\u0002\u0002",
  481. "\u0002\u014f\u0150\u0005=\u001f\u0002\u0150X\u0003\u0002\u0002\u0002",
  482. "\u0151\u0152\u0007@\u0002\u0002\u0152\u015b\u0007?\u0002\u0002\u0153",
  483. "\u0154\u0007?\u0002\u0002\u0154\u015b\u0007?\u0002\u0002\u0155\u0156",
  484. "\u0007>\u0002\u0002\u0156\u015b\u0007?\u0002\u0002\u0157\u015b\t\u0004",
  485. "\u0002\u0002\u0158\u0159\u0007#\u0002\u0002\u0159\u015b\u0007?\u0002",
  486. "\u0002\u015a\u0151\u0003\u0002\u0002\u0002\u015a\u0153\u0003\u0002\u0002",
  487. "\u0002\u015a\u0155\u0003\u0002\u0002\u0002\u015a\u0157\u0003\u0002\u0002",
  488. "\u0002\u015a\u0158\u0003\u0002\u0002\u0002\u015bZ\u0003\u0002\u0002",
  489. "\u0002\u015c\u015d\u0007<\u0002\u0002\u015d\\\u0003\u0002\u0002\u0002",
  490. "\u015e\u015f\u00059\u001d\u0002\u015f^\u0003\u0002\u0002\u0002\u0160",
  491. "\u0164\t\u0005\u0002\u0002\u0161\u0163\t\u0006\u0002\u0002\u0162\u0161",
  492. "\u0003\u0002\u0002\u0002\u0163\u0166\u0003\u0002\u0002\u0002\u0164\u0162",
  493. "\u0003\u0002\u0002\u0002\u0164\u0165\u0003\u0002\u0002\u0002\u0165`",
  494. "\u0003\u0002\u0002\u0002\u0166\u0164\u0003\u0002\u0002\u0002\u0167\u0168",
  495. "\u0005_0\u0002\u0168\u0169\u00070\u0002\u0002\u0169\u016a\u0005_0\u0002",
  496. "\u016ab\u0003\u0002\u0002\u0002\u016b\u016d\t\u0007\u0002\u0002\u016c",
  497. "\u016b\u0003\u0002\u0002\u0002\u016d\u016e\u0003\u0002\u0002\u0002\u016e",
  498. "\u016c\u0003\u0002\u0002\u0002\u016e\u016f\u0003\u0002\u0002\u0002\u016f",
  499. "\u0187\u0003\u0002\u0002\u0002\u0170\u0171\u00072\u0002\u0002\u0171",
  500. "\u0175\u0007z\u0002\u0002\u0172\u0173\u00072\u0002\u0002\u0173\u0175",
  501. "\u0007Z\u0002\u0002\u0174\u0170\u0003\u0002\u0002\u0002\u0174\u0172",
  502. "\u0003\u0002\u0002\u0002\u0175\u0177\u0003\u0002\u0002\u0002\u0176\u0178",
  503. "\u0005u;\u0002\u0177\u0176\u0003\u0002\u0002\u0002\u0178\u0179\u0003",
  504. "\u0002\u0002\u0002\u0179\u0177\u0003\u0002\u0002\u0002\u0179\u017a\u0003",
  505. "\u0002\u0002\u0002\u017a\u0187\u0003\u0002\u0002\u0002\u017b\u017c\u0007",
  506. "2\u0002\u0002\u017c\u0180\u0007d\u0002\u0002\u017d\u017e\u00072\u0002",
  507. "\u0002\u017e\u0180\u0007D\u0002\u0002\u017f\u017b\u0003\u0002\u0002",
  508. "\u0002\u017f\u017d\u0003\u0002\u0002\u0002\u0180\u0182\u0003\u0002\u0002",
  509. "\u0002\u0181\u0183\t\b\u0002\u0002\u0182\u0181\u0003\u0002\u0002\u0002",
  510. "\u0183\u0184\u0003\u0002\u0002\u0002\u0184\u0182\u0003\u0002\u0002\u0002",
  511. "\u0184\u0185\u0003\u0002\u0002\u0002\u0185\u0187\u0003\u0002\u0002\u0002",
  512. "\u0186\u016c\u0003\u0002\u0002\u0002\u0186\u0174\u0003\u0002\u0002\u0002",
  513. "\u0186\u017f\u0003\u0002\u0002\u0002\u0187d\u0003\u0002\u0002\u0002",
  514. "\u0188\u018a\t\u0007\u0002\u0002\u0189\u0188\u0003\u0002\u0002\u0002",
  515. "\u018a\u018b\u0003\u0002\u0002\u0002\u018b\u0189\u0003\u0002\u0002\u0002",
  516. "\u018b\u018c\u0003\u0002\u0002\u0002\u018c\u018d\u0003\u0002\u0002\u0002",
  517. "\u018d\u018f\u00070\u0002\u0002\u018e\u0190\t\u0007\u0002\u0002\u018f",
  518. "\u018e\u0003\u0002\u0002\u0002\u0190\u0191\u0003\u0002\u0002\u0002\u0191",
  519. "\u018f\u0003\u0002\u0002\u0002\u0191\u0192\u0003\u0002\u0002\u0002\u0192",
  520. "\u01a1\u0003\u0002\u0002\u0002\u0193\u0195\t\u0007\u0002\u0002\u0194",
  521. "\u0193\u0003\u0002\u0002\u0002\u0195\u0196\u0003\u0002\u0002\u0002\u0196",
  522. "\u0194\u0003\u0002\u0002\u0002\u0196\u0197\u0003\u0002\u0002\u0002\u0197",
  523. "\u0198\u0003\u0002\u0002\u0002\u0198\u019c\u00070\u0002\u0002\u0199",
  524. "\u019b\t\u0007\u0002\u0002\u019a\u0199\u0003\u0002\u0002\u0002\u019b",
  525. "\u019e\u0003\u0002\u0002\u0002\u019c\u019a\u0003\u0002\u0002\u0002\u019c",
  526. "\u019d\u0003\u0002\u0002\u0002\u019d\u019f\u0003\u0002\u0002\u0002\u019e",
  527. "\u019c\u0003\u0002\u0002\u0002\u019f\u01a1\u0005g4\u0002\u01a0\u0189",
  528. "\u0003\u0002\u0002\u0002\u01a0\u0194\u0003\u0002\u0002\u0002\u01a1f",
  529. "\u0003\u0002\u0002\u0002\u01a2\u01a4\t\t\u0002\u0002\u01a3\u01a5\t\u0002",
  530. "\u0002\u0002\u01a4\u01a3\u0003\u0002\u0002\u0002\u01a4\u01a5\u0003\u0002",
  531. "\u0002\u0002\u01a5\u01a7\u0003\u0002\u0002\u0002\u01a6\u01a8\t\u0007",
  532. "\u0002\u0002\u01a7\u01a6\u0003\u0002\u0002\u0002\u01a8\u01a9\u0003\u0002",
  533. "\u0002\u0002\u01a9\u01a7\u0003\u0002\u0002\u0002\u01a9\u01aa\u0003\u0002",
  534. "\u0002\u0002\u01aah\u0003\u0002\u0002\u0002\u01ab\u01af\u0007$\u0002",
  535. "\u0002\u01ac\u01ae\u0005k6\u0002\u01ad\u01ac\u0003\u0002\u0002\u0002",
  536. "\u01ae\u01b1\u0003\u0002\u0002\u0002\u01af\u01ad\u0003\u0002\u0002\u0002",
  537. "\u01af\u01b0\u0003\u0002\u0002\u0002\u01b0\u01b2\u0003\u0002\u0002\u0002",
  538. "\u01b1\u01af\u0003\u0002\u0002\u0002\u01b2\u01b3\u0007$\u0002\u0002",
  539. "\u01b3j\u0003\u0002\u0002\u0002\u01b4\u01b7\n\n\u0002\u0002\u01b5\u01b7",
  540. "\u0005y=\u0002\u01b6\u01b4\u0003\u0002\u0002\u0002\u01b6\u01b5\u0003",
  541. "\u0002\u0002\u0002\u01b7l\u0003\u0002\u0002\u0002\u01b8\u01bb\u0007",
  542. ")\u0002\u0002\u01b9\u01bc\u0005y=\u0002\u01ba\u01bc\n\u000b\u0002\u0002",
  543. "\u01bb\u01b9\u0003\u0002\u0002\u0002\u01bb\u01ba\u0003\u0002\u0002\u0002",
  544. "\u01bc\u01bd\u0003\u0002\u0002\u0002\u01bd\u01be\u0007)\u0002\u0002",
  545. "\u01ben\u0003\u0002\u0002\u0002\u01bf\u01c0\t\f\u0002\u0002\u01c0\u01c1",
  546. "\u0003\u0002\u0002\u0002\u01c1\u01c2\b8\u0002\u0002\u01c2p\u0003\u0002",
  547. "\u0002\u0002\u01c3\u01c4\u0007=\u0002\u0002\u01c4r\u0003\u0002\u0002",
  548. "\u0002\u01c5\u01c7\t\r\u0002\u0002\u01c6\u01c5\u0003\u0002\u0002\u0002",
  549. "\u01c7\u01c8\u0003\u0002\u0002\u0002\u01c8\u01c6\u0003\u0002\u0002\u0002",
  550. "\u01c8\u01c9\u0003\u0002\u0002\u0002\u01c9\u01cc\u0003\u0002\u0002\u0002",
  551. "\u01ca\u01cc\u0005q9\u0002\u01cb\u01c6\u0003\u0002\u0002\u0002\u01cb",
  552. "\u01ca\u0003\u0002\u0002\u0002\u01cct\u0003\u0002\u0002\u0002\u01cd",
  553. "\u01ce\t\u000e\u0002\u0002\u01cev\u0003\u0002\u0002\u0002\u01cf\u01d0",
  554. "\t\u000f\u0002\u0002\u01d0x\u0003\u0002\u0002\u0002\u01d1\u01d2\u0007",
  555. "^\u0002\u0002\u01d2\u01d6\t\u0010\u0002\u0002\u01d3\u01d6\u0005}?\u0002",
  556. "\u01d4\u01d6\u0005{>\u0002\u01d5\u01d1\u0003\u0002\u0002\u0002\u01d5",
  557. "\u01d3\u0003\u0002\u0002\u0002\u01d5\u01d4\u0003\u0002\u0002\u0002\u01d6",
  558. "z\u0003\u0002\u0002\u0002\u01d7\u01d8\u0007^\u0002\u0002\u01d8\u01d9",
  559. "\t\u0011\u0002\u0002\u01d9\u01da\u0005w<\u0002\u01da\u01db\u0005w<\u0002",
  560. "\u01db\u01e3\u0003\u0002\u0002\u0002\u01dc\u01dd\u0007^\u0002\u0002",
  561. "\u01dd\u01de\u0005w<\u0002\u01de\u01df\u0005w<\u0002\u01df\u01e3\u0003",
  562. "\u0002\u0002\u0002\u01e0\u01e1\u0007^\u0002\u0002\u01e1\u01e3\u0005",
  563. "w<\u0002\u01e2\u01d7\u0003\u0002\u0002\u0002\u01e2\u01dc\u0003\u0002",
  564. "\u0002\u0002\u01e2\u01e0\u0003\u0002\u0002\u0002\u01e3|\u0003\u0002",
  565. "\u0002\u0002\u01e4\u01e5\u0007^\u0002\u0002\u01e5\u01e6\u0007w\u0002",
  566. "\u0002\u01e6\u01e7\u0005u;\u0002\u01e7\u01e8\u0005u;\u0002\u01e8\u01e9",
  567. "\u0005u;\u0002\u01e9\u01ea\u0005u;\u0002\u01ea~\u0003\u0002\u0002\u0002",
  568. "\u01eb\u01ec\u00071\u0002\u0002\u01ec\u01ed\u00071\u0002\u0002\u01ed",
  569. "\u01f1\u0003\u0002\u0002\u0002\u01ee\u01f0\n\r\u0002\u0002\u01ef\u01ee",
  570. "\u0003\u0002\u0002\u0002\u01f0\u01f3\u0003\u0002\u0002\u0002\u01f1\u01ef",
  571. "\u0003\u0002\u0002\u0002\u01f1\u01f2\u0003\u0002\u0002\u0002\u01f2\u01f5",
  572. "\u0003\u0002\u0002\u0002\u01f3\u01f1\u0003\u0002\u0002\u0002\u01f4\u01f6",
  573. "\u0007\u000f\u0002\u0002\u01f5\u01f4\u0003\u0002\u0002\u0002\u01f5\u01f6",
  574. "\u0003\u0002\u0002\u0002\u01f6\u01f7\u0003\u0002\u0002\u0002\u01f7\u0204",
  575. "\u0007\f\u0002\u0002\u01f8\u01f9\u00071\u0002\u0002\u01f9\u01fa\u0007",
  576. ",\u0002\u0002\u01fa\u01fe\u0003\u0002\u0002\u0002\u01fb\u01fd\u000b",
  577. "\u0002\u0002\u0002\u01fc\u01fb\u0003\u0002\u0002\u0002\u01fd\u0200\u0003",
  578. "\u0002\u0002\u0002\u01fe\u01ff\u0003\u0002\u0002\u0002\u01fe\u01fc\u0003",
  579. "\u0002\u0002\u0002\u01ff\u0201\u0003\u0002\u0002\u0002\u0200\u01fe\u0003",
  580. "\u0002\u0002\u0002\u0201\u0202\u0007,\u0002\u0002\u0202\u0204\u0007",
  581. "1\u0002\u0002\u0203\u01eb\u0003\u0002\u0002\u0002\u0203\u01f8\u0003",
  582. "\u0002\u0002\u0002\u0204\u0205\u0003\u0002\u0002\u0002\u0205\u0206\b",
  583. "@\u0003\u0002\u0206\u0080\u0003\u0002\u0002\u0002\u001e\u0002\u0147",
  584. "\u015a\u0164\u016e\u0174\u0179\u017f\u0184\u0186\u018b\u0191\u0196\u019c",
  585. "\u01a0\u01a4\u01a9\u01af\u01b6\u01bb\u01c8\u01cb\u01d5\u01e2\u01f1\u01f5",
  586. "\u01fe\u0203\u0004\b\u0002\u0002\u0002\u0003\u0002"].join("");
  587. var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
  588. var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
  589. function ivprog(input) {
  590. antlr4.Lexer.call(this, input);
  591. this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
  592. return this;
  593. }
  594. ivprog.prototype = Object.create(antlr4.Lexer.prototype);
  595. ivprog.prototype.constructor = ivprog;
  596. ivprog.EOF = antlr4.Token.EOF;
  597. ivprog.RK_PROGRAM = 1;
  598. ivprog.RK_REAL = 2;
  599. ivprog.RK_VOID = 3;
  600. ivprog.RK_BOOLEAN = 4;
  601. ivprog.RK_STRING = 5;
  602. ivprog.RK_INTEGER = 6;
  603. ivprog.RK_CHARACTER = 7;
  604. ivprog.RK_SWITCH = 8;
  605. ivprog.RK_CASE = 9;
  606. ivprog.RK_DEFAULT = 10;
  607. ivprog.RK_CONST = 11;
  608. ivprog.RK_FUNCTION = 12;
  609. ivprog.RK_RETURN = 13;
  610. ivprog.RK_FOR = 14;
  611. ivprog.RK_FOR_ALT = 15;
  612. ivprog.RK_FOR_FROM = 16;
  613. ivprog.RK_FOR_TO = 17;
  614. ivprog.RK_FOR_PASS = 18;
  615. ivprog.RK_BREAK = 19;
  616. ivprog.RK_DO = 20;
  617. ivprog.RK_DO_UNTIL = 21;
  618. ivprog.RK_WHILE = 22;
  619. ivprog.RK_WHILE_ALT = 23;
  620. ivprog.RK_IF = 24;
  621. ivprog.RK_ELSE = 25;
  622. ivprog.RK_FALSE = 26;
  623. ivprog.RK_TRUE = 27;
  624. ivprog.RK_REFERENCE = 28;
  625. ivprog.OPEN_PARENTHESIS = 29;
  626. ivprog.CLOSE_PARENTHESIS = 30;
  627. ivprog.OPEN_BRACE = 31;
  628. ivprog.CLOSE_BRACE = 32;
  629. ivprog.OPEN_CURLY = 33;
  630. ivprog.CLOSE_CURLY = 34;
  631. ivprog.COMMA = 35;
  632. ivprog.EQUAL = 36;
  633. ivprog.SUM_OP = 37;
  634. ivprog.MULTI_OP = 38;
  635. ivprog.AND_OPERATOR = 39;
  636. ivprog.OR_OPERATOR = 40;
  637. ivprog.RELATIONAL_OPERATOR = 41;
  638. ivprog.COLON = 42;
  639. ivprog.NOT_OPERATOR = 43;
  640. ivprog.ID = 44;
  641. ivprog.LIB_ID = 45;
  642. ivprog.INTEGER = 46;
  643. ivprog.REAL = 47;
  644. ivprog.STRING = 48;
  645. ivprog.CHARACTER = 49;
  646. ivprog.WHITESPACE = 50;
  647. ivprog.EOS = 51;
  648. ivprog.COMMENTS = 52;
  649. ivprog.prototype.channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
  650. ivprog.prototype.modeNames = [ "DEFAULT_MODE" ];
  651. ivprog.prototype.literalNames = [ null, "'program'", "'real'", "'void'",
  652. "'bool'", "'string'", "'int'", "'char'",
  653. "'switch'", "'case'", "'otherwise'", "'const'",
  654. "'function'", "'return'", "'for'", "'repeat_for'",
  655. "'from'", "'to'", "'pass'", "'break'",
  656. "'repeat'", "'until'", "'while'", "'repeat_while'",
  657. "'if'", "'else'", "'false'", "'true'",
  658. "'&'", "'('", "')'", "'['", "']'", "'{'",
  659. "'}'", "','", null, null, null, null,
  660. null, null, "':'" ];
  661. ivprog.prototype.symbolicNames = [ null, "RK_PROGRAM", "RK_REAL", "RK_VOID",
  662. "RK_BOOLEAN", "RK_STRING", "RK_INTEGER",
  663. "RK_CHARACTER", "RK_SWITCH", "RK_CASE",
  664. "RK_DEFAULT", "RK_CONST", "RK_FUNCTION",
  665. "RK_RETURN", "RK_FOR", "RK_FOR_ALT",
  666. "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
  667. "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
  668. "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
  669. "RK_TRUE", "RK_REFERENCE", "OPEN_PARENTHESIS",
  670. "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
  671. "OPEN_CURLY", "CLOSE_CURLY", "COMMA",
  672. "EQUAL", "SUM_OP", "MULTI_OP", "AND_OPERATOR",
  673. "OR_OPERATOR", "RELATIONAL_OPERATOR",
  674. "COLON", "NOT_OPERATOR", "ID", "LIB_ID",
  675. "INTEGER", "REAL", "STRING", "CHARACTER",
  676. "WHITESPACE", "EOS", "COMMENTS" ];
  677. ivprog.prototype.ruleNames = [ "RK_PROGRAM", "RK_REAL", "RK_VOID", "RK_BOOLEAN",
  678. "RK_STRING", "RK_INTEGER", "RK_CHARACTER",
  679. "RK_SWITCH", "RK_CASE", "RK_DEFAULT", "RK_CONST",
  680. "RK_FUNCTION", "RK_RETURN", "RK_FOR", "RK_FOR_ALT",
  681. "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
  682. "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
  683. "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
  684. "RK_TRUE", "RK_LOGICAL_NOT", "RK_LOGICAL_AND",
  685. "RK_LOGICAL_OR", "RK_REFERENCE", "OPEN_PARENTHESIS",
  686. "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
  687. "OPEN_CURLY", "CLOSE_CURLY", "COMMA", "EQUAL",
  688. "SUM_OP", "MULTI_OP", "AND_OPERATOR", "OR_OPERATOR",
  689. "RELATIONAL_OPERATOR", "COLON", "NOT_OPERATOR",
  690. "ID", "LIB_ID", "INTEGER", "REAL", "ExponentPart",
  691. "STRING", "STRING_CHARACTER", "CHARACTER",
  692. "WHITESPACE", "SEMICOLON", "EOS", "HEX_DIGIT",
  693. "OCTAL_DIGIT", "ESC_SEQ", "ESC_OCTAL", "ESC_UNICODE",
  694. "COMMENTS" ];
  695. ivprog.prototype.grammarFileName = "ivprog.g4";
  696. exports.ivprog = ivprog;
  697. /***/ }),
  698. /* 1 */
  699. /***/ (function(module, exports, __webpack_require__) {
  700. module.exports = {
  701. ivprog: __webpack_require__(0).ivprog
  702. };
  703. /***/ }),
  704. /* 2 */
  705. /***/ (function(module, exports) {
  706. module.exports = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
  707. /***/ })
  708. /******/ ]);
  709. /***/ }),
  710. /***/ "./grammar/en/langFunctions.js":
  711. /*!*************************************!*\
  712. !*** ./grammar/en/langFunctions.js ***!
  713. \*************************************/
  714. /*! exports provided: default */
  715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  716. "use strict";
  717. __webpack_require__.r(__webpack_exports__);
  718. /* This is a dictionary of the language defined functions
  719. **/
  720. /* harmony default export */ __webpack_exports__["default"] = ({
  721. main_function: "main",
  722. $read: "read",
  723. $write: "write",
  724. $numElements: "total_of_elements",
  725. $matrixLines: "total_of_lines",
  726. $matrixColumns: "total_of_columns",
  727. $substring: "substring",
  728. $length: "length",
  729. $uppercase: "uppercase",
  730. $lowercase: "lowercase",
  731. $charAt: "char_at",
  732. $isReal: "is_real",
  733. $isInt: "is_integer",
  734. $isBool: "is_logic",
  735. $castReal: "to_real",
  736. $castInt: "to_integer",
  737. $castBool: "to_logic",
  738. $castString: "to_string",
  739. $castChar: "to_char",
  740. $sin: "sin",
  741. $cos: "cos",
  742. $tan: "tan",
  743. $sqrt: "sqrt",
  744. $pow: "pow",
  745. $log: "log",
  746. $abs: "abs",
  747. $negate: "negate",
  748. $invert: "invert",
  749. $max: "maximum",
  750. $min: "minimum",
  751. $rand: "random"
  752. });
  753. /***/ }),
  754. /***/ "./grammar/en/langLibs.js":
  755. /*!********************************!*\
  756. !*** ./grammar/en/langLibs.js ***!
  757. \********************************/
  758. /*! exports provided: default */
  759. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  760. "use strict";
  761. __webpack_require__.r(__webpack_exports__);
  762. /**
  763. * This is the dictionary of the language defined libraries
  764. */
  765. /* harmony default export */ __webpack_exports__["default"] = ({
  766. $mathLib: "Mathematic",
  767. $ioLib: "IO",
  768. $strLib: "Text",
  769. $arrayLib: "Array",
  770. $langLib: "Conversion"
  771. });
  772. /***/ }),
  773. /***/ "./grammar/index.js":
  774. /*!**************************!*\
  775. !*** ./grammar/index.js ***!
  776. \**************************/
  777. /*! exports provided: default */
  778. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  779. "use strict";
  780. __webpack_require__.r(__webpack_exports__);
  781. /* harmony import */ var _pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pt/ivprog.g4 */ "./grammar/pt/ivprog.g4");
  782. /* harmony import */ var _pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0__);
  783. /* harmony import */ var _pt_langFunctions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pt/langFunctions */ "./grammar/pt/langFunctions.js");
  784. /* harmony import */ var _pt_langLibs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pt/langLibs */ "./grammar/pt/langLibs.js");
  785. /* harmony import */ var _en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./en/ivprog.g4 */ "./grammar/en/ivprog.g4");
  786. /* harmony import */ var _en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3__);
  787. /* harmony import */ var _en_langFunctions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./en/langFunctions */ "./grammar/en/langFunctions.js");
  788. /* harmony import */ var _en_langLibs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./en/langLibs */ "./grammar/en/langLibs.js");
  789. /*import * as ES from "./es/ivprog.g4";
  790. import ESFuncs from "./es/langFunctions";
  791. import ESLibs from "./es/langLibs";*/
  792. /* harmony default export */ __webpack_exports__["default"] = ({
  793. pt: {
  794. lexer: _pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0__["ivprog"],
  795. langFuncs: _pt_langFunctions__WEBPACK_IMPORTED_MODULE_1__["default"],
  796. langLibs: _pt_langLibs__WEBPACK_IMPORTED_MODULE_2__["default"]
  797. },
  798. en: {
  799. lexer: _en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3__["ivprog"],
  800. langFuncs: _en_langFunctions__WEBPACK_IMPORTED_MODULE_4__["default"],
  801. langLibs: _en_langLibs__WEBPACK_IMPORTED_MODULE_5__["default"]
  802. } //es: {lexer: ES.ivprog, langFuncs: ESFuncs, langLibs: ESLibs}
  803. });
  804. /***/ }),
  805. /***/ "./grammar/pt/ivprog.g4":
  806. /*!******************************!*\
  807. !*** ./grammar/pt/ivprog.g4 ***!
  808. \******************************/
  809. /*! no static exports found */
  810. /***/ (function(module, exports, __webpack_require__) {
  811. module.exports =
  812. /******/ (function(modules) { // webpackBootstrap
  813. /******/ // The module cache
  814. /******/ var installedModules = {};
  815. /******/
  816. /******/ // The require function
  817. /******/ function __webpack_require__(moduleId) {
  818. /******/
  819. /******/ // Check if module is in cache
  820. /******/ if(installedModules[moduleId]) {
  821. /******/ return installedModules[moduleId].exports;
  822. /******/ }
  823. /******/ // Create a new module (and put it into the cache)
  824. /******/ var module = installedModules[moduleId] = {
  825. /******/ i: moduleId,
  826. /******/ l: false,
  827. /******/ exports: {}
  828. /******/ };
  829. /******/
  830. /******/ // Execute the module function
  831. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  832. /******/
  833. /******/ // Flag the module as loaded
  834. /******/ module.l = true;
  835. /******/
  836. /******/ // Return the exports of the module
  837. /******/ return module.exports;
  838. /******/ }
  839. /******/
  840. /******/
  841. /******/ // expose the modules object (__webpack_modules__)
  842. /******/ __webpack_require__.m = modules;
  843. /******/
  844. /******/ // expose the module cache
  845. /******/ __webpack_require__.c = installedModules;
  846. /******/
  847. /******/ // identity function for calling harmony imports with the correct context
  848. /******/ __webpack_require__.i = function(value) { return value; };
  849. /******/
  850. /******/ // define getter function for harmony exports
  851. /******/ __webpack_require__.d = function(exports, name, getter) {
  852. /******/ if(!__webpack_require__.o(exports, name)) {
  853. /******/ Object.defineProperty(exports, name, {
  854. /******/ configurable: false,
  855. /******/ enumerable: true,
  856. /******/ get: getter
  857. /******/ });
  858. /******/ }
  859. /******/ };
  860. /******/
  861. /******/ // getDefaultExport function for compatibility with non-harmony modules
  862. /******/ __webpack_require__.n = function(module) {
  863. /******/ var getter = module && module.__esModule ?
  864. /******/ function getDefault() { return module['default']; } :
  865. /******/ function getModuleExports() { return module; };
  866. /******/ __webpack_require__.d(getter, 'a', getter);
  867. /******/ return getter;
  868. /******/ };
  869. /******/
  870. /******/ // Object.prototype.hasOwnProperty.call
  871. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  872. /******/
  873. /******/ // __webpack_public_path__
  874. /******/ __webpack_require__.p = "";
  875. /******/
  876. /******/ // Load entry module and return exports
  877. /******/ return __webpack_require__(__webpack_require__.s = 1);
  878. /******/ })
  879. /************************************************************************/
  880. /******/ ([
  881. /* 0 */
  882. /***/ (function(module, exports, __webpack_require__) {
  883. // Generated from /tmp/tmp-13432RkES50UJ2rfI/ivprog.g4 by ANTLR 4.7
  884. // jshint ignore: start
  885. var antlr4 = __webpack_require__(2);
  886. var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
  887. "\u00026\u0222\b\u0001\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004",
  888. "\u0004\t\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t",
  889. "\u0007\u0004\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004",
  890. "\f\t\f\u0004\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010",
  891. "\t\u0010\u0004\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013",
  892. "\u0004\u0014\t\u0014\u0004\u0015\t\u0015\u0004\u0016\t\u0016\u0004\u0017",
  893. "\t\u0017\u0004\u0018\t\u0018\u0004\u0019\t\u0019\u0004\u001a\t\u001a",
  894. "\u0004\u001b\t\u001b\u0004\u001c\t\u001c\u0004\u001d\t\u001d\u0004\u001e",
  895. "\t\u001e\u0004\u001f\t\u001f\u0004 \t \u0004!\t!\u0004\"\t\"\u0004#",
  896. "\t#\u0004$\t$\u0004%\t%\u0004&\t&\u0004\'\t\'\u0004(\t(\u0004)\t)\u0004",
  897. "*\t*\u0004+\t+\u0004,\t,\u0004-\t-\u0004.\t.\u0004/\t/\u00040\t0\u0004",
  898. "1\t1\u00042\t2\u00043\t3\u00044\t4\u00045\t5\u00046\t6\u00047\t7\u0004",
  899. "8\t8\u00049\t9\u0004:\t:\u0004;\t;\u0004<\t<\u0004=\t=\u0004>\t>\u0004",
  900. "?\t?\u0004@\t@\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003",
  901. "\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0003\u0003",
  902. "\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0004\u0003\u0004\u0003",
  903. "\u0004\u0003\u0004\u0003\u0004\u0003\u0004\u0003\u0005\u0003\u0005\u0003",
  904. "\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0006\u0003",
  905. "\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003",
  906. "\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003",
  907. "\u0007\u0003\u0007\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003",
  908. "\b\u0003\b\u0003\b\u0003\b\u0003\t\u0003\t\u0003\t\u0003\t\u0003\t\u0003",
  909. "\t\u0003\t\u0003\t\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\u000b",
  910. "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
  911. "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\f\u0003\f\u0003\f\u0003\f",
  912. "\u0003\f\u0003\f\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003",
  913. "\r\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003",
  914. "\u000e\u0003\u000e\u0003\u000e\u0003\u000f\u0003\u000f\u0003\u000f\u0003",
  915. "\u000f\u0003\u000f\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
  916. "\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
  917. "\u0010\u0003\u0010\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0012\u0003",
  918. "\u0012\u0003\u0012\u0003\u0012\u0003\u0013\u0003\u0013\u0003\u0013\u0003",
  919. "\u0013\u0003\u0013\u0003\u0013\u0003\u0014\u0003\u0014\u0003\u0014\u0003",
  920. "\u0014\u0003\u0014\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003",
  921. "\u0015\u0003\u0015\u0003\u0015\u0003\u0016\u0003\u0016\u0003\u0016\u0003",
  922. "\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0017\u0003",
  923. "\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003",
  924. "\u0017\u0003\u0017\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
  925. "\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
  926. "\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
  927. "\u0019\u0003\u0019\u0003\u0019\u0003\u001a\u0003\u001a\u0003\u001a\u0003",
  928. "\u001a\u0003\u001a\u0003\u001a\u0003\u001b\u0003\u001b\u0003\u001b\u0003",
  929. "\u001b\u0003\u001b\u0003\u001b\u0003\u001c\u0003\u001c\u0003\u001c\u0003",
  930. "\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003",
  931. "\u001c\u0003\u001c\u0003\u001d\u0003\u001d\u0003\u001d\u0003\u001d\u0003",
  932. "\u001e\u0003\u001e\u0003\u001f\u0003\u001f\u0003\u001f\u0003 \u0003",
  933. " \u0003!\u0003!\u0003\"\u0003\"\u0003#\u0003#\u0003$\u0003$\u0003%\u0003",
  934. "%\u0003&\u0003&\u0003\'\u0003\'\u0003(\u0003(\u0003(\u0005(\u0163\n",
  935. "(\u0003)\u0003)\u0003*\u0003*\u0003+\u0003+\u0003,\u0003,\u0003-\u0003",
  936. "-\u0003-\u0003-\u0003-\u0003-\u0003-\u0003-\u0003-\u0005-\u0176\n-\u0003",
  937. ".\u0003.\u0003/\u0003/\u00030\u00030\u00070\u017e\n0\f0\u000e0\u0181",
  938. "\u000b0\u00031\u00031\u00031\u00031\u00032\u00062\u0188\n2\r2\u000e",
  939. "2\u0189\u00032\u00032\u00032\u00032\u00052\u0190\n2\u00032\u00062\u0193",
  940. "\n2\r2\u000e2\u0194\u00032\u00032\u00032\u00032\u00052\u019b\n2\u0003",
  941. "2\u00062\u019e\n2\r2\u000e2\u019f\u00052\u01a2\n2\u00033\u00063\u01a5",
  942. "\n3\r3\u000e3\u01a6\u00033\u00033\u00063\u01ab\n3\r3\u000e3\u01ac\u0003",
  943. "3\u00063\u01b0\n3\r3\u000e3\u01b1\u00033\u00033\u00073\u01b6\n3\f3\u000e",
  944. "3\u01b9\u000b3\u00033\u00053\u01bc\n3\u00034\u00034\u00054\u01c0\n4",
  945. "\u00034\u00064\u01c3\n4\r4\u000e4\u01c4\u00035\u00035\u00075\u01c9\n",
  946. "5\f5\u000e5\u01cc\u000b5\u00035\u00035\u00036\u00036\u00056\u01d2\n",
  947. "6\u00037\u00037\u00037\u00057\u01d7\n7\u00037\u00037\u00038\u00038\u0003",
  948. "8\u00038\u00039\u00039\u0003:\u0006:\u01e2\n:\r:\u000e:\u01e3\u0003",
  949. ":\u0005:\u01e7\n:\u0003;\u0003;\u0003<\u0003<\u0003=\u0003=\u0003=\u0003",
  950. "=\u0005=\u01f1\n=\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003",
  951. ">\u0003>\u0003>\u0003>\u0005>\u01fe\n>\u0003?\u0003?\u0003?\u0003?\u0003",
  952. "?\u0003?\u0003?\u0003@\u0003@\u0003@\u0003@\u0007@\u020b\n@\f@\u000e",
  953. "@\u020e\u000b@\u0003@\u0005@\u0211\n@\u0003@\u0003@\u0003@\u0003@\u0003",
  954. "@\u0007@\u0218\n@\f@\u000e@\u021b\u000b@\u0003@\u0003@\u0005@\u021f",
  955. "\n@\u0003@\u0003@\u0003\u0219\u0002A\u0003\u0003\u0005\u0004\u0007\u0005",
  956. "\t\u0006\u000b\u0007\r\b\u000f\t\u0011\n\u0013\u000b\u0015\f\u0017\r",
  957. "\u0019\u000e\u001b\u000f\u001d\u0010\u001f\u0011!\u0012#\u0013%\u0014",
  958. "\'\u0015)\u0016+\u0017-\u0018/\u00191\u001a3\u001b5\u001c7\u001d9\u0002",
  959. ";\u0002=\u0002?\u001eA\u001fC E!G\"I#K$M%O&Q\'S(U)W*Y+[,]-_.a/c0e1g",
  960. "\u0002i2k\u0002m3o4q\u0002s5u\u0002w\u0002y\u0002{\u0002}\u0002\u007f",
  961. "6\u0003\u0002\u0012\u0004\u0002--//\u0005\u0002\'\',,11\u0004\u0002",
  962. ">>@@\u0005\u0002C\\aac|\u0006\u00022;C\\aac|\u0003\u00022;\u0003\u0002",
  963. "23\u0004\u0002GGgg\u0006\u0002\f\f\u000f\u000f$$^^\u0006\u0002\f\f\u000f",
  964. "\u000f))^^\u0004\u0002\u000b\u000b\"\"\u0004\u0002\f\f\u000f\u000f\u0005",
  965. "\u00022;CHch\u0003\u000229\n\u0002$$))^^ddhhppttvv\u0003\u000225\u0002",
  966. "\u0237\u0002\u0003\u0003\u0002\u0002\u0002\u0002\u0005\u0003\u0002\u0002",
  967. "\u0002\u0002\u0007\u0003\u0002\u0002\u0002\u0002\t\u0003\u0002\u0002",
  968. "\u0002\u0002\u000b\u0003\u0002\u0002\u0002\u0002\r\u0003\u0002\u0002",
  969. "\u0002\u0002\u000f\u0003\u0002\u0002\u0002\u0002\u0011\u0003\u0002\u0002",
  970. "\u0002\u0002\u0013\u0003\u0002\u0002\u0002\u0002\u0015\u0003\u0002\u0002",
  971. "\u0002\u0002\u0017\u0003\u0002\u0002\u0002\u0002\u0019\u0003\u0002\u0002",
  972. "\u0002\u0002\u001b\u0003\u0002\u0002\u0002\u0002\u001d\u0003\u0002\u0002",
  973. "\u0002\u0002\u001f\u0003\u0002\u0002\u0002\u0002!\u0003\u0002\u0002",
  974. "\u0002\u0002#\u0003\u0002\u0002\u0002\u0002%\u0003\u0002\u0002\u0002",
  975. "\u0002\'\u0003\u0002\u0002\u0002\u0002)\u0003\u0002\u0002\u0002\u0002",
  976. "+\u0003\u0002\u0002\u0002\u0002-\u0003\u0002\u0002\u0002\u0002/\u0003",
  977. "\u0002\u0002\u0002\u00021\u0003\u0002\u0002\u0002\u00023\u0003\u0002",
  978. "\u0002\u0002\u00025\u0003\u0002\u0002\u0002\u00027\u0003\u0002\u0002",
  979. "\u0002\u0002?\u0003\u0002\u0002\u0002\u0002A\u0003\u0002\u0002\u0002",
  980. "\u0002C\u0003\u0002\u0002\u0002\u0002E\u0003\u0002\u0002\u0002\u0002",
  981. "G\u0003\u0002\u0002\u0002\u0002I\u0003\u0002\u0002\u0002\u0002K\u0003",
  982. "\u0002\u0002\u0002\u0002M\u0003\u0002\u0002\u0002\u0002O\u0003\u0002",
  983. "\u0002\u0002\u0002Q\u0003\u0002\u0002\u0002\u0002S\u0003\u0002\u0002",
  984. "\u0002\u0002U\u0003\u0002\u0002\u0002\u0002W\u0003\u0002\u0002\u0002",
  985. "\u0002Y\u0003\u0002\u0002\u0002\u0002[\u0003\u0002\u0002\u0002\u0002",
  986. "]\u0003\u0002\u0002\u0002\u0002_\u0003\u0002\u0002\u0002\u0002a\u0003",
  987. "\u0002\u0002\u0002\u0002c\u0003\u0002\u0002\u0002\u0002e\u0003\u0002",
  988. "\u0002\u0002\u0002i\u0003\u0002\u0002\u0002\u0002m\u0003\u0002\u0002",
  989. "\u0002\u0002o\u0003\u0002\u0002\u0002\u0002s\u0003\u0002\u0002\u0002",
  990. "\u0002\u007f\u0003\u0002\u0002\u0002\u0003\u0081\u0003\u0002\u0002\u0002",
  991. "\u0005\u008a\u0003\u0002\u0002\u0002\u0007\u008f\u0003\u0002\u0002\u0002",
  992. "\t\u0095\u0003\u0002\u0002\u0002\u000b\u009c\u0003\u0002\u0002\u0002",
  993. "\r\u00a3\u0003\u0002\u0002\u0002\u000f\u00ab\u0003\u0002\u0002\u0002",
  994. "\u0011\u00b5\u0003\u0002\u0002\u0002\u0013\u00bd\u0003\u0002\u0002\u0002",
  995. "\u0015\u00c2\u0003\u0002\u0002\u0002\u0017\u00cc\u0003\u0002\u0002\u0002",
  996. "\u0019\u00d2\u0003\u0002\u0002\u0002\u001b\u00d9\u0003\u0002\u0002\u0002",
  997. "\u001d\u00e1\u0003\u0002\u0002\u0002\u001f\u00e6\u0003\u0002\u0002\u0002",
  998. "!\u00f2\u0003\u0002\u0002\u0002#\u00f5\u0003\u0002\u0002\u0002%\u00f9",
  999. "\u0003\u0002\u0002\u0002\'\u00ff\u0003\u0002\u0002\u0002)\u0104\u0003",
  1000. "\u0002\u0002\u0002+\u010b\u0003\u0002\u0002\u0002-\u0113\u0003\u0002",
  1001. "\u0002\u0002/\u011c\u0003\u0002\u0002\u00021\u012c\u0003\u0002\u0002",
  1002. "\u00023\u012f\u0003\u0002\u0002\u00025\u0135\u0003\u0002\u0002\u0002",
  1003. "7\u013b\u0003\u0002\u0002\u00029\u0146\u0003\u0002\u0002\u0002;\u014a",
  1004. "\u0003\u0002\u0002\u0002=\u014c\u0003\u0002\u0002\u0002?\u014f\u0003",
  1005. "\u0002\u0002\u0002A\u0151\u0003\u0002\u0002\u0002C\u0153\u0003\u0002",
  1006. "\u0002\u0002E\u0155\u0003\u0002\u0002\u0002G\u0157\u0003\u0002\u0002",
  1007. "\u0002I\u0159\u0003\u0002\u0002\u0002K\u015b\u0003\u0002\u0002\u0002",
  1008. "M\u015d\u0003\u0002\u0002\u0002O\u0162\u0003\u0002\u0002\u0002Q\u0164",
  1009. "\u0003\u0002\u0002\u0002S\u0166\u0003\u0002\u0002\u0002U\u0168\u0003",
  1010. "\u0002\u0002\u0002W\u016a\u0003\u0002\u0002\u0002Y\u0175\u0003\u0002",
  1011. "\u0002\u0002[\u0177\u0003\u0002\u0002\u0002]\u0179\u0003\u0002\u0002",
  1012. "\u0002_\u017b\u0003\u0002\u0002\u0002a\u0182\u0003\u0002\u0002\u0002",
  1013. "c\u01a1\u0003\u0002\u0002\u0002e\u01bb\u0003\u0002\u0002\u0002g\u01bd",
  1014. "\u0003\u0002\u0002\u0002i\u01c6\u0003\u0002\u0002\u0002k\u01d1\u0003",
  1015. "\u0002\u0002\u0002m\u01d3\u0003\u0002\u0002\u0002o\u01da\u0003\u0002",
  1016. "\u0002\u0002q\u01de\u0003\u0002\u0002\u0002s\u01e6\u0003\u0002\u0002",
  1017. "\u0002u\u01e8\u0003\u0002\u0002\u0002w\u01ea\u0003\u0002\u0002\u0002",
  1018. "y\u01f0\u0003\u0002\u0002\u0002{\u01fd\u0003\u0002\u0002\u0002}\u01ff",
  1019. "\u0003\u0002\u0002\u0002\u007f\u021e\u0003\u0002\u0002\u0002\u0081\u0082",
  1020. "\u0007r\u0002\u0002\u0082\u0083\u0007t\u0002\u0002\u0083\u0084\u0007",
  1021. "q\u0002\u0002\u0084\u0085\u0007i\u0002\u0002\u0085\u0086\u0007t\u0002",
  1022. "\u0002\u0086\u0087\u0007c\u0002\u0002\u0087\u0088\u0007o\u0002\u0002",
  1023. "\u0088\u0089\u0007c\u0002\u0002\u0089\u0004\u0003\u0002\u0002\u0002",
  1024. "\u008a\u008b\u0007t\u0002\u0002\u008b\u008c\u0007g\u0002\u0002\u008c",
  1025. "\u008d\u0007c\u0002\u0002\u008d\u008e\u0007n\u0002\u0002\u008e\u0006",
  1026. "\u0003\u0002\u0002\u0002\u008f\u0090\u0007x\u0002\u0002\u0090\u0091",
  1027. "\u0007c\u0002\u0002\u0091\u0092\u0007|\u0002\u0002\u0092\u0093\u0007",
  1028. "k\u0002\u0002\u0093\u0094\u0007q\u0002\u0002\u0094\b\u0003\u0002\u0002",
  1029. "\u0002\u0095\u0096\u0007n\u0002\u0002\u0096\u0097\u0007q\u0002\u0002",
  1030. "\u0097\u0098\u0007i\u0002\u0002\u0098\u0099\u0007k\u0002\u0002\u0099",
  1031. "\u009a\u0007e\u0002\u0002\u009a\u009b\u0007q\u0002\u0002\u009b\n\u0003",
  1032. "\u0002\u0002\u0002\u009c\u009d\u0007e\u0002\u0002\u009d\u009e\u0007",
  1033. "c\u0002\u0002\u009e\u009f\u0007f\u0002\u0002\u009f\u00a0\u0007g\u0002",
  1034. "\u0002\u00a0\u00a1\u0007k\u0002\u0002\u00a1\u00a2\u0007c\u0002\u0002",
  1035. "\u00a2\f\u0003\u0002\u0002\u0002\u00a3\u00a4\u0007k\u0002\u0002\u00a4",
  1036. "\u00a5\u0007p\u0002\u0002\u00a5\u00a6\u0007v\u0002\u0002\u00a6\u00a7",
  1037. "\u0007g\u0002\u0002\u00a7\u00a8\u0007k\u0002\u0002\u00a8\u00a9\u0007",
  1038. "t\u0002\u0002\u00a9\u00aa\u0007q\u0002\u0002\u00aa\u000e\u0003\u0002",
  1039. "\u0002\u0002\u00ab\u00ac\u0007e\u0002\u0002\u00ac\u00ad\u0007c\u0002",
  1040. "\u0002\u00ad\u00ae\u0007t\u0002\u0002\u00ae\u00af\u0007c\u0002\u0002",
  1041. "\u00af\u00b0\u0007e\u0002\u0002\u00b0\u00b1\u0007v\u0002\u0002\u00b1",
  1042. "\u00b2\u0007g\u0002\u0002\u00b2\u00b3\u0007t\u0002\u0002\u00b3\u00b4",
  1043. "\u0007g\u0002\u0002\u00b4\u0010\u0003\u0002\u0002\u0002\u00b5\u00b6",
  1044. "\u0007g\u0002\u0002\u00b6\u00b7\u0007u\u0002\u0002\u00b7\u00b8\u0007",
  1045. "e\u0002\u0002\u00b8\u00b9\u0007q\u0002\u0002\u00b9\u00ba\u0007n\u0002",
  1046. "\u0002\u00ba\u00bb\u0007j\u0002\u0002\u00bb\u00bc\u0007c\u0002\u0002",
  1047. "\u00bc\u0012\u0003\u0002\u0002\u0002\u00bd\u00be\u0007e\u0002\u0002",
  1048. "\u00be\u00bf\u0007c\u0002\u0002\u00bf\u00c0\u0007u\u0002\u0002\u00c0",
  1049. "\u00c1\u0007q\u0002\u0002\u00c1\u0014\u0003\u0002\u0002\u0002\u00c2",
  1050. "\u00c3\u0007e\u0002\u0002\u00c3\u00c4\u0007q\u0002\u0002\u00c4\u00c5",
  1051. "\u0007p\u0002\u0002\u00c5\u00c6\u0007v\u0002\u0002\u00c6\u00c7\u0007",
  1052. "t\u0002\u0002\u00c7\u00c8\u0007c\u0002\u0002\u00c8\u00c9\u0007t\u0002",
  1053. "\u0002\u00c9\u00ca\u0007k\u0002\u0002\u00ca\u00cb\u0007q\u0002\u0002",
  1054. "\u00cb\u0016\u0003\u0002\u0002\u0002\u00cc\u00cd\u0007e\u0002\u0002",
  1055. "\u00cd\u00ce\u0007q\u0002\u0002\u00ce\u00cf\u0007p\u0002\u0002\u00cf",
  1056. "\u00d0\u0007u\u0002\u0002\u00d0\u00d1\u0007v\u0002\u0002\u00d1\u0018",
  1057. "\u0003\u0002\u0002\u0002\u00d2\u00d3\u0007h\u0002\u0002\u00d3\u00d4",
  1058. "\u0007w\u0002\u0002\u00d4\u00d5\u0007p\u0002\u0002\u00d5\u00d6\u0007",
  1059. "e\u0002\u0002\u00d6\u00d7\u0007c\u0002\u0002\u00d7\u00d8\u0007q\u0002",
  1060. "\u0002\u00d8\u001a\u0003\u0002\u0002\u0002\u00d9\u00da\u0007f\u0002",
  1061. "\u0002\u00da\u00db\u0007g\u0002\u0002\u00db\u00dc\u0007x\u0002\u0002",
  1062. "\u00dc\u00dd\u0007q\u0002\u0002\u00dd\u00de\u0007n\u0002\u0002\u00de",
  1063. "\u00df\u0007x\u0002\u0002\u00df\u00e0\u0007c\u0002\u0002\u00e0\u001c",
  1064. "\u0003\u0002\u0002\u0002\u00e1\u00e2\u0007r\u0002\u0002\u00e2\u00e3",
  1065. "\u0007c\u0002\u0002\u00e3\u00e4\u0007t\u0002\u0002\u00e4\u00e5\u0007",
  1066. "c\u0002\u0002\u00e5\u001e\u0003\u0002\u0002\u0002\u00e6\u00e7\u0007",
  1067. "t\u0002\u0002\u00e7\u00e8\u0007g\u0002\u0002\u00e8\u00e9\u0007r\u0002",
  1068. "\u0002\u00e9\u00ea\u0007k\u0002\u0002\u00ea\u00eb\u0007v\u0002\u0002",
  1069. "\u00eb\u00ec\u0007c\u0002\u0002\u00ec\u00ed\u0007a\u0002\u0002\u00ed",
  1070. "\u00ee\u0007r\u0002\u0002\u00ee\u00ef\u0007c\u0002\u0002\u00ef\u00f0",
  1071. "\u0007t\u0002\u0002\u00f0\u00f1\u0007c\u0002\u0002\u00f1 \u0003\u0002",
  1072. "\u0002\u0002\u00f2\u00f3\u0007f\u0002\u0002\u00f3\u00f4\u0007g\u0002",
  1073. "\u0002\u00f4\"\u0003\u0002\u0002\u0002\u00f5\u00f6\u0007c\u0002\u0002",
  1074. "\u00f6\u00f7\u0007v\u0002\u0002\u00f7\u00f8\u0007g\u0002\u0002\u00f8",
  1075. "$\u0003\u0002\u0002\u0002\u00f9\u00fa\u0007r\u0002\u0002\u00fa\u00fb",
  1076. "\u0007c\u0002\u0002\u00fb\u00fc\u0007u\u0002\u0002\u00fc\u00fd\u0007",
  1077. "u\u0002\u0002\u00fd\u00fe\u0007q\u0002\u0002\u00fe&\u0003\u0002\u0002",
  1078. "\u0002\u00ff\u0100\u0007r\u0002\u0002\u0100\u0101\u0007c\u0002\u0002",
  1079. "\u0101\u0102\u0007t\u0002\u0002\u0102\u0103\u0007g\u0002\u0002\u0103",
  1080. "(\u0003\u0002\u0002\u0002\u0104\u0105\u0007t\u0002\u0002\u0105\u0106",
  1081. "\u0007g\u0002\u0002\u0106\u0107\u0007r\u0002\u0002\u0107\u0108\u0007",
  1082. "k\u0002\u0002\u0108\u0109\u0007v\u0002\u0002\u0109\u010a\u0007c\u0002",
  1083. "\u0002\u010a*\u0003\u0002\u0002\u0002\u010b\u010c\u0007c\u0002\u0002",
  1084. "\u010c\u010d\u0007v\u0002\u0002\u010d\u010e\u0007g\u0002\u0002\u010e",
  1085. "\u010f\u0007a\u0002\u0002\u010f\u0110\u0007s\u0002\u0002\u0110\u0111",
  1086. "\u0007w\u0002\u0002\u0111\u0112\u0007g\u0002\u0002\u0112,\u0003\u0002",
  1087. "\u0002\u0002\u0113\u0114\u0007g\u0002\u0002\u0114\u0115\u0007p\u0002",
  1088. "\u0002\u0115\u0116\u0007s\u0002\u0002\u0116\u0117\u0007w\u0002\u0002",
  1089. "\u0117\u0118\u0007c\u0002\u0002\u0118\u0119\u0007p\u0002\u0002\u0119",
  1090. "\u011a\u0007v\u0002\u0002\u011a\u011b\u0007q\u0002\u0002\u011b.\u0003",
  1091. "\u0002\u0002\u0002\u011c\u011d\u0007t\u0002\u0002\u011d\u011e\u0007",
  1092. "g\u0002\u0002\u011e\u011f\u0007r\u0002\u0002\u011f\u0120\u0007k\u0002",
  1093. "\u0002\u0120\u0121\u0007v\u0002\u0002\u0121\u0122\u0007c\u0002\u0002",
  1094. "\u0122\u0123\u0007a\u0002\u0002\u0123\u0124\u0007g\u0002\u0002\u0124",
  1095. "\u0125\u0007p\u0002\u0002\u0125\u0126\u0007s\u0002\u0002\u0126\u0127",
  1096. "\u0007w\u0002\u0002\u0127\u0128\u0007c\u0002\u0002\u0128\u0129\u0007",
  1097. "p\u0002\u0002\u0129\u012a\u0007v\u0002\u0002\u012a\u012b\u0007q\u0002",
  1098. "\u0002\u012b0\u0003\u0002\u0002\u0002\u012c\u012d\u0007u\u0002\u0002",
  1099. "\u012d\u012e\u0007g\u0002\u0002\u012e2\u0003\u0002\u0002\u0002\u012f",
  1100. "\u0130\u0007u\u0002\u0002\u0130\u0131\u0007g\u0002\u0002\u0131\u0132",
  1101. "\u0007p\u0002\u0002\u0132\u0133\u0007c\u0002\u0002\u0133\u0134\u0007",
  1102. "q\u0002\u0002\u01344\u0003\u0002\u0002\u0002\u0135\u0136\u0007h\u0002",
  1103. "\u0002\u0136\u0137\u0007c\u0002\u0002\u0137\u0138\u0007n\u0002\u0002",
  1104. "\u0138\u0139\u0007u\u0002\u0002\u0139\u013a\u0007q\u0002\u0002\u013a",
  1105. "6\u0003\u0002\u0002\u0002\u013b\u013c\u0007x\u0002\u0002\u013c\u013d",
  1106. "\u0007g\u0002\u0002\u013d\u013e\u0007t\u0002\u0002\u013e\u013f\u0007",
  1107. "f\u0002\u0002\u013f\u0140\u0007c\u0002\u0002\u0140\u0141\u0007f\u0002",
  1108. "\u0002\u0141\u0142\u0007g\u0002\u0002\u0142\u0143\u0007k\u0002\u0002",
  1109. "\u0143\u0144\u0007t\u0002\u0002\u0144\u0145\u0007q\u0002\u0002\u0145",
  1110. "8\u0003\u0002\u0002\u0002\u0146\u0147\u0007p\u0002\u0002\u0147\u0148",
  1111. "\u0007c\u0002\u0002\u0148\u0149\u0007q\u0002\u0002\u0149:\u0003\u0002",
  1112. "\u0002\u0002\u014a\u014b\u0007G\u0002\u0002\u014b<\u0003\u0002\u0002",
  1113. "\u0002\u014c\u014d\u0007Q\u0002\u0002\u014d\u014e\u0007W\u0002\u0002",
  1114. "\u014e>\u0003\u0002\u0002\u0002\u014f\u0150\u0007(\u0002\u0002\u0150",
  1115. "@\u0003\u0002\u0002\u0002\u0151\u0152\u0007*\u0002\u0002\u0152B\u0003",
  1116. "\u0002\u0002\u0002\u0153\u0154\u0007+\u0002\u0002\u0154D\u0003\u0002",
  1117. "\u0002\u0002\u0155\u0156\u0007]\u0002\u0002\u0156F\u0003\u0002\u0002",
  1118. "\u0002\u0157\u0158\u0007_\u0002\u0002\u0158H\u0003\u0002\u0002\u0002",
  1119. "\u0159\u015a\u0007}\u0002\u0002\u015aJ\u0003\u0002\u0002\u0002\u015b",
  1120. "\u015c\u0007\u007f\u0002\u0002\u015cL\u0003\u0002\u0002\u0002\u015d",
  1121. "\u015e\u0007.\u0002\u0002\u015eN\u0003\u0002\u0002\u0002\u015f\u0160",
  1122. "\u0007>\u0002\u0002\u0160\u0163\u0007/\u0002\u0002\u0161\u0163\u0007",
  1123. "\u2192\u0002\u0002\u0162\u015f\u0003\u0002\u0002\u0002\u0162\u0161\u0003",
  1124. "\u0002\u0002\u0002\u0163P\u0003\u0002\u0002\u0002\u0164\u0165\t\u0002",
  1125. "\u0002\u0002\u0165R\u0003\u0002\u0002\u0002\u0166\u0167\t\u0003\u0002",
  1126. "\u0002\u0167T\u0003\u0002\u0002\u0002\u0168\u0169\u0005;\u001e\u0002",
  1127. "\u0169V\u0003\u0002\u0002\u0002\u016a\u016b\u0005=\u001f\u0002\u016b",
  1128. "X\u0003\u0002\u0002\u0002\u016c\u016d\u0007@\u0002\u0002\u016d\u0176",
  1129. "\u0007?\u0002\u0002\u016e\u016f\u0007?\u0002\u0002\u016f\u0176\u0007",
  1130. "?\u0002\u0002\u0170\u0171\u0007>\u0002\u0002\u0171\u0176\u0007?\u0002",
  1131. "\u0002\u0172\u0176\t\u0004\u0002\u0002\u0173\u0174\u0007#\u0002\u0002",
  1132. "\u0174\u0176\u0007?\u0002\u0002\u0175\u016c\u0003\u0002\u0002\u0002",
  1133. "\u0175\u016e\u0003\u0002\u0002\u0002\u0175\u0170\u0003\u0002\u0002\u0002",
  1134. "\u0175\u0172\u0003\u0002\u0002\u0002\u0175\u0173\u0003\u0002\u0002\u0002",
  1135. "\u0176Z\u0003\u0002\u0002\u0002\u0177\u0178\u0007<\u0002\u0002\u0178",
  1136. "\\\u0003\u0002\u0002\u0002\u0179\u017a\u00059\u001d\u0002\u017a^\u0003",
  1137. "\u0002\u0002\u0002\u017b\u017f\t\u0005\u0002\u0002\u017c\u017e\t\u0006",
  1138. "\u0002\u0002\u017d\u017c\u0003\u0002\u0002\u0002\u017e\u0181\u0003\u0002",
  1139. "\u0002\u0002\u017f\u017d\u0003\u0002\u0002\u0002\u017f\u0180\u0003\u0002",
  1140. "\u0002\u0002\u0180`\u0003\u0002\u0002\u0002\u0181\u017f\u0003\u0002",
  1141. "\u0002\u0002\u0182\u0183\u0005_0\u0002\u0183\u0184\u00070\u0002\u0002",
  1142. "\u0184\u0185\u0005_0\u0002\u0185b\u0003\u0002\u0002\u0002\u0186\u0188",
  1143. "\t\u0007\u0002\u0002\u0187\u0186\u0003\u0002\u0002\u0002\u0188\u0189",
  1144. "\u0003\u0002\u0002\u0002\u0189\u0187\u0003\u0002\u0002\u0002\u0189\u018a",
  1145. "\u0003\u0002\u0002\u0002\u018a\u01a2\u0003\u0002\u0002\u0002\u018b\u018c",
  1146. "\u00072\u0002\u0002\u018c\u0190\u0007z\u0002\u0002\u018d\u018e\u0007",
  1147. "2\u0002\u0002\u018e\u0190\u0007Z\u0002\u0002\u018f\u018b\u0003\u0002",
  1148. "\u0002\u0002\u018f\u018d\u0003\u0002\u0002\u0002\u0190\u0192\u0003\u0002",
  1149. "\u0002\u0002\u0191\u0193\u0005u;\u0002\u0192\u0191\u0003\u0002\u0002",
  1150. "\u0002\u0193\u0194\u0003\u0002\u0002\u0002\u0194\u0192\u0003\u0002\u0002",
  1151. "\u0002\u0194\u0195\u0003\u0002\u0002\u0002\u0195\u01a2\u0003\u0002\u0002",
  1152. "\u0002\u0196\u0197\u00072\u0002\u0002\u0197\u019b\u0007d\u0002\u0002",
  1153. "\u0198\u0199\u00072\u0002\u0002\u0199\u019b\u0007D\u0002\u0002\u019a",
  1154. "\u0196\u0003\u0002\u0002\u0002\u019a\u0198\u0003\u0002\u0002\u0002\u019b",
  1155. "\u019d\u0003\u0002\u0002\u0002\u019c\u019e\t\b\u0002\u0002\u019d\u019c",
  1156. "\u0003\u0002\u0002\u0002\u019e\u019f\u0003\u0002\u0002\u0002\u019f\u019d",
  1157. "\u0003\u0002\u0002\u0002\u019f\u01a0\u0003\u0002\u0002\u0002\u01a0\u01a2",
  1158. "\u0003\u0002\u0002\u0002\u01a1\u0187\u0003\u0002\u0002\u0002\u01a1\u018f",
  1159. "\u0003\u0002\u0002\u0002\u01a1\u019a\u0003\u0002\u0002\u0002\u01a2d",
  1160. "\u0003\u0002\u0002\u0002\u01a3\u01a5\t\u0007\u0002\u0002\u01a4\u01a3",
  1161. "\u0003\u0002\u0002\u0002\u01a5\u01a6\u0003\u0002\u0002\u0002\u01a6\u01a4",
  1162. "\u0003\u0002\u0002\u0002\u01a6\u01a7\u0003\u0002\u0002\u0002\u01a7\u01a8",
  1163. "\u0003\u0002\u0002\u0002\u01a8\u01aa\u00070\u0002\u0002\u01a9\u01ab",
  1164. "\t\u0007\u0002\u0002\u01aa\u01a9\u0003\u0002\u0002\u0002\u01ab\u01ac",
  1165. "\u0003\u0002\u0002\u0002\u01ac\u01aa\u0003\u0002\u0002\u0002\u01ac\u01ad",
  1166. "\u0003\u0002\u0002\u0002\u01ad\u01bc\u0003\u0002\u0002\u0002\u01ae\u01b0",
  1167. "\t\u0007\u0002\u0002\u01af\u01ae\u0003\u0002\u0002\u0002\u01b0\u01b1",
  1168. "\u0003\u0002\u0002\u0002\u01b1\u01af\u0003\u0002\u0002\u0002\u01b1\u01b2",
  1169. "\u0003\u0002\u0002\u0002\u01b2\u01b3\u0003\u0002\u0002\u0002\u01b3\u01b7",
  1170. "\u00070\u0002\u0002\u01b4\u01b6\t\u0007\u0002\u0002\u01b5\u01b4\u0003",
  1171. "\u0002\u0002\u0002\u01b6\u01b9\u0003\u0002\u0002\u0002\u01b7\u01b5\u0003",
  1172. "\u0002\u0002\u0002\u01b7\u01b8\u0003\u0002\u0002\u0002\u01b8\u01ba\u0003",
  1173. "\u0002\u0002\u0002\u01b9\u01b7\u0003\u0002\u0002\u0002\u01ba\u01bc\u0005",
  1174. "g4\u0002\u01bb\u01a4\u0003\u0002\u0002\u0002\u01bb\u01af\u0003\u0002",
  1175. "\u0002\u0002\u01bcf\u0003\u0002\u0002\u0002\u01bd\u01bf\t\t\u0002\u0002",
  1176. "\u01be\u01c0\t\u0002\u0002\u0002\u01bf\u01be\u0003\u0002\u0002\u0002",
  1177. "\u01bf\u01c0\u0003\u0002\u0002\u0002\u01c0\u01c2\u0003\u0002\u0002\u0002",
  1178. "\u01c1\u01c3\t\u0007\u0002\u0002\u01c2\u01c1\u0003\u0002\u0002\u0002",
  1179. "\u01c3\u01c4\u0003\u0002\u0002\u0002\u01c4\u01c2\u0003\u0002\u0002\u0002",
  1180. "\u01c4\u01c5\u0003\u0002\u0002\u0002\u01c5h\u0003\u0002\u0002\u0002",
  1181. "\u01c6\u01ca\u0007$\u0002\u0002\u01c7\u01c9\u0005k6\u0002\u01c8\u01c7",
  1182. "\u0003\u0002\u0002\u0002\u01c9\u01cc\u0003\u0002\u0002\u0002\u01ca\u01c8",
  1183. "\u0003\u0002\u0002\u0002\u01ca\u01cb\u0003\u0002\u0002\u0002\u01cb\u01cd",
  1184. "\u0003\u0002\u0002\u0002\u01cc\u01ca\u0003\u0002\u0002\u0002\u01cd\u01ce",
  1185. "\u0007$\u0002\u0002\u01cej\u0003\u0002\u0002\u0002\u01cf\u01d2\n\n\u0002",
  1186. "\u0002\u01d0\u01d2\u0005y=\u0002\u01d1\u01cf\u0003\u0002\u0002\u0002",
  1187. "\u01d1\u01d0\u0003\u0002\u0002\u0002\u01d2l\u0003\u0002\u0002\u0002",
  1188. "\u01d3\u01d6\u0007)\u0002\u0002\u01d4\u01d7\u0005y=\u0002\u01d5\u01d7",
  1189. "\n\u000b\u0002\u0002\u01d6\u01d4\u0003\u0002\u0002\u0002\u01d6\u01d5",
  1190. "\u0003\u0002\u0002\u0002\u01d7\u01d8\u0003\u0002\u0002\u0002\u01d8\u01d9",
  1191. "\u0007)\u0002\u0002\u01d9n\u0003\u0002\u0002\u0002\u01da\u01db\t\f\u0002",
  1192. "\u0002\u01db\u01dc\u0003\u0002\u0002\u0002\u01dc\u01dd\b8\u0002\u0002",
  1193. "\u01ddp\u0003\u0002\u0002\u0002\u01de\u01df\u0007=\u0002\u0002\u01df",
  1194. "r\u0003\u0002\u0002\u0002\u01e0\u01e2\t\r\u0002\u0002\u01e1\u01e0\u0003",
  1195. "\u0002\u0002\u0002\u01e2\u01e3\u0003\u0002\u0002\u0002\u01e3\u01e1\u0003",
  1196. "\u0002\u0002\u0002\u01e3\u01e4\u0003\u0002\u0002\u0002\u01e4\u01e7\u0003",
  1197. "\u0002\u0002\u0002\u01e5\u01e7\u0005q9\u0002\u01e6\u01e1\u0003\u0002",
  1198. "\u0002\u0002\u01e6\u01e5\u0003\u0002\u0002\u0002\u01e7t\u0003\u0002",
  1199. "\u0002\u0002\u01e8\u01e9\t\u000e\u0002\u0002\u01e9v\u0003\u0002\u0002",
  1200. "\u0002\u01ea\u01eb\t\u000f\u0002\u0002\u01ebx\u0003\u0002\u0002\u0002",
  1201. "\u01ec\u01ed\u0007^\u0002\u0002\u01ed\u01f1\t\u0010\u0002\u0002\u01ee",
  1202. "\u01f1\u0005}?\u0002\u01ef\u01f1\u0005{>\u0002\u01f0\u01ec\u0003\u0002",
  1203. "\u0002\u0002\u01f0\u01ee\u0003\u0002\u0002\u0002\u01f0\u01ef\u0003\u0002",
  1204. "\u0002\u0002\u01f1z\u0003\u0002\u0002\u0002\u01f2\u01f3\u0007^\u0002",
  1205. "\u0002\u01f3\u01f4\t\u0011\u0002\u0002\u01f4\u01f5\u0005w<\u0002\u01f5",
  1206. "\u01f6\u0005w<\u0002\u01f6\u01fe\u0003\u0002\u0002\u0002\u01f7\u01f8",
  1207. "\u0007^\u0002\u0002\u01f8\u01f9\u0005w<\u0002\u01f9\u01fa\u0005w<\u0002",
  1208. "\u01fa\u01fe\u0003\u0002\u0002\u0002\u01fb\u01fc\u0007^\u0002\u0002",
  1209. "\u01fc\u01fe\u0005w<\u0002\u01fd\u01f2\u0003\u0002\u0002\u0002\u01fd",
  1210. "\u01f7\u0003\u0002\u0002\u0002\u01fd\u01fb\u0003\u0002\u0002\u0002\u01fe",
  1211. "|\u0003\u0002\u0002\u0002\u01ff\u0200\u0007^\u0002\u0002\u0200\u0201",
  1212. "\u0007w\u0002\u0002\u0201\u0202\u0005u;\u0002\u0202\u0203\u0005u;\u0002",
  1213. "\u0203\u0204\u0005u;\u0002\u0204\u0205\u0005u;\u0002\u0205~\u0003\u0002",
  1214. "\u0002\u0002\u0206\u0207\u00071\u0002\u0002\u0207\u0208\u00071\u0002",
  1215. "\u0002\u0208\u020c\u0003\u0002\u0002\u0002\u0209\u020b\n\r\u0002\u0002",
  1216. "\u020a\u0209\u0003\u0002\u0002\u0002\u020b\u020e\u0003\u0002\u0002\u0002",
  1217. "\u020c\u020a\u0003\u0002\u0002\u0002\u020c\u020d\u0003\u0002\u0002\u0002",
  1218. "\u020d\u0210\u0003\u0002\u0002\u0002\u020e\u020c\u0003\u0002\u0002\u0002",
  1219. "\u020f\u0211\u0007\u000f\u0002\u0002\u0210\u020f\u0003\u0002\u0002\u0002",
  1220. "\u0210\u0211\u0003\u0002\u0002\u0002\u0211\u0212\u0003\u0002\u0002\u0002",
  1221. "\u0212\u021f\u0007\f\u0002\u0002\u0213\u0214\u00071\u0002\u0002\u0214",
  1222. "\u0215\u0007,\u0002\u0002\u0215\u0219\u0003\u0002\u0002\u0002\u0216",
  1223. "\u0218\u000b\u0002\u0002\u0002\u0217\u0216\u0003\u0002\u0002\u0002\u0218",
  1224. "\u021b\u0003\u0002\u0002\u0002\u0219\u021a\u0003\u0002\u0002\u0002\u0219",
  1225. "\u0217\u0003\u0002\u0002\u0002\u021a\u021c\u0003\u0002\u0002\u0002\u021b",
  1226. "\u0219\u0003\u0002\u0002\u0002\u021c\u021d\u0007,\u0002\u0002\u021d",
  1227. "\u021f\u00071\u0002\u0002\u021e\u0206\u0003\u0002\u0002\u0002\u021e",
  1228. "\u0213\u0003\u0002\u0002\u0002\u021f\u0220\u0003\u0002\u0002\u0002\u0220",
  1229. "\u0221\b@\u0003\u0002\u0221\u0080\u0003\u0002\u0002\u0002\u001e\u0002",
  1230. "\u0162\u0175\u017f\u0189\u018f\u0194\u019a\u019f\u01a1\u01a6\u01ac\u01b1",
  1231. "\u01b7\u01bb\u01bf\u01c4\u01ca\u01d1\u01d6\u01e3\u01e6\u01f0\u01fd\u020c",
  1232. "\u0210\u0219\u021e\u0004\b\u0002\u0002\u0002\u0003\u0002"].join("");
  1233. var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
  1234. var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
  1235. function ivprog(input) {
  1236. antlr4.Lexer.call(this, input);
  1237. this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
  1238. return this;
  1239. }
  1240. ivprog.prototype = Object.create(antlr4.Lexer.prototype);
  1241. ivprog.prototype.constructor = ivprog;
  1242. ivprog.EOF = antlr4.Token.EOF;
  1243. ivprog.RK_PROGRAM = 1;
  1244. ivprog.RK_REAL = 2;
  1245. ivprog.RK_VOID = 3;
  1246. ivprog.RK_BOOLEAN = 4;
  1247. ivprog.RK_STRING = 5;
  1248. ivprog.RK_INTEGER = 6;
  1249. ivprog.RK_CHARACTER = 7;
  1250. ivprog.RK_SWITCH = 8;
  1251. ivprog.RK_CASE = 9;
  1252. ivprog.RK_DEFAULT = 10;
  1253. ivprog.RK_CONST = 11;
  1254. ivprog.RK_FUNCTION = 12;
  1255. ivprog.RK_RETURN = 13;
  1256. ivprog.RK_FOR = 14;
  1257. ivprog.RK_FOR_ALT = 15;
  1258. ivprog.RK_FOR_FROM = 16;
  1259. ivprog.RK_FOR_TO = 17;
  1260. ivprog.RK_FOR_PASS = 18;
  1261. ivprog.RK_BREAK = 19;
  1262. ivprog.RK_DO = 20;
  1263. ivprog.RK_DO_UNTIL = 21;
  1264. ivprog.RK_WHILE = 22;
  1265. ivprog.RK_WHILE_ALT = 23;
  1266. ivprog.RK_IF = 24;
  1267. ivprog.RK_ELSE = 25;
  1268. ivprog.RK_FALSE = 26;
  1269. ivprog.RK_TRUE = 27;
  1270. ivprog.RK_REFERENCE = 28;
  1271. ivprog.OPEN_PARENTHESIS = 29;
  1272. ivprog.CLOSE_PARENTHESIS = 30;
  1273. ivprog.OPEN_BRACE = 31;
  1274. ivprog.CLOSE_BRACE = 32;
  1275. ivprog.OPEN_CURLY = 33;
  1276. ivprog.CLOSE_CURLY = 34;
  1277. ivprog.COMMA = 35;
  1278. ivprog.EQUAL = 36;
  1279. ivprog.SUM_OP = 37;
  1280. ivprog.MULTI_OP = 38;
  1281. ivprog.AND_OPERATOR = 39;
  1282. ivprog.OR_OPERATOR = 40;
  1283. ivprog.RELATIONAL_OPERATOR = 41;
  1284. ivprog.COLON = 42;
  1285. ivprog.NOT_OPERATOR = 43;
  1286. ivprog.ID = 44;
  1287. ivprog.LIB_ID = 45;
  1288. ivprog.INTEGER = 46;
  1289. ivprog.REAL = 47;
  1290. ivprog.STRING = 48;
  1291. ivprog.CHARACTER = 49;
  1292. ivprog.WHITESPACE = 50;
  1293. ivprog.EOS = 51;
  1294. ivprog.COMMENTS = 52;
  1295. ivprog.prototype.channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
  1296. ivprog.prototype.modeNames = [ "DEFAULT_MODE" ];
  1297. ivprog.prototype.literalNames = [ null, "'programa'", "'real'", "'vazio'",
  1298. "'logico'", "'cadeia'", "'inteiro'", "'caractere'",
  1299. "'escolha'", "'caso'", "'contrario'",
  1300. "'const'", "'funcao'", "'devolva'", "'para'",
  1301. "'repita_para'", "'de'", "'ate'", "'passo'",
  1302. "'pare'", "'repita'", "'ate_que'", "'enquanto'",
  1303. "'repita_enquanto'", "'se'", "'senao'",
  1304. "'falso'", "'verdadeiro'", "'&'", "'('",
  1305. "')'", "'['", "']'", "'{'", "'}'", "','",
  1306. null, null, null, null, null, null, "':'" ];
  1307. ivprog.prototype.symbolicNames = [ null, "RK_PROGRAM", "RK_REAL", "RK_VOID",
  1308. "RK_BOOLEAN", "RK_STRING", "RK_INTEGER",
  1309. "RK_CHARACTER", "RK_SWITCH", "RK_CASE",
  1310. "RK_DEFAULT", "RK_CONST", "RK_FUNCTION",
  1311. "RK_RETURN", "RK_FOR", "RK_FOR_ALT",
  1312. "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
  1313. "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
  1314. "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
  1315. "RK_TRUE", "RK_REFERENCE", "OPEN_PARENTHESIS",
  1316. "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
  1317. "OPEN_CURLY", "CLOSE_CURLY", "COMMA",
  1318. "EQUAL", "SUM_OP", "MULTI_OP", "AND_OPERATOR",
  1319. "OR_OPERATOR", "RELATIONAL_OPERATOR",
  1320. "COLON", "NOT_OPERATOR", "ID", "LIB_ID",
  1321. "INTEGER", "REAL", "STRING", "CHARACTER",
  1322. "WHITESPACE", "EOS", "COMMENTS" ];
  1323. ivprog.prototype.ruleNames = [ "RK_PROGRAM", "RK_REAL", "RK_VOID", "RK_BOOLEAN",
  1324. "RK_STRING", "RK_INTEGER", "RK_CHARACTER",
  1325. "RK_SWITCH", "RK_CASE", "RK_DEFAULT", "RK_CONST",
  1326. "RK_FUNCTION", "RK_RETURN", "RK_FOR", "RK_FOR_ALT",
  1327. "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
  1328. "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
  1329. "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
  1330. "RK_TRUE", "RK_LOGICAL_NOT", "RK_LOGICAL_AND",
  1331. "RK_LOGICAL_OR", "RK_REFERENCE", "OPEN_PARENTHESIS",
  1332. "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
  1333. "OPEN_CURLY", "CLOSE_CURLY", "COMMA", "EQUAL",
  1334. "SUM_OP", "MULTI_OP", "AND_OPERATOR", "OR_OPERATOR",
  1335. "RELATIONAL_OPERATOR", "COLON", "NOT_OPERATOR",
  1336. "ID", "LIB_ID", "INTEGER", "REAL", "ExponentPart",
  1337. "STRING", "STRING_CHARACTER", "CHARACTER",
  1338. "WHITESPACE", "SEMICOLON", "EOS", "HEX_DIGIT",
  1339. "OCTAL_DIGIT", "ESC_SEQ", "ESC_OCTAL", "ESC_UNICODE",
  1340. "COMMENTS" ];
  1341. ivprog.prototype.grammarFileName = "ivprog.g4";
  1342. exports.ivprog = ivprog;
  1343. /***/ }),
  1344. /* 1 */
  1345. /***/ (function(module, exports, __webpack_require__) {
  1346. module.exports = {
  1347. ivprog: __webpack_require__(0).ivprog
  1348. };
  1349. /***/ }),
  1350. /* 2 */
  1351. /***/ (function(module, exports) {
  1352. module.exports = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
  1353. /***/ })
  1354. /******/ ]);
  1355. /***/ }),
  1356. /***/ "./grammar/pt/langFunctions.js":
  1357. /*!*************************************!*\
  1358. !*** ./grammar/pt/langFunctions.js ***!
  1359. \*************************************/
  1360. /*! exports provided: default */
  1361. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1362. "use strict";
  1363. __webpack_require__.r(__webpack_exports__);
  1364. /* This is a dictionary of the language defined functions
  1365. **/
  1366. /* harmony default export */ __webpack_exports__["default"] = ({
  1367. main_function: "inicio",
  1368. $read: "leia",
  1369. $write: "escreva",
  1370. $numElements: "total_de_elementos",
  1371. $matrixLines: "total_de_linhas",
  1372. $matrixColumns: "total_de_colunas",
  1373. $substring: "subcadeia",
  1374. $length: "comprimento",
  1375. $uppercase: "caixa_alta",
  1376. $lowercase: "caixa_baixa",
  1377. $charAt: "caractere_na_posicao",
  1378. $isReal: "e_real",
  1379. $isInt: "e_inteiro",
  1380. $isBool: "e_logico",
  1381. $castReal: "como_real",
  1382. $castInt: "como_inteiro",
  1383. $castBool: "como_logico",
  1384. $castString: "como_cadeia",
  1385. $castChar: "como_caractere",
  1386. $sin: "seno",
  1387. $cos: "cosseno",
  1388. $tan: "tangente",
  1389. $sqrt: "raiz_quadrada",
  1390. $pow: "potencia",
  1391. $log: "logaritmo",
  1392. $abs: "modulo",
  1393. $negate: "trocar_sinal",
  1394. $invert: "inverter_valor",
  1395. $max: "maximo",
  1396. $min: "minimo",
  1397. $rand: "numero_aleatorio"
  1398. });
  1399. /***/ }),
  1400. /***/ "./grammar/pt/langLibs.js":
  1401. /*!********************************!*\
  1402. !*** ./grammar/pt/langLibs.js ***!
  1403. \********************************/
  1404. /*! exports provided: default */
  1405. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1406. "use strict";
  1407. __webpack_require__.r(__webpack_exports__);
  1408. /**
  1409. * This is the dictionary of the language defined libraries
  1410. */
  1411. /* harmony default export */ __webpack_exports__["default"] = ({
  1412. $mathLib: "Matematica",
  1413. $ioLib: "ES",
  1414. $strLib: "Texto",
  1415. $arrayLib: "Arranjo",
  1416. $langLib: "Conversao"
  1417. });
  1418. /***/ }),
  1419. /***/ "./i18n/error.csv":
  1420. /*!************************!*\
  1421. !*** ./i18n/error.csv ***!
  1422. \************************/
  1423. /*! no static exports found */
  1424. /***/ (function(module, exports) {
  1425. module.exports = {"pt":{"token_missing_one":"Erro de sintaxe: Espera-se $0, mas encontrou-se $1 na linha:$2, coluna:$3","token_missing_two":"Erro de sintaxe: Esperava-se $0 ou $1 mas encontrou-se $2 na liha:$3, coluna: $4","eos_missing":"Falta uma nova linha ou ; na linha: $0, coluna: $1","invalid_type":"$0 na linha: $1, coluna: $2 é um tipo inválido. Os tipos válidos são: $3","invalid_array_dimension":"A dimensão inválida na linha: $0, coluna: $1. Insira um $2 ou identificador válido do mesmo tipo.","invalid_array_size":"O tamnho do vetor/matriz excede o máximo de 2 na linha $0","extra_lines":"Nenhum texto é permitido após '}' em 'programa {...}'","invalid_main_return":"A função $0 declarada na linha $2 deve retornar $1.","invalid_var_declaration":"Erro na linha $0: variáveis só podem ser declaradas no corpo principal da função e nas primeiras linhas, antes de qualquer comando.","invalid_break_command":"Erro na linha $0. O comando $1 não pode ser usado fora de uma estrutura de repetição ou 'escolha...caso'","invalid_terminal":"Não é possível utilizar $0 na expressão da linha: $1, coluna: $2. Tente um valor númerico, variável ou chamada de função.","const_not_init":"Erro na linha: $0, coluna: $1. Uma variável declarada como const deve ser inicializada","id_missing":"Esperava-se um identificador, mas encontrou-se $0 na linha: $1, coluna: $2","invalid_id_format":"$0 na linha: $1, coluna: $2 não é um identificador válido. O símbolo '.' não é permitido neste contexto.","main_missing":"A função principal não foi encontrada","invalid_global_var":"Erro crítico: Chamada inválida da função initGlobal fora do contexto BASE","not_implemented":"Erro interno crítico: A função definida pelo sistema $0 não foi implementada.","function_missing":"A função $0 não foi encontrada","function_missing_full":"A função $0 na linha: $1, coluna: $2 não foi encontrada","invalid_parameters_size_full":"Erro na linha $0: a quantidade de parâmetros fornecidos à função $1 está incorreta. Esperava-se $2, encontrou-se $3.","invalid_parameters_size":"A quantidade de parâmetros fornecidos à função $0 está incorreta. Esperava-se $1, encontrou-se $2","invalid_ref_full":"A expressão $0 fornecida como parâmetro para a função $1 na linha $2 não é válida para esta função. Use uma variável ou posição de vetor.","invalid_ref":"A expressão $0 fornecida como parâmetro para a função $1 não é válida para esta função. Use uma variável ou posição de vetor.","invalid_parameter_type_full":"A expressão $0 fornecida como parâmetro para a função $1 na linha $2 não é compatível com o tipo esperado.","invalid_parameter_type":"A expressão $0 fornecida como parâmetro para a função $1 não é compatível com o tipo esperado.","unknown_command_full":"Erro interno crítico: comando desconhecido encontrado na linha $0","unknown_command":"Erro interno crítico: comando desconhecido encontrado!","loop_condition_type_full":"Erro na linha: $0, coluna $1: a condição $2 do laço de repetição deve ser do tipo lógico","loop_condition_type":"A condição $0 do laço de repetição deve ser do tipo lógico","endless_loop_full":"Possível laço infinito detectado no seu código. Verifique a linha $0","endless_loop":"Possível laço infinito detectado no seu código.","for_condition_type_full":"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico","for_condition_type":"A condição de parada $0 do comando para(...) deve ser do tipo lógico","if_condition_type_full":"Erro na linha: $0, coluna $1: a condição $2 do comando se...senao deve ser do tipo lógico","if_condition_type":"A condição $0 do comando se...senao deve ser do tipo lógico","invalid_return_type_full":"Erro na linha $0: a expressão não produz um tipo compatível com a função $1. Tipo esperado: $2.","invalid_return_type":"A expressão não produz um tipo compatível com a função $0. Tipo esperado: $1.","invalid_void_return_full":"Erro na linha $0: a função $1 não pode retornar uma expressão vazia, use uma espressão do tipo $2","invalid_void_return":"A função $0 não pode retornar uma expressão vazia, use uma espressão do tipo $1","unexpected_break_command_full":"Erro interno crítico: comando pare encontrado fora do contexto de um laço/escolha..caso na linha $0","unexpected_break_command":"Erro interno crítico: comando pare encontrado fora do contexto de um laço/escolha..caso","invalid_dimension":"As dimensões de um vetor/matriz devem ser do tipo inteiro","void_in_expression_full":"Erro na linha: $0, coluna: $1: a função $2 não pode ser utilizada em uma expressão pois seu tipo de retorno é vazio","void_in_expression":"A função $0 não pode ser utilizada em uma expressão pois seu tipo de retorno é vazio","invalid_array_access_full":"Identificador $0 na linha: $1, coluna: $2 não se refere a um vetor/matriz válido","invalid_array_access":"Identificador $0 não se refere a um vetor/matriz válido","invalid_matrix_access_full":"Identificador $0 na linha: $1, coluna: $2 não se refere a uma matriz válida","invalid_matrix_access":"Identificador $0 não se refere a uma matriz válida","matrix_column_outbounds_full":"Erro na linha $0: número de colunas $1 é inválido para a matriz $2 que possui $3 colunas","matrix_column_outbounds":"Número de colunas $0 é inválido para a matriz $1 que possui $2 colunas","matrix_line_outbounds_full":"Erro na linha $0: número de linhas $1 é inválido para a matriz $2 que possui $3 linhas","matrix_line_outbounds":"Número de linhas $0 é inválido para a matriz $1 que possui $2 linhas","vector_line_outbounds_full":"Erro na linha $0: O número de elementos $1 é inválido para a vetor $2 que possui $3 elementos.","vector_line_outbounds":"O número de elementos $1 é inválido para a vetor $2 que possui $3 elementos.","vector_not_matrix_full":"Erro na linha $0: $1 não é uma matriz","vector_not_matrix":"$0 não é uma matriz","invalid_infix_op_full":"Erro na linha $0: a expressão $1 é inválida, pois o operador $2 não pode ser aplicado aos tipos $3 e $4","invalid_infix_op":"A expressão $0 é inválida, pois o operador $1 não pode ser aplicado aos tipos $2 e $3","invalid_unary_op_full":"Erro na linha $0: a expressão $1 é inválida, pois o operador $2 não pode ser aplicado ao tipo $3","invalid_unary_op":"A expressão $0 é inválida, pois o operador $1 não pode ser aplicado ao tipo $2","unknown_op":"Erro interno crítico: Operação $0 desconhecida","duplicate_function":"A função $0 na linha: $1, coluna: $2 já foi definida anteriormente.","duplicate_variable":"A variável $0 na linha: $1, coluna: $2 já foi declarada anteriormente.","main_parameters":"A função inicio não pode ter parâmetros.","symbol_not_found_full":"A variável $0 na linha: $1, coluna: $2 não foi declarada","symbol_not_found":"A variável $0 não foi declarada","array_dimension_not_int_full":"As dimensões do arranjo (vetor ou matriz) na linha $0 devem ser do tipo inteiro.","array_dimension_not_int":"As dimensões de um arranjo (vetor ou matriz) devem ser do tipo inteiro.","array_dimension_not_positive_full":"As dimensões do arranjo (vetor ou matriz) na linha $0 devem ser valores positivos.","array_dimension_not_positive":"As dimensões de um arranjo (vetor ou matriz) devem ser valores positivos.","incompatible_types_full":"Era esperado um $0 mas a expressão $1 na linha $2 resulta em $3.","incompatible_types":"Era esperado um $0 mas a expressão $1 resulta em $2.","incompatible_types_array_full":"A expressão $0 na linha $2 é incompatível com o tipo $1.","incompatible_types_array":"A expressão $0 é incompatível com o tipo $1.","invalid_case_type_full":"O caso $0 na linha $1 é incompatível com o tipo $2.","invalid_case_type":"O caso $0 é incompatível com o tipo $1.","function_no_return":"A função $0 não possui um comando de devolução acessível. Toda função deve ter ao menos um comando 'devolva' no seu corpo principal.","invalid_array_literal_type_full":"Erro na linha $0: a expressão $1 não resulta em um tipo compatível.","invalid_array_literal_type":"A expressão $0 não resulta em um tipo compatível.","invalid_array_literal_line_full":"Erro na linha $0: esperava-se $1 linhas mas encontrou $2.","invalid_array_literal_line":"Esperava-se $0 linhas mas encontrou $1.","invalid_array_literal_column_full":"Erro na linha $0: esperava-se $1 colunas mas encontrou $2.","invalid_array_literal_column":"Esperava-se $0 colunas mas encontrou $1.","exceeded_input_request":"A quantidade de leituras requisitadas execedeu a quantidade de entradas disponíveis.","test_case_few_reads":"Caso de teste $0 falhou: ainda restam entradas!","test_case_failed":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"> <span>Caso de teste $0 não executou com sucesso.</span></div>","test_case_failed_exception":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$2\"> <span>Caso de teste $0 falhou</span>: $1","test_case_exception":"Ocorreu uma exceção no caso de teste $0: $1","invalid_type_conversion":"O valor $0 não pode ser convertido para o tipo $1","invalid_read_type":"Erro na linha $0: A entrada \"$1\" não é do tipo $2, que é o tipo da variável <span class='ivprog-error-varname'>$3</span>.","invalid_read_type_array":"Erro na linha $0: A entrada \"$1\" não é do tipo $2, que é o tipo aceito pela variável <span class='ivprog-error-varname'>$3</span> que é um $4.","inform_valid_identifier":"Informe um nome válido! O nome não pode ser uma palavra reservadas e deve começar com letras ou _ e conter apenas letras, números e _.","inform_valid_global_duplicated":"Já existe uma variável global com o nome <span class='ivprog-error-varname'>$0</span>, você precisa de nomes distintos.","inform_valid_variable_duplicated":"Já existe uma variável com o nome <span class='ivprog-error-varname'>$0</span> na função <span class='ivprog-error-varname'>$1</span>, você precisa de nomes distintos.","inform_valid_function_duplicated":"Já existe uma função com o nome <span class='ivprog-error-varname'>$0</span>, você precisa de nomes distintos.","inform_valid_param_duplicated":"Já existe um parâmetro com o nome <span class='ivprog-error-varname'>$0</span> na função <span class='ivprog-error-varname'>$1</span>, você precisa de nomes distintos.","invalid_character":"O caractere $0 na linha $1 não pode ser utilizado neste contexto.","annonymous_array_literal":"Erro na linha $0: a notação de vetor/matriz só permitida durante a inicialização de uma variável desse tipo. Ex: inteiro vec[3] ← {1,2,3}.","invalid_matrix_literal_line":"A expressão $0 na linha $1 não possui um número de elementos igual a linha anterior. Todas as linhas de uma matriz devem ter a mesma quantidade de elementos.","cannot_infer_matrix_line":"Não é possível inferir o número de linhas da matriz $0 na linha $1. É necessário que ela seja inicializada ou que o valor seja informado de forma explícita.","cannot_infer_matrix_column":"Não é possível inferir o número de colunas da matriz $0 na linha $1. É necessário que ela seja inicializada ou que o valor seja informado de forma explícita.","cannot_infer_vector_size":"Não é possível inferir o número de elementos do vetor $0 na linha $1. É necessário que ele seja inicializado ou que o valor seja informado de forma explícita","matrix_to_vector_literal_attr":"Erro na linha $0: A expressão $1 representa uma matriz e não pode ser atribuída ao vetor $2.","vector_to_matrix_literal_attr":"Erro na linha $0: A expressão $1 representa um vetor e não pode ser atribuído a matriz $2.","invalid_const_ref_full":"A variável $0 fornecida como parâmetro para a função $1 na linha $2 é uma constante e não pode ser usada neste contexto. Use uma variável ou posição de vetor.","invalid_const_ref":"A variável $0 fornecida como parâmetro para a função $1 é uma constante e não pode ser usada neste contexto. Use uma variável ou posição de vetor.","invalid_const_assignment_full":"Erro na linha $0: $1 é uma constante e portanto não pode ter seu valor alterado","invalid_const_assignment":"$0 é uma constante e portanto não pode ter seu valor alterado","array_init_not_literal":"Erro na linha $0: Vetor/Matriz só pode ser inicializado por literal. Ex: real vetor[] <- {1,2,3}","array_exceeds_2d":"Erro na linha $0: O número máximo de dimensões que um arranjo pode ter é 2. Elemento de 3 ou mais dimensões encontrado!","invalid_matrix_id_dimension":"Erro na linha $0: Você deve definir todas as dimensões da matriz quando uma delas é definida por uma variável! Ex: real mat1[var][5], mat2[5][var]","invalid_vector_init":"Erro na linha $0: Não se pode inicializar um vetor que teve seu tamanho declarado utilizando uma variável! Utilize uma atribuição de vetores ou use um laço de repetição.","invalid_matrix_init":"Erro na linha $0: Não se pode inicializar uma matrix que teve ao menos uma das suas dimensões declaradas utilizando uma variável! Utilize uma atribuição de matrizes ou use um laço de repetição.","invalid_vector_assignment_full":"Erro na linha $0: Só se pode atribuir um vetor a outro desde que eles comportem o mesmo número de elementos. $1 comporta $2 e $3 comporta $4!","invalid_vector_assignment":"Só se pode atribuir um vetor a outro desde que eles comportem o mesmo número de elementos. $0 comporta $1 e $2 comporta $3!","invalid_matrix_assignment_full":"Erro na linha $0: Só se pode atribuir uma matriz a outra desde que ambas possuam dimensões de mesmo tamanho. $1 tem $2 linhas e $3 colunas, enquanto $4 possui $5 linhas e $6 colunas!","invalid_matrix_assignment":"Só se pode atribuir uma matriz a outra desde que ambas possuam dimensões de mesmo tamanho. $0 tem $1 linhas e $2 colunas, enquanto $3 possui $4 linhas e $5 colunas!","matrix_to_vector_attr":"Erro na linha $0: $1 representa uma matriz e não pode ser atribuída ao vetor $2.","vector_to_matrix_attr":"Erro na linha $0: $1 representa um vetor e não pode ser atribuído a matriz $2.","invalid_matrix_index_assign_full":"Erro na linha $0: A posição $1 da matriz $2 aceita apenas vetores de tamanho $3, mas $4 tem tamanho $5","invalid_matrix_index_assign":"A linha $0 da matriz $1 aceita apenas vetores de tamanho $2, mas $3 tem tamanho $4","invalid_number_elements_vector":"Esperava-se por $0 elementos na linha $1 mas a expressão $2 possui $3 elementos.","invalid_number_lines_matrix":"Esperava-se por uma matriz com $0 linhas na linha $1 mas a expressão $2 possui $3 linhas","divsion_by_zero_full":"Erro na linha $0: A expressão $1 resulta em uma divisão por 0.","divsion_by_zero":"A expressão $0 resulta em uma divisão por 0.","undefined_tanget_value":"Erro na linha $0: A tangente de $1° não é indefinida.","negative_log_value":"Erro na linha $0: Não se pode calcular o log de um valor negativo.","invalid_string_index":"Erro na linha $0 durante a execução da função $1: $2 é um índice inválido para a cadeia de texto $3. Os valores válidos vão de 0 à $4","negative_sqrt_value":"Erro na linha $0: Não é permitido calcular a raiz quadrada de um número negativo.","exceeded_recursive_calls":"Erro na execução da linha $0: Número de chamadas recursivas execedeu o limite máximo definido!","invalid_for_variable":"Erro na linha $0: A variavel $1 utilizada no comando repita_para deve ser do tipo inteiro.","invalid_for_from":"Erro na linha $0: O valor $1 passado para o parâmetro 'de' do comando repita_para deve ser do tipo inteiro.","invalid_for_to":"Erro na linha $0: O valor $1 passado para o parâmetro 'para' do comando repita_para deve ser do tipo inteiro.","invalid_for_pass":"Erro na linha $0: O valor $1 passado para o parâmetro 'passo' do comando repita_para deve ser do tipo inteiro.","exceed_max_instructions":"Número de instruções excedeu o limite definido. Certifique-se que seu código não possui laços infinitos ou muitas chamadas de funções recursivas."},"en":{"token_missing_one":"Syntax error: Expected $0 but found $1 at line:$2, column:$3","token_missing_two":"Syntax error: Expected $0 or $1 but found $2 at line:$3, column: $4","eos_missing":"A new line or a ‘;’ is missing at line: $0, column: $1","invalid_type":"$0 at line: $1, column: $2 is a invalid type. The valid types are: $3","invalid_array_dimension":"Invalid dimension at line: $0, column: $1. Insert a $2 or a valid identifier of the same type.","invalid_array_size":"The array at line $0 exceeds the maximum size of 2.","extra_lines":"No text is allowed after '}' in 'program { … }'","invalid_main_return":"The function $0 declared at line $2 must return $1.","invalid_var_declaration":"Error at line $0: Variables can only be declared in the main body of a function and at the first lines, before any command.","invalid_break_command":"Error at line $0. The command $1 cannot be used outside a loop command or ‘switch ...case’ structure.","invalid_terminal":"It is not possible to use $0 in the expression at line: $1, column: $2. Try a numeric value, variable or function call.","const_not_init":"Error at line: $0, column: $1. A variable declared as const must be initialized.","id_missing":"Expected an identifier but found $0 at line: $1, column: $2.","invalid_id_format":"$0 at line: $1, column: $2 is not a valid identifier. The symbol '.' is not permitted in this context.","main_missing":"The main function was not found. You need to declare a function of return type void named main.","invalid_global_var":"Critical Error: Invalid call of the function IVProgProcessor.initGlobal outside the BASE context.","not_implemented":"Critial internal error: The system defined function $0 was not found.","function_missing":"The function $0 was not found.","function_missing_full":"The function $0 at line: $1, column: $2 was not found.","invalid_parameters_size_full":"Error at line $0: The number of parameters provided to the function $1 is incorrect. It expected $2 but found $3.","invalid_parameters_size":"The number of parameters provided to the function $0 is incorrect. It expected $1 but found $2.","invalid_ref_full":"The expression $0 provided as a parameter to the function $1 at line $2 is not valid in this context. Use a variable or a position of a vector.","invalid_ref":"The expression $0 provided as a parameter to the function $1 is not valid in this context. Use a variable or a position of a vector.","invalid_parameter_type_full":"The expression $0 provided as a parameter to the function $1 at line $2 is not of the expected type.","invalid_parameter_type":"The expression $0 provided as a parameter to the function $1 is not of the expected type.","unknown_command_full":"Internal error: an unknown command found at line $0.","unknown_command":"Internal error: an unknown command found.","loop_condition_type_full":"Error at line: $0, column $1: the condition $2 of the loop must be of type bool (true or false).","loop_condition_type":"The condition $0 of the loop must be of type bool (true or false).","endless_loop_full":"Possible infinite loop detected in your code. Check line $0.","endless_loop":"Possible infinite loop detected in your code.","for_condition_type_full":"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico","for_condition_type":"A condição de parada $0 do comando para(...) deve ser do tipo lógico","if_condition_type_full":"Error at line: $0, column $1: the condition $2 in the if … else command must result in a bool (true or false).","if_condition_type":"The condition $0 in the if … else command must result in a bool (true or false).","invalid_return_type_full":"Error at line $0: The expression doest not result in a type compatible with the function $1. Expected type: $2.","invalid_return_type":"The expression doest not result in a type compatible with the function $0. Expected type: $1.","invalid_void_return_full":"Error at line $0: The function $1 cannot return an empty expression, use an expression that results in a $2","invalid_void_return":"The function $0 cannot return an empty expression, use an expression that results in a $1","unexpected_break_command_full":"Critical error at line $0: a break command was found outside a valid context: loop or switch … case structure.","unexpected_break_command":"Critical error: a break command was found outside a valid context: loop or switch … case structure.","invalid_dimension":"Array (vector or matrix) dimensions must be of type int.","void_in_expression_full":"Error at line: $0, column: $1: The function $2 cannot be used inside an expression since its return type is void.","void_in_expression":"The function $0 cannot be used inside an expression since its return type is void.","invalid_array_access_full":"Identifier $0 at line: $1, column: $2 does not identify a valid vector or matrix.","invalid_array_access":"Identifier $0 does not identify a valid vector or matrix.","invalid_matrix_access_full":"Identifier $0 at line: $1, column: $2 does not identify a valid matrix.","invalid_matrix_access":"Identifier $0 does not identify a valid matrix.","matrix_column_outbounds_full":"Error at line $0: The number of columns $1 is invalid for the matrix $2 which has $3 columns.","matrix_column_outbounds":"The number of columns $0 is invalid for the matrix $1 which has $2 columns.","matrix_line_outbounds_full":"Error at line $0: The number of lines $1 is invalid for matrix $2 which has $3 lines.","matrix_line_outbounds":"The number of lines $0 is invalid for matrix $1 which has $2 lines.","vector_line_outbounds_full":"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.","vector_line_outbounds":"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.","vector_not_matrix_full":"Error at line $0: $1 is not a matrix.","vector_not_matrix":"$0 is not a matrix.","invalid_infix_op_full":"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the types $3 and $4.","invalid_infix_op":"The expression $0 is not valid because the operator $1 cannot be applied to the types $2 and $3.","invalid_unary_op_full":"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the type $3.","invalid_unary_op":"The expression $0 is not valid because the operator $1 cannot be applied to the type $2.","unknown_op":"Critical error: Unknown operator $0.","duplicate_function":"The function $0 at line: $1, column: $2 has already been declared.","duplicate_variable":"The variable $0 at line: $1, column: $2 has already been declared.","main_parameters":"The main function cannot have parameters.","symbol_not_found_full":"The variable $0 at line: $1, column: $2 has not been declared.","symbol_not_found":"The variable $0 has not been declared.","array_dimension_not_int_full":"The array (vector or matrix) dimensions at line $0 must be of type int.","array_dimension_not_int":"An array (vector or matrix) dimensions must be of type int.","array_dimension_not_positive_full":"The array (vector or matrix) dimensions at line $0 must be positive.","array_dimension_not_positive":"An array (vector or matrix) dimensions must be positive.","incompatible_types_full":"It expected $0 but the expression $1 at line $2 results in $3.","incompatible_types":"It expected $0 but the expression $1 results in $2.","incompatible_types_array_full":"The expression $0 at line $2 is not compatible with type $1.","incompatible_types_array":"The expression $0 is not compatible with type $1.","invalid_case_type_full":"The case expression $0 at line $1 is not compatible with type $2.","invalid_case_type":"The case expression $0 is not compatible with type $1.","function_no_return":"The function $0 does not have a reacheable return command. Every function must have at least one return command in its main body.","invalid_array_literal_type_full":"Error at line $0: the expression $1 does not result in a compatible type.","invalid_array_literal_type":"The expression $0 does not result in a compatible type.","invalid_array_literal_line_full":"Error at line $0: it expected $1 lines but found $2.","invalid_array_literal_line":"It expected $0 lines but found $1.","invalid_array_literal_column_full":"Error at line $0: it expected $1 column but found $2.","invalid_array_literal_column":"It expected $0 column but found $1.","exceeded_input_request":"The amount of reads requested exceeded the amount of inputs available.","test_case_few_reads":"Teste case $0 failed: there are available inputs remaining.","test_case_failed":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"> <span>Test case $0 did not executed successfully.</span></div>","test_case_failed_exception":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$2\"> <span>Test case $0 failed</span>: $1","test_case_exception":"An exception has ocurred during the execution of test case $0: $1","invalid_type_conversion":"The value $0 cannot be converted to type $1.","invalid_read_type":"Error at line $0: The input \"$1\" is not of type $2 which is the type of the variable <span class='ivprog-error-varname'>$3</span>.","invalid_read_type_array":"Error at line $0: The input \"$1\" is not of type $2 which is the type accepted by the variable <span class='ivprog-error-varname'>$3</span> of type $4.","inform_valid_identifier":"Enter a valid identifier! The identifier cannot be a reserved word and it must begin with a letter or _, followed by numbers, letters and _ only.","inform_valid_global_duplicated":"A global variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each gloval variable.","inform_valid_variable_duplicated":"A variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each variable.","inform_valid_function_duplicated":"A function named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each function.","inform_valid_param_duplicated":"A parameter named <span class='ivprog-error-varname'>$0</span> already exists in function <span class='ivprog-error-varname'>$1</span>, you need distinc names for each parameter.","invalid_character":"The character $0 at line $1 cannot be used in this context.","annonymous_array_literal":"Error at line $0: the array notation is only permitted during initialization of an array variable. i. e.: int vec[3] ← {1, 2, 3}.","invalid_matrix_literal_line":"The expression $0 at line $1 does not have the same number of elements as the last line. All lines of a matrix must have the same number of elements.","cannot_infer_matrix_line":"It is not possible to infer the number of lines of matrix $0 at line $1. It must be initialized or have its lines explicitly declared.","cannot_infer_matrix_column":"It is not possible to infer the number of columns of matrix $0 at line $1. It must be initialized or have its columns explicitly declared.","cannot_infer_vector_size":"It is not possible to infer the number of elements of vector $0 at line $1. It must be initialized or have its size explicitly declard.","matrix_to_vector_literal_attr":"Error at line $0: The expression $1 represents a matrix and cannot be assigned to the vector $2.","vector_to_matrix_literal_attr":"Error at line $0: The expression $1 represents a vector and cannot be assigned to the matrix $2.","invalid_const_ref_full":"The variable $0 provided as a parameter to the function $1 at line $2 is a constant and cannot be used in this context. Use a non-constant variable or vector position.","invalid_const_ref":"The variable $0 provided as a parameter to the function $1 is a constant and cannot be used in this context. Use a non-constant variable or vector position.","invalid_const_assignment_full":"Error at line $0: $1 is a constant e therefore cannot have its value changed.","invalid_const_assignment":"$0 is a constant e therefore cannot have its value changed.","array_init_not_literal":"Error at line $0: An array (vector or matrix) can only be initialized by an array literal. i.e : real vector[] <- {1,2,3}","array_exceeds_2d":"Error at line $0: The maximum number of dimensions an array can have is 2. An element of 3 or dimensions was found.","invalid_matrix_id_dimension":"Error at line $0: You must define all dimensions of the matrix when one of them is defined by a variable! i.e: real mat1[var][5], mat2[5][var]","invalid_vector_init":"Error at line $0: You cannot initialize a vector when its size is defined by a variable. Use a vector assignment or loop command.","invalid_matrix_init":"Error at line $0: You cannot initialize a matrix when one of its dimensions is defined by a variable. Use a matrix assignment or loop command.","invalid_vector_assignment_full":"Error at line $0: You can only assign a vector to another when both have the same number of elements. $1 has $2 and $3 has $4 elements!","invalid_vector_assignment":"You can only assign a vector to another when both have the same number of elements. $0 has $1 and $2 has $3 elements!","invalid_matrix_assignment_full":"Error at line $0: You can only assign a matrix to another when both have dimensions of the same size. $1 has $2 lines e $3 columns while $4 has $5 lines and $6 columns!","invalid_matrix_assignment":"You can only assign a matrix to another when both have dimensions of the same size. $0 has $1 lines e $2 columns while $3 has $4 lines and $5 columns!","matrix_to_vector_attr":"Error at line $0: $1 represents a matrix and cannot be assigned to the vector $2.","vector_to_matrix_attr":"Error at line $0: $1 represents a vector and cannot be assigned to the matrix $2.","invalid_matrix_index_assign_full":"Error at line $0: The position $1 of the matrix $2 only accepts vectors of size $3 but $4 has size $5.","invalid_matrix_index_assign":"The position $0 of the matrix $1 only accepts vectors of size $2 but $3 has size $4.","invalid_number_elements_vector":"It expected $0 elements at line $1 but the expression $2 has $3 elements.","invalid_number_lines_matrix":"It expected a matrix with $0 lines at line $1 but the expression $2 has $3 lines.","divsion_by_zero_full":"Error at line $0: The expression $1 resuts in a division by zero.","divsion_by_zero":"The expression $0 resuts in a division by zero.","undefined_tanget_value":"Error at line $0: The tangent of $1° is undefined.","negative_log_value":"Error at line $0: You cannot calculate the logarithm of a negative value.","invalid_string_index":"Error at line $0 during the execution of the function $1: $2 is an invalid index for the text string $3. The valid indexes go from 0 to $4.","negative_sqrt_value":"Error at line $0: It is not allowd to calculate the square root of a negative number.","exceeded_recursive_calls":"Error during the execution of line $0: The number of recursive calls exceeded the allowed number of calls.","invalid_for_variable":"Error at line $0: The variable $1 used in the repeat_for command must be of type int.","invalid_for_from":"Error at line $0: The value $1 passed to the parameter 'from' of the repeat_for command must be of type int.","invalid_for_to":"Error at line $0: The value $1 passed to the parameter 'to' of the repeat_for command must be of type int.","invalid_for_pass":"Error at line $0: The value $1 passed to the parameter 'pass' of the repeat_for command must be of type int.","exceed_max_instructions":"The number of instructions executed by your program exceed the defined limit. Check your code for infinite loops or excessive recursive functions calls."},"es":{"token_missing_one":"Syntax error: Expected $0 but found $1 at line:$2, column:$3","token_missing_two":"Syntax error: Expected $0 or $1 but found $2 at line:$3, column: $4","eos_missing":"A new line or a ‘;’ is missing at line: $0, column: $1","invalid_type":"$0 at line: $1, column: $2 is a invalid type. The valid types are: $3","invalid_array_dimension":"Invalid dimension at line: $0, column: $1. Insert a $2 or a valid identifier of the same type.","invalid_array_size":"The array at line $0 exceeds the maximum size of 2.","extra_lines":"No text is allowed after '}' in 'program { … }'","invalid_main_return":"The function $0 declared at line $2 must return $1.","invalid_var_declaration":"Error at line $0: Variables can only be declared in the main body of a function and at the first lines, before any command.","invalid_break_command":"Error at line $0. The command $1 cannot be used outside a loop command or ‘switch ...case’ structure.","invalid_terminal":"It is not possible to use $0 in the expression at line: $1, column: $2. Try a numeric value, variable or function call.","const_not_init":"Error at line: $0, column: $1. A variable declared as const must be initialized.","id_missing":"Expected an identifier but found $0 at line: $1, column: $2.","invalid_id_format":"$0 at line: $1, column: $2 is not a valid identifier. The symbol '.' is not permitted in this context.","main_missing":"The main function was not found. You need to declare a function of return type void named main.","invalid_global_var":"Critical Error: Invalid call of the function IVProgProcessor.initGlobal outside the BASE context.","not_implemented":"Critial internal error: The system defined function $0 was not found.","function_missing":"The function $0 was not found.","function_missing_full":"The function $0 at line: $1, column: $2 was not found.","invalid_parameters_size_full":"Error at line $0: The number of parameters provided to the function $1 is incorrect. It expected $2 but found $3.","invalid_parameters_size":"The number of parameters provided to the function $0 is incorrect. It expected $1 but found $2.","invalid_ref_full":"The expression $0 provided as a parameter to the function $1 at line $2 is not valid in this context. Use a variable or a position of a vector.","invalid_ref":"The expression $0 provided as a parameter to the function $1 is not valid in this context. Use a variable or a position of a vector.","invalid_parameter_type_full":"The expression $0 provided as a parameter to the function $1 at line $2 is not of the expected type.","invalid_parameter_type":"The expression $0 provided as a parameter to the function $1 is not of the expected type.","unknown_command_full":"Internal error: an unknown command found at line $0.","unknown_command":"Internal error: an unknown command found.","loop_condition_type_full":"Error at line: $0, column $1: the condition $2 of the loop must be of type bool (true or false).","loop_condition_type":"The condition $0 of the loop must be of type bool (true or false).","endless_loop_full":"Possible infinite loop detected in your code. Check line $0.","endless_loop":"Possible infinite loop detected in your code.","for_condition_type_full":"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico","for_condition_type":"A condição de parada $0 do comando para(...) deve ser do tipo lógico","if_condition_type_full":"Error at line: $0, column $1: the condition $2 in the if … else command must result in a bool (true or false).","if_condition_type":"The condition $0 in the if … else command must result in a bool (true or false).","invalid_return_type_full":"Error at line $0: The expression doest not result in a type compatible with the function $1. Expected type: $2.","invalid_return_type":"The expression doest not result in a type compatible with the function $0. Expected type: $1.","invalid_void_return_full":"Error at line $0: The function $1 cannot return an empty expression, use an expression that results in a $2","invalid_void_return":"The function $0 cannot return an empty expression, use an expression that results in a $1","unexpected_break_command_full":"Critical error at line $0: a break command was found outside a valid context: loop or switch … case structure.","unexpected_break_command":"Critical error: a break command was found outside a valid context: loop or switch … case structure.","invalid_dimension":"Array (vector or matrix) dimensions must be of type int.","void_in_expression_full":"Error at line: $0, column: $1: The function $2 cannot be used inside an expression since its return type is void.","void_in_expression":"The function $0 cannot be used inside an expression since its return type is void.","invalid_array_access_full":"Identifier $0 at line: $1, column: $2 does not identify a valid vector or matrix.","invalid_array_access":"Identifier $0 does not identify a valid vector or matrix.","invalid_matrix_access_full":"Identifier $0 at line: $1, column: $2 does not identify a valid matrix.","invalid_matrix_access":"Identifier $0 does not identify a valid matrix.","matrix_column_outbounds_full":"Error at line $0: The number of columns $1 is invalid for the matrix $2 which has $3 columns.","matrix_column_outbounds":"The number of columns $0 is invalid for the matrix $1 which has $2 columns.","matrix_line_outbounds_full":"Error at line $0: The number of lines $1 is invalid for matrix $2 which has $3 lines.","matrix_line_outbounds":"The number of lines $0 is invalid for matrix $1 which has $2 lines.","vector_line_outbounds_full":"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.","vector_line_outbounds":"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.","vector_not_matrix_full":"Error at line $0: $1 is not a matrix.","vector_not_matrix":"$0 is not a matrix.","invalid_infix_op_full":"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the types $3 and $4.","invalid_infix_op":"The expression $0 is not valid because the operator $1 cannot be applied to the types $2 and $3.","invalid_unary_op_full":"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the type $3.","invalid_unary_op":"The expression $0 is not valid because the operator $1 cannot be applied to the type $2.","unknown_op":"Critical error: Unknown operator $0.","duplicate_function":"The function $0 at line: $1, column: $2 has already been declared.","duplicate_variable":"The variable $0 at line: $1, column: $2 has already been declared.","main_parameters":"The main function cannot have parameters.","symbol_not_found_full":"The variable $0 at line: $1, column: $2 has not been declared.","symbol_not_found":"The variable $0 has not been declared.","array_dimension_not_int_full":"The array (vector or matrix) dimensions at line $0 must be of type int.","array_dimension_not_int":"An array (vector or matrix) dimensions must be of type int.","array_dimension_not_positive_full":"The array (vector or matrix) dimensions at line $0 must be positive.","array_dimension_not_positive":"An array (vector or matrix) dimensions must be positive.","incompatible_types_full":"It expected $0 but the expression $1 at line $2 results in $3.","incompatible_types":"It expected $0 but the expression $1 results in $2.","incompatible_types_array_full":"The expression $0 at line $2 is not compatible with type $1.","incompatible_types_array":"The expression $0 is not compatible with type $1.","invalid_case_type_full":"The case expression $0 at line $1 is not compatible with type $2.","invalid_case_type":"The case expression $0 is not compatible with type $1.","function_no_return":"The function $0 does not have a reacheable return command. Every function must have at least one return command in its main body.","invalid_array_literal_type_full":"Error at line $0: the expression $1 does not result in a compatible type.","invalid_array_literal_type":"The expression $0 does not result in a compatible type.","invalid_array_literal_line_full":"Error at line $0: it expected $1 lines but found $2.","invalid_array_literal_line":"It expected $0 lines but found $1.","invalid_array_literal_column_full":"Error at line $0: it expected $1 column but found $2.","invalid_array_literal_column":"It expected $0 column but found $1.","exceeded_input_request":"The amount of reads requested exceeded the amount of inputs available.","test_case_few_reads":"Teste case $0 failed: there are available inputs remaining.","test_case_failed":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"> <span>Test case $0 did not executed successfully.</span></div>","test_case_failed_exception":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$2\"> <span>Test case $0 failed</span>: $1","test_case_exception":"An exception has ocurred during the execution of test case $0: $1","invalid_type_conversion":"The value $0 cannot be converted to type $1.","invalid_read_type":"Error at line $0: The input \"$1\" is not of type $2 which is the type of the variable <span class='ivprog-error-varname'>$3</span>.","invalid_read_type_array":"Error at line $0: The input \"$1\" is not of type $2 which is the type accepted by the variable <span class='ivprog-error-varname'>$3</span> of type $4.","inform_valid_identifier":"Enter a valid identifier! The identifier cannot be a reserved word and it must begin with a letter or _, followed by numbers, letters and _ only.","inform_valid_global_duplicated":"A global variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each gloval variable.","inform_valid_variable_duplicated":"A variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each variable.","inform_valid_function_duplicated":"A function named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each function.","inform_valid_param_duplicated":"A parameter named <span class='ivprog-error-varname'>$0</span> already exists in function <span class='ivprog-error-varname'>$1</span>, you need distinc names for each parameter.","invalid_character":"The character $0 at line $1 cannot be used in this context.","annonymous_array_literal":"Error at line $0: the array notation is only permitted during initialization of an array variable. i. e.: int vec[3] ← {1, 2, 3}.","invalid_matrix_literal_line":"The expression $0 at line $1 does not have the same number of elements as the last line. All lines of a matrix must have the same number of elements.","cannot_infer_matrix_line":"It is not possible to infer the number of lines of matrix $0 at line $1. It must be initialized or have its lines explicitly declared.","cannot_infer_matrix_column":"It is not possible to infer the number of columns of matrix $0 at line $1. It must be initialized or have its columns explicitly declared.","cannot_infer_vector_size":"It is not possible to infer the number of elements of vector $0 at line $1. It must be initialized or have its size explicitly declard.","matrix_to_vector_literal_attr":"Error at line $0: The expression $1 represents a matrix and cannot be assigned to the vector $2.","vector_to_matrix_literal_attr":"Error at line $0: The expression $1 represents a vector and cannot be assigned to the matrix $2.","invalid_const_ref_full":"The variable $0 provided as a parameter to the function $1 at line $2 is a constant and cannot be used in this context. Use a non-constant variable or vector position.","invalid_const_ref":"The variable $0 provided as a parameter to the function $1 is a constant and cannot be used in this context. Use a non-constant variable or vector position.","invalid_const_assignment_full":"Error at line $0: $1 is a constant e therefore cannot have its value changed.","invalid_const_assignment":"$0 is a constant e therefore cannot have its value changed.","array_init_not_literal":"Error at line $0: An array (vector or matrix) can only be initialized by an array literal. i.e : real vector[] <- {1,2,3}","array_exceeds_2d":"Error at line $0: The maximum number of dimensions an array can have is 2. An element of 3 or dimensions was found.","invalid_matrix_id_dimension":"Error at line $0: You must define all dimensions of the matrix when one of them is defined by a variable! i.e: real mat1[var][5], mat2[5][var]","invalid_vector_init":"Error at line $0: You cannot initialize a vector when its size is defined by a variable. Use a vector assignment or loop command.","invalid_matrix_init":"Error at line $0: You cannot initialize a matrix when one of its dimensions is defined by a variable. Use a matrix assignment or loop command.","invalid_vector_assignment_full":"Error at line $0: You can only assign a vector to another when both have the same number of elements. $1 has $2 and $3 has $4 elements!","invalid_vector_assignment":"You can only assign a vector to another when both have the same number of elements. $0 has $1 and $2 has $3 elements!","invalid_matrix_assignment_full":"Error at line $0: You can only assign a matrix to another when both have dimensions of the same size. $1 has $2 lines e $3 columns while $4 has $5 lines and $6 columns!","invalid_matrix_assignment":"You can only assign a matrix to another when both have dimensions of the same size. $0 has $1 lines e $2 columns while $3 has $4 lines and $5 columns!","matrix_to_vector_attr":"Error at line $0: $1 represents a matrix and cannot be assigned to the vector $2.","vector_to_matrix_attr":"Error at line $0: $1 represents a vector and cannot be assigned to the matrix $2.","invalid_matrix_index_assign_full":"Error at line $0: The position $1 of the matrix $2 only accepts vectors of size $3 but $4 has size $5.","invalid_matrix_index_assign":"The position $0 of the matrix $1 only accepts vectors of size $2 but $3 has size $4.","invalid_number_elements_vector":"It expected $0 elements at line $1 but the expression $2 has $3 elements.","invalid_number_lines_matrix":"It expected a matrix with $0 lines at line $1 but the expression $2 has $3 lines.","divsion_by_zero_full":"Error at line $0: The expression $1 resuts in a division by zero.","divsion_by_zero":"The expression $0 resuts in a division by zero.","undefined_tanget_value":"Error at line $0: The tangent of $1° is undefined.","negative_log_value":"Error at line $0: You cannot calculate the logarithm of a negative value.","invalid_string_index":"Error at line $0 during the execution of the function $1: $2 is an invalid index for the text string $3. The valid indexes go from 0 to $4.","negative_sqrt_value":"Error at line $0: It is not allowd to calculate the square root of a negative number.","exceeded_recursive_calls":"Error during the execution of line $0: The number of recursive calls exceeded the allowed number of calls.","invalid_for_variable":"Error at line $0: The variable $1 used in the repeat_for command must be of type int.","invalid_for_from":"Error at line $0: The value $1 passed to the parameter 'from' of the repeat_for command must be of type int.","invalid_for_to":"Error at line $0: The value $1 passed to the parameter 'to' of the repeat_for command must be of type int.","invalid_for_pass":"Error at line $0: The value $1 passed to the parameter 'pass' of the repeat_for command must be of type int.","exceed_max_instructions":"The number of instructions executed by your program exceed the defined limit. Check your code for infinite loops or excessive recursive functions calls."}}
  1426. /***/ }),
  1427. /***/ "./i18n/index.ts":
  1428. /*!***********************!*\
  1429. !*** ./i18n/index.ts ***!
  1430. \***********************/
  1431. /*! no static exports found */
  1432. /***/ (function(module, exports, __webpack_require__) {
  1433. "use strict";
  1434. Object.defineProperty(exports, "__esModule", { value: true });
  1435. const Messages = __webpack_require__(/*! ./message.csv */ "./i18n/message.csv");
  1436. const UI = __webpack_require__(/*! ./ui.csv */ "./i18n/ui.csv");
  1437. const Errors = __webpack_require__(/*! ./error.csv */ "./i18n/error.csv");
  1438. const MessagesObj = Messages;
  1439. const UIObj = UI;
  1440. const ErrorsObj = Errors;
  1441. const i18n_data = {};
  1442. for (const key in UIObj) {
  1443. const data = {};
  1444. data['error'] = ErrorsObj[key];
  1445. data['message'] = MessagesObj[key];
  1446. data['ui'] = UIObj[key];
  1447. i18n_data[key] = data;
  1448. }
  1449. exports.default = i18n_data;
  1450. /***/ }),
  1451. /***/ "./i18n/message.csv":
  1452. /*!**************************!*\
  1453. !*** ./i18n/message.csv ***!
  1454. \**************************/
  1455. /*! no static exports found */
  1456. /***/ (function(module, exports) {
  1457. module.exports = {"pt":{"test_case_success":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"><span>Caso de teste $0</span>: OK</div>","test_case_duration":"Levou $0ms","test_suite_grade":"A sua solução alcançou $0% da nota.","awaiting_input_message":"O seu programa está em execução e aguardando uma entrada! Digite algo e pressione ENTER...","assessment-empty-expected-tooltip":"A saída gerada foi além do esperado","assessment-empty-generated-tooltip":"O programa não gerou saídas suficientes","testcase_autogen_unused_input":"A solução submetida não lê todas entradas disponíveis no caso de teste 1","testcase_autogen_empty":"Sua solução não gerou qualquer saída para o caso de teste $0.","success_execution":"Execução do programa finalizada!","aborted_execution":"A execução do programa foi interrompida!","unexpected_execution_error":"Erro inesperado durante a execução do programa."},"en":{"test_case_success":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"><span>Test case $0</span>: OK</div>","test_case_duration":"Took $0ms","test_suite_grade":"Your solution scored $0% of the grade.","awaiting_input_message":"Your program is running and awaiting for an input. Type something and press ENTER…","assessment-empty-expected-tooltip":"The generated output was beyond the amount expected","assessment-empty-generated-tooltip":"The program did not generate enough outputs","testcase_autogen_unused_input":"The submitted solution does not read all inputs available in the test case $0","testcase_autogen_empty":"Your solution did not generate any output for test case $0.","success_execution":"Program execution finished!","aborted_execution":"Program execution was aborted!","unexpected_execution_error":"Unexpected error during program execution."},"es":{"test_case_success":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"><span>Test case $0</span>: OK</div>","test_case_duration":"Tardó $0ms","test_suite_grade":"Su solución obtuvo $0% de la calificación.","awaiting_input_message":"Su programa se está ejecutando y esperando una entrada. Escriba algo y presione ENTER ...","assessment-empty-expected-tooltip":"The generated output was beyond the amount expected","assessment-empty-generated-tooltip":"El programa no generó suficientes resultados.","testcase_autogen_unused_input":"La solución presentada no lee todas las entradas disponibles en el caso de prueba 1","testcase_autogen_empty":"Su solución no generó ningún resultado para el caso de prueba de $ 0.","success_execution":"¡Ejecución del programa terminada!","aborted_execution":"¡La ejecución del programa fue abortada!","unexpected_execution_error":"Error inesperado durante la ejecución del programa."}}
  1458. /***/ }),
  1459. /***/ "./i18n/ui.csv":
  1460. /*!*********************!*\
  1461. !*** ./i18n/ui.csv ***!
  1462. \*********************/
  1463. /*! no static exports found */
  1464. /***/ (function(module, exports) {
  1465. module.exports = {"pt":{"function":"funcao","btn_clear":"Limpar","btn_function":"Função","btn_arithmetic_plus":"Adição","btn_arithmetic_minus":"Subtração","btn_arithmetic_multiplication":"Multiplicação","btn_arithmetic_division":"Divisão","btn_arithmetic_module":"Módulo","btn_break":"Pare","btn_case":"Caso","start":"inicio","type_void":"vazio","type_integer":"inteiro","logic_operator_and":"E","logic_operator_or":"OU","logic_operator_not":"nao","type_real":"real","program":"programa","type_text":"cadeia","textvar_default_value":"texto","type_boolean":"logico","logic_value_true":"verdadeiro","logic_value_false":"falso","variable":"Variável","command":"Comando","new_parameter":"parametro","new_variable":"variavel","new_global":"global","new_function":"nova_funcao","matrix":"matriz","vector":"vetor","text_comment_start":"Comentário inicial da função...","text_comment_main":"Esta é a função principal...","text_read_var":"Entrada/Leitura de dados","text_write_var":"Saída/Escrita de dados","text_command_read":"leia","text_command_write":"escreva","text_return":"devolva","text_btn_return":"Devolver","text_comment":"Comentário","string_join_or":"ou","matrix_info_string":"matriz de $0","vector_info_string":"vetor de $0","text_attribution":"Atribuição","text_if":"se","text_break":"pare","text_else":"senao","text_for":"repita_para","text_code_while":"repita_enquanto","text_code_do":"repita","text_code_do_until":"ate_que","text_command_do":"repita","text_command_while":"repita enquanto","text_command_do_until":"até que","text_code_switch":"escolha","text_code_case":"caso","text_config_programming":"Programação","text_config_programming_both":"Visual e textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Lógicos","text_arithmetic_expression":"Aritméticos","text_iftrue":"Se verdadeiro então","text_message_error_activity_file":"Aconteceu um erro ao processar a atividade. <br> Recarregue a página para tentar novamente.","text_message_error_activity_reload":"Recarregar","text_repeatNtimes":"Repita N vezes","text_receives":"recebe","text_whiletrue":"Enquanto verdadeiro","text_dowhiletrue":"Repita até que verdadeiro","text_switch":"Escolha","text_functioncall":"Chamada de função","text_value":"Valor","text_operator":"Operador","text_parentheses":"Parênteses","text_change":"Alterar","text_teacher_algorithm":"Algoritmo","text_teacher_algorithm_include":"Incluir o algoritmo abaixo no exercício","text_teacher_test_case":"Casos de teste","text_teacher_config":"Configurações","text_teacher_data_types":"Tipos de dados","text_teacher_commands":"Comandos","text_teacher_functions":"Funções","text_teacher_create_functions":"Criar novas funções","text_teacher_create_movement_functions":"Movimentar funções","text_teacher_test_case_input":"Entrada","text_teacher_test_case_output":"Saída","text_teacher_test_case_actions":"Ações","text_teacher_test_case_add":"Adicionar caso de teste","text_header_ivprog_functions":"Funções do iVProg","text_menu_functions_math":"Matemática","text_menu_functions_text":"Texto","text_menu_functions_array":"Arranjo","text_menu_functions_conversion":"Conversão","text_no_variable":"Nenhuma variável declarada","text_no_variable_instruction":"Antes de utilizar uma variável, é necessário criá-la","text_ivprog_description":"Programação Visual interativa na Internet","tooltip_visual":"Programação visual","tooltip_textual":"Programação textual","tooltip_upload":"Upload de código fonte","tooltip_download":"Download do código fonte","tooltip_undo":"Desfazer","tooltip_redo":"Refazer","tooltip_run":"Executar o programa","tooltip_evaluate":"Avaliar o programa","tooltip_help":"Ajuda","tooltip_add_global":"Adicionar variável global","tooltip_hide_function":"Ocultar os elementos da função","var_menu_select_var":"Selecione uma variável","var_menu_select_all":"Selecione","var_menu_select_function":"Selecione uma função","expression_menu_select":"Construir uma expressão lógica","inform_valid_content":"Informe o conteúdo!","inform_valid_expression":"Construa uma expressão lógica!","tooltip_terminal_clear":"Limpa o terminal removendo todos os textos já escritos e os pendentes.","tooltip_terminal_show":"Exibe o terminal caso esteja escondido","tooltip_terminal_hide":"Esconde o terminal caso não esteja escondido","text_ivprog_version":"Versão","text_teacher_filter":"Filtro","text_teacher_filter_active":"Ativado","text_teacher_filter_help":"Ao ativar o filtro, as modificações do iVProg estarão bloqueadas.","text_join_assessment_outputs":" ; ","assessment-detail-time-label":"Duração","assessment-detail-grade-label":"Nota","assessment-detail-input-label":"Entradas","assessment-detail-output-label":"Saídas","assessment-detail-expected-label":"Esperava","assessment-detail-generated-label":"Gerou","assessment-detail-result-label":"Resultado","assessment-detail-title":"Caso de Teste $0","text_teacher_generate_outputs":"Gerar saídas","text_teacher_generate_outputs_algorithm":"Antes de gerar as saídas, elabore um algoritmo!","text_code_for_from":"de","text_code_for_to":"ate","text_code_for_pass":"passo","text_for_from":"de","text_for_to":"até","text_for_pass":"passo","text_relational_expression":"Relacionais","write_command_newline_on":"Quebra de linha ativada","write_command_newline_off":" Quebra de linha desativada","write_seprator_menu_text":"Espaço","initial_program_code":"programa {\\n\\n\\t\\tfuncao vazio inicio () {\\n\\t\\t\\t// Inicie seu codigo aqui!\\n\\t\\t}\\n}","type_char":"caractere","charvar_default_value":"A","write_seprator_menu_tooltip":"Separador para imprimir mais valores/variáveis"},"en":{"function":"function","btn_clear":"Clean","btn_function":"Function","btn_arithmetic_plus":"Addition","btn_arithmetic_minus":"Subtraction","btn_arithmetic_multiplication":"Multiplication","btn_arithmetic_division":"Division","btn_arithmetic_module":"Remainder","btn_break":"break","btn_case":"Case","start":"main","type_void":"void","type_integer":"int","logic_operator_and":"AND","logic_operator_or":"OR","logic_operator_not":"not","type_real":"real","program":"program","type_text":"string","textvar_default_value":"text","type_boolean":"bool","logic_value_true":"true","logic_value_false":"false","variable":"Variable","command":"Command","new_parameter":"parameter","new_variable":"variable","new_global":"global","new_function":"new_function","matrix":"matrix","vector":"vector","text_comment_start":"Function initial comment","text_comment_main":"This is the main funcion","text_read_var":"Input/Read data","text_write_var":"Output/Write data","text_command_read":"read","text_command_write":"write","text_return":"return","text_btn_return":"Return","text_comment":"Comment","string_join_or":"or","matrix_info_string":"matrix of $0","vector_info_string":"vector of $0","text_attribution":"Assignment","text_if":"if","text_break":"break","text_else":"else","text_for":"repeat_for","text_code_while":"repeat_while","text_code_do":"repeat","text_code_do_until":"until","text_command_do":"repeat","text_command_while":"repeat while","text_command_do_until":"until","text_code_switch":"switch","text_code_case":"case","text_config_programming":"Programming","text_config_programming_both":"Visual & Textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Logic","text_arithmetic_expression":"Arithmetics","text_iftrue":"If true then","text_message_error_activity_file":"There was an error processing the activity.<br> Reload the page to try again.","text_message_error_activity_reload":"Reload","text_repeatNtimes":"Repeat N times","text_receives":"receives","text_whiletrue":"While true","text_dowhiletrue":"Repeat until true","text_switch":"Switch","text_functioncall":"Function call","text_value":"Value","text_operator":"Operator","text_parentheses":"Parentheses","text_change":"Modify","text_teacher_algorithm":"Algorithm","text_teacher_algorithm_include":"Include the algorithm below in the activity","text_teacher_test_case":"Test cases","text_teacher_config":"Configurations","text_teacher_data_types":"Data types","text_teacher_commands":"Commands","text_teacher_functions":"Functions","text_teacher_create_functions":"Create new functions","text_teacher_create_movement_functions":"Move functions","text_teacher_test_case_input":"Input","text_teacher_test_case_output":"Output","text_teacher_test_case_actions":"Actions","text_teacher_test_case_add":"Add test case","text_header_ivprog_functions":"iVProg Functions","text_menu_functions_math":"Math","text_menu_functions_text":"Text","text_menu_functions_array":"Array","text_menu_functions_conversion":"Conversion","text_no_variable":"No variable declared","text_no_variable_instruction":"Before using a variable, you need to create it","text_ivprog_description":"Interactive and Visual Programming on the Internet","tooltip_visual":"Visual programming","tooltip_textual":"Textual programming","tooltip_upload":"Upload source code","tooltip_download":"Download source code","tooltip_undo":"Undo","tooltip_redo":"Redo","tooltip_run":"Run the program","tooltip_evaluate":"Evaluate the program","tooltip_help":"Help","tooltip_add_global":"Add a global variable","tooltip_hide_function":"Hide function elements","var_menu_select_var":"Select a variable","var_menu_select_all":"Select","var_menu_select_function":"Select a function","expression_menu_select":"Construct a logic expression","inform_valid_content":"Provide some data","inform_valid_expression":"Construct a logic expression","tooltip_terminal_clear":"Clears the terminal by removing all wrriten and pending text.","tooltip_terminal_show":"Shows the terminal if it is hidden","tooltip_terminal_hide":"Hides the terminal if it is not on display","text_ivprog_version":"Version","text_teacher_filter":"Filter","text_teacher_filter_active":"Activated","text_teacher_filter_help":"By activating the filter modifications in iVProg will be blocked","text_join_assessment_outputs":" ; ","assessment-detail-time-label":"Duration","assessment-detail-grade-label":"Grade","assessment-detail-input-label":"Inputs","assessment-detail-output-label":"Outputs","assessment-detail-expected-label":"Expected","assessment-detail-generated-label":"Generated","assessment-detail-result-label":"Result","assessment-detail-title":"Test Case $0","text_teacher_generate_outputs":"Generate outputs","text_teacher_generate_outputs_algorithm":"Before generating the outputs you need to create an algorithm","text_code_for_from":"from","text_code_for_to":"to","text_code_for_pass":"pass","text_for_from":"from","text_for_to":"to","text_for_pass":"pass","text_relational_expression":"Relational","write_command_newline_on":" Line break is on","write_command_newline_off":" Line break is off","write_seprator_menu_text":"Spacer","initial_program_code":"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}","type_char":"char","charvar_default_value":"A","write_seprator_menu_tooltip":"Separator used to print more values/variables"},"es":{"function":"function","btn_clear":"Limpiar","btn_function":"Funcíon","btn_arithmetic_plus":"Adición","btn_arithmetic_minus":"Sustracción","btn_arithmetic_multiplication":"Multiplicación","btn_arithmetic_division":"División","btn_arithmetic_module":"Resto","btn_break":"break","btn_case":"Caso","start":"main","type_void":"void","type_integer":"int","logic_operator_and":"AND","logic_operator_or":"OR","logic_operator_not":"not","type_real":"real","program":"program","type_text":"string","textvar_default_value":"texto","type_boolean":"bool","logic_value_true":"true","logic_value_false":"false","variable":"Variable","command":"Comando","new_parameter":"parametro","new_variable":"variable","new_global":"global","new_function":"nueva_función","matrix":"matriz","vector":"vector","text_comment_start":"Comentario inicial de la función","text_comment_main":"Esta es la función principal","text_read_var":"Entrada/Lectura de dados","text_write_var":"Salida/Escribir datos","text_command_read":"read","text_command_write":"write","text_return":"return","text_btn_return":"Devolución","text_comment":"Comentario","string_join_or":"or","matrix_info_string":"matriz de $0","vector_info_string":"vector de $0","text_attribution":"Asignación","text_if":"if","text_break":"break","text_else":"else","text_for":"repeat_for","text_code_while":"repeat_while","text_code_do":"repeat","text_code_do_until":"until","text_command_do":"repeat","text_command_while":"repeat while","text_command_do_until":"until","text_code_switch":"switch","text_code_case":"case","text_config_programming":"Programación","text_config_programming_both":"Visual & Textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Lógicos","text_arithmetic_expression":"Aritmética","text_iftrue":"Si verdad entonces","text_message_error_activity_file":"Se produjo un error al procesar la actividad.<br> Recargar la página para volver a intentarlo.","text_message_error_activity_reload":"Recargar","text_repeatNtimes":"Repetir N veces","text_receives":"receives","text_whiletrue":"Mientras verdad","text_dowhiletrue":"Repita hasta verdad","text_switch":"Switch","text_functioncall":"Llamada de función","text_value":"Valor","text_operator":"Operador","text_parentheses":"Paréntesis","text_change":"Modify","text_teacher_algorithm":"Algorithm","text_teacher_algorithm_include":"Incluir el algoritmo en la actividad.","text_teacher_test_case":"Test cases","text_teacher_config":"Configuraciones","text_teacher_data_types":"Data types","text_teacher_commands":"Commands","text_teacher_functions":"Funciones","text_teacher_create_functions":"Create new functions","text_teacher_create_movement_functions":"Move functions","text_teacher_test_case_input":"Input","text_teacher_test_case_output":"Output","text_teacher_test_case_actions":"Actions","text_teacher_test_case_add":"Add test case","text_header_ivprog_functions":"iVProg Functions","text_menu_functions_math":"Math","text_menu_functions_text":"Text","text_menu_functions_array":"Array","text_menu_functions_conversion":"Conversion","text_no_variable":"No variable declared","text_no_variable_instruction":"Antes de usar una variable, debe crearla","text_ivprog_description":"Interactive and Visual Programming on the Internet","tooltip_visual":"Visual programming","tooltip_textual":"Textual programming","tooltip_upload":"Upload source code","tooltip_download":"Download source code","tooltip_undo":"Undo","tooltip_redo":"Redo","tooltip_run":"Run the program","tooltip_evaluate":"Evaluate the program","tooltip_help":"Help","tooltip_add_global":"Add a global variable","tooltip_hide_function":"Hide function elements","var_menu_select_var":"Select a variable","var_menu_select_all":"Select","var_menu_select_function":"Select a function","expression_menu_select":"Construct a logic expression","inform_valid_content":"Proporcionar algunos datos","inform_valid_expression":"Construct a logic expression","tooltip_terminal_clear":"Borra el terminal eliminando todo el texto escrito y pendiente.","tooltip_terminal_show":"Muestra el terminal si está oculto.","tooltip_terminal_hide":"Oculta el terminal si no está en exhibición","text_ivprog_version":"Version","text_teacher_filter":"Filter","text_teacher_filter_active":"Activated","text_teacher_filter_help":"Al activar el filtro, las modificaciones en iVProg serán bloqueadas","text_join_assessment_outputs":" ;","assessment-detail-time-label":"Duration","assessment-detail-grade-label":"Grade","assessment-detail-input-label":"Inputs","assessment-detail-output-label":"Outputs","assessment-detail-expected-label":"Expected","assessment-detail-generated-label":"Generated","assessment-detail-result-label":"Result","assessment-detail-title":"Test Case $0","text_teacher_generate_outputs":"Generate outputs","text_teacher_generate_outputs_algorithm":"Antes de generar las salidas necesita crear un algoritmo","text_code_for_from":"from","text_code_for_to":"to","text_code_for_pass":"pass","text_for_from":"from","text_for_to":"to","text_for_pass":"pass","text_relational_expression":"Relational","write_command_newline_on":"El salto de línea está activado","write_command_newline_off":"El salto de línea está desactivado","write_seprator_menu_text":"Spacer","initial_program_code":"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}","type_char":"char","charvar_default_value":"A","write_seprator_menu_tooltip":"Separator used to print more values/variables"}}
  1466. /***/ }),
  1467. /***/ "./js/assessment/ivprogAssessment.js":
  1468. /*!*******************************************!*\
  1469. !*** ./js/assessment/ivprogAssessment.js ***!
  1470. \*******************************************/
  1471. /*! exports provided: IVProgAssessment */
  1472. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1473. "use strict";
  1474. __webpack_require__.r(__webpack_exports__);
  1475. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgAssessment", function() { return IVProgAssessment; });
  1476. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  1477. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  1478. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  1479. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  1480. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  1481. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  1482. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  1483. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  1484. /* harmony import */ var _output_matching_output_matching__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./output_matching/output_matching */ "./js/assessment/output_matching/output_matching.js");
  1485. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  1486. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  1487. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_5__["getInstance"]();
  1488. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_2__["default"].StringTypes;
  1489. var AssessmentConfig = {
  1490. max_instruction_count: 350250,
  1491. suspend_threshold: 200
  1492. };
  1493. var IVProgAssessment = /*#__PURE__*/function () {
  1494. function IVProgAssessment(ast_code, testCases, domConsole) {
  1495. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgAssessment);
  1496. this.ast_code = ast_code;
  1497. this.testCases = testCases;
  1498. this.domConsole = domConsole;
  1499. this.old_config = JSON.parse(JSON.stringify(_util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]));
  1500. _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].setConfig(AssessmentConfig);
  1501. }
  1502. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgAssessment, [{
  1503. key: "runTest",
  1504. value: function runTest() {
  1505. var _this = this;
  1506. try {
  1507. // loop test cases and show messages through domconsole
  1508. var partialTests = this.testCases.map(function (t, name) {
  1509. return new _output_matching_output_matching__WEBPACK_IMPORTED_MODULE_6__["OutputMatching"](new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_3__["IVProgProcessor"](_this.ast_code), t.input, t.output, name);
  1510. });
  1511. var testResult = partialTests.map(function (om) {
  1512. return om.eval();
  1513. });
  1514. return Promise.all(testResult).then(function (results) {
  1515. var grade = 0;
  1516. for (var i = 0; i < results.length; i += 1) {
  1517. var result = results[i];
  1518. grade += result.grade;
  1519. if (result.grade == 1) {
  1520. _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].INFO, StringTypes.MESSAGE, 'test_case_success', result.name + 1, result.generateOutput());
  1521. } else if (result.status == 1) {
  1522. _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.ERROR, 'test_case_failed_exception', result.name + 1, result.error_msg, result.generateOutput());
  1523. } else {
  1524. _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.ERROR, 'test_case_failed', result.name + 1, result.generateOutput());
  1525. }
  1526. }
  1527. grade /= results.length;
  1528. var channel = grade == 1 ? _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].INFO : _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR;
  1529. _this.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", (grade * 100).toFixed(2));
  1530. return grade;
  1531. }); // return testResult.then(function (total) {
  1532. // const grade = total / this.testCases.length;
  1533. // const channel = grade == 1 ? DOMConsole.INFO : DOMConsole.ERR;
  1534. // this.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", (grade * 100).toFixed(2));
  1535. // return Promise.resolve(grade)
  1536. // }).catch(err => {
  1537. // this.domConsole.err("Erro inesperado durante o cálculo da nota.");// try and show error messages through domconsole
  1538. // this.domConsole.err(err.message);
  1539. // return Promise.resolve(0);
  1540. // });
  1541. } catch (error) {
  1542. this.showErrorMessage(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.MESSAGE, "unexpected_execution_error");
  1543. this.domConsole.err(error.message);
  1544. return Promise.resolve(0);
  1545. } finally {
  1546. _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].setConfig(this.old_config);
  1547. }
  1548. }
  1549. }, {
  1550. key: "showErrorMessage",
  1551. value: function showErrorMessage(errorID) {
  1552. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1553. args[_key - 1] = arguments[_key];
  1554. }
  1555. this.domConsole.err(LocalizedStrings.getError(errorID, args));
  1556. }
  1557. }, {
  1558. key: "showInfoMessage",
  1559. value: function showInfoMessage(msgID) {
  1560. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1561. args[_key2 - 1] = arguments[_key2];
  1562. }
  1563. this.domConsole.info(LocalizedStrings.getMessage(msgID, args));
  1564. }
  1565. }, {
  1566. key: "writeToConsole",
  1567. value: function writeToConsole(channel, msgType, msgID) {
  1568. var msg = LocalizedStrings.getString(msgID, msgType);
  1569. for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
  1570. args[_key3 - 3] = arguments[_key3];
  1571. }
  1572. msg = LocalizedStrings.processString(msg, args);
  1573. this.domConsole.writeRawHTML(msg, channel);
  1574. }
  1575. }]);
  1576. return IVProgAssessment;
  1577. }();
  1578. /***/ }),
  1579. /***/ "./js/assessment/output_matching/assessment_result.js":
  1580. /*!************************************************************!*\
  1581. !*** ./js/assessment/output_matching/assessment_result.js ***!
  1582. \************************************************************/
  1583. /*! exports provided: OutputAssessmentResult */
  1584. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1585. "use strict";
  1586. __webpack_require__.r(__webpack_exports__);
  1587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputAssessmentResult", function() { return OutputAssessmentResult; });
  1588. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  1589. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  1590. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  1591. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  1592. /* harmony import */ var _util_string_diff__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../util/string_diff */ "./js/util/string_diff.js");
  1593. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  1594. var OutputAssessmentResult = /*#__PURE__*/function () {
  1595. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputAssessmentResult, null, [{
  1596. key: "PAGE_TEMPLATE",
  1597. get: function get() {
  1598. return "<!DOCTYPE html>\n <html>\n <head>\n <meta http-equiv='content-type' content='text/html; charset=UTF-8'>\n <link rel='stylesheet' href='css/ivprog-assessment.css' type='text/css'/>\n </head>\n <body>\n :assessment-result:\n </body>\n </html>";
  1599. }
  1600. }, {
  1601. key: "DETAIL_TEMPLATE",
  1602. get: function get() {
  1603. return "<div class='details-body'>\n <div class='details-header'>\n <h2>:test-name:</h2>\n <p>:time-label:: <span>:time:ms</span></p>\n <p>:grade-label:: <span>:grade:%</span></p>\n </div>\n <div>\n <h3>:input-label:</h3>\n <ul>\n <li>:input-list:</li>\n </ul>\n </div>\n <div>\n <h3>:output-label:</h3>\n :output-result:\n </div>\n </div>";
  1604. }
  1605. }, {
  1606. key: "OUPUT_TABLE_TEMPLATE",
  1607. get: function get() {
  1608. return "<div class='detaisl-div-table'>\n <table class='assessment-output-table'>\n <tr>\n <th>:expected-label:</th>\n <th>:generated-label:</th>\n <th>:result-label:</th>\n </tr>\n :results:\n </table>\n </div>";
  1609. }
  1610. }, {
  1611. key: "OUTPUT_TEMPLATE",
  1612. get: function get() {
  1613. return "<tr><td class=':class-expected:'>$0</td>\n <td class=':class-generated:'>$1</td>\n <td class=':class-result:'>$2</td></tr>";
  1614. }
  1615. }, {
  1616. key: "EMPTY_OUTPUT_TEMPLATE",
  1617. get: function get() {
  1618. return "<div class='assessment-popup'><img class='assessment-empty-output' src='img/empty.svg'>\n <span class='assessment-popuptext'>$0</span></div>";
  1619. }
  1620. }, {
  1621. key: "FAILED_TEMPLATE",
  1622. get: function get() {
  1623. return "<p class='assessment-failed-execution'><span class='assessment-failed-case'>\u2717</span>$0</p>";
  1624. }
  1625. }, {
  1626. key: "INPUT_INFO_TEMPLATE",
  1627. get: function get() {
  1628. return "<span class='$0'>$1</span>";
  1629. } // Status code - it is not grade related!
  1630. // 0 - Succesful execution
  1631. // 1 - failed execution
  1632. }]);
  1633. function OutputAssessmentResult(name, status, inputs, result, store, time) {
  1634. var error_msg = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
  1635. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputAssessmentResult);
  1636. this.name = name;
  1637. this.status = status;
  1638. this.inputs = inputs;
  1639. this.results = result;
  1640. this.store = store;
  1641. this.time = time;
  1642. this.error_msg = error_msg;
  1643. }
  1644. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputAssessmentResult, [{
  1645. key: "prepareResults",
  1646. value: function prepareResults() {
  1647. var _this = this;
  1648. var template = OutputAssessmentResult.DETAIL_TEMPLATE;
  1649. var grade = (this.grade * 100).toFixed(2);
  1650. var time = this.time || "-";
  1651. template = template.replace(':test-name:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-title', [this.name + 1]));
  1652. template = template.replace(':time-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-time-label'));
  1653. template = template.replace(':time:', time);
  1654. template = template.replace(':grade-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-grade-label'));
  1655. template = template.replace(':grade:', grade);
  1656. var input_spans = this.prepareInputList(this.inputs);
  1657. template = template.replace(':input-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-input-label'));
  1658. template = template.replace(':input-list:', input_spans);
  1659. template = template.replace(':output-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-output-label'));
  1660. if (this.status == 0) {
  1661. var output_rows = this.results.map(function (result) {
  1662. if (result.type == "string") {
  1663. return _this.formatString(result);
  1664. } else if (result.type == "number") {
  1665. return _this.formatNumber(result);
  1666. } else {
  1667. return _this.formatBool(result);
  1668. }
  1669. }, this);
  1670. template = template.replace(':output-result:', this.prepareOutputTable(output_rows));
  1671. } else {
  1672. var failed_text = OutputAssessmentResult.FAILED_TEMPLATE;
  1673. failed_text = failed_text.replace("$0", this.error_msg);
  1674. template = template.replace(":output-result:", failed_text);
  1675. }
  1676. return template;
  1677. }
  1678. }, {
  1679. key: "prepareInputList",
  1680. value: function prepareInputList(input_list) {
  1681. var list = input_list.map(function (input) {
  1682. var template = OutputAssessmentResult.INPUT_INFO_TEMPLATE;
  1683. template = template.replace("$1", input.value);
  1684. if (input.read) {
  1685. template = template.replace("$0", "assessment-input-read");
  1686. } else {
  1687. template = template.replace("$0", "assessment-input-unread");
  1688. }
  1689. return template;
  1690. }, this);
  1691. return list.join(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('text_join_assessment_outputs'));
  1692. }
  1693. }, {
  1694. key: "prepareOutputTable",
  1695. value: function prepareOutputTable(output_rows) {
  1696. var template = OutputAssessmentResult.OUPUT_TABLE_TEMPLATE;
  1697. template = template.replace(':expected-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-expected-label'));
  1698. template = template.replace(':generated-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-generated-label'));
  1699. template = template.replace(':result-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-result-label'));
  1700. template = template.replace(':results:', output_rows.join(''));
  1701. return template;
  1702. }
  1703. }, {
  1704. key: "generateOutput",
  1705. value: function generateOutput() {
  1706. var assessment_result = this.prepareResults();
  1707. var page = OutputAssessmentResult.PAGE_TEMPLATE;
  1708. page = page.replace(':assessment-result:', assessment_result);
  1709. page = page.replace(/(\r|\n|\t)/gm, '').replace(/> *</g, '><');
  1710. return page;
  1711. }
  1712. }, {
  1713. key: "formatNumber",
  1714. value: function formatNumber(result) {
  1715. var result_class = result.grade == 1 ? 'assessment-number-result' : 'assessment-number-result-failed';
  1716. var template = this.formatOutput('assessment-number-expected', 'assessment-number-generated', result_class, result);
  1717. return template;
  1718. }
  1719. }, {
  1720. key: "formatBool",
  1721. value: function formatBool(result) {
  1722. var result_class = result.grade == 1 ? 'assessment-bool-result' : 'assessment-bool-result-failed';
  1723. var template = this.formatOutput('assessment-bool-expected', 'assessment-bool-generated', result_class, result);
  1724. return template;
  1725. }
  1726. }, {
  1727. key: "formatOutput",
  1728. value: function formatOutput(expected_class, generated_class, result_class, result) {
  1729. var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
  1730. template = template.replace(":class-expected:", expected_class);
  1731. template = template.replace(":class-generated:", generated_class);
  1732. template = template.replace(":class-result:", result_class);
  1733. var expected_tmpl = result.expected;
  1734. var generated_tmpl = result.generated;
  1735. if (expected_tmpl == null) {
  1736. expected_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-expected-tooltip'));
  1737. } else if (generated_tmpl == null) {
  1738. generated_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-generated-tooltip'));
  1739. }
  1740. template = template.replace("$0", expected_tmpl);
  1741. template = template.replace("$1", generated_tmpl);
  1742. var final_result = result.grade == 1 ? "✓" : "✗";
  1743. template = template.replace("$2", final_result);
  1744. return template;
  1745. }
  1746. }, {
  1747. key: "formatString",
  1748. value: function formatString(result) {
  1749. var _this2 = this;
  1750. var expected_class = 'assessment-string-expected';
  1751. var generated_class = 'assessment-string-generated'; //const result_class = 'assessment-string-result';
  1752. var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
  1753. template = template.replace(":class-expected:", expected_class);
  1754. template = template.replace(":class-generated:", generated_class); //template = template.replace(":class-result:", result_class);
  1755. var g_string = result.generated || "";
  1756. var e_string = result.expected || ""; // console.log("generated: ", g_string,"expected: ", e_string);
  1757. var g_string_tmpl = g_string;
  1758. var e_string_tmpl = e_string;
  1759. if (result.generated == null) {
  1760. g_string_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-generated-tooltip'));
  1761. } else if (result.expected == null) {
  1762. e_string_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-expected-tooltip'));
  1763. }
  1764. template = template.replace("$0", e_string_tmpl);
  1765. template = template.replace("$1", g_string_tmpl);
  1766. if (result.grade == 1) {
  1767. template = template.replace("$2", "✓");
  1768. template = template.replace(":class-result:", 'assessment-string-result');
  1769. } else {
  1770. var diff = Object(_util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"])(g_string, e_string); // console.log(diff);
  1771. var diff_vec = diff.map(function (part) {
  1772. return _this2.getDiffStringStyle(part[1], part[0]);
  1773. }, this);
  1774. var diff_string = diff_vec.reduce(function (prev, actual) {
  1775. return prev + actual;
  1776. }, "");
  1777. template = template.replace("$2", "<span class='assessment-failed-case'>✗</span>" + diff_string);
  1778. template = template.replace(":class-result:", "assessment-string-diff");
  1779. }
  1780. return template;
  1781. }
  1782. }, {
  1783. key: "getDiffStringStyle",
  1784. value: function getDiffStringStyle(text, action) {
  1785. var template = "<span class='$0'>$1</span>"; // Fix missing whitespace when its a single element
  1786. text = text.replace(/\s/g, "&#160;");
  1787. switch (action) {
  1788. case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].INSERT:
  1789. return template.replace("$0", "stringdiff-insert").replace("$1", text);
  1790. case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].DELETE:
  1791. return template.replace("$0", "stringdiff-delete").replace("$1", text);
  1792. case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].EQUAL:
  1793. return template.replace("$0", "stringdiff-equal").replace("$1", text);
  1794. }
  1795. }
  1796. }, {
  1797. key: "grade",
  1798. get: function get() {
  1799. if (this.results == null) {
  1800. return 0;
  1801. }
  1802. return this.results.reduce(function (prev, val) {
  1803. return prev + val.grade;
  1804. }, 0) / this.results.length;
  1805. }
  1806. }]);
  1807. return OutputAssessmentResult;
  1808. }();
  1809. /***/ }),
  1810. /***/ "./js/assessment/output_matching/output_matching.js":
  1811. /*!**********************************************************!*\
  1812. !*** ./js/assessment/output_matching/output_matching.js ***!
  1813. \**********************************************************/
  1814. /*! exports provided: OutputMatching */
  1815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1816. "use strict";
  1817. __webpack_require__.r(__webpack_exports__);
  1818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatching", function() { return OutputMatching; });
  1819. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  1820. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  1821. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  1822. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  1823. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  1824. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
  1825. /* harmony import */ var _util_input_assessment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/input_assessment */ "./js/util/input_assessment.js");
  1826. /* harmony import */ var _util_outputTest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/outputTest */ "./js/util/outputTest.js");
  1827. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
  1828. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_5__);
  1829. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/utils */ "./js/util/utils.js");
  1830. /* harmony import */ var _assessment_result__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./assessment_result */ "./js/assessment/output_matching/assessment_result.js");
  1831. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  1832. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  1833. /* harmony import */ var _output_result__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./output_result */ "./js/assessment/output_matching/output_result.js");
  1834. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_9__["getInstance"]();
  1835. var OutputMatching = /*#__PURE__*/function () {
  1836. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputMatching, null, [{
  1837. key: "NUM_REGEX",
  1838. get: function get() {
  1839. return /^[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)$/;
  1840. }
  1841. }, {
  1842. key: "NUM_IN_STRING_REGEX",
  1843. get: function get() {
  1844. return /[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)/g;
  1845. }
  1846. }, {
  1847. key: "BOOLEAN_REGEX",
  1848. get: function get() {
  1849. var str = "^(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")$");
  1850. return new RegExp(str);
  1851. }
  1852. }, {
  1853. key: "BOOLEAN_IN_STRING_REGEX",
  1854. get: function get() {
  1855. var str = "(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")");
  1856. return new RegExp(str, 'g');
  1857. }
  1858. }]);
  1859. function OutputMatching(program, input_list, expected_output, test_name) {
  1860. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputMatching);
  1861. this.program = program;
  1862. this.name = test_name;
  1863. this.input_list = input_list;
  1864. this.expected_output = expected_output;
  1865. }
  1866. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputMatching, [{
  1867. key: "eval",
  1868. value: function _eval() {
  1869. var _this = this;
  1870. var refThis = this;
  1871. var input = new _util_input_assessment__WEBPACK_IMPORTED_MODULE_3__["InputAssessment"](this.input_list);
  1872. var gen_output = new _util_outputTest__WEBPACK_IMPORTED_MODULE_4__["OutputTest"]();
  1873. this.program.registerInput(input);
  1874. this.program.registerOutput(gen_output);
  1875. var start_time = Date.now();
  1876. return this.program.interpretAST().then(function (sto) {
  1877. var final_time = Date.now() - start_time;
  1878. if (input.isInputAvailable()) {
  1879. return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 1, input.input_list, null, sto, final_time, refThis.getErrorMessage('test_case_few_reads', _this.name + 1));
  1880. }
  1881. var result = gen_output.list.map(function (g_out, i) {
  1882. if (i >= _this.expected_output.length) {
  1883. return new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"](null, g_out, 0, _this.getPotentialOutputType(g_out));
  1884. }
  1885. return _this.outputMatch(g_out, _this.expected_output[i]);
  1886. }, _this);
  1887. if (_this.expected_output.length > gen_output.list.length) {
  1888. console.log("Saída insuficientes!", _this.expected_output.length, gen_output.list.length);
  1889. for (var i = gen_output.list.length; i < _this.expected_output.length; ++i) {
  1890. var e_out = _this.expected_output[i];
  1891. result.push(new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"](e_out, null, 0, _this.getPotentialOutputType(e_out)));
  1892. }
  1893. } else if (_this.expected_output.length == 0 && _this.expected_output.length == gen_output.list.length) {
  1894. // no output expected....
  1895. result.push(new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"]("", "", 1, "string"));
  1896. }
  1897. return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 0, input.input_list, result, sto, final_time);
  1898. })["catch"](function (error) {
  1899. return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 1, input.input_list, null, null, null, refThis.getErrorMessage('test_case_exception', _this.name + 1, error.message));
  1900. });
  1901. }
  1902. }, {
  1903. key: "getPotentialOutputType",
  1904. value: function getPotentialOutputType(output) {
  1905. if (OutputMatching.NUM_REGEX.test(output)) {
  1906. return "number";
  1907. } else if (OutputMatching.BOOLEAN_REGEX.test(output)) {
  1908. return "bool";
  1909. } else {
  1910. return "string";
  1911. }
  1912. }
  1913. }, {
  1914. key: "outputMatch",
  1915. value: function outputMatch(g_output, e_output) {
  1916. if (OutputMatching.NUM_REGEX.test(e_output)) {
  1917. if (!OutputMatching.NUM_REGEX.test(g_output)) {
  1918. return this.checkStrings(g_output, e_output);
  1919. }
  1920. var g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](g_output);
  1921. var e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](e_output);
  1922. return this.checkNumbers(g_num, e_num);
  1923. } else if (OutputMatching.BOOLEAN_REGEX.test(e_output)) {
  1924. if (!OutputMatching.BOOLEAN_REGEX.test(g_output)) {
  1925. return this.checkStrings(g_output, e_output);
  1926. }
  1927. var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](g_output);
  1928. var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](e_output);
  1929. return this.checkBoolean(g_bool, e_bool);
  1930. } else {
  1931. return this.checkStrings(g_output, e_output);
  1932. }
  1933. }
  1934. }, {
  1935. key: "checkNumbers",
  1936. value: function checkNumbers(g_num, e_num) {
  1937. var decimalPlaces = Math.min(e_num.dp(), _util_config__WEBPACK_IMPORTED_MODULE_5__["Config"].decimalPlaces);
  1938. g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](g_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"].ROUND_FLOOR));
  1939. e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](e_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"].ROUND_FLOOR));
  1940. var result = g_num.eq(e_num);
  1941. var grade = result ? 1 : 0;
  1942. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](e_num.toNumber(), g_num.toNumber(), grade);
  1943. }
  1944. }, {
  1945. key: "checkBoolean",
  1946. value: function checkBoolean(g_bool, e_bool) {
  1947. var grade = g_bool == e_bool ? 1 : 0;
  1948. var g_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["convertBoolToString"](g_bool);
  1949. var e_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["convertBoolToString"](e_bool);
  1950. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](e_bool_text, g_bool_text, grade);
  1951. }
  1952. }, {
  1953. key: "checkStrings",
  1954. value: function checkStrings(g_output, e_ouput) {
  1955. var _this2 = this;
  1956. var assessmentList = [];
  1957. var e_output_clean = e_ouput.trim();
  1958. var g_output_clean = g_output.trim();
  1959. if (OutputMatching.NUM_IN_STRING_REGEX.test(e_ouput)) {
  1960. var expected_numbers = e_ouput.match(OutputMatching.NUM_IN_STRING_REGEX);
  1961. var generated_numbers = g_output.match(OutputMatching.NUM_IN_STRING_REGEX) || [];
  1962. var result = generated_numbers.map(function (val, i) {
  1963. if (i >= expected_numbers.length) {
  1964. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](null, val, 0);
  1965. }
  1966. var g_val = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](val);
  1967. var e_val = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](expected_numbers[i]);
  1968. return _this2.checkNumbers(g_val, e_val);
  1969. }, this);
  1970. if (expected_numbers.length > generated_numbers.length) {
  1971. for (var i = generated_numbers.length; i < expected_numbers.length; ++i) {
  1972. result.push(_output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](expected_numbers[i], null, 0));
  1973. }
  1974. }
  1975. e_output_clean = e_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '');
  1976. g_output_clean = g_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '');
  1977. var numberGrade = result.reduce(function (prev, r) {
  1978. return prev + r.grade;
  1979. }, 0) / result.length;
  1980. assessmentList.push(numberGrade);
  1981. }
  1982. if (OutputMatching.BOOLEAN_IN_STRING_REGEX.test(e_ouput)) {
  1983. var expected_bools = e_ouput.match(OutputMatching.BOOLEAN_IN_STRING_REGEX);
  1984. var generated_bools = g_output.match(OutputMatching.BOOLEAN_IN_STRING_REGEX) || [];
  1985. var _result = generated_bools.map(function (val, i) {
  1986. if (i >= expected_bools.length) {
  1987. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](null, val, 0);
  1988. }
  1989. var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](val);
  1990. var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](expected_bools[i]);
  1991. return _this2.checkBoolean(g_bool, e_bool);
  1992. }, this);
  1993. if (expected_bools.length > generated_bools.length) {
  1994. for (var _i = generated_bools.length; _i < expected_bools.length; ++_i) {
  1995. _result.push(_output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](expected_bools[_i], null, 0));
  1996. }
  1997. }
  1998. e_output_clean = e_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '');
  1999. g_output_clean = g_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '');
  2000. var boolGrade = _result.reduce(function (prev, r) {
  2001. return prev + r.grade;
  2002. }, 0) / _result.length;
  2003. assessmentList.push(boolGrade);
  2004. }
  2005. var dist = Object(_util_utils__WEBPACK_IMPORTED_MODULE_6__["levenshteinDistance"])(g_output_clean, e_output_clean);
  2006. var gradeDiff = Math.max(0, e_output_clean.length - dist) / e_output_clean.length;
  2007. gradeDiff = Number.isNaN(gradeDiff) ? 0 : gradeDiff;
  2008. var assessment_size = assessmentList.length + 1;
  2009. var gradeAcc = assessmentList.reduce(function (prev, val) {
  2010. return prev + val / assessment_size;
  2011. }, 0);
  2012. var finalGrade = 1 * (gradeDiff / assessment_size + gradeAcc);
  2013. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createStringResult"](e_ouput, g_output, finalGrade);
  2014. }
  2015. }, {
  2016. key: "getErrorMessage",
  2017. value: function getErrorMessage(errorID) {
  2018. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2019. args[_key - 1] = arguments[_key];
  2020. }
  2021. return LocalizedStrings.getError(errorID, args);
  2022. }
  2023. }]);
  2024. return OutputMatching;
  2025. }();
  2026. /***/ }),
  2027. /***/ "./js/assessment/output_matching/output_result.js":
  2028. /*!********************************************************!*\
  2029. !*** ./js/assessment/output_matching/output_result.js ***!
  2030. \********************************************************/
  2031. /*! exports provided: createNumberResult, createBoolResult, createStringResult, OutputMatchResult */
  2032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2033. "use strict";
  2034. __webpack_require__.r(__webpack_exports__);
  2035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumberResult", function() { return createNumberResult; });
  2036. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBoolResult", function() { return createBoolResult; });
  2037. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStringResult", function() { return createStringResult; });
  2038. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatchResult", function() { return OutputMatchResult; });
  2039. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2040. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2041. function createNumberResult(expected, generated, grade) {
  2042. return new OutputMatchResult(expected, generated, grade, "number");
  2043. }
  2044. function createBoolResult(expected, generated, grade) {
  2045. return new OutputMatchResult(expected, generated, grade, "bool");
  2046. }
  2047. function createStringResult(expected, generated, grade) {
  2048. return new OutputMatchResult(expected, generated, grade, "string");
  2049. }
  2050. var OutputMatchResult = function OutputMatchResult(expected, generated, grade, type) {
  2051. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputMatchResult);
  2052. this.expected = expected;
  2053. this.generated = generated;
  2054. this.grade = grade;
  2055. this.type = type;
  2056. };
  2057. /***/ }),
  2058. /***/ "./js/ast/ast_helpers.js":
  2059. /*!*******************************!*\
  2060. !*** ./js/ast/ast_helpers.js ***!
  2061. \*******************************/
  2062. /*! exports provided: recover */
  2063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2064. "use strict";
  2065. __webpack_require__.r(__webpack_exports__);
  2066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recover", function() { return recover; });
  2067. /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
  2068. function recover(_) {
  2069. var start = this._tokenStartCharIndex;
  2070. var stop = this._input.index;
  2071. var text = this._input.getText(start, stop);
  2072. text = this.getErrorDisplay(text);
  2073. var line = this._tokenStartLine;
  2074. var column = this._tokenStartColumn;
  2075. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__["SyntaxErrorFactory"].invalid_character(text, line, column);
  2076. }
  2077. /***/ }),
  2078. /***/ "./js/ast/commands/arrayAssign.js":
  2079. /*!****************************************!*\
  2080. !*** ./js/ast/commands/arrayAssign.js ***!
  2081. \****************************************/
  2082. /*! exports provided: ArrayIndexAssign */
  2083. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2084. "use strict";
  2085. __webpack_require__.r(__webpack_exports__);
  2086. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return ArrayIndexAssign; });
  2087. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2088. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2089. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2090. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2091. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2092. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2093. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2094. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2095. /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
  2096. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2097. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2098. var ArrayIndexAssign = /*#__PURE__*/function (_Assign) {
  2099. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(ArrayIndexAssign, _Assign);
  2100. var _super = _createSuper(ArrayIndexAssign);
  2101. function ArrayIndexAssign(id, lineExpression, columnExpression, expression) {
  2102. var _this;
  2103. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayIndexAssign);
  2104. _this = _super.call(this, id, expression);
  2105. _this.line = lineExpression;
  2106. _this.column = columnExpression;
  2107. return _this;
  2108. }
  2109. return ArrayIndexAssign;
  2110. }(_assign__WEBPACK_IMPORTED_MODULE_4__["Assign"]);
  2111. /***/ }),
  2112. /***/ "./js/ast/commands/arrayDeclaration.js":
  2113. /*!*********************************************!*\
  2114. !*** ./js/ast/commands/arrayDeclaration.js ***!
  2115. \*********************************************/
  2116. /*! exports provided: ArrayDeclaration */
  2117. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2118. "use strict";
  2119. __webpack_require__.r(__webpack_exports__);
  2120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return ArrayDeclaration; });
  2121. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2122. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2123. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2124. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2125. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2126. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2127. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2128. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2129. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2130. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2131. /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
  2132. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2133. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2134. var ArrayDeclaration = /*#__PURE__*/function (_Declaration) {
  2135. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayDeclaration, _Declaration);
  2136. var _super = _createSuper(ArrayDeclaration);
  2137. function ArrayDeclaration(id, type, lines, columns, initial, isConst) {
  2138. var _this;
  2139. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayDeclaration);
  2140. _this = _super.call(this, id, type, initial, isConst);
  2141. _this.lines = lines;
  2142. _this.columns = columns;
  2143. return _this;
  2144. }
  2145. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayDeclaration, [{
  2146. key: "isVector",
  2147. get: function get() {
  2148. return this.columns == null;
  2149. }
  2150. }]);
  2151. return ArrayDeclaration;
  2152. }(_declaration__WEBPACK_IMPORTED_MODULE_5__["Declaration"]);
  2153. /***/ }),
  2154. /***/ "./js/ast/commands/assign.js":
  2155. /*!***********************************!*\
  2156. !*** ./js/ast/commands/assign.js ***!
  2157. \***********************************/
  2158. /*! exports provided: Assign */
  2159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2160. "use strict";
  2161. __webpack_require__.r(__webpack_exports__);
  2162. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return Assign; });
  2163. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2164. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2165. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2166. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2167. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2168. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2169. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2170. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2171. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2172. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2173. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2174. var Assign = /*#__PURE__*/function (_Command) {
  2175. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Assign, _Command);
  2176. var _super = _createSuper(Assign);
  2177. function Assign(id, expression) {
  2178. var _this;
  2179. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Assign);
  2180. _this = _super.call(this);
  2181. _this.id = id;
  2182. _this.expression = expression;
  2183. return _this;
  2184. }
  2185. return Assign;
  2186. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2187. /***/ }),
  2188. /***/ "./js/ast/commands/break.js":
  2189. /*!**********************************!*\
  2190. !*** ./js/ast/commands/break.js ***!
  2191. \**********************************/
  2192. /*! exports provided: Break */
  2193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2194. "use strict";
  2195. __webpack_require__.r(__webpack_exports__);
  2196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  2197. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2198. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2199. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2200. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2201. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2202. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2203. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2204. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2205. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2206. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2207. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2208. var Break = /*#__PURE__*/function (_Command) {
  2209. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Break, _Command);
  2210. var _super = _createSuper(Break);
  2211. function Break() {
  2212. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Break);
  2213. return _super.call(this);
  2214. }
  2215. return Break;
  2216. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2217. /***/ }),
  2218. /***/ "./js/ast/commands/case.js":
  2219. /*!*********************************!*\
  2220. !*** ./js/ast/commands/case.js ***!
  2221. \*********************************/
  2222. /*! exports provided: Case */
  2223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2224. "use strict";
  2225. __webpack_require__.r(__webpack_exports__);
  2226. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return Case; });
  2227. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2228. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2229. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2230. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2231. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2232. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2233. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2234. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2235. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2236. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2237. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2238. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2239. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2240. var Case = /*#__PURE__*/function (_Command) {
  2241. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(Case, _Command);
  2242. var _super = _createSuper(Case);
  2243. function Case(expression) {
  2244. var _this;
  2245. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Case);
  2246. _this = _super.call(this);
  2247. _this.expression = expression;
  2248. /**
  2249. * @type {Command[]}
  2250. */
  2251. _this.commands = [];
  2252. return _this;
  2253. }
  2254. /**
  2255. *
  2256. * @param {Command[]} commands
  2257. */
  2258. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Case, [{
  2259. key: "setCommands",
  2260. value: function setCommands(commands) {
  2261. this.commands = commands;
  2262. }
  2263. }, {
  2264. key: "isDefault",
  2265. get: function get() {
  2266. return this.expression === null;
  2267. }
  2268. }]);
  2269. return Case;
  2270. }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
  2271. /***/ }),
  2272. /***/ "./js/ast/commands/command.js":
  2273. /*!************************************!*\
  2274. !*** ./js/ast/commands/command.js ***!
  2275. \************************************/
  2276. /*! exports provided: Command */
  2277. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2278. "use strict";
  2279. __webpack_require__.r(__webpack_exports__);
  2280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
  2281. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2282. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2283. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2284. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2285. var Command = /*#__PURE__*/function () {
  2286. function Command() {
  2287. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Command);
  2288. this._sourceInfo = null;
  2289. }
  2290. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Command, [{
  2291. key: "sourceInfo",
  2292. set: function set(sourceInfo) {
  2293. this._sourceInfo = sourceInfo;
  2294. },
  2295. get: function get() {
  2296. return this._sourceInfo;
  2297. }
  2298. }]);
  2299. return Command;
  2300. }();
  2301. /***/ }),
  2302. /***/ "./js/ast/commands/commandBlock.js":
  2303. /*!*****************************************!*\
  2304. !*** ./js/ast/commands/commandBlock.js ***!
  2305. \*****************************************/
  2306. /*! exports provided: CommandBlock */
  2307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2308. "use strict";
  2309. __webpack_require__.r(__webpack_exports__);
  2310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return CommandBlock; });
  2311. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2312. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2313. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2314. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2315. var CommandBlock = /*#__PURE__*/function () {
  2316. function CommandBlock(variables, commands) {
  2317. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CommandBlock);
  2318. this.variables = variables;
  2319. this.commands = commands;
  2320. this._sourceInfo = null;
  2321. }
  2322. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(CommandBlock, [{
  2323. key: "sourceInfo",
  2324. set: function set(sourceInfo) {
  2325. this._sourceInfo = sourceInfo;
  2326. },
  2327. get: function get() {
  2328. return this._sourceInfo;
  2329. }
  2330. }]);
  2331. return CommandBlock;
  2332. }();
  2333. /***/ }),
  2334. /***/ "./js/ast/commands/declaration.js":
  2335. /*!****************************************!*\
  2336. !*** ./js/ast/commands/declaration.js ***!
  2337. \****************************************/
  2338. /*! exports provided: Declaration */
  2339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2340. "use strict";
  2341. __webpack_require__.r(__webpack_exports__);
  2342. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return Declaration; });
  2343. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2344. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2345. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2346. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2347. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2348. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2349. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2350. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2351. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2352. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2353. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2354. var Declaration = /*#__PURE__*/function (_Command) {
  2355. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Declaration, _Command);
  2356. var _super = _createSuper(Declaration);
  2357. function Declaration(id, type, initial, isConst) {
  2358. var _this;
  2359. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Declaration);
  2360. _this = _super.call(this);
  2361. _this.id = id;
  2362. _this.type = type;
  2363. _this.initial = initial;
  2364. _this.isConst = isConst;
  2365. return _this;
  2366. }
  2367. return Declaration;
  2368. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2369. /***/ }),
  2370. /***/ "./js/ast/commands/for.js":
  2371. /*!********************************!*\
  2372. !*** ./js/ast/commands/for.js ***!
  2373. \********************************/
  2374. /*! exports provided: For */
  2375. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2376. "use strict";
  2377. __webpack_require__.r(__webpack_exports__);
  2378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "For", function() { return For; });
  2379. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2380. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2381. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2382. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2383. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2384. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2385. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2386. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2387. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2388. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2389. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2390. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2391. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2392. var For = /*#__PURE__*/function (_Command) {
  2393. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(For, _Command);
  2394. var _super = _createSuper(For);
  2395. function For(for_id, for_from, for_to, for_pass, commandBlock) {
  2396. var _this;
  2397. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, For);
  2398. _this = _super.call(this);
  2399. _this.for_id = for_id;
  2400. _this.for_from = for_from;
  2401. _this.for_to = for_to;
  2402. _this.for_pass = for_pass;
  2403. _this.commandBlock = commandBlock;
  2404. return _this;
  2405. }
  2406. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(For, [{
  2407. key: "commands",
  2408. get: function get() {
  2409. return this.commandBlock.commands;
  2410. }
  2411. }]);
  2412. return For;
  2413. }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
  2414. /***/ }),
  2415. /***/ "./js/ast/commands/formalParameter.js":
  2416. /*!********************************************!*\
  2417. !*** ./js/ast/commands/formalParameter.js ***!
  2418. \********************************************/
  2419. /*! exports provided: FormalParameter */
  2420. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2421. "use strict";
  2422. __webpack_require__.r(__webpack_exports__);
  2423. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return FormalParameter; });
  2424. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2425. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2426. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2427. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2428. var FormalParameter = /*#__PURE__*/function () {
  2429. function FormalParameter(type, id) {
  2430. var byRef = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  2431. var variadic = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2432. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FormalParameter);
  2433. this.type = type;
  2434. this.id = id;
  2435. this.byRef = byRef;
  2436. this.variadic = variadic;
  2437. this._sourceInfo = null;
  2438. }
  2439. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(FormalParameter, [{
  2440. key: "sourceInfo",
  2441. set: function set(sourceInfo) {
  2442. this._sourceInfo = sourceInfo;
  2443. },
  2444. get: function get() {
  2445. return this._sourceInfo;
  2446. }
  2447. }]);
  2448. return FormalParameter;
  2449. }();
  2450. /***/ }),
  2451. /***/ "./js/ast/commands/function.js":
  2452. /*!*************************************!*\
  2453. !*** ./js/ast/commands/function.js ***!
  2454. \*************************************/
  2455. /*! exports provided: Function */
  2456. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2457. "use strict";
  2458. __webpack_require__.r(__webpack_exports__);
  2459. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  2460. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2461. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2462. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2463. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2464. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  2465. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_2__);
  2466. var Function = /*#__PURE__*/function () {
  2467. /**
  2468. *
  2469. * @param {string} name
  2470. * @param {import('./../../typeSystem/itype').IType} returnType
  2471. * @param {import('./formalParameter').FormalParameter[]} formalParameters
  2472. * @param {import('./commandBlock').CommandBlock} commandBlock
  2473. */
  2474. function Function(name, returnType, formalParameters, commandBlock) {
  2475. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Function);
  2476. this.name = name;
  2477. this.returnType = returnType;
  2478. this.formalParameters = formalParameters;
  2479. this.commandBlock = commandBlock;
  2480. this._sourceInfo = null;
  2481. }
  2482. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Function, [{
  2483. key: "hasVariadic",
  2484. value: function hasVariadic() {
  2485. return this.formalParameters.some(function (p) {
  2486. return p.variadic;
  2487. });
  2488. }
  2489. }, {
  2490. key: "isMain",
  2491. get: function get() {
  2492. return this.name === null && this.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID);
  2493. }
  2494. }, {
  2495. key: "commands",
  2496. get: function get() {
  2497. return this.commandBlock.commands;
  2498. }
  2499. }, {
  2500. key: "variablesDeclarations",
  2501. get: function get() {
  2502. return this.commandBlock.variables;
  2503. }
  2504. }, {
  2505. key: "sourceInfo",
  2506. set: function set(sourceInfo) {
  2507. this._sourceInfo = sourceInfo;
  2508. },
  2509. get: function get() {
  2510. return this._sourceInfo;
  2511. }
  2512. }]);
  2513. return Function;
  2514. }();
  2515. /***/ }),
  2516. /***/ "./js/ast/commands/ifThenElse.js":
  2517. /*!***************************************!*\
  2518. !*** ./js/ast/commands/ifThenElse.js ***!
  2519. \***************************************/
  2520. /*! exports provided: IfThenElse */
  2521. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2522. "use strict";
  2523. __webpack_require__.r(__webpack_exports__);
  2524. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return IfThenElse; });
  2525. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2526. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2527. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2528. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2529. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2530. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2531. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2532. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2533. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2534. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2535. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2536. var IfThenElse = /*#__PURE__*/function (_Command) {
  2537. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(IfThenElse, _Command);
  2538. var _super = _createSuper(IfThenElse);
  2539. function IfThenElse(condition, ifTrue, ifFalse) {
  2540. var _this;
  2541. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IfThenElse);
  2542. _this = _super.call(this);
  2543. _this.condition = condition;
  2544. _this.ifTrue = ifTrue;
  2545. _this.ifFalse = ifFalse;
  2546. return _this;
  2547. }
  2548. return IfThenElse;
  2549. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2550. /***/ }),
  2551. /***/ "./js/ast/commands/index.js":
  2552. /*!**********************************!*\
  2553. !*** ./js/ast/commands/index.js ***!
  2554. \**********************************/
  2555. /*! exports provided: Break, Return, Assign, ArrayIndexAssign, Declaration, ArrayDeclaration, While, For, Function, IfThenElse, CommandBlock, RepeatUntil, Switch, Case, SysCall, FormalParameter, FunctionCall */
  2556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2557. "use strict";
  2558. __webpack_require__.r(__webpack_exports__);
  2559. /* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./break */ "./js/ast/commands/break.js");
  2560. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return _break__WEBPACK_IMPORTED_MODULE_0__["Break"]; });
  2561. /* harmony import */ var _return__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./return */ "./js/ast/commands/return.js");
  2562. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return _return__WEBPACK_IMPORTED_MODULE_1__["Return"]; });
  2563. /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
  2564. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return _assign__WEBPACK_IMPORTED_MODULE_2__["Assign"]; });
  2565. /* harmony import */ var _arrayAssign__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./arrayAssign */ "./js/ast/commands/arrayAssign.js");
  2566. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return _arrayAssign__WEBPACK_IMPORTED_MODULE_3__["ArrayIndexAssign"]; });
  2567. /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
  2568. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return _declaration__WEBPACK_IMPORTED_MODULE_4__["Declaration"]; });
  2569. /* harmony import */ var _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./arrayDeclaration */ "./js/ast/commands/arrayDeclaration.js");
  2570. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]; });
  2571. /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
  2572. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "While", function() { return _while__WEBPACK_IMPORTED_MODULE_6__["While"]; });
  2573. /* harmony import */ var _for__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./for */ "./js/ast/commands/for.js");
  2574. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "For", function() { return _for__WEBPACK_IMPORTED_MODULE_7__["For"]; });
  2575. /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./function */ "./js/ast/commands/function.js");
  2576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return _function__WEBPACK_IMPORTED_MODULE_8__["Function"]; });
  2577. /* harmony import */ var _ifThenElse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ifThenElse */ "./js/ast/commands/ifThenElse.js");
  2578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return _ifThenElse__WEBPACK_IMPORTED_MODULE_9__["IfThenElse"]; });
  2579. /* harmony import */ var _commandBlock__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commandBlock */ "./js/ast/commands/commandBlock.js");
  2580. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return _commandBlock__WEBPACK_IMPORTED_MODULE_10__["CommandBlock"]; });
  2581. /* harmony import */ var _repeatUntil__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./repeatUntil */ "./js/ast/commands/repeatUntil.js");
  2582. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return _repeatUntil__WEBPACK_IMPORTED_MODULE_11__["RepeatUntil"]; });
  2583. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./switch */ "./js/ast/commands/switch.js");
  2584. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return _switch__WEBPACK_IMPORTED_MODULE_12__["Switch"]; });
  2585. /* harmony import */ var _case__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./case */ "./js/ast/commands/case.js");
  2586. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return _case__WEBPACK_IMPORTED_MODULE_13__["Case"]; });
  2587. /* harmony import */ var _sysCall__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sysCall */ "./js/ast/commands/sysCall.js");
  2588. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return _sysCall__WEBPACK_IMPORTED_MODULE_14__["SysCall"]; });
  2589. /* harmony import */ var _formalParameter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./formalParameter */ "./js/ast/commands/formalParameter.js");
  2590. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return _formalParameter__WEBPACK_IMPORTED_MODULE_15__["FormalParameter"]; });
  2591. /* harmony import */ var _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../expressions/functionCall */ "./js/ast/expressions/functionCall.js");
  2592. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__["FunctionCall"]; });
  2593. //Proxy to expression since they do exatcly the same thing
  2594. /***/ }),
  2595. /***/ "./js/ast/commands/repeatUntil.js":
  2596. /*!****************************************!*\
  2597. !*** ./js/ast/commands/repeatUntil.js ***!
  2598. \****************************************/
  2599. /*! exports provided: RepeatUntil */
  2600. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2601. "use strict";
  2602. __webpack_require__.r(__webpack_exports__);
  2603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return RepeatUntil; });
  2604. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2605. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2606. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2607. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2608. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2609. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2610. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2611. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2612. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2613. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2614. /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
  2615. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2616. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2617. var RepeatUntil = /*#__PURE__*/function (_While) {
  2618. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RepeatUntil, _While);
  2619. var _super = _createSuper(RepeatUntil);
  2620. function RepeatUntil(condition, commandBlock) {
  2621. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RepeatUntil);
  2622. return _super.call(this, condition, commandBlock);
  2623. }
  2624. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RepeatUntil, [{
  2625. key: "testFirst",
  2626. get: function get() {
  2627. return false;
  2628. }
  2629. }]);
  2630. return RepeatUntil;
  2631. }(_while__WEBPACK_IMPORTED_MODULE_5__["While"]);
  2632. /***/ }),
  2633. /***/ "./js/ast/commands/return.js":
  2634. /*!***********************************!*\
  2635. !*** ./js/ast/commands/return.js ***!
  2636. \***********************************/
  2637. /*! exports provided: Return */
  2638. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2639. "use strict";
  2640. __webpack_require__.r(__webpack_exports__);
  2641. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  2642. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2643. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2644. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2645. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2646. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2647. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2648. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2649. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2650. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2651. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2652. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2653. var Return = /*#__PURE__*/function (_Command) {
  2654. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Return, _Command);
  2655. var _super = _createSuper(Return);
  2656. function Return(expression) {
  2657. var _this;
  2658. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Return);
  2659. _this = _super.call(this);
  2660. _this.expression = expression;
  2661. return _this;
  2662. }
  2663. return Return;
  2664. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2665. /***/ }),
  2666. /***/ "./js/ast/commands/switch.js":
  2667. /*!***********************************!*\
  2668. !*** ./js/ast/commands/switch.js ***!
  2669. \***********************************/
  2670. /*! exports provided: Switch */
  2671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2672. "use strict";
  2673. __webpack_require__.r(__webpack_exports__);
  2674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  2675. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2676. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2677. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2678. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2679. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2680. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2681. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2682. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2683. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2684. /* harmony import */ var _expressions_expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../expressions/expression */ "./js/ast/expressions/expression.js");
  2685. /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! . */ "./js/ast/commands/index.js");
  2686. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2687. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2688. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  2689. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  2690. var Switch = /*#__PURE__*/function (_Command) {
  2691. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Switch, _Command);
  2692. var _super = _createSuper(Switch);
  2693. /**
  2694. *
  2695. * @param {Expression} expression
  2696. * @param {Case[]} cases
  2697. */
  2698. function Switch(expression, cases) {
  2699. var _this;
  2700. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Switch);
  2701. _this = _super.call(this);
  2702. _this.expression = expression;
  2703. _this.cases = cases;
  2704. return _this;
  2705. }
  2706. return Switch;
  2707. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2708. /***/ }),
  2709. /***/ "./js/ast/commands/sysCall.js":
  2710. /*!************************************!*\
  2711. !*** ./js/ast/commands/sysCall.js ***!
  2712. \************************************/
  2713. /*! exports provided: SysCall */
  2714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2715. "use strict";
  2716. __webpack_require__.r(__webpack_exports__);
  2717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return SysCall; });
  2718. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2719. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2720. /**
  2721. * This class represents all the language defined functions.
  2722. * The language processor uses the id provided here to properly execute the desired function.
  2723. * The function is actually implemented inside the language processor.
  2724. * All the functions can be found at: js/processor/definedFunctions.js
  2725. */
  2726. var SysCall = function SysCall(langFunc) {
  2727. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SysCall);
  2728. this.langFunc = langFunc;
  2729. };
  2730. /***/ }),
  2731. /***/ "./js/ast/commands/while.js":
  2732. /*!**********************************!*\
  2733. !*** ./js/ast/commands/while.js ***!
  2734. \**********************************/
  2735. /*! exports provided: While */
  2736. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2737. "use strict";
  2738. __webpack_require__.r(__webpack_exports__);
  2739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "While", function() { return While; });
  2740. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2741. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2742. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2743. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2744. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2745. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2746. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2747. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2748. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2749. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2750. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2751. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2752. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2753. var While = /*#__PURE__*/function (_Command) {
  2754. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(While, _Command);
  2755. var _super = _createSuper(While);
  2756. function While(expression, commandBlock) {
  2757. var _this;
  2758. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, While);
  2759. _this = _super.call(this);
  2760. _this.expression = expression;
  2761. _this.commandBlock = commandBlock;
  2762. return _this;
  2763. }
  2764. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(While, [{
  2765. key: "commands",
  2766. get: function get() {
  2767. return this.commandBlock.commands;
  2768. }
  2769. }, {
  2770. key: "testFirst",
  2771. get: function get() {
  2772. return true;
  2773. }
  2774. }]);
  2775. return While;
  2776. }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
  2777. /***/ }),
  2778. /***/ "./js/ast/error/syntaxError.js":
  2779. /*!*************************************!*\
  2780. !*** ./js/ast/error/syntaxError.js ***!
  2781. \*************************************/
  2782. /*! exports provided: SyntaxError */
  2783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2784. "use strict";
  2785. __webpack_require__.r(__webpack_exports__);
  2786. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxError", function() { return SyntaxError; });
  2787. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2788. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2789. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  2790. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
  2791. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2792. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2793. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2794. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2795. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2796. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2797. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  2798. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
  2799. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2800. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2801. var SyntaxError = /*#__PURE__*/function (_Error) {
  2802. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(SyntaxError, _Error);
  2803. var _super = _createSuper(SyntaxError);
  2804. function SyntaxError() {
  2805. var _this;
  2806. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SyntaxError);
  2807. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  2808. msg[_key] = arguments[_key];
  2809. }
  2810. _this = _super.call.apply(_super, [this].concat(msg));
  2811. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), SyntaxError);
  2812. return _this;
  2813. }
  2814. return SyntaxError;
  2815. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
  2816. /***/ }),
  2817. /***/ "./js/ast/error/syntaxErrorFactory.js":
  2818. /*!********************************************!*\
  2819. !*** ./js/ast/error/syntaxErrorFactory.js ***!
  2820. \********************************************/
  2821. /*! exports provided: SyntaxErrorFactory */
  2822. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2823. "use strict";
  2824. __webpack_require__.r(__webpack_exports__);
  2825. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxErrorFactory", function() { return SyntaxErrorFactory; });
  2826. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  2827. /* harmony import */ var _syntaxError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./syntaxError */ "./js/ast/error/syntaxError.js");
  2828. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["getInstance"]();
  2829. function createError(message_id) {
  2830. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2831. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError(message_id, context));
  2832. }
  2833. var SyntaxErrorFactory = Object.freeze({
  2834. extra_lines: function extra_lines() {
  2835. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError("extra_lines"));
  2836. },
  2837. token_missing_one: function token_missing_one(expected, token) {
  2838. var context = [expected, token.text, token.line, token.column];
  2839. return createError("token_missing_one", context);
  2840. },
  2841. token_missing_list: function token_missing_list(expectedList, token) {
  2842. var line = expectedList.join(LocalizedStrings.getOR());
  2843. return SyntaxErrorFactory.token_missing_one(line, token);
  2844. },
  2845. id_missing: function id_missing(token) {
  2846. var context = [token.text, token.line, token.column];
  2847. return createError("id_missing", context);
  2848. },
  2849. eos_missing: function eos_missing(token) {
  2850. var context = [token.line, token.column];
  2851. return createError("eos_missing", context);
  2852. },
  2853. invalid_array_dimension: function invalid_array_dimension(typeName, token) {
  2854. var context = [token.line, token.column, typeName];
  2855. return createError("invalid_array_dimension", context);
  2856. },
  2857. invalid_array_size: function invalid_array_size(token) {
  2858. var context = [token.line];
  2859. return createError("invalid_array_size", context);
  2860. },
  2861. invalid_main_return: function invalid_main_return(name, typeName, token) {
  2862. var context = [name, typeName, token.line];
  2863. return createError("invalid_main_return", context);
  2864. },
  2865. invalid_var_declaration: function invalid_var_declaration(token) {
  2866. var context = [token.line];
  2867. return createError("invalid_var_declaration", context);
  2868. },
  2869. invalid_break_command: function invalid_break_command(cmdName, token) {
  2870. var context = [token.line, cmdName];
  2871. return createError("invalid_break_command", context);
  2872. },
  2873. invalid_terminal: function invalid_terminal(token) {
  2874. var context = [token.text, token.line, token.column];
  2875. return createError('invalid_terminal', context);
  2876. },
  2877. invalid_type: function invalid_type(list, token) {
  2878. var line = list.join(LocalizedStrings.getOR());
  2879. var context = [token.text, token.line, token.column, line];
  2880. return createError("invalid_type", context);
  2881. },
  2882. const_not_init: function const_not_init(token) {
  2883. var context = [token.line, token.column];
  2884. return createError("const_not_init", context);
  2885. },
  2886. invalid_id_format: function invalid_id_format(token) {
  2887. var context = [token.text, token.line, token.column];
  2888. return createError("invalid_id_format", context);
  2889. },
  2890. duplicate_function: function duplicate_function(token) {
  2891. var context = [token.text, token.line, token.column];
  2892. return createError("duplicate_function", context);
  2893. },
  2894. main_parameters: function main_parameters() {
  2895. return createError("main_parameters");
  2896. },
  2897. duplicate_variable: function duplicate_variable(token) {
  2898. var context = [token.text, token.line, token.column];
  2899. return createError("duplicate_variable", context);
  2900. },
  2901. invalid_character: function invalid_character(text, line, _column) {
  2902. var context = [text, line];
  2903. return createError("invalid_character", context);
  2904. },
  2905. annonymous_array_literal: function annonymous_array_literal(token) {
  2906. var context = [token.line];
  2907. return createError("annonymous_array_literal", context);
  2908. },
  2909. invalid_matrix_literal_line: function invalid_matrix_literal_line(exp, sourceInfo) {
  2910. var context = [exp, sourceInfo.line];
  2911. return createError("invalid_matrix_literal_line", context);
  2912. },
  2913. cannot_infer_matrix_line: function cannot_infer_matrix_line(name, sourceInfo) {
  2914. var context = [name, sourceInfo.line];
  2915. return createError("cannot_infer_matrix_line", context);
  2916. },
  2917. cannot_infer_matrix_column: function cannot_infer_matrix_column(name, sourceInfo) {
  2918. var context = [name, sourceInfo.line];
  2919. return createError("cannot_infer_matrix_column", context);
  2920. },
  2921. cannot_infer_vector_size: function cannot_infer_vector_size(name, sourceInfo) {
  2922. var context = [name, sourceInfo.line];
  2923. return createError("cannot_infer_vector_size", context);
  2924. },
  2925. matrix_to_vector_literal_attr: function matrix_to_vector_literal_attr(name, exp, sourceInfo) {
  2926. var context = [sourceInfo.line, exp, name];
  2927. return createError("matrix_to_vector_literal_attr", context);
  2928. },
  2929. vector_to_matrix_literal_attr: function vector_to_matrix_literal_attr(name, exp, sourceInfo) {
  2930. var context = [sourceInfo.line, exp, name];
  2931. return createError("vector_to_matrix_literal_attr", context);
  2932. },
  2933. array_init_not_literal: function array_init_not_literal(sourceInfo) {
  2934. var context = [sourceInfo.line];
  2935. return createError("array_init_not_literal", context);
  2936. },
  2937. array_exceeds_2d: function array_exceeds_2d(sourceInfo) {
  2938. var context = [sourceInfo.line];
  2939. return createError("array_exceeds_2d", context);
  2940. },
  2941. invalid_matrix_id_dimension: function invalid_matrix_id_dimension(sourceInfo) {
  2942. var context = [sourceInfo.line];
  2943. return createError("invalid_matrix_id_dimension", context);
  2944. },
  2945. invalid_vector_init: function invalid_vector_init(sourceInfo) {
  2946. var context = [sourceInfo.line];
  2947. return createError("invalid_vector_init", context);
  2948. },
  2949. invalid_matrix_init: function invalid_matrix_init(sourceInfo) {
  2950. var context = [sourceInfo.line];
  2951. return createError("invalid_matrix_init", context);
  2952. }
  2953. });
  2954. /***/ }),
  2955. /***/ "./js/ast/expressions/arrayAccess.js":
  2956. /*!*******************************************!*\
  2957. !*** ./js/ast/expressions/arrayAccess.js ***!
  2958. \*******************************************/
  2959. /*! exports provided: ArrayAccess */
  2960. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2961. "use strict";
  2962. __webpack_require__.r(__webpack_exports__);
  2963. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return ArrayAccess; });
  2964. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2965. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2966. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2967. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2968. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2969. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2970. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2971. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2972. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2973. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2974. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  2975. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2976. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2977. var ArrayAccess = /*#__PURE__*/function (_Expression) {
  2978. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayAccess, _Expression);
  2979. var _super = _createSuper(ArrayAccess);
  2980. function ArrayAccess(id, line, column) {
  2981. var _this;
  2982. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayAccess);
  2983. _this = _super.call(this);
  2984. _this.id = id;
  2985. _this.line = line;
  2986. _this.column = column;
  2987. return _this;
  2988. }
  2989. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayAccess, [{
  2990. key: "toString",
  2991. value: function toString() {
  2992. var strLine = this.line.toString();
  2993. var strColumn = null;
  2994. if (this.column) {
  2995. strColumn = this.column.toString();
  2996. }
  2997. var text = null;
  2998. if (strColumn) {
  2999. text = "".concat(this.id, "[").concat(strLine, "][").concat(strColumn, "]");
  3000. } else {
  3001. text = "".concat(this.id, "[").concat(strLine, "]");
  3002. }
  3003. if (this.parenthesis) {
  3004. return "(".concat(text, ")");
  3005. } else {
  3006. return text;
  3007. }
  3008. }
  3009. }]);
  3010. return ArrayAccess;
  3011. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3012. /***/ }),
  3013. /***/ "./js/ast/expressions/arrayLiteral.js":
  3014. /*!********************************************!*\
  3015. !*** ./js/ast/expressions/arrayLiteral.js ***!
  3016. \********************************************/
  3017. /*! exports provided: ArrayLiteral */
  3018. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3019. "use strict";
  3020. __webpack_require__.r(__webpack_exports__);
  3021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return ArrayLiteral; });
  3022. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3023. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3024. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3025. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3026. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3027. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3028. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3029. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3030. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3031. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3032. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3033. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3034. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3035. var ArrayLiteral = /*#__PURE__*/function (_Literal) {
  3036. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayLiteral, _Literal);
  3037. var _super = _createSuper(ArrayLiteral);
  3038. /**
  3039. *
  3040. * @param {import('../../typeSystem/itype').IType} type
  3041. * @param {import('./expression').Expression[]} value
  3042. */
  3043. function ArrayLiteral(type, value) {
  3044. var _this;
  3045. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayLiteral);
  3046. _this = _super.call(this, type);
  3047. _this.value = value;
  3048. return _this;
  3049. }
  3050. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayLiteral, [{
  3051. key: "validateType",
  3052. value: function validateType() {
  3053. var valid = true; // const subtype = this.subtype;
  3054. // if(this.columns !== null) {
  3055. // const len = this.lines;
  3056. // const len2 = this.columns;
  3057. // for (let i = len - 1; i >= 0 && valid; --i) {
  3058. // for (let j = len2 - 1; j >= 0 && valid; --j) {
  3059. // if(!this.value[i].value[j].type.isCompatilbe(subtype)) {
  3060. // valid = false;
  3061. // break;
  3062. // }
  3063. // }
  3064. // }
  3065. // } else {
  3066. // const len = this.lines;
  3067. // for (var i = len - 1; i >= 0 && valid; i--) {
  3068. // if(!this.value[i].type.isCompatilbe(subtype)) {
  3069. // valid = false;
  3070. // break;
  3071. // }
  3072. // }
  3073. // }
  3074. // Cannot validate type since no information on variables literals are available
  3075. return valid;
  3076. }
  3077. }, {
  3078. key: "validateSize",
  3079. value: function validateSize() {
  3080. var valid = true; // if(this.columns !== null) {
  3081. // const equalityTest = this.value.map(v => v.value.length)
  3082. // .reduce((old, next) => {
  3083. // console.log(next);
  3084. // if (old == null) {
  3085. // return next;
  3086. // } else if (old === next) {
  3087. // return old
  3088. // } else {
  3089. // return -1;
  3090. // }
  3091. // }, null);
  3092. // valid = equalityTest !== -1;
  3093. // }
  3094. // check is now made inside IVProgParser.parseVectorList(...)
  3095. return valid;
  3096. }
  3097. }, {
  3098. key: "toString",
  3099. value: function toString() {
  3100. var strList = this.value.map(function (arrayLiteral) {
  3101. return arrayLiteral.toString();
  3102. });
  3103. var text = "{" + strList.join(',') + "}";
  3104. if (this.parenthesis) {
  3105. return "(".concat(text, ")");
  3106. } else {
  3107. return text;
  3108. }
  3109. }
  3110. }, {
  3111. key: "subtype",
  3112. get: function get() {
  3113. var element = this.value[0];
  3114. if (element instanceof ArrayLiteral) {
  3115. return element.value[0].type;
  3116. } else {
  3117. return element.type;
  3118. }
  3119. }
  3120. }, {
  3121. key: "lines",
  3122. get: function get() {
  3123. return this.value.length;
  3124. }
  3125. }, {
  3126. key: "columns",
  3127. get: function get() {
  3128. var element = this.value[0];
  3129. if (!(element instanceof ArrayLiteral)) {
  3130. return null;
  3131. } else {
  3132. return element.value.length;
  3133. }
  3134. }
  3135. }, {
  3136. key: "isVector",
  3137. get: function get() {
  3138. return this.columns === null;
  3139. }
  3140. }, {
  3141. key: "isValid",
  3142. get: function get() {
  3143. return this.validateSize() && this.validateType();
  3144. }
  3145. }]);
  3146. return ArrayLiteral;
  3147. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3148. /***/ }),
  3149. /***/ "./js/ast/expressions/boolLiteral.js":
  3150. /*!*******************************************!*\
  3151. !*** ./js/ast/expressions/boolLiteral.js ***!
  3152. \*******************************************/
  3153. /*! exports provided: BoolLiteral */
  3154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3155. "use strict";
  3156. __webpack_require__.r(__webpack_exports__);
  3157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return BoolLiteral; });
  3158. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3159. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3160. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3161. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3162. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3163. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3164. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3165. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3166. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3167. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3168. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3169. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3170. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3171. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3172. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3173. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3174. var BoolLiteral = /*#__PURE__*/function (_Literal) {
  3175. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(BoolLiteral, _Literal);
  3176. var _super = _createSuper(BoolLiteral);
  3177. function BoolLiteral(value) {
  3178. var _this;
  3179. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, BoolLiteral);
  3180. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].BOOLEAN);
  3181. _this.value = value;
  3182. return _this;
  3183. }
  3184. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(BoolLiteral, [{
  3185. key: "toString",
  3186. value: function toString() {
  3187. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertBoolToString"])(this.value);
  3188. if (this.parenthesis) {
  3189. return "(".concat(text, ")");
  3190. } else {
  3191. return text;
  3192. }
  3193. }
  3194. }]);
  3195. return BoolLiteral;
  3196. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3197. /***/ }),
  3198. /***/ "./js/ast/expressions/charLiteral.js":
  3199. /*!*******************************************!*\
  3200. !*** ./js/ast/expressions/charLiteral.js ***!
  3201. \*******************************************/
  3202. /*! exports provided: CharLiteral */
  3203. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3204. "use strict";
  3205. __webpack_require__.r(__webpack_exports__);
  3206. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return CharLiteral; });
  3207. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3208. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3209. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3210. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3211. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3212. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3213. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3214. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3215. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3216. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3217. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3218. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3219. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3220. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3221. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3222. var CharLiteral = /*#__PURE__*/function (_Literal) {
  3223. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(CharLiteral, _Literal);
  3224. var _super = _createSuper(CharLiteral);
  3225. function CharLiteral(value) {
  3226. var _this;
  3227. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CharLiteral);
  3228. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].CHAR);
  3229. _this.value = value;
  3230. return _this;
  3231. }
  3232. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(CharLiteral, [{
  3233. key: "toString",
  3234. value: function toString() {
  3235. var text = "'".concat(this.value, "'");
  3236. if (this.parenthesis) {
  3237. return "(".concat(text, ")");
  3238. } else {
  3239. return text;
  3240. }
  3241. }
  3242. }]);
  3243. return CharLiteral;
  3244. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3245. /***/ }),
  3246. /***/ "./js/ast/expressions/expression.js":
  3247. /*!******************************************!*\
  3248. !*** ./js/ast/expressions/expression.js ***!
  3249. \******************************************/
  3250. /*! exports provided: Expression */
  3251. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3252. "use strict";
  3253. __webpack_require__.r(__webpack_exports__);
  3254. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Expression", function() { return Expression; });
  3255. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3256. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3257. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3258. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3259. var Expression = /*#__PURE__*/function () {
  3260. function Expression() {
  3261. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Expression);
  3262. this._sourceInfo = null;
  3263. this._parenthesis = false;
  3264. }
  3265. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Expression, [{
  3266. key: "sourceInfo",
  3267. set: function set(sourceInfo) {
  3268. this._sourceInfo = sourceInfo;
  3269. },
  3270. get: function get() {
  3271. return this._sourceInfo;
  3272. }
  3273. }, {
  3274. key: "parenthesis",
  3275. set: function set(flag) {
  3276. this._parenthesis = flag;
  3277. },
  3278. get: function get() {
  3279. return this._parenthesis;
  3280. }
  3281. }]);
  3282. return Expression;
  3283. }();
  3284. /***/ }),
  3285. /***/ "./js/ast/expressions/functionCall.js":
  3286. /*!********************************************!*\
  3287. !*** ./js/ast/expressions/functionCall.js ***!
  3288. \********************************************/
  3289. /*! exports provided: FunctionCall */
  3290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3291. "use strict";
  3292. __webpack_require__.r(__webpack_exports__);
  3293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  3294. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3295. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3296. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3297. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3298. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3299. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3300. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3301. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3302. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3303. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3304. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3305. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  3306. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3307. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3308. var FunctionCall = /*#__PURE__*/function (_Expression) {
  3309. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(FunctionCall, _Expression);
  3310. var _super = _createSuper(FunctionCall);
  3311. /**
  3312. *
  3313. * @param {string} id
  3314. * @param {Expression[]} actualParameters
  3315. */
  3316. function FunctionCall(id, actualParameters) {
  3317. var _this;
  3318. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FunctionCall);
  3319. _this = _super.call(this);
  3320. _this.id = id;
  3321. _this.actualParameters = actualParameters;
  3322. return _this;
  3323. }
  3324. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(FunctionCall, [{
  3325. key: "toString",
  3326. value: function toString() {
  3327. var name = null;
  3328. if (this.isMainCall) {
  3329. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getMainFunctionName();
  3330. } else {
  3331. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getLocalName(this.id);
  3332. }
  3333. var params = null;
  3334. if (this.actualParameters.length == 0) {
  3335. params = "()";
  3336. } else {
  3337. var strParams = this.actualParameters.map(function (v) {
  3338. return v.toString();
  3339. });
  3340. params = "(" + strParams.join(",") + ")";
  3341. }
  3342. if (this.parenthesis) {
  3343. return "(".concat(name + params, ")");
  3344. } else {
  3345. return name + params;
  3346. }
  3347. }
  3348. }, {
  3349. key: "isMainCall",
  3350. get: function get() {
  3351. return this.id === null;
  3352. }
  3353. }, {
  3354. key: "parametersSize",
  3355. get: function get() {
  3356. return this.actualParameters.length;
  3357. }
  3358. }]);
  3359. return FunctionCall;
  3360. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3361. /***/ }),
  3362. /***/ "./js/ast/expressions/index.js":
  3363. /*!*************************************!*\
  3364. !*** ./js/ast/expressions/index.js ***!
  3365. \*************************************/
  3366. /*! exports provided: ArrayAccess, FunctionCall, IntLiteral, RealLiteral, BoolLiteral, CharLiteral, StringLiteral, ArrayLiteral, VariableLiteral, InfixApp, UnaryApp */
  3367. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3368. "use strict";
  3369. __webpack_require__.r(__webpack_exports__);
  3370. /* harmony import */ var _arrayAccess__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayAccess */ "./js/ast/expressions/arrayAccess.js");
  3371. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return _arrayAccess__WEBPACK_IMPORTED_MODULE_0__["ArrayAccess"]; });
  3372. /* harmony import */ var _functionCall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functionCall */ "./js/ast/expressions/functionCall.js");
  3373. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _functionCall__WEBPACK_IMPORTED_MODULE_1__["FunctionCall"]; });
  3374. /* harmony import */ var _intLiteral__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intLiteral */ "./js/ast/expressions/intLiteral.js");
  3375. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return _intLiteral__WEBPACK_IMPORTED_MODULE_2__["IntLiteral"]; });
  3376. /* harmony import */ var _realLiteral__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./realLiteral */ "./js/ast/expressions/realLiteral.js");
  3377. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return _realLiteral__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"]; });
  3378. /* harmony import */ var _boolLiteral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./boolLiteral */ "./js/ast/expressions/boolLiteral.js");
  3379. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return _boolLiteral__WEBPACK_IMPORTED_MODULE_4__["BoolLiteral"]; });
  3380. /* harmony import */ var _charLiteral__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./charLiteral */ "./js/ast/expressions/charLiteral.js");
  3381. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return _charLiteral__WEBPACK_IMPORTED_MODULE_5__["CharLiteral"]; });
  3382. /* harmony import */ var _stringLiteral__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stringLiteral */ "./js/ast/expressions/stringLiteral.js");
  3383. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return _stringLiteral__WEBPACK_IMPORTED_MODULE_6__["StringLiteral"]; });
  3384. /* harmony import */ var _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./arrayLiteral */ "./js/ast/expressions/arrayLiteral.js");
  3385. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__["ArrayLiteral"]; });
  3386. /* harmony import */ var _variableLiteral__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./variableLiteral */ "./js/ast/expressions/variableLiteral.js");
  3387. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return _variableLiteral__WEBPACK_IMPORTED_MODULE_8__["VariableLiteral"]; });
  3388. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  3389. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return _infixApp__WEBPACK_IMPORTED_MODULE_9__["InfixApp"]; });
  3390. /* harmony import */ var _unaryApp__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./unaryApp */ "./js/ast/expressions/unaryApp.js");
  3391. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return _unaryApp__WEBPACK_IMPORTED_MODULE_10__["UnaryApp"]; });
  3392. /***/ }),
  3393. /***/ "./js/ast/expressions/infixApp.js":
  3394. /*!****************************************!*\
  3395. !*** ./js/ast/expressions/infixApp.js ***!
  3396. \****************************************/
  3397. /*! exports provided: InfixApp */
  3398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3399. "use strict";
  3400. __webpack_require__.r(__webpack_exports__);
  3401. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return InfixApp; });
  3402. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3403. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3404. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3405. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3406. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3407. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3408. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3409. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3410. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3411. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3412. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3413. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3414. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3415. var InfixApp = /*#__PURE__*/function (_Expression) {
  3416. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InfixApp, _Expression);
  3417. var _super = _createSuper(InfixApp);
  3418. function InfixApp(op, left, right) {
  3419. var _this;
  3420. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InfixApp);
  3421. _this = _super.call(this);
  3422. _this.op = op;
  3423. _this.left = left;
  3424. _this.right = right;
  3425. return _this;
  3426. }
  3427. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InfixApp, [{
  3428. key: "toString",
  3429. value: function toString() {
  3430. var l = this.left.toString();
  3431. var op = this.op.value;
  3432. var r = this.right.toString();
  3433. if (this.parenthesis) {
  3434. return "(".concat(l + op + r, ")");
  3435. } else {
  3436. return l + op + r;
  3437. }
  3438. }
  3439. }]);
  3440. return InfixApp;
  3441. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3442. /***/ }),
  3443. /***/ "./js/ast/expressions/intLiteral.js":
  3444. /*!******************************************!*\
  3445. !*** ./js/ast/expressions/intLiteral.js ***!
  3446. \******************************************/
  3447. /*! exports provided: IntLiteral */
  3448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3449. "use strict";
  3450. __webpack_require__.r(__webpack_exports__);
  3451. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return IntLiteral; });
  3452. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3453. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3454. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3455. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3456. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3457. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3458. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3459. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3460. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3461. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3462. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3463. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3464. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3465. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3466. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3467. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3468. var IntLiteral = /*#__PURE__*/function (_Literal) {
  3469. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IntLiteral, _Literal);
  3470. var _super = _createSuper(IntLiteral);
  3471. function IntLiteral(value) {
  3472. var _this;
  3473. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IntLiteral);
  3474. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].INTEGER);
  3475. _this.value = value;
  3476. return _this;
  3477. }
  3478. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IntLiteral, [{
  3479. key: "toString",
  3480. value: function toString() {
  3481. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
  3482. if (this.parenthesis) {
  3483. return "(".concat(text, ")");
  3484. } else {
  3485. return text;
  3486. }
  3487. }
  3488. }]);
  3489. return IntLiteral;
  3490. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3491. /***/ }),
  3492. /***/ "./js/ast/expressions/literal.js":
  3493. /*!***************************************!*\
  3494. !*** ./js/ast/expressions/literal.js ***!
  3495. \***************************************/
  3496. /*! exports provided: Literal */
  3497. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3498. "use strict";
  3499. __webpack_require__.r(__webpack_exports__);
  3500. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Literal", function() { return Literal; });
  3501. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3502. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3503. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3504. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  3505. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3506. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  3507. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3508. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  3509. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3510. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  3511. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3512. var Literal = /*#__PURE__*/function (_Expression) {
  3513. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Literal, _Expression);
  3514. var _super = _createSuper(Literal);
  3515. function Literal(type) {
  3516. var _this;
  3517. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Literal);
  3518. _this = _super.call(this);
  3519. _this.type = type;
  3520. return _this;
  3521. }
  3522. return Literal;
  3523. }(_expression__WEBPACK_IMPORTED_MODULE_4__["Expression"]);
  3524. /***/ }),
  3525. /***/ "./js/ast/expressions/realLiteral.js":
  3526. /*!*******************************************!*\
  3527. !*** ./js/ast/expressions/realLiteral.js ***!
  3528. \*******************************************/
  3529. /*! exports provided: RealLiteral */
  3530. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3531. "use strict";
  3532. __webpack_require__.r(__webpack_exports__);
  3533. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return RealLiteral; });
  3534. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3535. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3536. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3537. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3538. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3539. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3540. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3541. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3542. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3543. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3544. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3545. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3546. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3547. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3548. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3549. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3550. var RealLiteral = /*#__PURE__*/function (_Literal) {
  3551. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RealLiteral, _Literal);
  3552. var _super = _createSuper(RealLiteral);
  3553. function RealLiteral(value) {
  3554. var _this;
  3555. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RealLiteral);
  3556. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].REAL);
  3557. _this.value = value;
  3558. return _this;
  3559. }
  3560. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RealLiteral, [{
  3561. key: "toString",
  3562. value: function toString() {
  3563. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
  3564. if (this.parenthesis) {
  3565. return "(".concat(text, ")");
  3566. } else {
  3567. return text;
  3568. }
  3569. }
  3570. }]);
  3571. return RealLiteral;
  3572. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3573. /***/ }),
  3574. /***/ "./js/ast/expressions/stringLiteral.js":
  3575. /*!*********************************************!*\
  3576. !*** ./js/ast/expressions/stringLiteral.js ***!
  3577. \*********************************************/
  3578. /*! exports provided: StringLiteral */
  3579. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3580. "use strict";
  3581. __webpack_require__.r(__webpack_exports__);
  3582. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return StringLiteral; });
  3583. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3584. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3585. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3586. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3587. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3588. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3589. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3590. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3591. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3592. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3593. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3594. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3595. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3596. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3597. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3598. var StringLiteral = /*#__PURE__*/function (_Literal) {
  3599. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(StringLiteral, _Literal);
  3600. var _super = _createSuper(StringLiteral);
  3601. function StringLiteral(value) {
  3602. var _this;
  3603. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, StringLiteral);
  3604. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].STRING);
  3605. _this.value = value;
  3606. return _this;
  3607. }
  3608. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(StringLiteral, [{
  3609. key: "toString",
  3610. value: function toString() {
  3611. var text = '"' + this.value + '"';
  3612. if (this.parenthesis) {
  3613. return "(".concat(text, ")");
  3614. } else {
  3615. return text;
  3616. }
  3617. }
  3618. }]);
  3619. return StringLiteral;
  3620. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3621. /***/ }),
  3622. /***/ "./js/ast/expressions/unaryApp.js":
  3623. /*!****************************************!*\
  3624. !*** ./js/ast/expressions/unaryApp.js ***!
  3625. \****************************************/
  3626. /*! exports provided: UnaryApp */
  3627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3628. "use strict";
  3629. __webpack_require__.r(__webpack_exports__);
  3630. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return UnaryApp; });
  3631. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3632. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3633. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3634. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3635. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3636. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3637. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3638. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3639. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3640. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3641. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  3642. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3643. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3644. var UnaryApp = /*#__PURE__*/function (_InfixApp) {
  3645. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(UnaryApp, _InfixApp);
  3646. var _super = _createSuper(UnaryApp);
  3647. function UnaryApp(op, left) {
  3648. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, UnaryApp);
  3649. return _super.call(this, op, left, null);
  3650. }
  3651. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(UnaryApp, [{
  3652. key: "toString",
  3653. value: function toString() {
  3654. var l = this.left.toString();
  3655. var op = this.op.value;
  3656. if (this.parenthesis) {
  3657. return "(".concat(op + l, ")");
  3658. } else {
  3659. return op + l;
  3660. }
  3661. }
  3662. }]);
  3663. return UnaryApp;
  3664. }(_infixApp__WEBPACK_IMPORTED_MODULE_5__["InfixApp"]);
  3665. /***/ }),
  3666. /***/ "./js/ast/expressions/variableLiteral.js":
  3667. /*!***********************************************!*\
  3668. !*** ./js/ast/expressions/variableLiteral.js ***!
  3669. \***********************************************/
  3670. /*! exports provided: VariableLiteral */
  3671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3672. "use strict";
  3673. __webpack_require__.r(__webpack_exports__);
  3674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return VariableLiteral; });
  3675. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3676. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3677. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3678. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3679. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3680. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3681. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3682. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3683. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3684. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3685. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3686. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3687. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3688. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  3689. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  3690. var VariableLiteral = /*#__PURE__*/function (_Literal) {
  3691. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(VariableLiteral, _Literal);
  3692. var _super = _createSuper(VariableLiteral);
  3693. function VariableLiteral(id) {
  3694. var _this;
  3695. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, VariableLiteral);
  3696. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].UNDEFINED);
  3697. _this.id = id;
  3698. return _this;
  3699. }
  3700. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(VariableLiteral, [{
  3701. key: "toString",
  3702. value: function toString() {
  3703. if (this.parenthesis) {
  3704. return "(".concat(this.id, ")");
  3705. } else {
  3706. return this.id;
  3707. }
  3708. }
  3709. }]);
  3710. return VariableLiteral;
  3711. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3712. /***/ }),
  3713. /***/ "./js/ast/ivprogParser.js":
  3714. /*!********************************!*\
  3715. !*** ./js/ast/ivprogParser.js ***!
  3716. \********************************/
  3717. /*! exports provided: IVProgParser */
  3718. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3719. "use strict";
  3720. __webpack_require__.r(__webpack_exports__);
  3721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgParser", function() { return IVProgParser; });
  3722. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3723. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3724. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3725. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3726. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
  3727. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antlr4_index__WEBPACK_IMPORTED_MODULE_2__);
  3728. /* harmony import */ var _expressions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./expressions */ "./js/ast/expressions/index.js");
  3729. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands */ "./js/ast/commands/index.js");
  3730. /* harmony import */ var _ast_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ast_helpers */ "./js/ast/ast_helpers.js");
  3731. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3732. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  3733. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__);
  3734. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  3735. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  3736. /* harmony import */ var _sourceInfo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sourceInfo */ "./js/ast/sourceInfo.js");
  3737. /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./operators */ "./js/ast/operators.ts");
  3738. /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_operators__WEBPACK_IMPORTED_MODULE_10__);
  3739. /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
  3740. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  3741. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  3742. var IVProgParser = /*#__PURE__*/function () {
  3743. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, null, [{
  3744. key: "createParser",
  3745. value: function createParser(input) {
  3746. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLexer();
  3747. return new IVProgParser(input, lexerClass);
  3748. } // <BEGIN scope consts>
  3749. }, {
  3750. key: "BASE",
  3751. get: function get() {
  3752. return 0;
  3753. }
  3754. }, {
  3755. key: "FUNCTION",
  3756. get: function get() {
  3757. return 1;
  3758. }
  3759. }, {
  3760. key: "COMMAND",
  3761. get: function get() {
  3762. return 2;
  3763. }
  3764. }, {
  3765. key: "BREAKABLE",
  3766. get: function get() {
  3767. return 4;
  3768. } // </ END scope consts>
  3769. }]);
  3770. function IVProgParser(input, lexerClass) {
  3771. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgParser);
  3772. this.lexerClass = lexerClass;
  3773. this.inputStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["InputStream"](input);
  3774. this.lexer = new lexerClass(this.inputStream);
  3775. this.lexer.recover = _ast_helpers__WEBPACK_IMPORTED_MODULE_5__["recover"].bind(this.lexer);
  3776. this.tokenStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["CommonTokenStream"](this.lexer);
  3777. this.tokenStream.fill();
  3778. this.pos = 1;
  3779. this.variableTypes = [this.lexerClass.RK_INTEGER, this.lexerClass.RK_REAL, this.lexerClass.RK_BOOLEAN, this.lexerClass.RK_STRING, this.lexerClass.RK_CHARACTER];
  3780. this.functionTypes = this.variableTypes.concat(this.lexerClass.RK_VOID);
  3781. this.parsingArrayDimension = 0;
  3782. this.scope = [];
  3783. this.langFuncs = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLangFuncs();
  3784. this.definedFuncsNameList = [];
  3785. this.definedVariablesStack = [];
  3786. }
  3787. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, [{
  3788. key: "parseTree",
  3789. value: function parseTree() {
  3790. return this.parseProgram();
  3791. }
  3792. }, {
  3793. key: "getToken",
  3794. value: function getToken() {
  3795. var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pos;
  3796. // if(index === null)
  3797. // index = this.pos;
  3798. return this.tokenStream.LT(index);
  3799. }
  3800. }, {
  3801. key: "insideScope",
  3802. value: function insideScope(scope) {
  3803. if (this.scope.length <= 0) {
  3804. return IVProgParser.BASE === scope;
  3805. } else {
  3806. return this.scope[this.scope.length - 1] === scope;
  3807. }
  3808. }
  3809. }, {
  3810. key: "pushScope",
  3811. value: function pushScope(scope) {
  3812. this.scope.push(scope);
  3813. }
  3814. }, {
  3815. key: "pushVariableStack",
  3816. value: function pushVariableStack() {
  3817. this.definedVariablesStack.push([]);
  3818. }
  3819. }, {
  3820. key: "popScope",
  3821. value: function popScope() {
  3822. return this.scope.pop();
  3823. }
  3824. }, {
  3825. key: "popVariableStack",
  3826. value: function popVariableStack() {
  3827. return this.definedVariablesStack.pop();
  3828. }
  3829. }, {
  3830. key: "getCurrentVariableStack",
  3831. value: function getCurrentVariableStack() {
  3832. return this.definedVariablesStack[this.definedVariablesStack.length - 1];
  3833. }
  3834. }, {
  3835. key: "isEOF",
  3836. value: function isEOF() {
  3837. this.getToken(this.pos);
  3838. return this.tokenStream.fetchedEOF;
  3839. }
  3840. }, {
  3841. key: "parseProgram",
  3842. value: function parseProgram() {
  3843. this.consumeNewLines();
  3844. var token = this.getToken();
  3845. var globalVars = [];
  3846. var functions = [];
  3847. if (this.lexerClass.RK_PROGRAM === token.type) {
  3848. this.pos++;
  3849. this.consumeNewLines();
  3850. this.checkOpenCurly();
  3851. this.pos++;
  3852. this.pushVariableStack();
  3853. for (;;) {
  3854. this.consumeNewLines();
  3855. var _token = this.getToken();
  3856. if (_token.type === this.lexerClass.RK_CONST || this.isVariableType(_token)) {
  3857. globalVars = globalVars.concat(this.parseGlobalVariables());
  3858. } else if (_token.type === this.lexerClass.RK_FUNCTION) {
  3859. this.pushVariableStack();
  3860. functions = functions.concat(this.parseFunction());
  3861. this.popVariableStack();
  3862. } else {
  3863. break;
  3864. }
  3865. }
  3866. this.consumeNewLines();
  3867. this.checkCloseCurly();
  3868. this.pos++;
  3869. this.consumeNewLines();
  3870. if (!this.isEOF()) {
  3871. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].extra_lines();
  3872. }
  3873. this.popVariableStack();
  3874. return {
  3875. global: globalVars,
  3876. functions: functions
  3877. };
  3878. } else {
  3879. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_PROGRAM], token);
  3880. }
  3881. }
  3882. }, {
  3883. key: "checkOpenCurly",
  3884. value: function checkOpenCurly() {
  3885. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3886. var token = this.getToken();
  3887. if (this.lexerClass.OPEN_CURLY !== token.type) {
  3888. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("{", token);else return false;
  3889. }
  3890. return true;
  3891. }
  3892. }, {
  3893. key: "checkCloseCurly",
  3894. value: function checkCloseCurly() {
  3895. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3896. var token = this.getToken();
  3897. if (this.lexerClass.CLOSE_CURLY !== token.type) {
  3898. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("}", token);else return false;
  3899. }
  3900. return true;
  3901. }
  3902. /* It checks if the current token at position pos is a ']'.
  3903. * As a check function it doesn't increment pos.
  3904. *
  3905. * @params bool:attempt, indicates that the token is optional. Defaults: false
  3906. *
  3907. * @returns true if the attempt is true and current token is '[',
  3908. * false is attempt is true and current token is not '['
  3909. **/
  3910. }, {
  3911. key: "checkOpenBrace",
  3912. value: function checkOpenBrace() {
  3913. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3914. var token = this.getToken();
  3915. if (this.lexerClass.OPEN_BRACE !== token.type) {
  3916. if (!attempt) {
  3917. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("[", token);
  3918. } else {
  3919. return false;
  3920. }
  3921. }
  3922. return true;
  3923. }
  3924. }, {
  3925. key: "checkCloseBrace",
  3926. value: function checkCloseBrace() {
  3927. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3928. var token = this.getToken();
  3929. if (this.lexerClass.CLOSE_BRACE !== token.type) {
  3930. if (!attempt) {
  3931. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("]", token);
  3932. } else {
  3933. return false;
  3934. }
  3935. }
  3936. return true;
  3937. }
  3938. }, {
  3939. key: "checkOpenParenthesis",
  3940. value: function checkOpenParenthesis() {
  3941. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3942. var token = this.getToken();
  3943. if (this.lexerClass.OPEN_PARENTHESIS !== token.type) {
  3944. if (!attempt) {
  3945. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("(", token);
  3946. } else {
  3947. return false;
  3948. }
  3949. }
  3950. return true;
  3951. }
  3952. }, {
  3953. key: "checkCloseParenthesis",
  3954. value: function checkCloseParenthesis() {
  3955. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3956. var token = this.getToken();
  3957. if (this.lexerClass.CLOSE_PARENTHESIS !== token.type) {
  3958. if (!attempt) {
  3959. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(")", token);
  3960. } else {
  3961. return false;
  3962. }
  3963. }
  3964. return true;
  3965. }
  3966. }, {
  3967. key: "checkEOS",
  3968. value: function checkEOS() {
  3969. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3970. var eosToken = this.getToken();
  3971. if (eosToken.type !== this.lexerClass.EOS) {
  3972. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].eos_missing(eosToken);else return false;
  3973. }
  3974. return true;
  3975. }
  3976. }, {
  3977. key: "checkFunctionDuplicate",
  3978. value: function checkFunctionDuplicate(functionID, funcIDToken) {
  3979. var id = functionID === null ? "$main" : functionID;
  3980. var index = this.definedFuncsNameList.indexOf(id);
  3981. if (index !== -1) {
  3982. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_function(funcIDToken);
  3983. }
  3984. this.definedFuncsNameList.push(id);
  3985. }
  3986. }, {
  3987. key: "checkVariableDuplicate",
  3988. value: function checkVariableDuplicate(variableID, sourceInfo) {
  3989. var index = this.getCurrentVariableStack().indexOf(variableID);
  3990. if (index !== -1) {
  3991. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_variable(sourceInfo);
  3992. }
  3993. this.getCurrentVariableStack().push(variableID);
  3994. }
  3995. }, {
  3996. key: "consumeForSemiColon",
  3997. value: function consumeForSemiColon() {
  3998. var eosToken = this.getToken();
  3999. if (eosToken.type === this.lexerClass.EOS && eosToken.text.match(";")) {
  4000. this.pos++;
  4001. return;
  4002. }
  4003. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(";", eosToken);
  4004. }
  4005. }, {
  4006. key: "parseGlobalVariables",
  4007. value: function parseGlobalVariables() {
  4008. var decl = this.parseMaybeConst();
  4009. this.checkEOS();
  4010. this.pos++;
  4011. return decl;
  4012. }
  4013. /*
  4014. * Checks if the next token is PR_CONST. It's only available
  4015. * at global variables declaration level
  4016. * @returns Declararion(const, type, id, initVal?)
  4017. **/
  4018. }, {
  4019. key: "parseMaybeConst",
  4020. value: function parseMaybeConst() {
  4021. var constToken = this.getToken();
  4022. if (constToken.type === this.lexerClass.RK_CONST) {
  4023. this.pos++;
  4024. var typeString = this.parseType();
  4025. return this.parseDeclaration(typeString, true);
  4026. } else if (this.isVariableType(constToken)) {
  4027. var _typeString = this.parseType();
  4028. return this.parseDeclaration(_typeString);
  4029. } else {
  4030. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_CONST]].concat(this.getTypeArray()), constToken);
  4031. }
  4032. }
  4033. /*
  4034. * Parses a declarion of the form: type --- id --- (= --- EAnd)?
  4035. * @returns a list of Declararion(const, type, id, initVal?)
  4036. **/
  4037. }, {
  4038. key: "parseDeclaration",
  4039. value: function parseDeclaration(typeString) {
  4040. var isConst = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  4041. var initial = null;
  4042. var dim1 = null;
  4043. var dim2 = null;
  4044. var dimensions = 0;
  4045. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(this.getToken());
  4046. var idString = this.parseID();
  4047. this.checkVariableDuplicate(idString, sourceInfo); // Check for array or vector
  4048. // ID[int/IDi?][int/IDj?]
  4049. if (this.checkOpenBrace(true)) {
  4050. this.pos += 1;
  4051. this.consumeNewLines();
  4052. dim1 = this.parseArrayDimension();
  4053. this.consumeNewLines();
  4054. this.checkCloseBrace();
  4055. this.pos += 1;
  4056. dimensions += 1;
  4057. if (this.checkOpenBrace(true)) {
  4058. this.pos += 1;
  4059. this.consumeNewLines();
  4060. dim2 = this.parseArrayDimension();
  4061. this.consumeNewLines();
  4062. this.checkCloseBrace();
  4063. this.pos += 1;
  4064. dimensions += 1;
  4065. }
  4066. return this.parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2);
  4067. } else {
  4068. var equalsToken = this.getToken();
  4069. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4070. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4071. }
  4072. if (equalsToken.type === this.lexerClass.EQUAL) {
  4073. this.pos++;
  4074. initial = this.parseExpressionOR();
  4075. }
  4076. var declaration = new _commands__WEBPACK_IMPORTED_MODULE_4__["Declaration"](idString, typeString, initial, isConst);
  4077. declaration.sourceInfo = sourceInfo;
  4078. var commaToken = this.getToken();
  4079. if (commaToken.type === this.lexerClass.COMMA) {
  4080. this.pos++;
  4081. this.consumeNewLines();
  4082. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4083. } else {
  4084. return [declaration];
  4085. }
  4086. }
  4087. }
  4088. }, {
  4089. key: "parseArrayDeclaration",
  4090. value: function parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2) {
  4091. var equalsToken = this.getToken();
  4092. var n_lines = dim1;
  4093. var n_columns = dim2;
  4094. var initial = null;
  4095. var dim_is_id = false;
  4096. if (dim1 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"] || dim2 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"]) {
  4097. dim_is_id = true;
  4098. if (dimensions > 1 && (dim1 == null || dim2 == null)) {
  4099. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_id_dimension(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4100. }
  4101. }
  4102. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4103. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4104. }
  4105. if (equalsToken.type === this.lexerClass.EQUAL) {
  4106. if (dim_is_id) {
  4107. if (dimensions == 1) {
  4108. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_vector_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4109. } else {
  4110. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4111. }
  4112. }
  4113. this.pos += 1;
  4114. initial = this.parseArrayLiteral(typeString);
  4115. }
  4116. if (initial == null && dim1 == null) {
  4117. if (dimensions > 1) {
  4118. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_line(idString, sourceInfo);
  4119. }
  4120. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_vector_size(idString, sourceInfo);
  4121. }
  4122. if (dimensions > 1) {
  4123. if (initial == null && dim2 == null) {
  4124. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_column(idString, sourceInfo);
  4125. }
  4126. }
  4127. if (dimensions === 1 && initial != null && !initial.isVector) {
  4128. var expString = initial.toString();
  4129. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].matrix_to_vector_literal_attr(idString, expString, initial.sourceInfo);
  4130. } else if (dimensions > 1 && initial != null && initial.isVector) {
  4131. var _expString = initial.toString();
  4132. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].vector_to_matrix_literal_attr(idString, _expString, initial.sourceInfo);
  4133. }
  4134. if (dim1 == null) {
  4135. n_lines = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.lines));
  4136. n_lines.sourceInfo = sourceInfo;
  4137. }
  4138. if (dimensions > 1) {
  4139. if (dim2 == null) {
  4140. n_columns = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.columns));
  4141. n_columns.sourceInfo = sourceInfo;
  4142. }
  4143. }
  4144. var declaration = new _commands__WEBPACK_IMPORTED_MODULE_4__["ArrayDeclaration"](idString, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dimensions), n_lines, n_columns, initial, isConst);
  4145. declaration.sourceInfo = sourceInfo;
  4146. var commaToken = this.getToken();
  4147. if (commaToken.type === this.lexerClass.COMMA) {
  4148. this.pos++;
  4149. this.consumeNewLines();
  4150. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4151. } else {
  4152. return [declaration];
  4153. }
  4154. }
  4155. }, {
  4156. key: "consumeNewLines",
  4157. value: function consumeNewLines() {
  4158. var token = this.getToken();
  4159. while (token.type === this.lexerClass.EOS && token.text.match("[\r\n]+")) {
  4160. this.pos++;
  4161. token = this.getToken();
  4162. }
  4163. }
  4164. }, {
  4165. key: "isVariableType",
  4166. value: function isVariableType(token) {
  4167. return this.variableTypes.find(function (v) {
  4168. return v === token.type;
  4169. });
  4170. }
  4171. /*
  4172. * Reads the next token of the stream to check if it is a Integer or an ID.
  4173. * @returns Integer | ID
  4174. **/
  4175. }, {
  4176. key: "parseArrayDimension",
  4177. value: function parseArrayDimension() {
  4178. var dimToken = this.getToken();
  4179. if (dimToken.type === this.lexerClass.INTEGER) {
  4180. //parse as int literal
  4181. this.pos++;
  4182. return this.getIntLiteral(dimToken);
  4183. } else if (dimToken.type === this.lexerClass.ID) {
  4184. //parse as variable
  4185. this.pos++;
  4186. return this.parseVariable(dimToken);
  4187. } else if (dimToken.type === this.lexerClass.CLOSE_BRACE) {
  4188. return null;
  4189. } else {
  4190. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_array_dimension(this.lexer.literalNames[this.lexerClass.RK_INTEGER], dimToken);
  4191. }
  4192. }
  4193. /*
  4194. * Returns an object {type: 'int', value: value}.
  4195. * It checks for binary and hexadecimal integers.
  4196. * @returns object with fields type and value
  4197. **/
  4198. }, {
  4199. key: "getIntLiteral",
  4200. value: function getIntLiteral(token) {
  4201. var text = token.text;
  4202. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4203. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](text));
  4204. exp.sourceInfo = sourceInfo;
  4205. return exp;
  4206. }
  4207. }, {
  4208. key: "getRealLiteral",
  4209. value: function getRealLiteral(token) {
  4210. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4211. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toReal"](token.text));
  4212. exp.sourceInfo = sourceInfo;
  4213. return exp;
  4214. }
  4215. }, {
  4216. key: "getStringLiteral",
  4217. value: function getStringLiteral(token) {
  4218. var text = token.text;
  4219. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4220. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["StringLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toString"](text));
  4221. exp.sourceInfo = sourceInfo;
  4222. return exp;
  4223. }
  4224. }, {
  4225. key: "getCharLiteral",
  4226. value: function getCharLiteral(token) {
  4227. var text = token.text;
  4228. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["CharLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toChar"](text));
  4229. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4230. return exp;
  4231. }
  4232. }, {
  4233. key: "getBoolLiteral",
  4234. value: function getBoolLiteral(token) {
  4235. var val = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toBool"](token.text);
  4236. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["BoolLiteral"](val);
  4237. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4238. return exp;
  4239. }
  4240. }, {
  4241. key: "parseArrayLiteral",
  4242. value: function parseArrayLiteral(typeString) {
  4243. var openCurly = this.checkOpenCurly(true);
  4244. if (!openCurly) {
  4245. var invalid_token = this.getToken();
  4246. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_init_not_literal(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(invalid_token));
  4247. }
  4248. var beginArray = this.getToken();
  4249. if (this.parsingArrayDimension >= 2) {
  4250. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
  4251. }
  4252. this.pos += 1;
  4253. this.parsingArrayDimension += 1;
  4254. this.consumeNewLines();
  4255. var data = null;
  4256. var maybeCurlyOpen = this.checkOpenCurly(true);
  4257. if (maybeCurlyOpen) {
  4258. // This is potentially a list of vectors
  4259. data = this.parseVectorList(typeString);
  4260. } else {
  4261. data = this.parseExpressionList();
  4262. }
  4263. this.consumeNewLines();
  4264. this.checkCloseCurly();
  4265. var endArray = this.getToken();
  4266. this.pos += 1;
  4267. this.parsingArrayDimension -= 1;
  4268. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4269. var dataDim = 1;
  4270. if (data[0] instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"]) {
  4271. dataDim += 1;
  4272. } else if (data.length == 1) {
  4273. console.log("Talvez uma variável seja uma melhor opção");
  4274. }
  4275. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dataDim);
  4276. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
  4277. exp.sourceInfo = sourceInfo;
  4278. return exp;
  4279. }
  4280. /**
  4281. * Returns a list of ArrayLiterals. Helper function for parsing matrices
  4282. */
  4283. }, {
  4284. key: "parseVectorList",
  4285. value: function parseVectorList(typeString) {
  4286. var list = [];
  4287. var lastSize = null;
  4288. for (;;) {
  4289. this.checkOpenCurly();
  4290. var beginArray = this.getToken();
  4291. if (this.parsingArrayDimension >= 2) {
  4292. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
  4293. }
  4294. this.pos += 1;
  4295. this.parsingArrayDimension += 1;
  4296. this.consumeNewLines();
  4297. var data = this.parseExpressionList();
  4298. this.consumeNewLines();
  4299. this.checkCloseCurly();
  4300. var endArray = this.getToken();
  4301. this.pos += 1;
  4302. this.parsingArrayDimension -= 1;
  4303. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4304. if (lastSize == null) {
  4305. lastSize = data.length;
  4306. } else if (lastSize !== data.length) {
  4307. var expString = this.inputStream.getText(beginArray.start, endArray.stop);
  4308. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_literal_line(expString, sourceInfo);
  4309. }
  4310. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, 1);
  4311. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
  4312. exp.sourceInfo = sourceInfo;
  4313. list.push(exp);
  4314. var commaToken = this.getToken();
  4315. if (commaToken.type !== this.lexerClass.COMMA) {
  4316. break;
  4317. }
  4318. this.pos += 1;
  4319. this.consumeNewLines();
  4320. }
  4321. if (list.length == 1) {
  4322. console.log("Talvez um vetor seja uma melhor opção");
  4323. }
  4324. return list;
  4325. }
  4326. /*
  4327. * Returns an object {type: 'variable', value: value}.
  4328. * @returns object with fields type and value
  4329. **/
  4330. }, {
  4331. key: "parseVariable",
  4332. value: function parseVariable(token) {
  4333. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4334. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](token.text);
  4335. exp.sourceInfo = sourceInfo;
  4336. return exp;
  4337. }
  4338. /*
  4339. * Returns an object representing a function. It has
  4340. * four attributes: returnType, id, formalParams and block.
  4341. * The block object has two attributes: declarations and commands
  4342. **/
  4343. }, {
  4344. key: "parseFunction",
  4345. value: function parseFunction() {
  4346. this.pushScope(IVProgParser.FUNCTION);
  4347. var formalParams = [];
  4348. var token = this.getToken();
  4349. if (token.type !== this.lexerClass.RK_FUNCTION) {
  4350. //throw SyntaxError.createError(this.lexer.literalNames[this.lexerClass.PR_FUNCAO], token);
  4351. return null;
  4352. }
  4353. this.pos++;
  4354. var funType = this.parseType();
  4355. var dimensions = 0;
  4356. if (this.checkOpenBrace(true)) {
  4357. this.pos++;
  4358. this.checkCloseBrace();
  4359. this.pos++;
  4360. dimensions++;
  4361. if (this.checkOpenBrace(true)) {
  4362. this.pos++;
  4363. this.checkCloseBrace();
  4364. this.pos++;
  4365. dimensions++;
  4366. }
  4367. }
  4368. var funcIDToken = this.getToken();
  4369. var functionID = this.parseID();
  4370. this.checkFunctionDuplicate(functionID, funcIDToken);
  4371. this.checkOpenParenthesis();
  4372. this.pos++;
  4373. this.consumeNewLines();
  4374. if (!this.checkCloseParenthesis(true)) {
  4375. formalParams = this.parseFormalParameters(); // formal parameters
  4376. this.consumeNewLines();
  4377. this.checkCloseParenthesis();
  4378. this.pos++;
  4379. } else {
  4380. this.pos++;
  4381. }
  4382. this.consumeNewLines();
  4383. var commandsBlock = this.parseCommandBlock();
  4384. var returnType = funType;
  4385. if (dimensions > 0) {
  4386. returnType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](funType, dimensions);
  4387. }
  4388. var func = new _commands__WEBPACK_IMPORTED_MODULE_4__["Function"](functionID, returnType, formalParams, commandsBlock);
  4389. if (functionID === null && !func.isMain) {
  4390. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_main_return(_processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName(), this.lexer.literalNames[this.lexerClass.RK_VOID], token.line);
  4391. } else if (func.isMain && formalParams.length !== 0) {
  4392. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].main_parameters();
  4393. }
  4394. this.popScope();
  4395. return func;
  4396. }
  4397. /*
  4398. * Parse the formal parameters of a function.
  4399. * @returns a list of objects with the following attributes: type, id and dimensions.
  4400. **/
  4401. }, {
  4402. key: "parseFormalParameters",
  4403. value: function parseFormalParameters() {
  4404. var list = [];
  4405. for (;;) {
  4406. var dimensions = 0;
  4407. var reference = false;
  4408. var typeString = this.parseType();
  4409. var maybeIDToken = this.getToken();
  4410. if (maybeIDToken.type === this.lexerClass.RK_REFERENCE) {
  4411. reference = true;
  4412. this.pos += 1;
  4413. maybeIDToken = this.getToken();
  4414. }
  4415. var idString = this.parseID();
  4416. this.checkVariableDuplicate(idString, maybeIDToken);
  4417. if (this.checkOpenBrace(true)) {
  4418. this.pos += 1;
  4419. dimensions += 1;
  4420. this.checkCloseBrace();
  4421. this.pos += 1;
  4422. if (this.checkOpenBrace(true)) {
  4423. this.pos += 1;
  4424. dimensions += 1;
  4425. this.checkCloseBrace();
  4426. this.pos += 1;
  4427. }
  4428. }
  4429. var type = null;
  4430. if (dimensions > 0) {
  4431. type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dimensions);
  4432. } else {
  4433. type = typeString;
  4434. }
  4435. var parameter = new _commands__WEBPACK_IMPORTED_MODULE_4__["FormalParameter"](type, idString, reference);
  4436. parameter.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(maybeIDToken);
  4437. list.push(parameter);
  4438. var commaToken = this.getToken();
  4439. if (commaToken.type !== this.lexerClass.COMMA) break;
  4440. this.pos++;
  4441. this.consumeNewLines();
  4442. }
  4443. return list;
  4444. }
  4445. }, {
  4446. key: "parseID",
  4447. value: function parseID() {
  4448. var token = this.getToken();
  4449. if (token.type !== this.lexerClass.ID) {
  4450. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
  4451. }
  4452. this.pos++;
  4453. if (this.insideScope(IVProgParser.FUNCTION)) {
  4454. if (token.text === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
  4455. return null;
  4456. }
  4457. }
  4458. return token.text;
  4459. }
  4460. }, {
  4461. key: "parseMaybeLibID",
  4462. value: function parseMaybeLibID() {
  4463. var token = this.getToken();
  4464. if (token.type !== this.lexerClass.ID && token.type !== this.lexerClass.LIB_ID) {
  4465. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
  4466. }
  4467. this.pos++;
  4468. return token.text;
  4469. }
  4470. }, {
  4471. key: "parseType",
  4472. value: function parseType() {
  4473. var token = this.getToken();
  4474. if (token.type === this.lexerClass.ID && this.insideScope(IVProgParser.FUNCTION)) {
  4475. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
  4476. } else if (token.type === this.lexerClass.RK_VOID && this.insideScope(IVProgParser.FUNCTION)) {
  4477. this.pos++;
  4478. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
  4479. } else if (this.isVariableType(token)) {
  4480. this.pos++;
  4481. switch (token.type) {
  4482. case this.lexerClass.RK_INTEGER:
  4483. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER;
  4484. case this.lexerClass.RK_BOOLEAN:
  4485. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].BOOLEAN;
  4486. case this.lexerClass.RK_REAL:
  4487. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].REAL;
  4488. case this.lexerClass.RK_STRING:
  4489. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].STRING;
  4490. case this.lexerClass.RK_CHARACTER:
  4491. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].CHAR;
  4492. default:
  4493. break;
  4494. }
  4495. }
  4496. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_type(this.getTypeArray(), token);
  4497. }
  4498. }, {
  4499. key: "parseCommandBlock",
  4500. value: function parseCommandBlock() {
  4501. var optionalCurly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4502. var variablesDecl = [];
  4503. var commands = [];
  4504. var hasOpen = false;
  4505. if (this.checkOpenCurly(optionalCurly)) {
  4506. this.pos++;
  4507. hasOpen = true;
  4508. }
  4509. this.consumeNewLines();
  4510. var parsedCommand = false;
  4511. for (;;) {
  4512. var cmd = this.parseCommand();
  4513. if (cmd === null) break;
  4514. if (cmd !== -1) {
  4515. if (cmd instanceof Array) {
  4516. if (parsedCommand) {
  4517. var lastToken = this.getToken(this.pos - 1);
  4518. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(lastToken);
  4519. }
  4520. variablesDecl = variablesDecl.concat(cmd);
  4521. } else {
  4522. parsedCommand = true;
  4523. commands.push(cmd);
  4524. }
  4525. }
  4526. }
  4527. this.consumeNewLines();
  4528. if (hasOpen) {
  4529. this.checkCloseCurly();
  4530. this.pos++;
  4531. this.consumeNewLines();
  4532. }
  4533. return new _commands__WEBPACK_IMPORTED_MODULE_4__["CommandBlock"](variablesDecl, commands);
  4534. }
  4535. }, {
  4536. key: "parseCommand",
  4537. value: function parseCommand() {
  4538. var token = this.getToken();
  4539. if (this.isVariableType(token)) {
  4540. if (!this.insideScope(IVProgParser.FUNCTION)) {
  4541. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(token);
  4542. }
  4543. this.pushScope(IVProgParser.BASE);
  4544. var varType = this.parseType();
  4545. this.popScope();
  4546. var cmd = this.parseDeclaration(varType);
  4547. this.checkEOS();
  4548. this.pos++;
  4549. return cmd;
  4550. } else if (token.type === this.lexerClass.ID) {
  4551. return this.parseIDCommand();
  4552. } else if (token.type === this.lexerClass.LIB_ID) {
  4553. return this.parseIDCommand();
  4554. } else if (token.type === this.lexerClass.RK_RETURN) {
  4555. return this.parseReturn();
  4556. } else if (token.type === this.lexerClass.RK_WHILE || token.type === this.lexerClass.RK_WHILE_ALT) {
  4557. return this.parseWhile();
  4558. } else if (token.type === this.lexerClass.RK_FOR || token.type === this.lexerClass.RK_FOR_ALT) {
  4559. return this.parseFor();
  4560. } else if (token.type === this.lexerClass.RK_BREAK) {
  4561. if (!this.insideScope(IVProgParser.BREAKABLE)) {
  4562. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_break_command(this.lexer.literalNames[this.lexerClass.RK_BREAK], token);
  4563. }
  4564. return this.parseBreak();
  4565. } else if (token.type === this.lexerClass.RK_SWITCH) {
  4566. return this.parseSwitchCase();
  4567. } else if (token.type === this.lexerClass.RK_DO) {
  4568. return this.parseRepeatUntil();
  4569. } else if (token.type === this.lexerClass.RK_IF) {
  4570. return this.parseIfThenElse();
  4571. } else if (this.checkEOS(true)) {
  4572. this.pos++;
  4573. return -1;
  4574. } else {
  4575. return null;
  4576. }
  4577. }
  4578. }, {
  4579. key: "parseSwitchCase",
  4580. value: function parseSwitchCase() {
  4581. this.pushScope(IVProgParser.BREAKABLE);
  4582. this.pos++;
  4583. this.checkOpenParenthesis();
  4584. this.pos++;
  4585. this.consumeNewLines();
  4586. var exp = this.parseExpressionOR();
  4587. this.consumeNewLines();
  4588. this.checkCloseParenthesis();
  4589. this.pos++;
  4590. this.consumeNewLines();
  4591. this.checkOpenCurly();
  4592. this.pos++;
  4593. this.consumeNewLines();
  4594. var casesList = this.parseCases();
  4595. this.consumeNewLines();
  4596. this.checkCloseCurly();
  4597. this.pos++;
  4598. this.consumeNewLines();
  4599. this.popScope();
  4600. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Switch"](exp, casesList);
  4601. }
  4602. }, {
  4603. key: "parseRepeatUntil",
  4604. value: function parseRepeatUntil() {
  4605. this.pos++;
  4606. this.consumeNewLines();
  4607. this.pushScope(IVProgParser.BREAKABLE);
  4608. var commandsBlock = this.parseCommandBlock();
  4609. this.consumeNewLines(); //Maybe not...
  4610. var whileToken = this.getToken();
  4611. if (whileToken.type !== this.lexerClass.RK_DO_UNTIL) {
  4612. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_DO_UNTIL], whileToken);
  4613. }
  4614. this.pos++;
  4615. this.checkOpenParenthesis();
  4616. this.pos++;
  4617. this.consumeNewLines();
  4618. var condition = this.parseExpressionOR();
  4619. this.consumeNewLines();
  4620. this.checkCloseParenthesis();
  4621. this.pos++;
  4622. this.checkEOS();
  4623. this.popScope();
  4624. return new _commands__WEBPACK_IMPORTED_MODULE_4__["RepeatUntil"](condition, commandsBlock);
  4625. }
  4626. }, {
  4627. key: "parseIfThenElse",
  4628. value: function parseIfThenElse() {
  4629. if (this.insideScope(IVProgParser.BREAKABLE)) {
  4630. this.pushScope(IVProgParser.BREAKABLE);
  4631. } else {
  4632. this.pushScope(IVProgParser.COMMAND);
  4633. }
  4634. var token = this.getToken();
  4635. this.pos++;
  4636. this.checkOpenParenthesis();
  4637. this.pos++;
  4638. this.consumeNewLines();
  4639. var logicalExpression = this.parseExpressionOR();
  4640. this.consumeNewLines();
  4641. this.checkCloseParenthesis();
  4642. this.pos++;
  4643. this.consumeNewLines();
  4644. var cmdBlocks = this.parseCommandBlock();
  4645. var maybeElse = this.getToken();
  4646. if (maybeElse.type === this.lexerClass.RK_ELSE) {
  4647. this.pos++;
  4648. this.consumeNewLines();
  4649. var maybeIf = this.getToken();
  4650. var elseBlock = null;
  4651. if (this.checkOpenCurly(true)) {
  4652. elseBlock = this.parseCommandBlock();
  4653. } else if (maybeIf.type === this.lexerClass.RK_IF) {
  4654. elseBlock = this.parseIfThenElse();
  4655. } else {
  4656. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_IF], "{"], maybeIf);
  4657. }
  4658. this.popScope();
  4659. var _cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, elseBlock);
  4660. _cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4661. return _cmd;
  4662. }
  4663. this.popScope();
  4664. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, null);
  4665. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4666. return cmd;
  4667. }
  4668. }, {
  4669. key: "parseFor",
  4670. value: function parseFor() {
  4671. this.pushScope(IVProgParser.BREAKABLE);
  4672. var for_token = this.getToken();
  4673. this.pos += 1; // parse ID
  4674. var id_token = this.getToken();
  4675. var id = this.parseID();
  4676. var for_id = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
  4677. for_id.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(id_token); // END parse ID
  4678. var for_from = this.parseForParameters(this.lexerClass.RK_FOR_FROM);
  4679. var for_to = this.parseForParameters(this.lexerClass.RK_FOR_TO);
  4680. var maybePass = this.parseForParameters(this.lexerClass.RK_FOR_PASS);
  4681. this.consumeNewLines();
  4682. var commandsBlock = this.parseCommandBlock();
  4683. this.popScope();
  4684. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["For"](for_id, for_from, for_to, maybePass, commandsBlock);
  4685. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(for_token);
  4686. return cmd;
  4687. }
  4688. }, {
  4689. key: "parseWhile",
  4690. value: function parseWhile() {
  4691. this.pushScope(IVProgParser.BREAKABLE);
  4692. var token = this.getToken();
  4693. this.pos++;
  4694. this.checkOpenParenthesis();
  4695. this.pos++;
  4696. this.consumeNewLines();
  4697. var logicalExpression = this.parseExpressionOR();
  4698. this.consumeNewLines();
  4699. this.checkCloseParenthesis();
  4700. this.pos++;
  4701. this.consumeNewLines();
  4702. var cmdBlocks = this.parseCommandBlock();
  4703. this.popScope();
  4704. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["While"](logicalExpression, cmdBlocks);
  4705. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4706. return cmd;
  4707. }
  4708. }, {
  4709. key: "parseBreak",
  4710. value: function parseBreak() {
  4711. var token = this.getToken();
  4712. this.pos++;
  4713. this.checkEOS();
  4714. this.pos++;
  4715. var command = new _commands__WEBPACK_IMPORTED_MODULE_4__["Break"]();
  4716. command.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4717. return command;
  4718. }
  4719. }, {
  4720. key: "parseReturn",
  4721. value: function parseReturn() {
  4722. this.pos++;
  4723. var exp = null;
  4724. if (!this.checkEOS(true)) {
  4725. exp = this.parseExpressionOR();
  4726. this.checkEOS();
  4727. }
  4728. this.pos++;
  4729. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Return"](exp);
  4730. }
  4731. }, {
  4732. key: "parseIDCommand",
  4733. value: function parseIDCommand() {
  4734. var refToken = this.getToken();
  4735. var isID = refToken.type === this.lexerClass.ID;
  4736. var id = this.parseMaybeLibID();
  4737. if (this.checkOpenBrace(true)) {
  4738. this.pos++;
  4739. var lineExpression = null;
  4740. var columnExpression = null;
  4741. this.consumeNewLines();
  4742. lineExpression = this.parseExpression();
  4743. this.consumeNewLines();
  4744. this.checkCloseBrace();
  4745. this.pos++;
  4746. if (this.checkOpenBrace(true)) {
  4747. this.pos++;
  4748. this.consumeNewLines();
  4749. columnExpression = this.parseExpression();
  4750. this.consumeNewLines();
  4751. this.checkCloseBrace();
  4752. this.pos++;
  4753. }
  4754. var equalToken = this.getToken();
  4755. if (equalToken.type !== this.lexerClass.EQUAL) {
  4756. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("=", equalToken);
  4757. }
  4758. this.pos++;
  4759. var exp = this.parseExpressionOR();
  4760. this.checkEOS();
  4761. this.pos++;
  4762. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["ArrayIndexAssign"](id, lineExpression, columnExpression, exp);
  4763. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalToken);
  4764. return cmd;
  4765. }
  4766. var equalOrParenthesis = this.getToken();
  4767. if (isID && equalOrParenthesis.type === this.lexerClass.EQUAL) {
  4768. this.pos++;
  4769. var _exp = this.parseExpressionOR();
  4770. this.checkEOS();
  4771. this.pos++;
  4772. var _cmd2 = new _commands__WEBPACK_IMPORTED_MODULE_4__["Assign"](id, _exp);
  4773. _cmd2.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalOrParenthesis);
  4774. return _cmd2;
  4775. } else if (equalOrParenthesis.type === this.lexerClass.OPEN_PARENTHESIS) {
  4776. var funcCall = this.parseFunctionCallCommand(id);
  4777. this.checkEOS();
  4778. this.pos++;
  4779. return funcCall;
  4780. } else if (isID) {
  4781. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list(["=", "("], equalOrParenthesis);
  4782. } else {
  4783. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(refToken);
  4784. }
  4785. }
  4786. }, {
  4787. key: "parseForParameters",
  4788. value: function parseForParameters(keyword_code) {
  4789. if (keyword_code === this.lexerClass.RK_FOR_PASS) {
  4790. if (this.checkOpenCurly(true)) {
  4791. return null;
  4792. }
  4793. }
  4794. var from_token = this.getToken();
  4795. if (from_token.type !== keyword_code) {
  4796. // TODO better error message
  4797. var keyword = this.lexer.literalNames[keyword_code];
  4798. throw new Error("Error de sintaxe no comando repita_para: esperava-se " + keyword + " mas encontrou " + from_token.text);
  4799. }
  4800. this.pos += 1;
  4801. var int_or_id = this.getToken();
  4802. var is_unary_op = false;
  4803. var op = null;
  4804. if (int_or_id.type === this.lexerClass.SUM_OP) {
  4805. is_unary_op = true;
  4806. op = int_or_id.text;
  4807. this.pos += 1;
  4808. int_or_id = this.getToken();
  4809. }
  4810. var for_from = null;
  4811. if (int_or_id.type === this.lexerClass.ID) {
  4812. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](this.parseID());
  4813. for_from.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(int_or_id);
  4814. } else if (int_or_id.type === this.lexerClass.INTEGER) {
  4815. this.pos += 1;
  4816. for_from = this.getIntLiteral(int_or_id);
  4817. }
  4818. if (for_from == null) {
  4819. // TODO better error message
  4820. var _keyword = this.lexer.literalNames[keyword_code];
  4821. throw new Error("Error de sintaxe no comando repeita_para: " + int_or_id.text + " não é compativel com o esperado para o paramentro " + _keyword + ". O valor deve ser um inteiro ou variável.");
  4822. }
  4823. if (is_unary_op) {
  4824. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(op), for_from);
  4825. }
  4826. return for_from;
  4827. }
  4828. }, {
  4829. key: "parseCases",
  4830. value: function parseCases() {
  4831. var token = this.getToken();
  4832. if (token.type !== this.lexerClass.RK_CASE) {
  4833. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_CASE], token);
  4834. }
  4835. this.pos++;
  4836. var nextToken = this.getToken();
  4837. if (nextToken.type === this.lexerClass.RK_DEFAULT) {
  4838. this.pos++;
  4839. var colonToken = this.getToken();
  4840. if (colonToken.type !== this.lexerClass.COLON) {
  4841. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(":", colonToken);
  4842. }
  4843. this.pos++;
  4844. this.consumeNewLines();
  4845. var block = this.parseCommandBlock(true);
  4846. var defaultCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](null);
  4847. defaultCase.setCommands(block.commands);
  4848. return [defaultCase];
  4849. } else {
  4850. var exp = this.parseExpressionOR();
  4851. var _colonToken = this.getToken();
  4852. if (_colonToken.type !== this.lexerClass.COLON) {
  4853. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(":", _colonToken);
  4854. }
  4855. this.pos++;
  4856. this.consumeNewLines();
  4857. var _block = this.parseCommandBlock(true);
  4858. var aCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](exp);
  4859. aCase.setCommands(_block.commands);
  4860. var caseToken = this.getToken();
  4861. if (caseToken.type === this.lexerClass.RK_CASE) {
  4862. return [aCase].concat(this.parseCases());
  4863. } else {
  4864. return [aCase];
  4865. }
  4866. }
  4867. }
  4868. /*
  4869. * Parses an Expression following the structure:
  4870. *
  4871. * EOR => EAnd ( 'or' EOR)? #expression and
  4872. *
  4873. * EOR => ENot ('and' EOR)? #expression or
  4874. *
  4875. * ENot => 'not'? ER #expression not
  4876. *
  4877. * ER => E ((>=, <=, ==, >, <) E)? #expression relational
  4878. *
  4879. * E => factor ((+, -) E)? #expression
  4880. *
  4881. * factor=> term ((*, /, %) factor)?
  4882. *
  4883. * term => literal || arrayAccess || FuncCall || ID || '('EAnd')'
  4884. **/
  4885. }, {
  4886. key: "parseExpressionOR",
  4887. value: function parseExpressionOR() {
  4888. var exp1 = this.parseExpressionAND();
  4889. while (this.getToken().type === this.lexerClass.OR_OPERATOR) {
  4890. var opToken = this.getToken();
  4891. this.pos++;
  4892. var or = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])("or");
  4893. this.consumeNewLines();
  4894. var exp2 = this.parseExpressionAND();
  4895. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](or, exp1, exp2);
  4896. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  4897. exp1 = finalExp;
  4898. }
  4899. return exp1;
  4900. }
  4901. }, {
  4902. key: "parseExpressionAND",
  4903. value: function parseExpressionAND() {
  4904. var exp1 = this.parseExpressionNot();
  4905. while (this.getToken().type === this.lexerClass.AND_OPERATOR) {
  4906. var opToken = this.getToken();
  4907. this.pos++;
  4908. var and = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])("and");
  4909. this.consumeNewLines();
  4910. var exp2 = this.parseExpressionNot();
  4911. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](and, exp1, exp2);
  4912. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  4913. exp1 = finalExp;
  4914. }
  4915. return exp1;
  4916. }
  4917. }, {
  4918. key: "parseExpressionNot",
  4919. value: function parseExpressionNot() {
  4920. var maybeNotToken = this.getToken();
  4921. if (maybeNotToken.type === this.lexerClass.NOT_OPERATOR) {
  4922. var opToken = this.getToken();
  4923. this.pos++;
  4924. var not = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])("not");
  4925. var exp1 = this.parseExpressionRel();
  4926. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](not, exp1);
  4927. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  4928. return finalExp;
  4929. } else {
  4930. return this.parseExpressionRel();
  4931. }
  4932. }
  4933. }, {
  4934. key: "parseExpressionRel",
  4935. value: function parseExpressionRel() {
  4936. var exp1 = this.parseExpression();
  4937. while (this.getToken().type === this.lexerClass.RELATIONAL_OPERATOR) {
  4938. var relToken = this.getToken();
  4939. this.pos++;
  4940. var rel = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(relToken.text);
  4941. var exp2 = this.parseExpression();
  4942. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](rel, exp1, exp2);
  4943. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(relToken);
  4944. exp1 = finalExp;
  4945. }
  4946. return exp1;
  4947. }
  4948. }, {
  4949. key: "parseExpression",
  4950. value: function parseExpression() {
  4951. var factor = this.parseFactor();
  4952. while (this.getToken().type === this.lexerClass.SUM_OP) {
  4953. var sumOpToken = this.getToken();
  4954. this.pos++;
  4955. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(sumOpToken.text);
  4956. var factor2 = this.parseFactor();
  4957. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, factor, factor2);
  4958. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(sumOpToken);
  4959. factor = finalExp;
  4960. }
  4961. return factor;
  4962. }
  4963. }, {
  4964. key: "parseFactor",
  4965. value: function parseFactor() {
  4966. var term = this.parseTerm();
  4967. while (this.getToken().type === this.lexerClass.MULTI_OP) {
  4968. var multOpToken = this.getToken();
  4969. this.pos++;
  4970. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(multOpToken.text);
  4971. var term2 = this.parseTerm();
  4972. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, term, term2);
  4973. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(multOpToken);
  4974. term = finalExp;
  4975. }
  4976. return term;
  4977. }
  4978. }, {
  4979. key: "parseTerm",
  4980. value: function parseTerm() {
  4981. var token = this.getToken();
  4982. var sourceInfo = null;
  4983. var exp = null;
  4984. switch (token.type) {
  4985. case this.lexerClass.SUM_OP:
  4986. this.pos++;
  4987. sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4988. exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(token.text), this.parseTerm());
  4989. exp.sourceInfo = sourceInfo;
  4990. return exp;
  4991. case this.lexerClass.INTEGER:
  4992. this.pos++;
  4993. return this.getIntLiteral(token);
  4994. case this.lexerClass.REAL:
  4995. this.pos++;
  4996. return this.getRealLiteral(token);
  4997. case this.lexerClass.STRING:
  4998. this.pos++;
  4999. return this.getStringLiteral(token);
  5000. case this.lexerClass.CHARACTER:
  5001. this.pos++;
  5002. return this.getCharLiteral(token);
  5003. case this.lexerClass.RK_TRUE:
  5004. case this.lexerClass.RK_FALSE:
  5005. this.pos++;
  5006. return this.getBoolLiteral(token);
  5007. case this.lexerClass.OPEN_CURLY:
  5008. // No more annonymous array
  5009. // return this.parseArrayLiteral();
  5010. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].annonymous_array_literal(token);
  5011. case this.lexerClass.ID:
  5012. case this.lexerClass.LIB_ID:
  5013. return this.parseIDTerm();
  5014. case this.lexerClass.OPEN_PARENTHESIS:
  5015. return this.parseParenthesisExp();
  5016. default:
  5017. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_terminal(token);
  5018. }
  5019. }
  5020. }, {
  5021. key: "parseIDTerm",
  5022. value: function parseIDTerm() {
  5023. var tokenA = this.getToken();
  5024. var id = this.parseMaybeLibID();
  5025. var isID = tokenA.type === this.lexerClass.ID;
  5026. if (isID && this.checkOpenBrace(true)) {
  5027. var tokenB = null;
  5028. this.pos++;
  5029. var firstIndex = this.parseExpression();
  5030. var secondIndex = null;
  5031. this.consumeNewLines();
  5032. this.checkCloseBrace();
  5033. tokenB = this.getToken();
  5034. this.pos++;
  5035. if (this.checkOpenBrace(true)) {
  5036. this.pos++;
  5037. secondIndex = this.parseExpression();
  5038. this.consumeNewLines();
  5039. this.checkCloseBrace();
  5040. tokenB = this.getToken();
  5041. this.pos++;
  5042. }
  5043. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5044. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayAccess"](id, firstIndex, secondIndex);
  5045. exp.sourceInfo = sourceInfo;
  5046. return exp;
  5047. } else if (this.checkOpenParenthesis(true)) {
  5048. return this.parseFunctionCallExpression(id);
  5049. } else if (isID) {
  5050. var _sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(tokenA);
  5051. var _exp2 = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
  5052. _exp2.sourceInfo = _sourceInfo;
  5053. return _exp2;
  5054. } else {
  5055. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(tokenA);
  5056. }
  5057. }
  5058. }, {
  5059. key: "getFunctionName",
  5060. value: function getFunctionName(id) {
  5061. var name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getInternalName(id);
  5062. if (name === null) {
  5063. if (id === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
  5064. return null;
  5065. }
  5066. return id;
  5067. } else {
  5068. return name;
  5069. }
  5070. }
  5071. }, {
  5072. key: "parseFunctionCallExpression",
  5073. value: function parseFunctionCallExpression(id) {
  5074. var tokenA = this.getToken(this.pos - 1);
  5075. var actualParameters = this.parseActualParameters();
  5076. var tokenB = this.getToken(this.pos - 1);
  5077. var funcName = this.getFunctionName(id);
  5078. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5079. var cmd = new _expressions__WEBPACK_IMPORTED_MODULE_3__["FunctionCall"](funcName, actualParameters);
  5080. cmd.sourceInfo = sourceInfo;
  5081. return cmd;
  5082. }
  5083. }, {
  5084. key: "parseFunctionCallCommand",
  5085. value: function parseFunctionCallCommand(id) {
  5086. return this.parseFunctionCallExpression(id);
  5087. }
  5088. }, {
  5089. key: "parseParenthesisExp",
  5090. value: function parseParenthesisExp() {
  5091. this.checkOpenParenthesis();
  5092. var tokenA = this.getToken();
  5093. this.pos += 1;
  5094. this.consumeNewLines();
  5095. var exp = this.parseExpressionOR();
  5096. this.consumeNewLines();
  5097. this.checkCloseParenthesis();
  5098. var tokenB = this.getToken();
  5099. this.pos += 1;
  5100. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5101. exp.parenthesis = true;
  5102. return exp;
  5103. }
  5104. }, {
  5105. key: "parseActualParameters",
  5106. value: function parseActualParameters() {
  5107. this.checkOpenParenthesis();
  5108. this.pos++;
  5109. if (this.checkCloseParenthesis(true)) {
  5110. this.pos++;
  5111. return [];
  5112. }
  5113. this.consumeNewLines();
  5114. var list = this.parseExpressionList();
  5115. this.consumeNewLines();
  5116. this.checkCloseParenthesis();
  5117. this.pos++;
  5118. return list;
  5119. }
  5120. }, {
  5121. key: "parseExpressionList",
  5122. value: function parseExpressionList() {
  5123. var list = [];
  5124. for (;;) {
  5125. var exp = this.parseExpressionOR();
  5126. list.push(exp);
  5127. var maybeToken = this.getToken();
  5128. if (maybeToken.type !== this.lexerClass.COMMA) {
  5129. break;
  5130. } else {
  5131. this.pos++;
  5132. this.consumeNewLines();
  5133. }
  5134. }
  5135. return list;
  5136. }
  5137. }, {
  5138. key: "getTypeArray",
  5139. value: function getTypeArray() {
  5140. var _this = this;
  5141. var types = this.insideScope(IVProgParser.FUNCTION) ? this.functionTypes : this.variableTypes;
  5142. return types.map(function (x) {
  5143. return _this.lexer.literalNames[x];
  5144. });
  5145. }
  5146. }]);
  5147. return IVProgParser;
  5148. }();
  5149. /***/ }),
  5150. /***/ "./js/ast/operators.ts":
  5151. /*!*****************************!*\
  5152. !*** ./js/ast/operators.ts ***!
  5153. \*****************************/
  5154. /*! no static exports found */
  5155. /***/ (function(module, exports, __webpack_require__) {
  5156. "use strict";
  5157. Object.defineProperty(exports, "__esModule", { value: true });
  5158. exports.convertFromString = exports.Operators = void 0;
  5159. exports.Operators = Object.freeze({
  5160. ADD: { ord: 0, value: "+" },
  5161. SUB: { ord: 1, value: "-" },
  5162. MULT: { ord: 2, value: '*' },
  5163. DIV: { ord: 3, value: '/' },
  5164. MOD: { ord: 4, value: '%' },
  5165. GT: { ord: 5, value: '>' },
  5166. GE: { ord: 6, value: '>=' },
  5167. LT: { ord: 7, value: '<' },
  5168. LE: { ord: 8, value: '<=' },
  5169. EQ: { ord: 9, value: '==' },
  5170. NEQ: { ord: 10, value: '!=' },
  5171. AND: { ord: 11, value: 'and' },
  5172. OR: { ord: 12, value: 'or' },
  5173. NOT: { ord: 13, value: 'not' }
  5174. });
  5175. function convertFromString(op) {
  5176. switch (op) {
  5177. case '+': return exports.Operators.ADD;
  5178. case '-': return exports.Operators.SUB;
  5179. case '*': return exports.Operators.MULT;
  5180. case '/': return exports.Operators.DIV;
  5181. case '%': return exports.Operators.MOD;
  5182. case '>': return exports.Operators.GT;
  5183. case '>=': return exports.Operators.GE;
  5184. case '<': return exports.Operators.LT;
  5185. case '<=': return exports.Operators.LE;
  5186. case '==': return exports.Operators.EQ;
  5187. case '!=': return exports.Operators.NEQ;
  5188. case 'and': return exports.Operators.AND;
  5189. case 'or': return exports.Operators.OR;
  5190. case 'not': return exports.Operators.NOT;
  5191. }
  5192. return null;
  5193. }
  5194. exports.convertFromString = convertFromString;
  5195. /***/ }),
  5196. /***/ "./js/ast/sourceInfo.js":
  5197. /*!******************************!*\
  5198. !*** ./js/ast/sourceInfo.js ***!
  5199. \******************************/
  5200. /*! exports provided: SourceInfo */
  5201. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5202. "use strict";
  5203. __webpack_require__.r(__webpack_exports__);
  5204. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SourceInfo", function() { return SourceInfo; });
  5205. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5206. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5207. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5208. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5209. var SourceInfo = /*#__PURE__*/function () {
  5210. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SourceInfo, null, [{
  5211. key: "createSourceInfo",
  5212. value: function createSourceInfo(token) {
  5213. return new SourceInfo(token.line, token.column, token.text, token.text.length);
  5214. }
  5215. }, {
  5216. key: "createSourceInfoFromList",
  5217. value: function createSourceInfoFromList(tokenA, tokenB) {
  5218. var line = tokenA.line;
  5219. var column = tokenA.column; // adapted from https://github.com/UNIVALI-LITE/Portugol-Studio/blob/master/core/src/main/java/br/univali/portugol/nucleo/analise/sintatica/Portugol.g
  5220. // No idea why...
  5221. var size = tokenB.tokenIndex + 1 - tokenA.tokenIndex;
  5222. return new SourceInfo(line, column, "", size);
  5223. }
  5224. }]);
  5225. function SourceInfo(line, column, text, size) {
  5226. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SourceInfo);
  5227. this.line = line;
  5228. this.column = column;
  5229. this.text = text;
  5230. this.size = size;
  5231. }
  5232. return SourceInfo;
  5233. }();
  5234. /***/ }),
  5235. /***/ "./js/io/domConsole.js":
  5236. /*!*****************************!*\
  5237. !*** ./js/io/domConsole.js ***!
  5238. \*****************************/
  5239. /*! exports provided: DOMConsole */
  5240. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5241. "use strict";
  5242. __webpack_require__.r(__webpack_exports__);
  5243. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMConsole", function() { return DOMConsole; });
  5244. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  5245. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  5246. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  5247. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  5248. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5249. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
  5250. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5251. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
  5252. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  5253. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  5254. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  5255. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_6__);
  5256. var DOMConsole = /*#__PURE__*/function () {
  5257. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, null, [{
  5258. key: "BASH_TEMPLATE",
  5259. get: function get() {
  5260. return "\n <div class=\"bash-title\">\n <i id=\"ivprog-console-clearbtn\" class=\"icon eraser\" style=\"float:left;padding-left: 5px\"></i>\n <span>Terminal</span>\n <i id=\"ivprog-console-showbtn\" class=\"icon window maximize outline\" style=\"float:right\"></i>\n <i id=\"ivprog-console-hidebtn\" class=\"icon window minimize outline\" style=\"float:right\"></i>\n </div>\n <div id='ivprog-term' class=\"bash-body\"></div>";
  5261. }
  5262. }, {
  5263. key: "INPUT_CARET_TEMPLATE",
  5264. get: function get() {
  5265. return "\n <div id=\"cmd\">\n <span></span>\n <div id=\"cursor\"></div>\n </div>";
  5266. }
  5267. }, {
  5268. key: "USER",
  5269. get: function get() {
  5270. return 0;
  5271. }
  5272. }, {
  5273. key: "INFO",
  5274. get: function get() {
  5275. return 1;
  5276. }
  5277. }, {
  5278. key: "ERR",
  5279. get: function get() {
  5280. return 2;
  5281. }
  5282. }, {
  5283. key: "INPUT",
  5284. get: function get() {
  5285. return 3;
  5286. }
  5287. }]);
  5288. function DOMConsole(elementID) {
  5289. var disableMarginTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5290. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, DOMConsole);
  5291. this.disableMarginTop = disableMarginTop;
  5292. this.input = null;
  5293. this.cursorInterval = null;
  5294. this.idleInterval = null;
  5295. this.inputDiv = null;
  5296. this.inputCMD = null;
  5297. this.inputSpan = null;
  5298. this.cursorRef = null;
  5299. this.needInput = false;
  5300. this.clearBtn = null;
  5301. this.hideBtn = null;
  5302. this.showBtn = null;
  5303. this.termDiv = null;
  5304. this.anyKey = false;
  5305. var actualID = elementID;
  5306. if (elementID[0] === "#") {
  5307. actualID = elementID.substring(1);
  5308. }
  5309. this.parent = document.getElementById(actualID);
  5310. this.setup();
  5311. this.inputListeners = [];
  5312. this.hideInput();
  5313. this.pending_writes = [];
  5314. this.last_clear = -1;
  5315. }
  5316. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, [{
  5317. key: "setup",
  5318. value: function setup() {
  5319. this._setupDom();
  5320. this._setupEvents();
  5321. }
  5322. }, {
  5323. key: "_setupEvents",
  5324. value: function _setupEvents() {
  5325. this.input.addEventListener("keydown", this.registerInput.bind(this));
  5326. this.clearBtn.addEventListener("click", this.clearBtnClick.bind(this));
  5327. this.hideBtn.addEventListener("click", this.hideBtnClick.bind(this));
  5328. this.showBtn.addEventListener("click", this.showBtnClick.bind(this));
  5329. }
  5330. }, {
  5331. key: "registerInput",
  5332. value: function registerInput(event) {
  5333. if (!this.needInput) {
  5334. return;
  5335. }
  5336. var keyCode = event.which;
  5337. if (keyCode === 13 || this.anyKey) {
  5338. if (this.idleInterval != null) {
  5339. clearInterval(this.idleInterval);
  5340. this.idleInterval = null;
  5341. }
  5342. var text = this.input.value;
  5343. text = text.replace("[\n\r]+", "");
  5344. this.notifyListeners(text);
  5345. this._appendUserInput(text);
  5346. this.input.value = "";
  5347. this.inputSpan.innerHTML = "";
  5348. this.currentLine = null;
  5349. }
  5350. }
  5351. }, {
  5352. key: "_setupDom",
  5353. value: function _setupDom() {
  5354. var bashNode = document.createElement("div");
  5355. bashNode.classList.add("bash");
  5356. bashNode.innerHTML = DOMConsole.BASH_TEMPLATE;
  5357. this.termDiv = bashNode.querySelector("#ivprog-term");
  5358. this.termDiv.classList.add("ivprog-term-div");
  5359. this.inputDiv = document.createElement("div");
  5360. this.inputDiv.id = "ivprog-terminal-inputdiv";
  5361. this.inputDiv.innerHTML = DOMConsole.INPUT_CARET_TEMPLATE;
  5362. this.input = document.createElement("input");
  5363. this.input.setAttribute("name", "command");
  5364. this.input.setAttribute("value", "");
  5365. this.input.setAttribute("type", "text");
  5366. this.inputDiv.append(this.input);
  5367. this.termDiv.append(this.inputDiv);
  5368. bashNode.append(this.termDiv);
  5369. this.parent.append(bashNode);
  5370. this.inputCMD = this.inputDiv.querySelector("#cmd");
  5371. this.cursorRef = this.inputCMD.querySelector("#cursor");
  5372. this.inputSpan = this.inputCMD.querySelector("span");
  5373. this.clearBtn = bashNode.querySelector("#ivprog-console-clearbtn");
  5374. this.hideBtn = bashNode.querySelector("#ivprog-console-hidebtn");
  5375. this.showBtn = bashNode.querySelector("#ivprog-console-showbtn");
  5376. this._setupCursor(); //Jquery tooltips....
  5377. window.$(this.clearBtn).popup({
  5378. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_clear")
  5379. });
  5380. window.$(this.showBtn).popup({
  5381. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_show")
  5382. });
  5383. window.$(this.hideBtn).popup({
  5384. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_hide")
  5385. });
  5386. }
  5387. }, {
  5388. key: "_setupCursor",
  5389. value: function _setupCursor() {
  5390. this.inputCMD.addEventListener("click", this.blinkCaretAndFocus.bind(this)); //this.inputCMD.click();
  5391. this.input.addEventListener("keyup", this.updateSpanText.bind(this));
  5392. this.input.addEventListener("blur", this.stopBlinkCaret.bind(this));
  5393. }
  5394. }, {
  5395. key: "blinkCaretAndFocus",
  5396. value: function blinkCaretAndFocus() {
  5397. var _this = this;
  5398. if (this.cursorInterval != null) {
  5399. return;
  5400. }
  5401. this.input.focus();
  5402. this.cursorInterval = window.setInterval(function () {
  5403. if (_this.cursorRef.style.visibility === "visible") {
  5404. _this.cursorRef.style.visibility = "hidden";
  5405. } else {
  5406. _this.cursorRef.style.visibility = "visible";
  5407. }
  5408. }, 500);
  5409. }
  5410. }, {
  5411. key: "updateSpanText",
  5412. value: function updateSpanText() {
  5413. this.inputSpan.innerHTML = this.input.value;
  5414. if (this.idleInterval != null) window.clearInterval(this.idleInterval);
  5415. this.scheduleNotify();
  5416. }
  5417. }, {
  5418. key: "stopBlinkCaret",
  5419. value: function stopBlinkCaret() {
  5420. clearInterval(this.cursorInterval);
  5421. this.cursorInterval = null;
  5422. this.cursorRef.style.visibility = "visible";
  5423. }
  5424. }, {
  5425. key: "notifyListeners",
  5426. value: function notifyListeners(text) {
  5427. this.inputListeners.forEach(function (resolve) {
  5428. return resolve(text);
  5429. });
  5430. this.inputListeners.splice(0, this.inputListeners.length);
  5431. this.hideInput();
  5432. this.anyKey = false;
  5433. }
  5434. }, {
  5435. key: "writeRawHTML",
  5436. value: function writeRawHTML(text, channel) {
  5437. this._appendTextLn(text, channel, false);
  5438. }
  5439. }, {
  5440. key: "write",
  5441. value: function write(text) {
  5442. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5443. this._appendText(text, DOMConsole.USER, newLine);
  5444. }
  5445. }, {
  5446. key: "info",
  5447. value: function info(text) {
  5448. this._appendTextLn(text, DOMConsole.INFO);
  5449. }
  5450. }, {
  5451. key: "err",
  5452. value: function err(text) {
  5453. this._appendTextLn(text, DOMConsole.ERR);
  5454. }
  5455. }, {
  5456. key: "_appendText",
  5457. value: function () {
  5458. var _appendText2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(text, type) {
  5459. var newLine,
  5460. write_time,
  5461. divClass,
  5462. textDiv,
  5463. _args = arguments;
  5464. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  5465. while (1) {
  5466. switch (_context.prev = _context.next) {
  5467. case 0:
  5468. newLine = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
  5469. // console.debug("Caling appendText");
  5470. write_time = Date.now();
  5471. this.pending_writes.push(0);
  5472. _context.next = 5;
  5473. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  5474. case 5:
  5475. this.pending_writes.pop();
  5476. if (!(this.last_clear >= write_time)) {
  5477. _context.next = 8;
  5478. break;
  5479. }
  5480. return _context.abrupt("return");
  5481. case 8:
  5482. if (this.currentLine == null) {
  5483. divClass = this.getClassForType(type);
  5484. textDiv = document.createElement("div");
  5485. textDiv.classList.add(divClass);
  5486. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5487. this.currentLine = textDiv;
  5488. }
  5489. this.currentLine.innerHTML += this.getOutputText(text);
  5490. if (newLine) {
  5491. // console.debug("append newline");
  5492. this.currentLine = null;
  5493. }
  5494. this.scrollTerm();
  5495. case 12:
  5496. case "end":
  5497. return _context.stop();
  5498. }
  5499. }
  5500. }, _callee, this);
  5501. }));
  5502. function _appendText(_x, _x2) {
  5503. return _appendText2.apply(this, arguments);
  5504. }
  5505. return _appendText;
  5506. }()
  5507. }, {
  5508. key: "_appendTextLn",
  5509. value: function () {
  5510. var _appendTextLn2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(text, type) {
  5511. var filter,
  5512. write_time,
  5513. divClass,
  5514. textDiv,
  5515. _args2 = arguments;
  5516. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  5517. while (1) {
  5518. switch (_context2.prev = _context2.next) {
  5519. case 0:
  5520. filter = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : true;
  5521. write_time = Date.now();
  5522. this.pending_writes.push(0);
  5523. _context2.next = 5;
  5524. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  5525. case 5:
  5526. this.pending_writes.pop();
  5527. if (!(this.last_clear >= write_time)) {
  5528. _context2.next = 8;
  5529. break;
  5530. }
  5531. return _context2.abrupt("return");
  5532. case 8:
  5533. divClass = this.getClassForType(type);
  5534. textDiv = document.createElement("div");
  5535. textDiv.classList.add(divClass);
  5536. if (filter) textDiv.innerHTML = this.getOutputText(text);else textDiv.innerHTML = "<span>".concat(text, "</span>");
  5537. if (this.currentLine != null && this.currentLine.innerHTML.length === 0) {
  5538. this.termDiv.removeChild(this.currentLine);
  5539. }
  5540. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5541. this.currentLine = null;
  5542. this.scrollTerm();
  5543. case 16:
  5544. case "end":
  5545. return _context2.stop();
  5546. }
  5547. }
  5548. }, _callee2, this);
  5549. }));
  5550. function _appendTextLn(_x3, _x4) {
  5551. return _appendTextLn2.apply(this, arguments);
  5552. }
  5553. return _appendTextLn;
  5554. }()
  5555. }, {
  5556. key: "_appendUserInput",
  5557. value: function () {
  5558. var _appendUserInput2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(text) {
  5559. var write_time, divClass, textDiv;
  5560. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  5561. while (1) {
  5562. switch (_context3.prev = _context3.next) {
  5563. case 0:
  5564. write_time = Date.now();
  5565. this.pending_writes.push(0);
  5566. _context3.next = 4;
  5567. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  5568. case 4:
  5569. this.pending_writes.pop();
  5570. if (!(this.last_clear >= write_time)) {
  5571. _context3.next = 7;
  5572. break;
  5573. }
  5574. return _context3.abrupt("return");
  5575. case 7:
  5576. divClass = this.getClassForType(DOMConsole.INPUT);
  5577. textDiv = document.createElement("div");
  5578. textDiv.innerHTML = this.getUserInputText(text);
  5579. textDiv.classList.add(divClass);
  5580. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5581. this.currentLine = null;
  5582. this.scrollTerm();
  5583. case 14:
  5584. case "end":
  5585. return _context3.stop();
  5586. }
  5587. }
  5588. }, _callee3, this);
  5589. }));
  5590. function _appendUserInput(_x5) {
  5591. return _appendUserInput2.apply(this, arguments);
  5592. }
  5593. return _appendUserInput;
  5594. }()
  5595. }, {
  5596. key: "getOutputText",
  5597. value: function getOutputText(text) {
  5598. text = text.replace(/\s/g, "&#160;");
  5599. return "<span>".concat(text, "</span>");
  5600. }
  5601. }, {
  5602. key: "getUserInputText",
  5603. value: function getUserInputText(text) {
  5604. if (text.trim().length == 0) {
  5605. text = "&nbsp;";
  5606. }
  5607. return "<i class=\"icon keyboard outline\" style=\"float:left\"></i><span>".concat(text, "</span>");
  5608. }
  5609. }, {
  5610. key: "scrollTerm",
  5611. value: function scrollTerm() {
  5612. //scrollIt(this.inputDiv.previousSibling,200);
  5613. this.termDiv.scrollTop = this.termDiv.scrollHeight;
  5614. }
  5615. }, {
  5616. key: "focus",
  5617. value: function focus() {
  5618. this.termDiv.style.display = "block"; // Is in draggable mode?
  5619. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  5620. this.parent.style.marginTop = "-160px";
  5621. }
  5622. if (this.needInput) {
  5623. this.showInput();
  5624. this.scheduleNotify();
  5625. }
  5626. if (!_util_utils__WEBPACK_IMPORTED_MODULE_5__["isElementInViewport"](this.termDiv)) this.termDiv.scrollIntoView(false);
  5627. this.scrollTerm();
  5628. }
  5629. }, {
  5630. key: "hide",
  5631. value: function hide() {
  5632. if (this.needInput) {
  5633. clearInterval(this.idleInterval);
  5634. this.hideInput();
  5635. this.needInput = true;
  5636. } // Is in draggable mode?
  5637. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  5638. this.parent.style.marginTop = "0";
  5639. }
  5640. this.termDiv.style.display = "none";
  5641. }
  5642. }, {
  5643. key: "getClassForType",
  5644. value: function getClassForType(type) {
  5645. switch (type) {
  5646. case DOMConsole.INPUT:
  5647. return "ivprog-term-userInput";
  5648. case DOMConsole.USER:
  5649. return "ivprog-term-userText";
  5650. case DOMConsole.INFO:
  5651. return "ivprog-term-info";
  5652. case DOMConsole.ERR:
  5653. return "ivprog-term-error";
  5654. }
  5655. }
  5656. }, {
  5657. key: "dispose",
  5658. value: function dispose() {
  5659. this.input.removeEventListener("keyup", this.updateSpanText.bind(this));
  5660. this.input.removeEventListener("blur", this.stopBlinkCaret.bind(this));
  5661. this.input.removeEventListener("keydown", this.registerInput.bind(this));
  5662. this.inputCMD.removeEventListener("click", this.blinkCaretAndFocus.bind(this));
  5663. this.clearBtn.removeEventListener("click", this.clearBtnClick.bind(this));
  5664. this.hideBtn.removeEventListener("click", this.hideBtnClick.bind(this));
  5665. this.showBtn.removeEventListener("click", this.showBtnClick.bind(this));
  5666. this.input = null;
  5667. this.inputCMD = null;
  5668. this.inputDiv = null;
  5669. this.termDiv = null;
  5670. this.inputSpan = null;
  5671. this.cursorRef = null;
  5672. this.clearBtn = null;
  5673. this.hideBtn = null;
  5674. this.showBtn = null;
  5675. this.currentLine = null;
  5676. var cNode = this.parent.cloneNode(false);
  5677. this.parent.parentNode.replaceChild(cNode, this.parent);
  5678. if (this.cursorInterval != null) {
  5679. clearInterval(this.cursorInterval);
  5680. }
  5681. if (this.idleInterval != null) {
  5682. clearInterval(this.idleInterval);
  5683. }
  5684. }
  5685. }, {
  5686. key: "showInput",
  5687. value: function showInput() {
  5688. this.needInput = true;
  5689. this.inputDiv.style.display = "block";
  5690. this.inputCMD.click(); //this.inputCMD.scrollIntoView();
  5691. this.scrollTerm();
  5692. }
  5693. }, {
  5694. key: "hideInput",
  5695. value: function hideInput() {
  5696. this.needInput = false;
  5697. this.inputDiv.style.display = " none";
  5698. clearInterval(this.cursorInterval);
  5699. this.cursorInterval = null;
  5700. }
  5701. }, {
  5702. key: "requestInput",
  5703. value: function requestInput() {
  5704. var _this2 = this;
  5705. var anyKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  5706. var promise = new Promise(function (resolve, _) {
  5707. _this2.inputListeners.push(resolve);
  5708. _this2.anyKey = anyKey;
  5709. if (_this2.idleInterval == null) _this2.scheduleNotify();
  5710. _this2.showInput();
  5711. });
  5712. return promise;
  5713. }
  5714. }, {
  5715. key: "sendOutput",
  5716. value: function sendOutput(text) {
  5717. //console.debug(text);
  5718. var output = "" + text;
  5719. if (output.indexOf("\n") !== -1) {
  5720. //console.debug("newline");
  5721. var outputList = output.split("\n");
  5722. var i = 0;
  5723. for (; i < outputList.length - 1; i += 1) {
  5724. //console.debug("newline write");
  5725. var _t = outputList[i];
  5726. _t = _t.replace(/\t/g, "&#x0020;&#x0020;");
  5727. _t = _t.replace(/\s/g, "&#x0020;");
  5728. if (_t.length !== 0) {
  5729. this.write(_t);
  5730. }
  5731. this.write("", true);
  5732. }
  5733. var t = outputList[i];
  5734. t = t.replace(/\t/g, "&#x0020;&#x0020;");
  5735. t = t.replace(/\s/g, "&#x0020;");
  5736. if (t.length != 0) this.write(t);
  5737. } else {
  5738. // console.debug("no newline");
  5739. output = output.replace(/\t/g, "&#x0020;&#x0020;");
  5740. output = output.replace(/\s/g, "&#x0020;");
  5741. if (output.length != 0) this.write(output);
  5742. }
  5743. }
  5744. }, {
  5745. key: "clearPendingWrites",
  5746. value: function clearPendingWrites() {
  5747. this.last_clear = Date.now();
  5748. }
  5749. }, {
  5750. key: "clear",
  5751. value: function clear() {
  5752. this.clearPendingWrites();
  5753. while (this.inputDiv.parentElement.childNodes.length > 1) {
  5754. this.inputDiv.parentElement.removeChild(this.inputDiv.parentElement.firstChild);
  5755. }
  5756. this.input.value = "";
  5757. this.inputSpan.innerHTML = "";
  5758. this.currentLine = null;
  5759. }
  5760. }, {
  5761. key: "clearBtnClick",
  5762. value: function clearBtnClick() {
  5763. this.clear();
  5764. }
  5765. }, {
  5766. key: "showBtnClick",
  5767. value: function showBtnClick() {
  5768. this.focus();
  5769. }
  5770. }, {
  5771. key: "hideBtnClick",
  5772. value: function hideBtnClick() {
  5773. this.hide();
  5774. }
  5775. }, {
  5776. key: "notifyIdle",
  5777. value: function notifyIdle() {
  5778. this.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("awaiting_input_message"));
  5779. this.inputCMD.click();
  5780. }
  5781. }, {
  5782. key: "scheduleNotify",
  5783. value: function scheduleNotify() {
  5784. this.idleInterval = window.setInterval(this.notifyIdle.bind(this), _util_config__WEBPACK_IMPORTED_MODULE_6__["Config"].idle_input_interval);
  5785. }
  5786. }, {
  5787. key: "cancelPendingInputRequests",
  5788. value: function cancelPendingInputRequests() {
  5789. this.inputListeners.forEach(function (resolve) {
  5790. return resolve("");
  5791. });
  5792. this.inputListeners.splice(0, this.inputListeners.length);
  5793. if (this.idleInterval != null) {
  5794. clearInterval(this.idleInterval);
  5795. this.idleInterval = null;
  5796. }
  5797. this.input.value = "";
  5798. this.inputSpan.innerHTML = "";
  5799. this.currentLine = null;
  5800. this.hideInput();
  5801. this.anyKey = false;
  5802. }
  5803. }]);
  5804. return DOMConsole;
  5805. }();
  5806. /***/ }),
  5807. /***/ "./js/io/input.js":
  5808. /*!************************!*\
  5809. !*** ./js/io/input.js ***!
  5810. \************************/
  5811. /*! exports provided: Input */
  5812. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5813. "use strict";
  5814. __webpack_require__.r(__webpack_exports__);
  5815. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
  5816. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5817. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5818. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5819. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5820. var Input = /*#__PURE__*/function () {
  5821. function Input() {
  5822. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Input);
  5823. }
  5824. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Input, [{
  5825. key: "requestInput",
  5826. value: function requestInput() {
  5827. throw new Error("Must be implemented");
  5828. }
  5829. }, {
  5830. key: "cancelPendingInputRequests",
  5831. value: function cancelPendingInputRequests() {
  5832. throw new Error("Must be implemented");
  5833. }
  5834. }]);
  5835. return Input;
  5836. }();
  5837. /***/ }),
  5838. /***/ "./js/io/output.js":
  5839. /*!*************************!*\
  5840. !*** ./js/io/output.js ***!
  5841. \*************************/
  5842. /*! exports provided: Output */
  5843. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5844. "use strict";
  5845. __webpack_require__.r(__webpack_exports__);
  5846. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; });
  5847. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5848. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5849. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5850. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5851. var Output = /*#__PURE__*/function () {
  5852. function Output() {
  5853. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Output);
  5854. }
  5855. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Output, [{
  5856. key: "sendOutput",
  5857. value: function sendOutput(text) {
  5858. throw new Error("Must be implemented");
  5859. }
  5860. }]);
  5861. return Output;
  5862. }();
  5863. /***/ }),
  5864. /***/ "./js/main.js":
  5865. /*!********************!*\
  5866. !*** ./js/main.js ***!
  5867. \********************/
  5868. /*! exports provided: runner, initVisualUI, addFunctionChangeListener, addGlobalChangeListener, removeFunctionListener, removeGlobalListener, getTestCases, autoEval, prepareActivityToStudentHelper, LocalizedStrings, i18n, getLogs, getLogsAsString, registerClick, registerUserEvent, parseLogs, ActionTypes, CodeEditor, openAssessmentDetail, autoGenerateTestCaseOutput, Config */
  5869. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5870. "use strict";
  5871. __webpack_require__.r(__webpack_exports__);
  5872. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  5873. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18n", function() { return i18n; });
  5874. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditor", function() { return CodeEditor; });
  5875. /* harmony import */ var _runner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runner */ "./js/runner.js");
  5876. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return _runner__WEBPACK_IMPORTED_MODULE_0__["runner"]; });
  5877. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualUI/functions */ "./js/visualUI/functions.js");
  5878. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["initVisualUI"]; });
  5879. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addFunctionChangeListener"]; });
  5880. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addGlobalChangeListener"]; });
  5881. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeFunctionListener"]; });
  5882. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeGlobalListener"]; });
  5883. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["getTestCases"]; });
  5884. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/localizedStringsService */ "./js/services/localizedStringsService.js");
  5885. /* harmony import */ var _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/i18nHelper */ "./js/services/i18nHelper.js");
  5886. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/userLog */ "./js/services/userLog.js");
  5887. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogs"]; });
  5888. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogsAsString"]; });
  5889. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerClick"]; });
  5890. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"]; });
  5891. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"]; });
  5892. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"]; });
  5893. /* harmony import */ var _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/iassignHelpers */ "./js/util/iassignHelpers.js");
  5894. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["autoEval"]; });
  5895. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["prepareActivityToStudentHelper"]; });
  5896. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/utils */ "./js/util/utils.js");
  5897. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return _util_utils__WEBPACK_IMPORTED_MODULE_6__["openAssessmentDetail"]; });
  5898. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/config */ "./js/util/config.ts");
  5899. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  5900. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Config", function() { return _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]; });
  5901. /* harmony import */ var _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./visualUI/text_editor */ "./js/visualUI/text_editor.js");
  5902. /* harmony import */ var _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util/auto_gen_output */ "./js/util/auto_gen_output.js");
  5903. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_9__["autoGenerateTestCaseOutput"]; });
  5904. var CodeEditor = {
  5905. initTextEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["initTextEditor"],
  5906. setCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["setCode"],
  5907. getCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["getCode"],
  5908. updateEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["updateEditor"],
  5909. disable: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["disable"]
  5910. };
  5911. var i18n = _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__["i18nHelper"].i18n;
  5912. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  5913. /***/ }),
  5914. /***/ "./js/memory/address.ts":
  5915. /*!******************************!*\
  5916. !*** ./js/memory/address.ts ***!
  5917. \******************************/
  5918. /*! no static exports found */
  5919. /***/ (function(module, exports, __webpack_require__) {
  5920. "use strict";
  5921. Object.defineProperty(exports, "__esModule", { value: true });
  5922. exports.Address = void 0;
  5923. class Address {
  5924. /**
  5925. *
  5926. * @param {Number} id the address id
  5927. * @param {never} value the value stored at this address
  5928. */
  5929. constructor(id, value) {
  5930. this.id = id;
  5931. this.value = value;
  5932. }
  5933. }
  5934. exports.Address = Address;
  5935. /***/ }),
  5936. /***/ "./js/memory/location.ts":
  5937. /*!*******************************!*\
  5938. !*** ./js/memory/location.ts ***!
  5939. \*******************************/
  5940. /*! no static exports found */
  5941. /***/ (function(module, exports, __webpack_require__) {
  5942. "use strict";
  5943. Object.defineProperty(exports, "__esModule", { value: true });
  5944. exports.Location = void 0;
  5945. const address_1 = __webpack_require__(/*! ./address */ "./js/memory/address.ts");
  5946. class LocationHolder {
  5947. constructor() {
  5948. this.data = [];
  5949. this.address_id = 0;
  5950. }
  5951. /**
  5952. *
  5953. * @param {never} value the value to be allocated
  5954. * @returns {number} - the address id
  5955. */
  5956. allocate(value) {
  5957. const id = this.address_id;
  5958. // console.log("Allocation address "+ id);
  5959. const address = new address_1.Address(id, value);
  5960. this.data.push(address);
  5961. this.address_id += 1;
  5962. return id;
  5963. }
  5964. /**
  5965. *
  5966. * @param {number} id
  5967. */
  5968. deallocate(id) {
  5969. const index = this.findIndex(id);
  5970. // console.log("Deallocation address "+ id);
  5971. if (index !== -1) {
  5972. this.data.splice(index, 1);
  5973. return true;
  5974. }
  5975. return false;
  5976. }
  5977. /**
  5978. *
  5979. * @param {number} id
  5980. * @returns {Address} the address identified by id
  5981. */
  5982. find(id) {
  5983. let beg = 0;
  5984. let end = this.data.length;
  5985. // console.log("Finding address "+id);
  5986. while (beg < end) {
  5987. const med = Math.floor((beg + end) / 2);
  5988. const address = this.getAddressAt(med);
  5989. if (address.id === id) {
  5990. return address;
  5991. }
  5992. else if (id > address.id) {
  5993. beg = med;
  5994. }
  5995. else {
  5996. end = med;
  5997. }
  5998. }
  5999. return undefined;
  6000. }
  6001. getAddressAt(pos) {
  6002. return this.data[pos];
  6003. }
  6004. /**
  6005. *
  6006. * @param {number} id address id
  6007. * @returns {number} the index of the address identified by id
  6008. */
  6009. findIndex(id) {
  6010. let beg = 0;
  6011. let end = this.data.length;
  6012. while (beg < end) {
  6013. const med = Math.floor((beg + end) / 2);
  6014. const address = this.getAddressAt(med);
  6015. if (address.id === id) {
  6016. return med;
  6017. }
  6018. else if (id > address.id) {
  6019. beg = med;
  6020. }
  6021. else {
  6022. end = med;
  6023. }
  6024. }
  6025. return -1;
  6026. }
  6027. updateAddress(id, value) {
  6028. const index = this.findIndex(id);
  6029. if (index === -1) {
  6030. throw new Error("Invalid address..." + id);
  6031. }
  6032. this.data[index].value = value;
  6033. }
  6034. clear() {
  6035. for (let i = 0; i < this.data.length; i += 1) {
  6036. delete this.data[i];
  6037. }
  6038. this.data = [];
  6039. this.address_id = 0;
  6040. }
  6041. }
  6042. const inner_ref = new LocationHolder();
  6043. exports.Location = Object.freeze({
  6044. allocate: inner_ref.allocate.bind(inner_ref),
  6045. deallocate: inner_ref.deallocate.bind(inner_ref),
  6046. find: inner_ref.find.bind(inner_ref),
  6047. updateAddress: inner_ref.updateAddress.bind(inner_ref),
  6048. clear: inner_ref.clear.bind(inner_ref),
  6049. size: () => inner_ref.data.length
  6050. });
  6051. /***/ }),
  6052. /***/ "./js/processor/compatibilityTable.ts":
  6053. /*!********************************************!*\
  6054. !*** ./js/processor/compatibilityTable.ts ***!
  6055. \********************************************/
  6056. /*! no static exports found */
  6057. /***/ (function(module, exports, __webpack_require__) {
  6058. "use strict";
  6059. Object.defineProperty(exports, "__esModule", { value: true });
  6060. exports.resultTypeAfterUnaryOp = exports.resultTypeAfterInfixOp = void 0;
  6061. const types_1 = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  6062. const operators_1 = __webpack_require__(/*! ../ast/operators */ "./js/ast/operators.ts");
  6063. const multiType_1 = __webpack_require__(/*! ../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  6064. const config_1 = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  6065. function buildInfixAddTable() {
  6066. const table = [[], [], [], [], []];
  6067. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6068. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6069. table[types_1.Types.INTEGER.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6070. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6071. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6072. table[types_1.Types.REAL.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6073. table[types_1.Types.STRING.ord][types_1.Types.INTEGER.ord] = types_1.Types.STRING;
  6074. table[types_1.Types.STRING.ord][types_1.Types.REAL.ord] = types_1.Types.STRING;
  6075. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6076. table[types_1.Types.STRING.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.STRING;
  6077. table[types_1.Types.STRING.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6078. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6079. table[types_1.Types.CHAR.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6080. return table;
  6081. }
  6082. function buildInfixMultiDivSubTable() {
  6083. const table = [[], []];
  6084. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6085. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6086. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6087. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6088. return table;
  6089. }
  6090. function buildInfixEqualityInequalityTable() {
  6091. const table = [[], [], [], [], []];
  6092. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6093. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6094. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6095. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6096. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6097. return table;
  6098. }
  6099. function buildInfixRelationalTable() {
  6100. const table = [[], [], [], [], []];
  6101. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6102. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6103. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6104. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6105. return table;
  6106. }
  6107. function buildInfixAndOrTable() {
  6108. const table = [[], [], [], []];
  6109. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6110. return table;
  6111. }
  6112. function buildInfixModTable() {
  6113. const table = [[]];
  6114. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6115. return table;
  6116. }
  6117. function buildUnarySumSubList() {
  6118. const list = [];
  6119. list[types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6120. list[types_1.Types.REAL.ord] = types_1.Types.REAL;
  6121. return list;
  6122. }
  6123. function buildUnaryNegList() {
  6124. const list = [];
  6125. list[types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6126. return list;
  6127. }
  6128. function buildInfixCompatibilityTable() {
  6129. const compatibilityMap = new WeakMap();
  6130. compatibilityMap.set(operators_1.Operators.ADD, buildInfixAddTable());
  6131. compatibilityMap.set(operators_1.Operators.SUB, buildInfixMultiDivSubTable());
  6132. compatibilityMap.set(operators_1.Operators.MULT, buildInfixMultiDivSubTable());
  6133. compatibilityMap.set(operators_1.Operators.DIV, buildInfixMultiDivSubTable());
  6134. compatibilityMap.set(operators_1.Operators.EQ, buildInfixEqualityInequalityTable());
  6135. compatibilityMap.set(operators_1.Operators.NEQ, buildInfixEqualityInequalityTable());
  6136. compatibilityMap.set(operators_1.Operators.GE, buildInfixRelationalTable());
  6137. compatibilityMap.set(operators_1.Operators.GT, buildInfixRelationalTable());
  6138. compatibilityMap.set(operators_1.Operators.LE, buildInfixRelationalTable());
  6139. compatibilityMap.set(operators_1.Operators.LT, buildInfixRelationalTable());
  6140. compatibilityMap.set(operators_1.Operators.OR, buildInfixAndOrTable());
  6141. compatibilityMap.set(operators_1.Operators.AND, buildInfixAndOrTable());
  6142. compatibilityMap.set(operators_1.Operators.MOD, buildInfixModTable());
  6143. return compatibilityMap;
  6144. }
  6145. function buildUnaryCompatibilityTable() {
  6146. const compatibilityMap = new WeakMap();
  6147. compatibilityMap.set(operators_1.Operators.ADD, buildUnarySumSubList());
  6148. compatibilityMap.set(operators_1.Operators.SUB, buildUnarySumSubList());
  6149. compatibilityMap.set(operators_1.Operators.NOT, buildUnaryNegList());
  6150. return compatibilityMap;
  6151. }
  6152. const infixMap = buildInfixCompatibilityTable();
  6153. const unaryMap = buildUnaryCompatibilityTable();
  6154. function resultTypeAfterInfixOp(operator, leftExpressionType, rightExpressionType) {
  6155. try {
  6156. if (leftExpressionType instanceof multiType_1.MultiType && rightExpressionType instanceof multiType_1.MultiType) {
  6157. let newMulti = [];
  6158. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6159. const typeA = leftExpressionType.types[i];
  6160. for (let j = 0; j < rightExpressionType.types.length; ++i) {
  6161. const typeB = rightExpressionType.types[j];
  6162. newMulti.push(resultTypeAfterInfixOp(operator, typeA, typeB));
  6163. }
  6164. }
  6165. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6166. if (newMulti.length <= 0) {
  6167. if (config_1.Config.enable_type_casting) {
  6168. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6169. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6170. return new multiType_1.MultiType([types_1.Types.INTEGER, types_1.Types.REAL]);
  6171. }
  6172. }
  6173. }
  6174. return types_1.Types.UNDEFINED;
  6175. }
  6176. else {
  6177. return new multiType_1.MultiType(newMulti);
  6178. }
  6179. }
  6180. else if (leftExpressionType instanceof multiType_1.MultiType) {
  6181. if (leftExpressionType.isCompatible(rightExpressionType)) {
  6182. return resultTypeAfterInfixOp(operator, rightExpressionType, rightExpressionType);
  6183. }
  6184. else {
  6185. if (config_1.Config.enable_type_casting) {
  6186. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6187. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6188. return rightExpressionType;
  6189. }
  6190. }
  6191. }
  6192. return types_1.Types.UNDEFINED;
  6193. }
  6194. }
  6195. else if (rightExpressionType instanceof multiType_1.MultiType) {
  6196. if (rightExpressionType.isCompatible(leftExpressionType)) {
  6197. return resultTypeAfterInfixOp(operator, leftExpressionType, leftExpressionType);
  6198. }
  6199. else {
  6200. if (config_1.Config.enable_type_casting) {
  6201. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6202. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6203. return leftExpressionType;
  6204. }
  6205. }
  6206. }
  6207. return types_1.Types.UNDEFINED;
  6208. }
  6209. }
  6210. const resultTable = infixMap.get(operator) || [];
  6211. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6212. const resultType = resultTable[leftExpressionType.ord][rightExpressionType.ord];
  6213. if (resultType === null || resultType === undefined) {
  6214. if (config_1.Config.enable_type_casting) {
  6215. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6216. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6217. if (operator === operators_1.Operators.MOD) {
  6218. return types_1.Types.INTEGER;
  6219. }
  6220. else if (operator.ord >= 5 && operator.ord <= 10) {
  6221. return types_1.Types.BOOLEAN;
  6222. }
  6223. }
  6224. }
  6225. }
  6226. return types_1.Types.UNDEFINED;
  6227. }
  6228. return resultType;
  6229. }
  6230. catch (e) {
  6231. if (e instanceof TypeError) {
  6232. return types_1.Types.UNDEFINED;
  6233. }
  6234. else {
  6235. throw e;
  6236. }
  6237. }
  6238. }
  6239. exports.resultTypeAfterInfixOp = resultTypeAfterInfixOp;
  6240. function resultTypeAfterUnaryOp(operator, leftExpressionType) {
  6241. try {
  6242. if (leftExpressionType instanceof multiType_1.MultiType) {
  6243. let newMulti = [];
  6244. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6245. const type = leftExpressionType.types[i];
  6246. newMulti.push(resultTypeAfterUnaryOp(operator, type));
  6247. }
  6248. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6249. if (newMulti.length <= 0) {
  6250. return types_1.Types.UNDEFINED;
  6251. }
  6252. return new multiType_1.MultiType(newMulti);
  6253. }
  6254. const resultTable = unaryMap.get(operator) || [];
  6255. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6256. const resultType = resultTable[leftExpressionType.ord];
  6257. if (resultType == null) {
  6258. return types_1.Types.UNDEFINED;
  6259. }
  6260. return resultType;
  6261. }
  6262. catch (e) {
  6263. if (e instanceof TypeError) {
  6264. return types_1.Types.UNDEFINED;
  6265. }
  6266. else {
  6267. throw e;
  6268. }
  6269. }
  6270. }
  6271. exports.resultTypeAfterUnaryOp = resultTypeAfterUnaryOp;
  6272. /***/ }),
  6273. /***/ "./js/processor/context.ts":
  6274. /*!*********************************!*\
  6275. !*** ./js/processor/context.ts ***!
  6276. \*********************************/
  6277. /*! no static exports found */
  6278. /***/ (function(module, exports, __webpack_require__) {
  6279. "use strict";
  6280. Object.defineProperty(exports, "__esModule", { value: true });
  6281. exports.Context = void 0;
  6282. exports.Context = Object.freeze({
  6283. BASE: Symbol('context:base'),
  6284. BREAKABLE: Symbol('context:breakable'),
  6285. FUNCTION: Symbol('context:function')
  6286. });
  6287. /***/ }),
  6288. /***/ "./js/processor/definedFunctions.js":
  6289. /*!******************************************!*\
  6290. !*** ./js/processor/definedFunctions.js ***!
  6291. \******************************************/
  6292. /*! exports provided: LanguageDefinedFunction */
  6293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6294. "use strict";
  6295. __webpack_require__.r(__webpack_exports__);
  6296. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageDefinedFunction", function() { return LanguageDefinedFunction; });
  6297. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  6298. /* harmony import */ var _lib_io__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/io */ "./js/processor/lib/io.js");
  6299. /* harmony import */ var _lib_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/strings */ "./js/processor/lib/strings.js");
  6300. /* harmony import */ var _lib_arrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/arrays */ "./js/processor/lib/arrays.js");
  6301. /* harmony import */ var _lib_lang__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/lang */ "./js/processor/lib/lang.js");
  6302. /* harmony import */ var _lib_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/math */ "./js/processor/lib/math.js");
  6303. function valueToKey(value, object) {
  6304. for (var key in object) {
  6305. if (Object.prototype.hasOwnProperty.call(object, key)) {
  6306. if (object[key] === value) {
  6307. return key;
  6308. }
  6309. }
  6310. }
  6311. return null;
  6312. }
  6313. function concatObjects() {
  6314. var result = {};
  6315. for (var i = 0; i < arguments.length; i++) {
  6316. var obj = i < 0 || arguments.length <= i ? undefined : arguments[i];
  6317. for (var key in obj) {
  6318. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  6319. result[key] = obj[key];
  6320. }
  6321. }
  6322. }
  6323. return result;
  6324. }
  6325. var libsObject = {
  6326. $mathLib: {
  6327. $sin: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSinFun"])(),
  6328. $cos: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createCosFun"])(),
  6329. $tan: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createTanFun"])(),
  6330. $sqrt: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSqrtFun"])(),
  6331. $pow: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createPowFun"])(),
  6332. $log: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createLogFun"])(),
  6333. $abs: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createAbsFun"])(),
  6334. $negate: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createNegateFun"])(),
  6335. $invert: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createInvertFun"])(),
  6336. $max: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMaxFun"])(),
  6337. $min: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMinFun"])(),
  6338. $rand: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createRandFun"])()
  6339. },
  6340. $ioLib: {
  6341. $read: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createInputFun"])(),
  6342. $write: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createOutputFun"])()
  6343. },
  6344. $strLib: {
  6345. $substring: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createSubstringFun"])(),
  6346. $length: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLengthFun"])(),
  6347. $uppercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createUppercaseFun"])(),
  6348. $lowercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLowercaseFun"])(),
  6349. $charAt: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createrCharAtFun"])()
  6350. },
  6351. $arrayLib: {
  6352. $numElements: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createNumElementsFun"])(),
  6353. $matrixLines: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixLinesFun"])(),
  6354. $matrixColumns: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixColumnsFun"])()
  6355. },
  6356. $langLib: {
  6357. $isReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsRealFun"])(),
  6358. $isInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsIntFun"])(),
  6359. $isBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsBoolFun"])(),
  6360. $castReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastRealFun"])(),
  6361. $castInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastIntFun"])(),
  6362. $castBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastBoolFun"])(),
  6363. $castString: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastStringFun"])(),
  6364. $castChar: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastCharFun"])()
  6365. }
  6366. };
  6367. var funcsObject = concatObjects(libsObject.$ioLib, libsObject.$langLib, libsObject.$strLib, libsObject.$arrayLib);
  6368. var LanguageDefinedFunction = Object.freeze({
  6369. getMainFunctionName: function getMainFunctionName() {
  6370. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs().main_function;
  6371. },
  6372. getInternalName: function getInternalName(localName) {
  6373. if (localName.indexOf(".") !== -1) {
  6374. var names = localName.split(".");
  6375. var lib = valueToKey(names[0], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs());
  6376. var internalName = valueToKey(names[1], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6377. if (lib === null || internalName === null) {
  6378. return null;
  6379. }
  6380. return lib + "." + internalName;
  6381. }
  6382. var funcName = valueToKey(localName, _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6383. if (funcName !== null) {
  6384. if (funcsObject[funcName]) {
  6385. return funcName;
  6386. }
  6387. }
  6388. return null;
  6389. },
  6390. getFunction: function getFunction(internalName) {
  6391. if (internalName.indexOf(".") !== -1) {
  6392. var names = internalName.split(".");
  6393. var libName = names[0];
  6394. var funName = names[1];
  6395. return libsObject[libName][funName];
  6396. }
  6397. return funcsObject[internalName];
  6398. },
  6399. getLocalName: function getLocalName(internalName) {
  6400. if (internalName.indexOf(".") !== -1) {
  6401. var names = internalName.split(".");
  6402. var libName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs()[names[0]];
  6403. var funName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[names[1]];
  6404. return "".concat(libName, ".").concat(funName);
  6405. } else if (_services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName]) {
  6406. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName];
  6407. } else {
  6408. return internalName;
  6409. }
  6410. }
  6411. });
  6412. /***/ }),
  6413. /***/ "./js/processor/error/processorErrorFactory.js":
  6414. /*!*****************************************************!*\
  6415. !*** ./js/processor/error/processorErrorFactory.js ***!
  6416. \*****************************************************/
  6417. /*! exports provided: ProcessorErrorFactory */
  6418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6419. "use strict";
  6420. __webpack_require__.r(__webpack_exports__);
  6421. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProcessorErrorFactory", function() { return ProcessorErrorFactory; });
  6422. /* harmony import */ var _runtimeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runtimeError */ "./js/processor/error/runtimeError.js");
  6423. /* harmony import */ var _semanticError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./semanticError */ "./js/processor/error/semanticError.js");
  6424. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6425. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../definedFunctions */ "./js/processor/definedFunctions.js");
  6426. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6427. function createRuntimeError(i18n_id) {
  6428. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6429. return new _runtimeError__WEBPACK_IMPORTED_MODULE_0__["RuntimeError"](LocalizedStrings.getError(i18n_id, context));
  6430. }
  6431. function createSemanticError(i18n_id) {
  6432. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6433. return new _semanticError__WEBPACK_IMPORTED_MODULE_1__["SemanticError"](LocalizedStrings.getError(i18n_id, context));
  6434. }
  6435. var ProcessorErrorFactory = Object.freeze({
  6436. symbol_not_found_full: function symbol_not_found_full(id, sourceInfo) {
  6437. if (sourceInfo) {
  6438. var context = [id, sourceInfo.line, sourceInfo.column];
  6439. return createSemanticError("symbol_not_found_full", context);
  6440. } else {
  6441. return ProcessorErrorFactory.symbol_not_found(id);
  6442. }
  6443. },
  6444. symbol_not_found: function symbol_not_found(id) {
  6445. var context = [id];
  6446. return createSemanticError("symbol_not_found", context);
  6447. },
  6448. function_missing_full: function function_missing_full(id, sourceInfo) {
  6449. if (sourceInfo) {
  6450. var context = [id, sourceInfo.line, sourceInfo.column];
  6451. return createSemanticError("function_missing_full", context);
  6452. } else {
  6453. return ProcessorErrorFactory.function_missing(id);
  6454. }
  6455. },
  6456. function_missing: function function_missing(id) {
  6457. var context = [id];
  6458. return createSemanticError("function_missing", context);
  6459. },
  6460. main_missing: function main_missing() {
  6461. return createSemanticError("main_missing");
  6462. },
  6463. array_dimension_not_int_full: function array_dimension_not_int_full(sourceInfo) {
  6464. if (sourceInfo) {
  6465. var context = [sourceInfo.line];
  6466. return createSemanticError("array_dimension_not_int_full", context);
  6467. } else {
  6468. return ProcessorErrorFactory.array_dimension_not_int();
  6469. }
  6470. },
  6471. array_dimension_not_int: function array_dimension_not_int() {
  6472. return createSemanticError("array_dimension_not_int");
  6473. },
  6474. unknown_command_full: function unknown_command_full(sourceInfo) {
  6475. if (sourceInfo) {
  6476. var context = [sourceInfo.line];
  6477. return createRuntimeError("unknown_command_full", context);
  6478. } else {
  6479. return ProcessorErrorFactory.unknown_command();
  6480. }
  6481. },
  6482. unknown_command: function unknown_command() {
  6483. return createRuntimeError("unknown_command");
  6484. },
  6485. incompatible_types_full: function incompatible_types_full(left_type, left_dim, right_type, right_dim, exp, source_info) {
  6486. if (source_info) {
  6487. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, source_info.line, LocalizedStrings.translateType(right_type, right_dim)];
  6488. return createSemanticError("incompatible_types_full", context);
  6489. } else {
  6490. return ProcessorErrorFactory.incompatible_types(left_type, left_dim, right_type, right_dim, exp);
  6491. }
  6492. },
  6493. incompatible_types: function incompatible_types(left_type, left_dim, right_type, right_dim, exp) {
  6494. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, LocalizedStrings.translateType(right_type, right_dim)];
  6495. return createSemanticError("incompatible_types", context);
  6496. },
  6497. incompatible_types_array_full: function incompatible_types_array_full(exp, type, dim, sourceInfo) {
  6498. if (sourceInfo) {
  6499. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6500. return createSemanticError("incompatible_types_array_full", context);
  6501. } else {
  6502. return ProcessorErrorFactory.incompatible_types_array(exp, type, dim);
  6503. }
  6504. },
  6505. incompatible_types_array: function incompatible_types_array(exp, type, dim) {
  6506. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6507. return createSemanticError("incompatible_types_array", context);
  6508. },
  6509. loop_condition_type_full: function loop_condition_type_full(exp, sourceInfo) {
  6510. if (sourceInfo) {
  6511. var context = [sourceInfo.line, sourceInfo.column, exp];
  6512. return createSemanticError("loop_condition_type_full", context);
  6513. } else {
  6514. return ProcessorErrorFactory.loop_condition_type(exp);
  6515. }
  6516. },
  6517. loop_condition_type: function loop_condition_type(exp) {
  6518. var context = [exp];
  6519. return createSemanticError("loop_condition_type", context);
  6520. },
  6521. /**
  6522. * @deprecated 01/10/2019
  6523. */
  6524. endless_loop_full: function endless_loop_full(sourceInfo) {
  6525. if (sourceInfo) {
  6526. var context = [sourceInfo.line];
  6527. return createSemanticError("endless_loop_full", context);
  6528. } else {
  6529. return ProcessorErrorFactory.endless_loop();
  6530. }
  6531. },
  6532. endless_loop: function endless_loop() {
  6533. return createSemanticError("endless_loop");
  6534. },
  6535. if_condition_type_full: function if_condition_type_full(exp, sourceInfo) {
  6536. if (sourceInfo) {
  6537. var context = [sourceInfo.line, sourceInfo.column, exp];
  6538. return createSemanticError("if_condition_type_full", context);
  6539. } else {
  6540. return ProcessorErrorFactory.if_condition_type(exp);
  6541. }
  6542. },
  6543. if_condition_type: function if_condition_type(exp) {
  6544. var context = [exp];
  6545. return createSemanticError("if_condition_type", context);
  6546. },
  6547. invalid_global_var: function invalid_global_var() {
  6548. return createRuntimeError("invalid_global_var");
  6549. },
  6550. not_implemented: function not_implemented(id) {
  6551. var context = [id];
  6552. return createRuntimeError("not_implemented", context);
  6553. },
  6554. invalid_case_type_full: function invalid_case_type_full(exp, type, dim, sourceInfo) {
  6555. if (sourceInfo) {
  6556. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6557. return createSemanticError("invalid_case_type_full", context);
  6558. } else {
  6559. return ProcessorErrorFactory.invalid_case_type(exp, type, dim);
  6560. }
  6561. },
  6562. invalid_case_type: function invalid_case_type(exp, type, dim) {
  6563. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6564. return createSemanticError("invalid_case_type", context);
  6565. },
  6566. void_in_expression_full: function void_in_expression_full(id, sourceInfo) {
  6567. if (sourceInfo) {
  6568. var context = [sourceInfo.line, sourceInfo.column, id];
  6569. return createSemanticError("void_in_expression_full", context);
  6570. } else {
  6571. return ProcessorErrorFactory.void_in_expression(id);
  6572. }
  6573. },
  6574. void_in_expression: function void_in_expression(id) {
  6575. var context = [id];
  6576. return createSemanticError("void_in_expression", context);
  6577. },
  6578. invalid_array_access_full: function invalid_array_access_full(id, sourceInfo) {
  6579. if (sourceInfo) {
  6580. var context = [id, sourceInfo.line, sourceInfo.column];
  6581. return createSemanticError("invalid_array_access_full", context);
  6582. } else {
  6583. return ProcessorErrorFactory.invalid_array_access(id);
  6584. }
  6585. },
  6586. invalid_array_access: function invalid_array_access(id) {
  6587. var context = [id];
  6588. return createSemanticError("invalid_array_access", context);
  6589. },
  6590. invalid_matrix_access_full: function invalid_matrix_access_full(id, sourceInfo) {
  6591. if (sourceInfo) {
  6592. var context = [id, sourceInfo.line, sourceInfo.column];
  6593. return createSemanticError("invalid_matrix_access_full", context);
  6594. } else {
  6595. return ProcessorErrorFactory.invalid_matrix_access(id);
  6596. }
  6597. },
  6598. invalid_matrix_access: function invalid_matrix_access(id) {
  6599. var context = [id];
  6600. return createSemanticError("invalid_matrix_access", context);
  6601. },
  6602. matrix_column_outbounds_full: function matrix_column_outbounds_full(id, value, columns, sourceInfo) {
  6603. if (sourceInfo) {
  6604. var context = [sourceInfo.line, value, id, columns];
  6605. return createRuntimeError("matrix_column_outbounds_full", context);
  6606. } else {
  6607. return ProcessorErrorFactory.matrix_column_outbounds(id, value, columns);
  6608. }
  6609. },
  6610. matrix_column_outbounds: function matrix_column_outbounds(id, value, columns) {
  6611. var context = [value, id, columns];
  6612. return createRuntimeError("matrix_column_outbounds", context);
  6613. },
  6614. matrix_line_outbounds_full: function matrix_line_outbounds_full(id, value, lines, sourceInfo) {
  6615. if (sourceInfo) {
  6616. var context = [sourceInfo.line, value, id, lines];
  6617. return createRuntimeError("matrix_line_outbounds_full", context);
  6618. } else {
  6619. return ProcessorErrorFactory.matrix_line_outbounds(id, value, lines);
  6620. }
  6621. },
  6622. matrix_line_outbounds: function matrix_line_outbounds(id, value, lines) {
  6623. var context = [value, id, lines];
  6624. return createRuntimeError("matrix_line_outbounds", context);
  6625. },
  6626. vector_line_outbounds_full: function vector_line_outbounds_full(id, value, lines, sourceInfo) {
  6627. if (sourceInfo) {
  6628. var context = [sourceInfo.line, value, id, lines];
  6629. return createRuntimeError("vector_line_outbounds_full", context);
  6630. } else {
  6631. return ProcessorErrorFactory.vector_line_outbounds(id, value, lines);
  6632. }
  6633. },
  6634. vector_line_outbounds: function vector_line_outbounds(id, value, lines) {
  6635. var context = [value, id, lines];
  6636. return createRuntimeError("vector_line_outbounds", context);
  6637. },
  6638. vector_not_matrix_full: function vector_not_matrix_full(id, sourceInfo) {
  6639. if (sourceInfo) {
  6640. var context = [sourceInfo.line, id];
  6641. return createRuntimeError("vector_not_matrix_full", context);
  6642. } else {
  6643. return ProcessorErrorFactory.vector_not_matrix(id);
  6644. }
  6645. },
  6646. vector_not_matrix: function vector_not_matrix(id) {
  6647. var context = [id];
  6648. return createRuntimeError("vector_not_matrix", context);
  6649. },
  6650. function_no_return: function function_no_return(id) {
  6651. var context = [id];
  6652. return createSemanticError("function_no_return", context);
  6653. },
  6654. invalid_void_return_full: function invalid_void_return_full(id, type, dim, sourceInfo) {
  6655. if (sourceInfo) {
  6656. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6657. return createSemanticError("invalid_void_return_full", context);
  6658. } else {
  6659. return ProcessorErrorFactory.invalid_void_return(id, type, dim);
  6660. }
  6661. },
  6662. invalid_void_return: function invalid_void_return(id, type, dim) {
  6663. var context = [id, LocalizedStrings.translateType(type, dim)];
  6664. return createSemanticError("invalid_void_return_full", context);
  6665. },
  6666. invalid_return_type_full: function invalid_return_type_full(id, type, dim, sourceInfo) {
  6667. if (sourceInfo) {
  6668. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6669. return createSemanticError("invalid_return_type_full", context);
  6670. } else {
  6671. return ProcessorErrorFactory.invalid_return_type(id, type, dim);
  6672. }
  6673. },
  6674. invalid_return_type: function invalid_return_type(id, type, dim) {
  6675. var context = [id, LocalizedStrings.translateType(type, dim)];
  6676. return createSemanticError("invalid_return_type", context);
  6677. },
  6678. invalid_parameters_size_full: function invalid_parameters_size_full(id, expected, actual, sourceInfo) {
  6679. if (sourceInfo) {
  6680. var context = [sourceInfo.line, id, expected, actual];
  6681. return createSemanticError("invalid_parameters_size_full", context);
  6682. } else {
  6683. return ProcessorErrorFactory.invalid_parameters_size(id, expected, actual);
  6684. }
  6685. },
  6686. invalid_parameters_size: function invalid_parameters_size(id, expected, actual) {
  6687. var context = [id, expected, actual];
  6688. return createSemanticError("invalid_parameters_size", context);
  6689. },
  6690. invalid_parameter_type_full: function invalid_parameter_type_full(fun_name, exp, sourceInfo) {
  6691. if (sourceInfo) {
  6692. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  6693. return createSemanticError("invalid_parameter_type_full", context);
  6694. } else {
  6695. return ProcessorErrorFactory.invalid_parameter_type(fun_name, exp);
  6696. }
  6697. },
  6698. invalid_parameter_type: function invalid_parameter_type(fun_name, exp) {
  6699. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  6700. return createSemanticError("invalid_parameter_type_full", context);
  6701. },
  6702. invalid_ref_full: function invalid_ref_full(id, exp, sourceInfo) {
  6703. if (sourceInfo) {
  6704. var context = [exp, id, sourceInfo.line];
  6705. return createSemanticError("invalid_ref_full", context);
  6706. } else {
  6707. return ProcessorErrorFactory.invalid_ref(id, exp);
  6708. }
  6709. },
  6710. invalid_ref: function invalid_ref(id, exp) {
  6711. var context = [exp, id];
  6712. return createSemanticError("invalid_ref", context);
  6713. },
  6714. unexpected_break_command_full: function unexpected_break_command_full(sourceInfo) {
  6715. if (sourceInfo) {
  6716. var context = [sourceInfo.line];
  6717. return createRuntimeError("unexpected_break_command_full", context);
  6718. } else {
  6719. return ProcessorErrorFactory.unexpected_break_command();
  6720. }
  6721. },
  6722. unexpected_break_command: function unexpected_break_command() {
  6723. return createRuntimeError("unexpected_break_command");
  6724. },
  6725. invalid_array_literal_type_full: function invalid_array_literal_type_full(exp, sourceInfo) {
  6726. if (sourceInfo) {
  6727. var context = [sourceInfo.line, exp];
  6728. return createRuntimeError("invalid_array_literal_type_full", context);
  6729. } else {
  6730. return ProcessorErrorFactory.invalid_array_literal_type(exp);
  6731. }
  6732. },
  6733. invalid_array_literal_type: function invalid_array_literal_type(exp) {
  6734. var context = [exp];
  6735. return createRuntimeError("invalid_array_literal_type", context);
  6736. },
  6737. invalid_array_literal_line_full: function invalid_array_literal_line_full(expected, actual, sourceInfo) {
  6738. if (sourceInfo) {
  6739. var context = [sourceInfo.line, expected, actual];
  6740. return createRuntimeError("invalid_array_literal_line_full", context);
  6741. } else {
  6742. return ProcessorErrorFactory.invalid_array_literal_type(expected, actual);
  6743. }
  6744. },
  6745. invalid_array_literal_line: function invalid_array_literal_line(expected, actual) {
  6746. var context = [expected, actual];
  6747. return createRuntimeError("invalid_array_literal_line", context);
  6748. },
  6749. invalid_array_literal_column_full: function invalid_array_literal_column_full(expected, actual, sourceInfo) {
  6750. if (sourceInfo) {
  6751. var context = [sourceInfo.line, expected, actual];
  6752. return createRuntimeError("invalid_array_literal_column_full", context);
  6753. } else {
  6754. return ProcessorErrorFactory.invalid_array_literal_column(expected, actual);
  6755. }
  6756. },
  6757. invalid_array_literal_column: function invalid_array_literal_column(expected, actual) {
  6758. var context = [expected, actual];
  6759. return createRuntimeError("invalid_array_literal_column", context);
  6760. },
  6761. invalid_unary_op_full: function invalid_unary_op_full(expString, opName, type, dim, sourceInfo) {
  6762. if (sourceInfo) {
  6763. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  6764. return createRuntimeError("invalid_unary_op_full", context);
  6765. } else {
  6766. return ProcessorErrorFactory.invalid_unary_op(opName, type, dim);
  6767. }
  6768. },
  6769. invalid_unary_op: function invalid_unary_op(expString, opName, type, dim) {
  6770. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  6771. return createRuntimeError("invalid_unary_op", context);
  6772. },
  6773. invalid_infix_op_full: function invalid_infix_op_full(expString, opName, typeLeft, dimLeft, typeRight, dimRight, sourceInfo) {
  6774. if (sourceInfo) {
  6775. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  6776. return createRuntimeError("invalid_infix_op_full", context);
  6777. } else {
  6778. return ProcessorErrorFactory.invalid_infix_op(opName, typeLeft, dimLeft, typeRight, dimRight);
  6779. }
  6780. },
  6781. invalid_infix_op: function invalid_infix_op(expString, opName, typeLeft, dimLeft, typeRight, dimRight) {
  6782. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  6783. return createRuntimeError("invalid_infix_op", context);
  6784. },
  6785. array_dimension_not_positive_full: function array_dimension_not_positive_full(sourceInfo) {
  6786. if (sourceInfo) {
  6787. var context = [sourceInfo.line];
  6788. return createSemanticError("array_dimension_not_positive_full", context);
  6789. } else {
  6790. return ProcessorErrorFactory.array_dimension_not_positive();
  6791. }
  6792. },
  6793. array_dimension_not_positive: function array_dimension_not_positive() {
  6794. return createSemanticError("array_dimension_not_positive");
  6795. },
  6796. invalid_type_conversion: function invalid_type_conversion(value, type, dim) {
  6797. var context = [value, LocalizedStrings.translateType(type, dim)];
  6798. return createRuntimeError("invalid_type_conversion", context);
  6799. },
  6800. invalid_read_type: function invalid_read_type(exp, type, dim, name, source_info) {
  6801. var context = [source_info.line, exp, LocalizedStrings.translateType(type, dim), name];
  6802. return createRuntimeError("invalid_read_type", context);
  6803. },
  6804. invalid_read_type_array: function invalid_read_type_array(exp, typePos, dimPos, name, typeArray, dimArray, sourceInfo) {
  6805. var context = [sourceInfo.line, exp, LocalizedStrings.translateType(typePos, dimPos), name, LocalizedStrings.translateType(typeArray, dimArray)];
  6806. return createRuntimeError("invalid_read_type_array", context);
  6807. },
  6808. invalid_const_ref_full: function invalid_const_ref_full(fun_name, exp, sourceInfo) {
  6809. if (sourceInfo) {
  6810. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  6811. return createSemanticError("invalid_const_ref_full", context);
  6812. } else {
  6813. return ProcessorErrorFactory.invalid_const_ref(fun_name, exp);
  6814. }
  6815. },
  6816. invalid_const_ref: function invalid_const_ref(fun_name, exp) {
  6817. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  6818. return createSemanticError("invalid_const_ref", context);
  6819. },
  6820. invalid_const_assignment_full: function invalid_const_assignment_full(var_id, source_info) {
  6821. if (source_info) {
  6822. var context = [source_info.line, var_id];
  6823. return createSemanticError("invalid_const_assignment_full", context);
  6824. } else {
  6825. return ProcessorErrorFactory.invalid_const_assignment(var_id);
  6826. }
  6827. },
  6828. invalid_const_assignment: function invalid_const_assignment(var_id) {
  6829. var context = [var_id];
  6830. return createSemanticError("invalid_const_assignment", context);
  6831. },
  6832. invalid_vector_assignment_full: function invalid_vector_assignment_full(left_id, left_size, right_id, right_size, source_info) {
  6833. if (source_info) {
  6834. var context = [source_info.line, left_id, left_size, right_id, right_size];
  6835. return createRuntimeError("invalid_vector_assignment_full", context);
  6836. } else {
  6837. return ProcessorErrorFactory.invalid_vector_assignment(left_id, left_size, right_id, right_size);
  6838. }
  6839. },
  6840. invalid_vector_assignment: function invalid_vector_assignment(left_id, left_size, right_id, right_size) {
  6841. var context = [left_id, left_size, right_id, right_size];
  6842. return createRuntimeError("invalid_vector_assignment", context);
  6843. },
  6844. invalid_matrix_assignment_full: function invalid_matrix_assignment_full(left_id, left_line, left_column, right_id, right_line, right_column, source_info) {
  6845. if (source_info) {
  6846. var context = [source_info.line, left_id, left_line, left_column, right_id, right_line, right_column];
  6847. return createRuntimeError("invalid_matrix_assignment_full", context);
  6848. } else {
  6849. return ProcessorErrorFactory.invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column);
  6850. }
  6851. },
  6852. invalid_matrix_assignment: function invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column) {
  6853. var context = [left_id, left_line, left_column, right_id, right_line, right_column];
  6854. return createRuntimeError("invalid_matrix_assignment", context);
  6855. },
  6856. matrix_to_vector_attr: function matrix_to_vector_attr(left_id, right_id, source_info) {
  6857. // SourceInfo have to be valid...
  6858. var context = [source_info.line, right_id, left_id];
  6859. return createSemanticError("matrix_to_vector_attr", context);
  6860. },
  6861. vector_to_matrix_attr: function vector_to_matrix_attr(left_id, right_id, source_info) {
  6862. // SourceInfo have to be valid...
  6863. var context = [source_info.line, right_id, left_id];
  6864. return createSemanticError("vector_to_matrix_attr", context);
  6865. },
  6866. invalid_matrix_index_assign_full: function invalid_matrix_index_assign_full(mat_id, mat_line, mat_size, exp, exp_size, source_info) {
  6867. if (source_info) {
  6868. var context = [source_info.line, mat_line, mat_id, mat_size, exp, exp_size];
  6869. return createRuntimeError("invalid_matrix_index_assign_full", context);
  6870. } else {
  6871. return ProcessorErrorFactory.invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size);
  6872. }
  6873. },
  6874. invalid_matrix_index_assign: function invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size) {
  6875. var context = [mat_line, mat_id, mat_size, exp, exp_size];
  6876. return createRuntimeError("invalid_matrix_index_assign", context);
  6877. },
  6878. invalid_number_elements_vector: function invalid_number_elements_vector(expected_num, exp, actual_num, source_info) {
  6879. // SourceInfo have to be valid...
  6880. var context = [expected_num, source_info.line, exp, actual_num];
  6881. return createRuntimeError("invalid_number_elements_vector", context);
  6882. },
  6883. invalid_number_lines_matrix: function invalid_number_lines_matrix(expected_num, exp, actual_num, source_info) {
  6884. // SourceInfo have to be valid...
  6885. var context = [expected_num, source_info.line, exp, actual_num];
  6886. return createRuntimeError("invalid_number_lines_matrix", context);
  6887. },
  6888. divsion_by_zero_full: function divsion_by_zero_full(exp, source_info) {
  6889. if (source_info) {
  6890. var context = [source_info.line, exp];
  6891. return createRuntimeError("divsion_by_zero_full", context);
  6892. } else {
  6893. return ProcessorErrorFactory.divsion_by_zero(exp);
  6894. }
  6895. },
  6896. divsion_by_zero: function divsion_by_zero(exp) {
  6897. var context = [exp];
  6898. return createRuntimeError("divsion_by_zero", context);
  6899. },
  6900. undefined_tanget_value: function undefined_tanget_value(value, source_info) {
  6901. var context = [source_info.line, value];
  6902. return createRuntimeError("undefined_tanget_value", context);
  6903. },
  6904. negative_log_value: function negative_log_value(source_info) {
  6905. return createRuntimeError("negative_log_value", [source_info.line]);
  6906. },
  6907. invalid_string_index: function invalid_string_index(index, str, source_info) {
  6908. var local_fun_name = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName("$charAt");
  6909. var context = [source_info.line, local_fun_name, index, str, str.length - 1];
  6910. return createRuntimeError("invalid_string_index", context);
  6911. },
  6912. negative_sqrt_value: function negative_sqrt_value(source_info) {
  6913. return createRuntimeError("negative_sqrt_value", [source_info.line]);
  6914. },
  6915. /**
  6916. * @deprecated 01/10/2019
  6917. */
  6918. exceeded_recursive_calls: function exceeded_recursive_calls(source_info) {
  6919. var context = [source_info.line];
  6920. return createRuntimeError("exceeded_recursive_calls", context);
  6921. },
  6922. invalid_for_variable: function invalid_for_variable(id, source_info) {
  6923. var context = [source_info.line, id];
  6924. return createSemanticError("invalid_for_variable", context);
  6925. },
  6926. invalid_for_from: function invalid_for_from(exp, source_info) {
  6927. var context = [source_info.line, exp];
  6928. return createSemanticError("invalid_for_from", context);
  6929. },
  6930. invalid_for_to: function invalid_for_to(exp, source_info) {
  6931. var context = [source_info.line, exp];
  6932. return createSemanticError("invalid_for_to", context);
  6933. },
  6934. invalid_for_pass: function invalid_for_pass(exp, source_info) {
  6935. var context = [source_info.line, exp];
  6936. return createSemanticError("invalid_for_pass", context);
  6937. },
  6938. exceed_max_instructions: function exceed_max_instructions() {
  6939. return createRuntimeError('exceed_max_instructions');
  6940. }
  6941. });
  6942. /***/ }),
  6943. /***/ "./js/processor/error/runtimeError.js":
  6944. /*!********************************************!*\
  6945. !*** ./js/processor/error/runtimeError.js ***!
  6946. \********************************************/
  6947. /*! exports provided: RuntimeError */
  6948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6949. "use strict";
  6950. __webpack_require__.r(__webpack_exports__);
  6951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuntimeError", function() { return RuntimeError; });
  6952. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  6953. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  6954. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  6955. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
  6956. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  6957. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  6958. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  6959. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  6960. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  6961. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  6962. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  6963. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
  6964. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  6965. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  6966. var RuntimeError = /*#__PURE__*/function (_Error) {
  6967. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RuntimeError, _Error);
  6968. var _super = _createSuper(RuntimeError);
  6969. function RuntimeError() {
  6970. var _this;
  6971. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RuntimeError);
  6972. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  6973. msg[_key] = arguments[_key];
  6974. }
  6975. _this = _super.call.apply(_super, [this].concat(msg));
  6976. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), RuntimeError);
  6977. return _this;
  6978. }
  6979. return RuntimeError;
  6980. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
  6981. /***/ }),
  6982. /***/ "./js/processor/error/semanticError.js":
  6983. /*!*********************************************!*\
  6984. !*** ./js/processor/error/semanticError.js ***!
  6985. \*********************************************/
  6986. /*! exports provided: SemanticError */
  6987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6988. "use strict";
  6989. __webpack_require__.r(__webpack_exports__);
  6990. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticError", function() { return SemanticError; });
  6991. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  6992. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  6993. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  6994. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
  6995. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  6996. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  6997. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  6998. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  6999. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  7000. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  7001. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  7002. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
  7003. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  7004. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  7005. var SemanticError = /*#__PURE__*/function (_Error) {
  7006. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(SemanticError, _Error);
  7007. var _super = _createSuper(SemanticError);
  7008. function SemanticError() {
  7009. var _this;
  7010. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticError);
  7011. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  7012. msg[_key] = arguments[_key];
  7013. }
  7014. _this = _super.call.apply(_super, [this].concat(msg));
  7015. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), SemanticError);
  7016. return _this;
  7017. }
  7018. return SemanticError;
  7019. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
  7020. /***/ }),
  7021. /***/ "./js/processor/ivprogProcessor.js":
  7022. /*!*****************************************!*\
  7023. !*** ./js/processor/ivprogProcessor.js ***!
  7024. \*****************************************/
  7025. /*! exports provided: IVProgProcessor */
  7026. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7027. "use strict";
  7028. __webpack_require__.r(__webpack_exports__);
  7029. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgProcessor", function() { return IVProgProcessor; });
  7030. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
  7031. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
  7032. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  7033. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  7034. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  7035. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  7036. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7037. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);
  7038. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  7039. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);
  7040. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./store/store */ "./js/processor/store/store.ts");
  7041. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_5__);
  7042. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modes */ "./js/processor/modes.ts");
  7043. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  7044. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./context */ "./js/processor/context.ts");
  7045. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_context__WEBPACK_IMPORTED_MODULE_7__);
  7046. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../typeSystem/types */ "./js/typeSystem/types.ts");
  7047. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__);
  7048. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  7049. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  7050. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./definedFunctions */ "./js/processor/definedFunctions.js");
  7051. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./compatibilityTable */ "./js/processor/compatibilityTable.ts");
  7052. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__);
  7053. /* harmony import */ var _ast_commands___WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../ast/commands/ */ "./js/ast/commands/index.js");
  7054. /* harmony import */ var _ast_commands_command__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../ast/commands/command */ "./js/ast/commands/command.js");
  7055. /* harmony import */ var _ast_expressions___WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../ast/expressions/ */ "./js/ast/expressions/index.js");
  7056. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  7057. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  7058. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  7059. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__);
  7060. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  7061. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  7062. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_19__);
  7063. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  7064. /* harmony import */ var _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./error/runtimeError */ "./js/processor/error/runtimeError.js");
  7065. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../memory/location */ "./js/memory/location.ts");
  7066. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_22__);
  7067. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./store/value/store_value */ "./js/processor/store/value/store_value.ts");
  7068. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_23__);
  7069. /* harmony import */ var _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./store/value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
  7070. /* harmony import */ var _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__);
  7071. /* harmony import */ var _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./store/value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  7072. /* harmony import */ var _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__);
  7073. /* harmony import */ var _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./store/value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
  7074. /* harmony import */ var _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(_store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__);
  7075. /* harmony import */ var _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./store/value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
  7076. /* harmony import */ var _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__);
  7077. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  7078. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7079. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7080. var IVProgProcessor = /*#__PURE__*/function () {
  7081. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, null, [{
  7082. key: "MAIN_INTERNAL_ID",
  7083. get: function get() {
  7084. return "$main";
  7085. }
  7086. }]);
  7087. function IVProgProcessor(ast) {
  7088. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, IVProgProcessor);
  7089. this.ast = ast;
  7090. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7091. this.stores = [this.globalStore];
  7092. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7093. this.input = null;
  7094. this.forceKill = false;
  7095. this.output = null;
  7096. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7097. /**
  7098. * Stores the sourceInfo of every function call, command or expression
  7099. */
  7100. this.function_call_stack = [];
  7101. this.instruction_count = 0;
  7102. this.function_call_count = 0;
  7103. }
  7104. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, [{
  7105. key: "registerInput",
  7106. value: function registerInput(input) {
  7107. if (this.input !== null) this.input = null;
  7108. this.input = input;
  7109. }
  7110. }, {
  7111. key: "registerOutput",
  7112. value: function registerOutput(output) {
  7113. if (this.output !== null) this.output = null;
  7114. this.output = output;
  7115. }
  7116. }, {
  7117. key: "checkContext",
  7118. value: function checkContext(context) {
  7119. return this.context[this.context.length - 1] === context;
  7120. }
  7121. }, {
  7122. key: "ignoreSwitchCases",
  7123. value: function ignoreSwitchCases(store) {
  7124. if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN) {
  7125. return true;
  7126. } else if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  7127. return true;
  7128. } else {
  7129. return false;
  7130. }
  7131. }
  7132. }, {
  7133. key: "prepareState",
  7134. value: function prepareState() {
  7135. if (this.stores !== null) {
  7136. for (var i = 0; i < this.stores.length; i++) {
  7137. delete this.stores[i];
  7138. }
  7139. this.stores = null;
  7140. }
  7141. if (this.globalStore !== null) this.globalStore = null;
  7142. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7143. this.stores = [this.globalStore];
  7144. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7145. this.instruction_count = 0;
  7146. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7147. }
  7148. }, {
  7149. key: "interpretAST",
  7150. value: function () {
  7151. var _interpretAST = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee() {
  7152. var mainFunc;
  7153. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  7154. while (1) {
  7155. switch (_context.prev = _context.next) {
  7156. case 0:
  7157. this.prepareState();
  7158. _memory_location__WEBPACK_IMPORTED_MODULE_22__["Location"].clear();
  7159. _context.next = 4;
  7160. return this.initGlobal();
  7161. case 4:
  7162. mainFunc = this.findMainFunction();
  7163. if (!(mainFunc === null)) {
  7164. _context.next = 7;
  7165. break;
  7166. }
  7167. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].main_missing();
  7168. case 7:
  7169. return _context.abrupt("return", this.runFunction(mainFunc, [], this.globalStore));
  7170. case 8:
  7171. case "end":
  7172. return _context.stop();
  7173. }
  7174. }
  7175. }, _callee, this);
  7176. }));
  7177. function interpretAST() {
  7178. return _interpretAST.apply(this, arguments);
  7179. }
  7180. return interpretAST;
  7181. }()
  7182. }, {
  7183. key: "initGlobal",
  7184. value: function () {
  7185. var _initGlobal = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2() {
  7186. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  7187. while (1) {
  7188. switch (_context2.prev = _context2.next) {
  7189. case 0:
  7190. if (this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE)) {
  7191. _context2.next = 2;
  7192. break;
  7193. }
  7194. return _context2.abrupt("return", _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_global_var());
  7195. case 2:
  7196. return _context2.abrupt("return", this.executeCommands(this.globalStore, this.ast.global));
  7197. case 3:
  7198. case "end":
  7199. return _context2.stop();
  7200. }
  7201. }
  7202. }, _callee2, this);
  7203. }));
  7204. function initGlobal() {
  7205. return _initGlobal.apply(this, arguments);
  7206. }
  7207. return initGlobal;
  7208. }()
  7209. }, {
  7210. key: "findMainFunction",
  7211. value: function findMainFunction() {
  7212. return this.ast.functions.find(function (v) {
  7213. return v.isMain;
  7214. });
  7215. }
  7216. }, {
  7217. key: "findFunction",
  7218. value: function findFunction(name) {
  7219. if (name.match(/^\$.+$/)) {
  7220. if (name === IVProgProcessor.MAIN_INTERNAL_ID) {
  7221. return this.findMainFunction();
  7222. }
  7223. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getFunction(name);
  7224. if (!fun) {
  7225. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].not_implemented(name);
  7226. }
  7227. return fun;
  7228. } else {
  7229. var val = this.ast.functions.find(function (v) {
  7230. return v.name === name;
  7231. });
  7232. if (!val) {
  7233. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_missing(name);
  7234. }
  7235. return val;
  7236. }
  7237. }
  7238. }, {
  7239. key: "runFunction",
  7240. value: function () {
  7241. var _runFunction = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee3(func, actualParameters, store) {
  7242. var funcName, funcStore, stoWithVars, finalSto;
  7243. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  7244. while (1) {
  7245. switch (_context3.prev = _context3.next) {
  7246. case 0:
  7247. funcName = func.isMain ? IVProgProcessor.MAIN_INTERNAL_ID : func.name;
  7248. funcStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"](funcName);
  7249. funcStore.extendStore(this.globalStore);
  7250. _context3.next = 5;
  7251. return this.associateParameters(func.formalParameters, actualParameters, store, funcStore);
  7252. case 5:
  7253. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].FUNCTION);
  7254. this.stores.push(funcStore);
  7255. _context3.next = 9;
  7256. return this.executeCommands(funcStore, func.variablesDeclarations);
  7257. case 9:
  7258. stoWithVars = _context3.sent;
  7259. _context3.next = 12;
  7260. return this.executeCommands(stoWithVars, func.commands);
  7261. case 12:
  7262. finalSto = _context3.sent;
  7263. this.stores.pop();
  7264. this.context.pop();
  7265. return _context3.abrupt("return", finalSto);
  7266. case 16:
  7267. case "end":
  7268. return _context3.stop();
  7269. }
  7270. }
  7271. }, _callee3, this);
  7272. }));
  7273. function runFunction(_x, _x2, _x3) {
  7274. return _runFunction.apply(this, arguments);
  7275. }
  7276. return runFunction;
  7277. }()
  7278. /**
  7279. *
  7280. * @param {import('./../ast/commands/formalParameter').FormalParameter[]} formal_params
  7281. * @param {Expression[]} effective_params
  7282. * @param {Store} caller_store
  7283. * @param {Store} callee_store
  7284. */
  7285. }, {
  7286. key: "associateParameters",
  7287. value: function () {
  7288. var _associateParameters = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee4(formal_params, effective_params, caller_store, callee_store) {
  7289. var funcName, hasVariadic, i, j, formalParameter, _yield$this$associate, _yield$this$associate2, actualParam;
  7290. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  7291. while (1) {
  7292. switch (_context4.prev = _context4.next) {
  7293. case 0:
  7294. funcName = callee_store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : callee_store.name;
  7295. hasVariadic = formal_params.some(function (p) {
  7296. return p.variadic;
  7297. });
  7298. if (!(formal_params.length != effective_params.length && !hasVariadic || formal_params.length > effective_params.length)) {
  7299. _context4.next = 4;
  7300. break;
  7301. }
  7302. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameters_size(funcName, formal_params.length, effective_params.length);
  7303. case 4:
  7304. i = 0, j = 0;
  7305. case 5:
  7306. if (!(i < formal_params.length && j < effective_params.length)) {
  7307. _context4.next = 23;
  7308. break;
  7309. }
  7310. formalParameter = formal_params[i];
  7311. if (!formalParameter.variadic) {
  7312. _context4.next = 16;
  7313. break;
  7314. }
  7315. _context4.next = 10;
  7316. return this.associateVariadicParameter(funcName, formalParameter, j, effective_params, caller_store, callee_store);
  7317. case 10:
  7318. _yield$this$associate = _context4.sent;
  7319. _yield$this$associate2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_yield$this$associate, 2);
  7320. j = _yield$this$associate2[0];
  7321. callee_store = _yield$this$associate2[1];
  7322. _context4.next = 20;
  7323. break;
  7324. case 16:
  7325. actualParam = effective_params[i];
  7326. _context4.next = 19;
  7327. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store);
  7328. case 19:
  7329. callee_store = _context4.sent;
  7330. case 20:
  7331. i += 1, j += 1;
  7332. _context4.next = 5;
  7333. break;
  7334. case 23:
  7335. return _context4.abrupt("return", callee_store);
  7336. case 24:
  7337. case "end":
  7338. return _context4.stop();
  7339. }
  7340. }
  7341. }, _callee4, this);
  7342. }));
  7343. function associateParameters(_x4, _x5, _x6, _x7) {
  7344. return _associateParameters.apply(this, arguments);
  7345. }
  7346. return associateParameters;
  7347. }()
  7348. /**
  7349. *
  7350. * @param {string} funcName
  7351. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7352. * @param {number} index
  7353. * @param {Expression[]} effective_params
  7354. * @param {Store} caller_store
  7355. * @param {Store} callee_store
  7356. */
  7357. }, {
  7358. key: "associateVariadicParameter",
  7359. value: function () {
  7360. var _associateVariadicParameter = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee5(funcName, formalParameter, index, effective_params, caller_store, callee_store) {
  7361. var i, count, actualParam, variadicCount;
  7362. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  7363. while (1) {
  7364. switch (_context5.prev = _context5.next) {
  7365. case 0:
  7366. count = 1;
  7367. i = index;
  7368. case 2:
  7369. if (!(i < effective_params.length)) {
  7370. _context5.next = 11;
  7371. break;
  7372. }
  7373. actualParam = effective_params[i];
  7374. _context5.next = 6;
  7375. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store, count);
  7376. case 6:
  7377. callee_store = _context5.sent;
  7378. count += 1;
  7379. case 8:
  7380. i += 1;
  7381. _context5.next = 2;
  7382. break;
  7383. case 11:
  7384. variadicCount = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER, count, undefined, true);
  7385. callee_store.insertStore("".concat(formalParameter.id, ".0"), variadicCount);
  7386. return _context5.abrupt("return", [i - 1, callee_store]);
  7387. case 14:
  7388. case "end":
  7389. return _context5.stop();
  7390. }
  7391. }
  7392. }, _callee5, this);
  7393. }));
  7394. function associateVariadicParameter(_x8, _x9, _x10, _x11, _x12, _x13) {
  7395. return _associateVariadicParameter.apply(this, arguments);
  7396. }
  7397. return associateVariadicParameter;
  7398. }()
  7399. /**
  7400. *
  7401. * @param {string} funcName
  7402. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7403. * @param {Expression} actualParameter
  7404. * @param {Store} callerStore
  7405. * @param {Store} calleeStore
  7406. * @param {number} variadicCount The number of the current value being assigned to the variadic parameter, default 0
  7407. */
  7408. }, {
  7409. key: "associateParameter",
  7410. value: function () {
  7411. var _associateParameter = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee6(funcName, formalParameter, actualParameter, callerStore, calleeStore) {
  7412. var variadicCount,
  7413. actualValue,
  7414. shouldTypeCast,
  7415. realObj,
  7416. ref,
  7417. values,
  7418. array_type,
  7419. addresses,
  7420. columns,
  7421. line,
  7422. column,
  7423. varID,
  7424. realValue,
  7425. _varID,
  7426. _args6 = arguments;
  7427. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  7428. while (1) {
  7429. switch (_context6.prev = _context6.next) {
  7430. case 0:
  7431. variadicCount = _args6.length > 5 && _args6[5] !== undefined ? _args6[5] : 0;
  7432. _context6.next = 3;
  7433. return this.evaluateExpression(callerStore, actualParameter);
  7434. case 3:
  7435. actualValue = _context6.sent;
  7436. shouldTypeCast = false;
  7437. if (formalParameter.type.isCompatible(actualValue.type)) {
  7438. _context6.next = 11;
  7439. break;
  7440. }
  7441. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && !formalParameter.byRef && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(formalParameter.type, actualValue.type))) {
  7442. _context6.next = 10;
  7443. break;
  7444. }
  7445. shouldTypeCast = true;
  7446. _context6.next = 11;
  7447. break;
  7448. case 10:
  7449. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameter_type(funcName, actualParameter.toString());
  7450. case 11:
  7451. if (!(formalParameter.byRef && !actualValue.inStore())) {
  7452. _context6.next = 13;
  7453. break;
  7454. }
  7455. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_ref(funcName, actualParameter.toString());
  7456. case 13:
  7457. if (formalParameter.byRef) {
  7458. realObj = callerStore.getStoreObject(actualValue.id);
  7459. ref = null;
  7460. if (actualValue instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"]) {
  7461. // it's a vector or matrix...
  7462. values = actualValue.get();
  7463. array_type = actualValue.type;
  7464. addresses = values.map(function (v) {
  7465. return realObj.getLocAddressOf(v.line, v.column);
  7466. });
  7467. columns = actualValue.isVector() ? 0 : actualValue.columns;
  7468. ref = new _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__["ArrayStoreValueRef"](array_type, values, addresses, actualValue.lines, columns, realObj.id);
  7469. } else {
  7470. if (actualValue instanceof _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"]) {
  7471. line = actualValue.line;
  7472. column = actualValue.column;
  7473. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.getLocAddressOf(line, column), realObj.id);
  7474. ref.setReferenceDimension(realObj.type.dimensions);
  7475. } else {
  7476. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.locAddress, realObj.id);
  7477. }
  7478. }
  7479. varID = formalParameter.id;
  7480. if (formalParameter.variadic) varID = "".concat(varID, ".").concat(variadicCount);
  7481. calleeStore.insertStore(varID, ref);
  7482. } else {
  7483. realValue = actualValue;
  7484. if (shouldTypeCast) {
  7485. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(formalParameter.type, realValue);
  7486. }
  7487. _varID = formalParameter.id;
  7488. if (formalParameter.variadic) _varID = "".concat(_varID, ".").concat(variadicCount);
  7489. calleeStore.insertStore(_varID, realValue);
  7490. }
  7491. return _context6.abrupt("return", calleeStore);
  7492. case 15:
  7493. case "end":
  7494. return _context6.stop();
  7495. }
  7496. }
  7497. }, _callee6, this);
  7498. }));
  7499. function associateParameter(_x14, _x15, _x16, _x17, _x18) {
  7500. return _associateParameter.apply(this, arguments);
  7501. }
  7502. return associateParameter;
  7503. }()
  7504. /**
  7505. *
  7506. * @param {Store} store
  7507. * @param {Command[]} cmds
  7508. *
  7509. * @returns {Promise<Store>}
  7510. */
  7511. }, {
  7512. key: "executeCommands",
  7513. value: function () {
  7514. var _executeCommands = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee7(store, cmds) {
  7515. var sto, i;
  7516. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  7517. while (1) {
  7518. switch (_context7.prev = _context7.next) {
  7519. case 0:
  7520. // helper to partially apply a function, in this case executeCommand
  7521. sto = store;
  7522. i = 0;
  7523. case 2:
  7524. if (!(i < cmds.length)) {
  7525. _context7.next = 9;
  7526. break;
  7527. }
  7528. _context7.next = 5;
  7529. return this.executeCommand(sto, cmds[i]);
  7530. case 5:
  7531. sto = _context7.sent;
  7532. case 6:
  7533. i += 1;
  7534. _context7.next = 2;
  7535. break;
  7536. case 9:
  7537. return _context7.abrupt("return", sto);
  7538. case 10:
  7539. case "end":
  7540. return _context7.stop();
  7541. }
  7542. }
  7543. }, _callee7, this);
  7544. }));
  7545. function executeCommands(_x19, _x20) {
  7546. return _executeCommands.apply(this, arguments);
  7547. }
  7548. return executeCommands;
  7549. }()
  7550. /**
  7551. *
  7552. * @param {Store} store
  7553. * @param {Command} cmd
  7554. *
  7555. * @returns {Promise<Store>}
  7556. */
  7557. }, {
  7558. key: "executeCommand",
  7559. value: function () {
  7560. var _executeCommand = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee8(store, cmd) {
  7561. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  7562. while (1) {
  7563. switch (_context8.prev = _context8.next) {
  7564. case 0:
  7565. this.instruction_count += 1;
  7566. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  7567. _context8.next = 4;
  7568. break;
  7569. }
  7570. _context8.next = 4;
  7571. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
  7572. case 4:
  7573. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  7574. _context8.next = 8;
  7575. break;
  7576. }
  7577. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceed_max_instructions();
  7578. case 8:
  7579. if (!this.forceKill) {
  7580. _context8.next = 12;
  7581. break;
  7582. }
  7583. throw "FORCED_KILL!";
  7584. case 12:
  7585. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].PAUSE)) {
  7586. _context8.next = 16;
  7587. break;
  7588. }
  7589. return _context8.abrupt("return", this.executeCommand(store, cmd));
  7590. case 16:
  7591. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  7592. _context8.next = 20;
  7593. break;
  7594. }
  7595. return _context8.abrupt("return", store);
  7596. case 20:
  7597. if (!(this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE) && store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  7598. _context8.next = 24;
  7599. break;
  7600. }
  7601. return _context8.abrupt("return", store);
  7602. case 24:
  7603. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  7604. _context8.next = 26;
  7605. break;
  7606. }
  7607. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  7608. case 26:
  7609. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Declaration"])) {
  7610. _context8.next = 30;
  7611. break;
  7612. }
  7613. return _context8.abrupt("return", this.executeDeclaration(store, cmd));
  7614. case 30:
  7615. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayIndexAssign"])) {
  7616. _context8.next = 34;
  7617. break;
  7618. }
  7619. return _context8.abrupt("return", this.executeArrayIndexAssign(store, cmd));
  7620. case 34:
  7621. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"])) {
  7622. _context8.next = 38;
  7623. break;
  7624. }
  7625. return _context8.abrupt("return", this.executeAssign(store, cmd));
  7626. case 38:
  7627. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Break"])) {
  7628. _context8.next = 42;
  7629. break;
  7630. }
  7631. return _context8.abrupt("return", this.executeBreak(store, cmd));
  7632. case 42:
  7633. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Return"])) {
  7634. _context8.next = 46;
  7635. break;
  7636. }
  7637. return _context8.abrupt("return", this.executeReturn(store, cmd));
  7638. case 46:
  7639. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  7640. _context8.next = 50;
  7641. break;
  7642. }
  7643. return _context8.abrupt("return", this.executeIfThenElse(store, cmd));
  7644. case 50:
  7645. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["RepeatUntil"])) {
  7646. _context8.next = 54;
  7647. break;
  7648. }
  7649. return _context8.abrupt("return", this.executeRepeatUntil(store, cmd));
  7650. case 54:
  7651. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"])) {
  7652. _context8.next = 58;
  7653. break;
  7654. }
  7655. return _context8.abrupt("return", this.executeWhile(store, cmd));
  7656. case 58:
  7657. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["For"])) {
  7658. _context8.next = 62;
  7659. break;
  7660. }
  7661. return _context8.abrupt("return", this.executeFor(store, cmd));
  7662. case 62:
  7663. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Switch"])) {
  7664. _context8.next = 66;
  7665. break;
  7666. }
  7667. return _context8.abrupt("return", this.executeSwitch(store, cmd));
  7668. case 66:
  7669. if (!(cmd instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  7670. _context8.next = 70;
  7671. break;
  7672. }
  7673. return _context8.abrupt("return", this.executeFunctionCall(store, cmd));
  7674. case 70:
  7675. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["SysCall"])) {
  7676. _context8.next = 74;
  7677. break;
  7678. }
  7679. return _context8.abrupt("return", this.executeSysCall(store, cmd));
  7680. case 74:
  7681. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unknown_command(cmd.sourceInfo);
  7682. case 75:
  7683. case "end":
  7684. return _context8.stop();
  7685. }
  7686. }
  7687. }, _callee8, this);
  7688. }));
  7689. function executeCommand(_x21, _x22) {
  7690. return _executeCommand.apply(this, arguments);
  7691. }
  7692. return executeCommand;
  7693. }()
  7694. /**
  7695. *
  7696. * @param {Store} store
  7697. * @param {Commands.SysCall} cmd
  7698. *
  7699. * @returns {Promise<Store>}
  7700. */
  7701. }, {
  7702. key: "executeSysCall",
  7703. value: function () {
  7704. var _executeSysCall = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee9(store, cmd) {
  7705. var func;
  7706. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  7707. while (1) {
  7708. switch (_context9.prev = _context9.next) {
  7709. case 0:
  7710. func = cmd.langFunc.bind(this);
  7711. return _context9.abrupt("return", func(store, cmd));
  7712. case 2:
  7713. case "end":
  7714. return _context9.stop();
  7715. }
  7716. }
  7717. }, _callee9, this);
  7718. }));
  7719. function executeSysCall(_x23, _x24) {
  7720. return _executeSysCall.apply(this, arguments);
  7721. }
  7722. return executeSysCall;
  7723. }()
  7724. /**
  7725. *
  7726. * @param {Store} store
  7727. * @param {Commands.FunctionCall} cmd
  7728. *
  7729. * @returns {Promise<Store>}
  7730. */
  7731. }, {
  7732. key: "executeFunctionCall",
  7733. value: function () {
  7734. var _executeFunctionCall = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee10(store, cmd) {
  7735. var func, sto, funcName;
  7736. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  7737. while (1) {
  7738. switch (_context10.prev = _context10.next) {
  7739. case 0:
  7740. func = null;
  7741. if (cmd.isMainCall) {
  7742. func = this.findMainFunction();
  7743. } else {
  7744. func = this.findFunction(cmd.id);
  7745. }
  7746. this.function_call_stack.push(cmd.sourceInfo);
  7747. _context10.next = 5;
  7748. return this.runFunction(func, cmd.actualParameters, store);
  7749. case 5:
  7750. sto = _context10.sent;
  7751. sto.destroy();
  7752. if (!(!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType) && sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  7753. _context10.next = 12;
  7754. break;
  7755. }
  7756. funcName = func.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : func.name;
  7757. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_no_return(funcName);
  7758. case 12:
  7759. this.function_call_stack.pop();
  7760. return _context10.abrupt("return", store);
  7761. case 14:
  7762. case "end":
  7763. return _context10.stop();
  7764. }
  7765. }
  7766. }, _callee10, this);
  7767. }));
  7768. function executeFunctionCall(_x25, _x26) {
  7769. return _executeFunctionCall.apply(this, arguments);
  7770. }
  7771. return executeFunctionCall;
  7772. }()
  7773. /**
  7774. *
  7775. * @param {Store} store
  7776. * @param {Commands.Switch} cmd
  7777. *
  7778. * @returns {Promise<Store>}
  7779. */
  7780. }, {
  7781. key: "executeSwitch",
  7782. value: function () {
  7783. var _executeSwitch = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee11(store, cmd) {
  7784. var switchCases, lastStore, lastCaseCheckResult, i, switchCase, equalityInfixApp, result;
  7785. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  7786. while (1) {
  7787. switch (_context11.prev = _context11.next) {
  7788. case 0:
  7789. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  7790. switchCases = cmd.cases;
  7791. lastStore = store;
  7792. lastCaseCheckResult = false;
  7793. i = 0;
  7794. case 5:
  7795. if (!(i < switchCases.length && !this.ignoreSwitchCases(lastStore))) {
  7796. _context11.next = 26;
  7797. break;
  7798. }
  7799. switchCase = switchCases[i];
  7800. if (!(lastCaseCheckResult || switchCase.isDefault)) {
  7801. _context11.next = 13;
  7802. break;
  7803. }
  7804. _context11.next = 10;
  7805. return this.executeCommands(lastStore, switchCase.commands);
  7806. case 10:
  7807. lastStore = _context11.sent;
  7808. _context11.next = 23;
  7809. break;
  7810. case 13:
  7811. equalityInfixApp = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].EQ, cmd.expression, switchCase.expression);
  7812. equalityInfixApp.sourceInfo = switchCase.sourceInfo;
  7813. _context11.next = 17;
  7814. return this.evaluateExpression(lastStore, equalityInfixApp);
  7815. case 17:
  7816. result = _context11.sent;
  7817. if (!result.get()) {
  7818. _context11.next = 22;
  7819. break;
  7820. }
  7821. _context11.next = 21;
  7822. return this.executeCommands(lastStore, switchCase.commands);
  7823. case 21:
  7824. lastStore = _context11.sent;
  7825. case 22:
  7826. lastCaseCheckResult = result.get();
  7827. case 23:
  7828. i += 1;
  7829. _context11.next = 5;
  7830. break;
  7831. case 26:
  7832. this.context.pop();
  7833. if (lastStore.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  7834. lastStore.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7835. }
  7836. return _context11.abrupt("return", lastStore);
  7837. case 29:
  7838. case "end":
  7839. return _context11.stop();
  7840. }
  7841. }
  7842. }, _callee11, this);
  7843. }));
  7844. function executeSwitch(_x27, _x28) {
  7845. return _executeSwitch.apply(this, arguments);
  7846. }
  7847. return executeSwitch;
  7848. }()
  7849. /**
  7850. *
  7851. * @param {Store} store
  7852. * @param {Commands.For} cmd
  7853. *
  7854. * @returns {Promise<Store>}
  7855. */
  7856. }, {
  7857. key: "executeFor",
  7858. value: function () {
  7859. var _executeFor = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee12(store, cmd) {
  7860. var initCmd, passValue, condition, checkEndGTBegin, isForward, increment, whileBlock, forAsWhile, newCmdList;
  7861. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  7862. while (1) {
  7863. switch (_context12.prev = _context12.next) {
  7864. case 0:
  7865. //BEGIN for -> while rewrite
  7866. initCmd = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"](cmd.for_id.id, cmd.for_from);
  7867. initCmd.sourceInfo = cmd.sourceInfo; // Assume for is iterating forward and that pass is not missing
  7868. passValue = cmd.for_pass;
  7869. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LT, cmd.for_id, cmd.for_to);
  7870. if (!(cmd.for_pass == null)) {
  7871. _context12.next = 12;
  7872. break;
  7873. }
  7874. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(1));
  7875. _context12.next = 8;
  7876. return this.evaluateExpression(store, new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GE, cmd.for_to, cmd.for_from));
  7877. case 8:
  7878. checkEndGTBegin = _context12.sent;
  7879. if (!checkEndGTBegin.get()) {
  7880. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(-1));
  7881. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  7882. }
  7883. _context12.next = 16;
  7884. break;
  7885. case 12:
  7886. _context12.next = 14;
  7887. return this.evaluateExpression(store, new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GE, cmd.for_pass, new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(0))));
  7888. case 14:
  7889. isForward = _context12.sent;
  7890. if (!isForward.get()) {
  7891. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  7892. }
  7893. case 16:
  7894. condition.sourceInfo = cmd.sourceInfo;
  7895. increment = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"](cmd.for_id.id, new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].ADD, cmd.for_id, passValue));
  7896. increment.sourceInfo = cmd.sourceInfo;
  7897. whileBlock = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["CommandBlock"]([], cmd.commands.concat(increment));
  7898. forAsWhile = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"](condition, whileBlock);
  7899. forAsWhile.sourceInfo = cmd.sourceInfo; //END for -> while rewrite
  7900. newCmdList = [initCmd, forAsWhile];
  7901. return _context12.abrupt("return", this.executeCommands(store, newCmdList));
  7902. case 24:
  7903. case "end":
  7904. return _context12.stop();
  7905. }
  7906. }
  7907. }, _callee12, this);
  7908. }));
  7909. function executeFor(_x29, _x30) {
  7910. return _executeFor.apply(this, arguments);
  7911. }
  7912. return executeFor;
  7913. }()
  7914. /**
  7915. *
  7916. * @param {Store} store
  7917. * @param {Commands.RepeatUntil} cmd
  7918. *
  7919. * @returns {Promise<Store>}
  7920. */
  7921. }, {
  7922. key: "executeRepeatUntil",
  7923. value: function () {
  7924. var _executeRepeatUntil = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee13(store, cmd) {
  7925. var sto, checkCondition;
  7926. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  7927. while (1) {
  7928. switch (_context13.prev = _context13.next) {
  7929. case 0:
  7930. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  7931. _context13.next = 3;
  7932. return this.executeCommands(store, cmd.commands);
  7933. case 3:
  7934. sto = _context13.sent;
  7935. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  7936. _context13.next = 8;
  7937. break;
  7938. }
  7939. this.context.pop();
  7940. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7941. return _context13.abrupt("return", sto);
  7942. case 8:
  7943. _context13.next = 10;
  7944. return this.evaluateExpression(sto, cmd.expression);
  7945. case 10:
  7946. checkCondition = _context13.sent;
  7947. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  7948. _context13.next = 13;
  7949. break;
  7950. }
  7951. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.sourceInfo);
  7952. case 13:
  7953. this.context.pop();
  7954. if (!checkCondition.get()) {
  7955. _context13.next = 18;
  7956. break;
  7957. }
  7958. return _context13.abrupt("return", sto);
  7959. case 18:
  7960. return _context13.abrupt("return", this.executeCommand(sto, cmd));
  7961. case 19:
  7962. case "end":
  7963. return _context13.stop();
  7964. }
  7965. }
  7966. }, _callee13, this);
  7967. }));
  7968. function executeRepeatUntil(_x31, _x32) {
  7969. return _executeRepeatUntil.apply(this, arguments);
  7970. }
  7971. return executeRepeatUntil;
  7972. }()
  7973. /**
  7974. *
  7975. * @param {Store} store
  7976. * @param {Commands.While} cmd
  7977. *
  7978. * @returns {Promise<Store>}
  7979. */
  7980. }, {
  7981. key: "executeWhile",
  7982. value: function () {
  7983. var _executeWhile = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee14(store, cmd) {
  7984. var checkCondition, sto;
  7985. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee14$(_context14) {
  7986. while (1) {
  7987. switch (_context14.prev = _context14.next) {
  7988. case 0:
  7989. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  7990. _context14.next = 3;
  7991. return this.evaluateExpression(store, cmd.expression);
  7992. case 3:
  7993. checkCondition = _context14.sent;
  7994. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  7995. _context14.next = 6;
  7996. break;
  7997. }
  7998. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  7999. case 6:
  8000. if (!checkCondition.get()) {
  8001. _context14.next = 17;
  8002. break;
  8003. }
  8004. _context14.next = 9;
  8005. return this.executeCommands(store, cmd.commands);
  8006. case 9:
  8007. sto = _context14.sent;
  8008. this.context.pop();
  8009. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8010. _context14.next = 14;
  8011. break;
  8012. }
  8013. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8014. return _context14.abrupt("return", sto);
  8015. case 14:
  8016. return _context14.abrupt("return", this.executeCommand(sto, cmd));
  8017. case 17:
  8018. this.context.pop();
  8019. return _context14.abrupt("return", store);
  8020. case 19:
  8021. case "end":
  8022. return _context14.stop();
  8023. }
  8024. }
  8025. }, _callee14, this);
  8026. }));
  8027. function executeWhile(_x33, _x34) {
  8028. return _executeWhile.apply(this, arguments);
  8029. }
  8030. return executeWhile;
  8031. }()
  8032. /**
  8033. *
  8034. * @param {Store} store
  8035. * @param {Commands.IfThenElse} cmd
  8036. *
  8037. * @returns {Promise<Store>}
  8038. */
  8039. }, {
  8040. key: "executeIfThenElse",
  8041. value: function () {
  8042. var _executeIfThenElse = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee15(store, cmd) {
  8043. var isTrue;
  8044. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee15$(_context15) {
  8045. while (1) {
  8046. switch (_context15.prev = _context15.next) {
  8047. case 0:
  8048. _context15.next = 2;
  8049. return this.evaluateExpression(store, cmd.condition);
  8050. case 2:
  8051. isTrue = _context15.sent;
  8052. if (isTrue.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8053. _context15.next = 5;
  8054. break;
  8055. }
  8056. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  8057. case 5:
  8058. if (!isTrue.get()) {
  8059. _context15.next = 9;
  8060. break;
  8061. }
  8062. return _context15.abrupt("return", this.executeCommands(store, cmd.ifTrue.commands));
  8063. case 9:
  8064. if (!(cmd.ifFalse !== null)) {
  8065. _context15.next = 17;
  8066. break;
  8067. }
  8068. if (!(cmd.ifFalse instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  8069. _context15.next = 14;
  8070. break;
  8071. }
  8072. return _context15.abrupt("return", this.executeCommand(store, cmd.ifFalse));
  8073. case 14:
  8074. return _context15.abrupt("return", this.executeCommands(store, cmd.ifFalse.commands));
  8075. case 15:
  8076. _context15.next = 18;
  8077. break;
  8078. case 17:
  8079. return _context15.abrupt("return", store);
  8080. case 18:
  8081. case "end":
  8082. return _context15.stop();
  8083. }
  8084. }
  8085. }, _callee15, this);
  8086. }));
  8087. function executeIfThenElse(_x35, _x36) {
  8088. return _executeIfThenElse.apply(this, arguments);
  8089. }
  8090. return executeIfThenElse;
  8091. }()
  8092. /**
  8093. *
  8094. * @param {Store} store
  8095. * @param {Commands.Return} cmd
  8096. *
  8097. * @returns {Promise<Store>}
  8098. */
  8099. }, {
  8100. key: "executeReturn",
  8101. value: function () {
  8102. var _executeReturn = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee16(store, cmd) {
  8103. var funcName, func, funcType, value, real_value, stringInfo, info;
  8104. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee16$(_context16) {
  8105. while (1) {
  8106. switch (_context16.prev = _context16.next) {
  8107. case 0:
  8108. funcName = store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : store.name; // console.log(funcName, store.name === IVProgProcessor.MAIN_INTERNAL_ID);
  8109. func = this.findFunction(store.name);
  8110. funcType = func.returnType;
  8111. _context16.next = 5;
  8112. return this.evaluateExpression(store, cmd.expression);
  8113. case 5:
  8114. value = _context16.sent;
  8115. if (!(value === null && funcType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID))) {
  8116. _context16.next = 9;
  8117. break;
  8118. }
  8119. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8120. return _context16.abrupt("return", store);
  8121. case 9:
  8122. real_value = value;
  8123. if (!(value === null || !funcType.isCompatible(value.type))) {
  8124. _context16.next = 16;
  8125. break;
  8126. }
  8127. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(funcType, value.type))) {
  8128. _context16.next = 15;
  8129. break;
  8130. }
  8131. stringInfo = funcType.stringInfo();
  8132. info = stringInfo[0];
  8133. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_return_type_full(funcName, info.type, info.dim, cmd.sourceInfo);
  8134. case 15:
  8135. real_value = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(funcType, value);
  8136. case 16:
  8137. store.insertStore("$", real_value);
  8138. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8139. return _context16.abrupt("return", store);
  8140. case 19:
  8141. case "end":
  8142. return _context16.stop();
  8143. }
  8144. }
  8145. }, _callee16, this);
  8146. }));
  8147. function executeReturn(_x37, _x38) {
  8148. return _executeReturn.apply(this, arguments);
  8149. }
  8150. return executeReturn;
  8151. }()
  8152. /**
  8153. *
  8154. * @param {Store} store
  8155. * @param {Commands.Break} cmd
  8156. *
  8157. * @returns {Promise<Store>}
  8158. */
  8159. }, {
  8160. key: "executeBreak",
  8161. value: function () {
  8162. var _executeBreak = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee17(store, cmd) {
  8163. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee17$(_context17) {
  8164. while (1) {
  8165. switch (_context17.prev = _context17.next) {
  8166. case 0:
  8167. if (!this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE)) {
  8168. _context17.next = 5;
  8169. break;
  8170. }
  8171. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK;
  8172. return _context17.abrupt("return", store);
  8173. case 5:
  8174. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unexpected_break_command_full(cmd.sourceInfo);
  8175. case 6:
  8176. case "end":
  8177. return _context17.stop();
  8178. }
  8179. }
  8180. }, _callee17, this);
  8181. }));
  8182. function executeBreak(_x39, _x40) {
  8183. return _executeBreak.apply(this, arguments);
  8184. }
  8185. return executeBreak;
  8186. }()
  8187. /**
  8188. *
  8189. * @param {Store} store
  8190. * @param {Commands.Assign} cmd
  8191. *
  8192. * @returns {Promise<Store>}
  8193. */
  8194. }, {
  8195. key: "executeAssign",
  8196. value: function () {
  8197. var _executeAssign = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee18(store, cmd) {
  8198. var inStore, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp, columns, _exp;
  8199. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee18$(_context18) {
  8200. while (1) {
  8201. switch (_context18.prev = _context18.next) {
  8202. case 0:
  8203. inStore = store.applyStore(cmd.id);
  8204. if (!inStore.isConst) {
  8205. _context18.next = 3;
  8206. break;
  8207. }
  8208. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8209. case 3:
  8210. _context18.next = 5;
  8211. return this.evaluateExpression(store, cmd.expression);
  8212. case 5:
  8213. value = _context18.sent;
  8214. realValue = value;
  8215. if (inStore.type.isCompatible(realValue.type)) {
  8216. _context18.next = 18;
  8217. break;
  8218. }
  8219. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(inStore.type, value.type))) {
  8220. _context18.next = 12;
  8221. break;
  8222. }
  8223. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(inStore.type, realValue);
  8224. _context18.next = 18;
  8225. break;
  8226. case 12:
  8227. stringInfo = inStore.type.stringInfo();
  8228. info = stringInfo[0];
  8229. exp_type_string_info = value.type.stringInfo();
  8230. exp_type_info = exp_type_string_info[0];
  8231. exp = cmd.expression.toString();
  8232. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, exp_type_info.type, exp_type_info.dim, exp, cmd.sourceInfo);
  8233. case 18:
  8234. if (!(inStore instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8235. _context18.next = 27;
  8236. break;
  8237. }
  8238. columns = realValue.columns == null ? 0 : realValue.columns;
  8239. if (!(inStore.lines !== realValue.lines || inStore.columns !== columns)) {
  8240. _context18.next = 27;
  8241. break;
  8242. }
  8243. _exp = cmd.expression.toString();
  8244. if (!inStore.isVector()) {
  8245. _context18.next = 26;
  8246. break;
  8247. }
  8248. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_vector_assignment_full(cmd.id, inStore.lines, _exp, realValue.lines, cmd.sourceInfo);
  8249. case 26:
  8250. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_matrix_assignment_full(cmd.id, inStore.lines, inStore.columns, _exp, realValue.lines, realValue.columns, cmd.sourceInfo);
  8251. case 27:
  8252. store.updateStore(cmd.id, realValue);
  8253. return _context18.abrupt("return", store);
  8254. case 29:
  8255. case "end":
  8256. return _context18.stop();
  8257. }
  8258. }
  8259. }, _callee18, this);
  8260. }));
  8261. function executeAssign(_x41, _x42) {
  8262. return _executeAssign.apply(this, arguments);
  8263. }
  8264. return executeAssign;
  8265. }()
  8266. /**
  8267. *
  8268. * @param {Store} store
  8269. * @param {Commands.ArrayIndexAssign} cmd
  8270. *
  8271. * @returns {Promise<Store>}
  8272. */
  8273. }, {
  8274. key: "executeArrayIndexAssign",
  8275. value: function () {
  8276. var _executeArrayIndexAssign = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee19(store, cmd) {
  8277. var mustBeArray, used_dims, lineSV, line, columnSV, column, value, actualValue, type, stringInfo, info, exp_type_string_info, exp_type_info, exp, current_value, _exp2;
  8278. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee19$(_context19) {
  8279. while (1) {
  8280. switch (_context19.prev = _context19.next) {
  8281. case 0:
  8282. mustBeArray = store.applyStore(cmd.id);
  8283. used_dims = 0;
  8284. if (!mustBeArray.isConst) {
  8285. _context19.next = 4;
  8286. break;
  8287. }
  8288. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8289. case 4:
  8290. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  8291. _context19.next = 6;
  8292. break;
  8293. }
  8294. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  8295. case 6:
  8296. _context19.next = 8;
  8297. return this.evaluateExpression(store, cmd.line);
  8298. case 8:
  8299. lineSV = _context19.sent;
  8300. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  8301. _context19.next = 11;
  8302. break;
  8303. }
  8304. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8305. case 11:
  8306. used_dims += 1;
  8307. line = lineSV.get().toNumber();
  8308. _context19.next = 15;
  8309. return this.evaluateExpression(store, cmd.column);
  8310. case 15:
  8311. columnSV = _context19.sent;
  8312. column = null;
  8313. if (!(columnSV != null)) {
  8314. _context19.next = 22;
  8315. break;
  8316. }
  8317. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  8318. _context19.next = 20;
  8319. break;
  8320. }
  8321. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8322. case 20:
  8323. column = columnSV.get().toNumber();
  8324. used_dims += 1;
  8325. case 22:
  8326. _context19.next = 24;
  8327. return this.evaluateExpression(store, cmd.expression);
  8328. case 24:
  8329. value = _context19.sent;
  8330. actualValue = value;
  8331. if (!(line >= mustBeArray.lines)) {
  8332. _context19.next = 34;
  8333. break;
  8334. }
  8335. if (!mustBeArray.isVector) {
  8336. _context19.next = 31;
  8337. break;
  8338. }
  8339. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8340. case 31:
  8341. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8342. case 32:
  8343. _context19.next = 36;
  8344. break;
  8345. case 34:
  8346. if (!(line < 0)) {
  8347. _context19.next = 36;
  8348. break;
  8349. }
  8350. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8351. case 36:
  8352. if (!(column != null && mustBeArray.columns === 0)) {
  8353. _context19.next = 38;
  8354. break;
  8355. }
  8356. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(cmd.id, cmd.sourceInfo);
  8357. case 38:
  8358. if (!(column != null)) {
  8359. _context19.next = 45;
  8360. break;
  8361. }
  8362. if (!(column >= mustBeArray.columns)) {
  8363. _context19.next = 43;
  8364. break;
  8365. }
  8366. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(cmd.id, column, mustBeArray.columns, cmd.sourceInfo);
  8367. case 43:
  8368. if (!(column < 0)) {
  8369. _context19.next = 45;
  8370. break;
  8371. }
  8372. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8373. case 45:
  8374. if (mustBeArray.type.canAccept(value.type, used_dims)) {
  8375. _context19.next = 55;
  8376. break;
  8377. }
  8378. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(mustBeArray.type.innerType, value.type))) {
  8379. _context19.next = 54;
  8380. break;
  8381. }
  8382. type = mustBeArray.type.innerType;
  8383. stringInfo = type.stringInfo();
  8384. info = stringInfo[0];
  8385. exp_type_string_info = value.type.stringInfo();
  8386. exp_type_info = exp_type_string_info[0];
  8387. exp = cmd.expression.toString();
  8388. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, exp_type_info.type, exp_type_info.dim, exp, cmd.sourceInfo);
  8389. case 54:
  8390. actualValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(mustBeArray.type.innerType, value);
  8391. case 55:
  8392. current_value = mustBeArray.getAt(line, column);
  8393. if (!(current_value instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8394. _context19.next = 60;
  8395. break;
  8396. }
  8397. if (!(current_value.lines !== actualValue.lines || current_value.columns !== actualValue.columns)) {
  8398. _context19.next = 60;
  8399. break;
  8400. }
  8401. _exp2 = cmd.expression.toString();
  8402. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_matrix_index_assign_full(cmd.id, line, current_value.lines, _exp2, actualValue.lines, cmd.sourceInfo);
  8403. case 60:
  8404. return _context19.abrupt("return", store.updateStoreArray(cmd.id, actualValue, line, column));
  8405. case 61:
  8406. case "end":
  8407. return _context19.stop();
  8408. }
  8409. }
  8410. }, _callee19, this);
  8411. }));
  8412. function executeArrayIndexAssign(_x43, _x44) {
  8413. return _executeArrayIndexAssign.apply(this, arguments);
  8414. }
  8415. return executeArrayIndexAssign;
  8416. }()
  8417. /**
  8418. *
  8419. * @param {Store} store
  8420. * @param {Commands.Declaration} cmd
  8421. *
  8422. * @returns {Promise<Store>}
  8423. */
  8424. }, {
  8425. key: "executeDeclaration",
  8426. value: function () {
  8427. var _executeDeclaration = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee20(store, cmd) {
  8428. var temp, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp;
  8429. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee20$(_context20) {
  8430. while (1) {
  8431. switch (_context20.prev = _context20.next) {
  8432. case 0:
  8433. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayDeclaration"])) {
  8434. _context20.next = 4;
  8435. break;
  8436. }
  8437. return _context20.abrupt("return", this.executeArrayDeclaration(store, cmd));
  8438. case 4:
  8439. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, null, null, cmd.isConst);
  8440. if (!(cmd.initial !== null)) {
  8441. _context20.next = 22;
  8442. break;
  8443. }
  8444. _context20.next = 8;
  8445. return this.evaluateExpression(store, cmd.initial);
  8446. case 8:
  8447. value = _context20.sent;
  8448. realValue = value;
  8449. if (value.type.isCompatible(cmd.type)) {
  8450. _context20.next = 21;
  8451. break;
  8452. }
  8453. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(cmd.type, value.type))) {
  8454. _context20.next = 15;
  8455. break;
  8456. }
  8457. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(cmd.type, realValue);
  8458. _context20.next = 21;
  8459. break;
  8460. case 15:
  8461. stringInfo = value.type.stringInfo();
  8462. info = stringInfo[0];
  8463. exp_type_string_info = value.type.stringInfo();
  8464. exp_type_info = exp_type_string_info[0];
  8465. exp = cmd.expression.toString();
  8466. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, exp_type_info.type, exp_type_info.dim, exp, cmd.sourceInfo);
  8467. case 21:
  8468. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, realValue.get(), null, cmd.isConst);
  8469. case 22:
  8470. store.insertStore(cmd.id, temp);
  8471. return _context20.abrupt("return", store);
  8472. case 24:
  8473. case "end":
  8474. return _context20.stop();
  8475. }
  8476. }
  8477. }, _callee20, this);
  8478. }));
  8479. function executeDeclaration(_x45, _x46) {
  8480. return _executeDeclaration.apply(this, arguments);
  8481. }
  8482. return executeDeclaration;
  8483. }()
  8484. /**
  8485. *
  8486. * @param {Store} store
  8487. * @param {Commands.ArrayDeclaration} cmd
  8488. *
  8489. * @returns {Promise<Store>}
  8490. */
  8491. }, {
  8492. key: "executeArrayDeclaration",
  8493. value: function () {
  8494. var _executeArrayDeclaration = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee21(store, cmd) {
  8495. var linesSV, line, columnsSV, column, temp, valueList;
  8496. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee21$(_context21) {
  8497. while (1) {
  8498. switch (_context21.prev = _context21.next) {
  8499. case 0:
  8500. _context21.next = 2;
  8501. return this.evaluateExpression(store, cmd.lines);
  8502. case 2:
  8503. linesSV = _context21.sent;
  8504. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(linesSV.type)) {
  8505. _context21.next = 5;
  8506. break;
  8507. }
  8508. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8509. case 5:
  8510. line = linesSV.get().toNumber();
  8511. _context21.next = 8;
  8512. return this.evaluateExpression(store, cmd.columns);
  8513. case 8:
  8514. columnsSV = _context21.sent;
  8515. column = null;
  8516. if (!(columnsSV !== null)) {
  8517. _context21.next = 16;
  8518. break;
  8519. }
  8520. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnsSV.type)) {
  8521. _context21.next = 13;
  8522. break;
  8523. }
  8524. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8525. case 13:
  8526. column = columnsSV.get().toNumber();
  8527. if (!(column < 0)) {
  8528. _context21.next = 16;
  8529. break;
  8530. }
  8531. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8532. case 16:
  8533. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, [], line, column, null, cmd.isConst);
  8534. if (!(cmd.initial !== null)) {
  8535. _context21.next = 22;
  8536. break;
  8537. }
  8538. _context21.next = 20;
  8539. return this.evaluateArrayLiteral(store, cmd.initial, cmd.type, line, column);
  8540. case 20:
  8541. valueList = _context21.sent;
  8542. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, valueList, line, column, null, cmd.isConst);
  8543. case 22:
  8544. store.insertStore(cmd.id, temp);
  8545. return _context21.abrupt("return", store);
  8546. case 24:
  8547. case "end":
  8548. return _context21.stop();
  8549. }
  8550. }
  8551. }, _callee21, this);
  8552. }));
  8553. function executeArrayDeclaration(_x47, _x48) {
  8554. return _executeArrayDeclaration.apply(this, arguments);
  8555. }
  8556. return executeArrayDeclaration;
  8557. }()
  8558. /**
  8559. *
  8560. * @param {Store} store
  8561. * @param {Expression} exp
  8562. *
  8563. * @returns {Promise<import('./store/value/istore_value').IStoreValue>}
  8564. */
  8565. }, {
  8566. key: "evaluateExpression",
  8567. value: function () {
  8568. var _evaluateExpression = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee22(store, exp) {
  8569. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee22$(_context22) {
  8570. while (1) {
  8571. switch (_context22.prev = _context22.next) {
  8572. case 0:
  8573. this.instruction_count += 1;
  8574. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  8575. _context22.next = 4;
  8576. break;
  8577. }
  8578. _context22.next = 4;
  8579. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
  8580. case 4:
  8581. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  8582. _context22.next = 6;
  8583. break;
  8584. }
  8585. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  8586. case 6:
  8587. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  8588. _context22.next = 8;
  8589. break;
  8590. }
  8591. throw new Error("Número de instruções excedeu o limite definido. Verifique se seu código não possui laços infinitos ou muitas chamadas de funções recursivas.");
  8592. case 8:
  8593. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["UnaryApp"])) {
  8594. _context22.next = 12;
  8595. break;
  8596. }
  8597. return _context22.abrupt("return", this.evaluateUnaryApp(store, exp));
  8598. case 12:
  8599. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"])) {
  8600. _context22.next = 16;
  8601. break;
  8602. }
  8603. return _context22.abrupt("return", this.evaluateInfixApp(store, exp));
  8604. case 16:
  8605. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayAccess"])) {
  8606. _context22.next = 20;
  8607. break;
  8608. }
  8609. return _context22.abrupt("return", this.evaluateArrayAccess(store, exp));
  8610. case 20:
  8611. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["VariableLiteral"])) {
  8612. _context22.next = 24;
  8613. break;
  8614. }
  8615. return _context22.abrupt("return", this.evaluateVariableLiteral(store, exp));
  8616. case 24:
  8617. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"])) {
  8618. _context22.next = 28;
  8619. break;
  8620. }
  8621. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8622. case 28:
  8623. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["RealLiteral"])) {
  8624. _context22.next = 32;
  8625. break;
  8626. }
  8627. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8628. case 32:
  8629. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["BoolLiteral"])) {
  8630. _context22.next = 36;
  8631. break;
  8632. }
  8633. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8634. case 36:
  8635. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["StringLiteral"])) {
  8636. _context22.next = 40;
  8637. break;
  8638. }
  8639. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8640. case 40:
  8641. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["CharLiteral"])) {
  8642. _context22.next = 44;
  8643. break;
  8644. }
  8645. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8646. case 44:
  8647. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayLiteral"])) {
  8648. _context22.next = 48;
  8649. break;
  8650. }
  8651. throw new Error("Internal Error: The system should not eval an array literal.");
  8652. case 48:
  8653. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  8654. _context22.next = 50;
  8655. break;
  8656. }
  8657. return _context22.abrupt("return", this.evaluateFunctionCall(store, exp));
  8658. case 50:
  8659. return _context22.abrupt("return", null);
  8660. case 51:
  8661. case "end":
  8662. return _context22.stop();
  8663. }
  8664. }
  8665. }, _callee22, this);
  8666. }));
  8667. function evaluateExpression(_x49, _x50) {
  8668. return _evaluateExpression.apply(this, arguments);
  8669. }
  8670. return evaluateExpression;
  8671. }()
  8672. }, {
  8673. key: "evaluateFunctionCall",
  8674. value: function () {
  8675. var _evaluateFunctionCall = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee23(store, exp) {
  8676. var func, sto, val;
  8677. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee23$(_context23) {
  8678. while (1) {
  8679. switch (_context23.prev = _context23.next) {
  8680. case 0:
  8681. if (!exp.isMainCall) {
  8682. _context23.next = 2;
  8683. break;
  8684. }
  8685. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName(), exp.sourceInfo);
  8686. case 2:
  8687. func = this.findFunction(exp.id);
  8688. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType)) {
  8689. _context23.next = 5;
  8690. break;
  8691. }
  8692. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(exp.id, exp.sourceInfo);
  8693. case 5:
  8694. if (!(this.function_call_stack.length >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_call_stack)) {
  8695. _context23.next = 7;
  8696. break;
  8697. }
  8698. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceeded_recursive_calls(exp.sourceInfo);
  8699. case 7:
  8700. this.function_call_stack.push(exp.sourceInfo);
  8701. _context23.next = 10;
  8702. return this.runFunction(func, exp.actualParameters, store);
  8703. case 10:
  8704. sto = _context23.sent;
  8705. if (!(sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  8706. _context23.next = 13;
  8707. break;
  8708. }
  8709. throw new Error("!!!Internal error: the function that was called did not have a return command or did not set the store mode properly -> " + exp.id);
  8710. case 13:
  8711. val = sto.applyStore("$");
  8712. sto.destroy();
  8713. this.function_call_stack.pop();
  8714. return _context23.abrupt("return", val);
  8715. case 17:
  8716. case "end":
  8717. return _context23.stop();
  8718. }
  8719. }
  8720. }, _callee23, this);
  8721. }));
  8722. function evaluateFunctionCall(_x51, _x52) {
  8723. return _evaluateFunctionCall.apply(this, arguments);
  8724. }
  8725. return evaluateFunctionCall;
  8726. }()
  8727. /**
  8728. *
  8729. * @param {Store} store
  8730. * @param {Expressions.ArrayLiteral} exp
  8731. * @param {ArrayType} type
  8732. *
  8733. * @returns {Promise<StoreValue[]>}
  8734. */
  8735. }, {
  8736. key: "evaluateArrayLiteral",
  8737. value: function () {
  8738. var _evaluateArrayLiteral = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee24(store, exp, type, lines, columns) {
  8739. var storeValueMatrix;
  8740. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee24$(_context24) {
  8741. while (1) {
  8742. switch (_context24.prev = _context24.next) {
  8743. case 0:
  8744. if (exp.isVector) {
  8745. _context24.next = 9;
  8746. break;
  8747. }
  8748. if (!(columns == null)) {
  8749. _context24.next = 3;
  8750. break;
  8751. }
  8752. throw new Error("This should never happen: Vector cannot be initialized by a matrix");
  8753. case 3:
  8754. _context24.next = 5;
  8755. return this.evaluateMatrix(store, exp, type, lines, columns);
  8756. case 5:
  8757. storeValueMatrix = _context24.sent;
  8758. return _context24.abrupt("return", storeValueMatrix.reduce(function (prev, next) {
  8759. return prev.concat(next);
  8760. }, []));
  8761. case 9:
  8762. if (!(columns != null)) {
  8763. _context24.next = 11;
  8764. break;
  8765. }
  8766. throw new Error("This should never happen: Matrix cannot be initialized by a vector");
  8767. case 11:
  8768. return _context24.abrupt("return", this.evaluateVector(store, exp, type, lines));
  8769. case 12:
  8770. case "end":
  8771. return _context24.stop();
  8772. }
  8773. }
  8774. }, _callee24, this);
  8775. }));
  8776. function evaluateArrayLiteral(_x53, _x54, _x55, _x56, _x57) {
  8777. return _evaluateArrayLiteral.apply(this, arguments);
  8778. }
  8779. return evaluateArrayLiteral;
  8780. }()
  8781. /**
  8782. * Evalautes a list of literals and expression composing the vector
  8783. * @param {Store} store
  8784. * @param {Expressions.ArrayLiteral} exps
  8785. * @param {ArrayType} type
  8786. * @param {number} n_elements
  8787. *
  8788. * @returns {Promise<StoreValue[]>} store object list
  8789. */
  8790. }, {
  8791. key: "evaluateVector",
  8792. value: function () {
  8793. var _evaluateVector = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee25(store, exps, type, n_elements) {
  8794. var _this = this;
  8795. var values, actualValues;
  8796. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee25$(_context25) {
  8797. while (1) {
  8798. switch (_context25.prev = _context25.next) {
  8799. case 0:
  8800. values = exps.value;
  8801. if (!(n_elements !== values.length)) {
  8802. _context25.next = 3;
  8803. break;
  8804. }
  8805. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_elements_vector(n_elements, exps.toString(), values.length, exps.sourceInfo);
  8806. case 3:
  8807. _context25.next = 5;
  8808. return Promise.all(values.map(function (exp) {
  8809. return _this.evaluateExpression(store, exp);
  8810. }));
  8811. case 5:
  8812. actualValues = _context25.sent;
  8813. return _context25.abrupt("return", actualValues.map(function (v, index) {
  8814. if (!type.canAccept(v.type, 1)) {
  8815. if (!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(type.innerType, v.type)) {
  8816. // const stringInfo = v.type.stringInfo();
  8817. // const info = stringInfo[0];
  8818. var exp_str = values[index].toString(); // TODO - fix error message
  8819. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_literal_type_full(exp_str, values[index].sourceInfo);
  8820. }
  8821. var newValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(type.innerType, v);
  8822. return newValue;
  8823. }
  8824. return v;
  8825. }));
  8826. case 7:
  8827. case "end":
  8828. return _context25.stop();
  8829. }
  8830. }
  8831. }, _callee25);
  8832. }));
  8833. function evaluateVector(_x58, _x59, _x60, _x61) {
  8834. return _evaluateVector.apply(this, arguments);
  8835. }
  8836. return evaluateVector;
  8837. }()
  8838. /**
  8839. * Evaluates a list of array literals composing the matrix
  8840. * @param {Store} store
  8841. * @param {Expressions.ArrayLiteral} exps
  8842. * @param {ArrayType} type
  8843. *
  8844. * @returns {Promise<StoreValue[][]>}
  8845. */
  8846. }, {
  8847. key: "evaluateMatrix",
  8848. value: function () {
  8849. var _evaluateMatrix = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee26(store, exps, type, lines, columns) {
  8850. var _this2 = this;
  8851. var values, vectors;
  8852. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee26$(_context26) {
  8853. while (1) {
  8854. switch (_context26.prev = _context26.next) {
  8855. case 0:
  8856. values = exps.value;
  8857. if (!(values.length !== lines)) {
  8858. _context26.next = 3;
  8859. break;
  8860. }
  8861. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_lines_matrix(lines, exps.toString(), values.length, exps.sourceInfo);
  8862. case 3:
  8863. vectors = values.map(function (vector) {
  8864. var vec_type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"](type.innerType, 1);
  8865. return _this2.evaluateVector(store, vector, vec_type, columns);
  8866. });
  8867. _context26.next = 6;
  8868. return Promise.all(vectors);
  8869. case 6:
  8870. return _context26.abrupt("return", _context26.sent);
  8871. case 7:
  8872. case "end":
  8873. return _context26.stop();
  8874. }
  8875. }
  8876. }, _callee26);
  8877. }));
  8878. function evaluateMatrix(_x62, _x63, _x64, _x65, _x66) {
  8879. return _evaluateMatrix.apply(this, arguments);
  8880. }
  8881. return evaluateMatrix;
  8882. }()
  8883. /**
  8884. *
  8885. * @param {Store} _
  8886. * @param {import('../ast/expressions/literal').Literal} exp
  8887. *
  8888. * @returns {import('./store/value/istore_value').IStoreValue}
  8889. */
  8890. }, {
  8891. key: "evaluateLiteral",
  8892. value: function () {
  8893. var _evaluateLiteral = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee27(_, exp) {
  8894. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee27$(_context27) {
  8895. while (1) {
  8896. switch (_context27.prev = _context27.next) {
  8897. case 0:
  8898. return _context27.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](exp.type, exp.value));
  8899. case 1:
  8900. case "end":
  8901. return _context27.stop();
  8902. }
  8903. }
  8904. }, _callee27);
  8905. }));
  8906. function evaluateLiteral(_x67, _x68) {
  8907. return _evaluateLiteral.apply(this, arguments);
  8908. }
  8909. return evaluateLiteral;
  8910. }()
  8911. /**
  8912. *
  8913. * @param {Store} store
  8914. * @param {Expressions.VariableLiteral} exp
  8915. *
  8916. * @returns {import('./store/value/istore_value').IStoreValue}
  8917. */
  8918. }, {
  8919. key: "evaluateVariableLiteral",
  8920. value: function () {
  8921. var _evaluateVariableLiteral = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee28(store, exp) {
  8922. var val;
  8923. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee28$(_context28) {
  8924. while (1) {
  8925. switch (_context28.prev = _context28.next) {
  8926. case 0:
  8927. val = store.applyStore(exp.id);
  8928. return _context28.abrupt("return", val);
  8929. case 2:
  8930. case "end":
  8931. return _context28.stop();
  8932. }
  8933. }
  8934. }, _callee28);
  8935. }));
  8936. function evaluateVariableLiteral(_x69, _x70) {
  8937. return _evaluateVariableLiteral.apply(this, arguments);
  8938. }
  8939. return evaluateVariableLiteral;
  8940. }()
  8941. /**
  8942. *
  8943. * @param {Store} store
  8944. * @param {Expressions.ArrayAccess} exp
  8945. *
  8946. * @returns {import('./store/value/istore_value').IStoreValue}
  8947. */
  8948. }, {
  8949. key: "evaluateArrayAccess",
  8950. value: function () {
  8951. var _evaluateArrayAccess = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee29(store, exp) {
  8952. var mustBeArray, lineSV, line, columnSV, column, result, type, values;
  8953. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee29$(_context29) {
  8954. while (1) {
  8955. switch (_context29.prev = _context29.next) {
  8956. case 0:
  8957. mustBeArray = store.getStoreObject(exp.id);
  8958. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  8959. _context29.next = 3;
  8960. break;
  8961. }
  8962. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(exp.id, exp.sourceInfo);
  8963. case 3:
  8964. _context29.next = 5;
  8965. return this.evaluateExpression(store, exp.line);
  8966. case 5:
  8967. lineSV = _context29.sent;
  8968. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  8969. _context29.next = 8;
  8970. break;
  8971. }
  8972. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  8973. case 8:
  8974. line = lineSV.get().toNumber();
  8975. _context29.next = 11;
  8976. return this.evaluateExpression(store, exp.column);
  8977. case 11:
  8978. columnSV = _context29.sent;
  8979. column = null;
  8980. if (!(columnSV !== null)) {
  8981. _context29.next = 17;
  8982. break;
  8983. }
  8984. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  8985. _context29.next = 16;
  8986. break;
  8987. }
  8988. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  8989. case 16:
  8990. column = columnSV.get().toNumber();
  8991. case 17:
  8992. if (!(line >= mustBeArray.lines)) {
  8993. _context29.next = 25;
  8994. break;
  8995. }
  8996. if (!mustBeArray.isVector) {
  8997. _context29.next = 22;
  8998. break;
  8999. }
  9000. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  9001. case 22:
  9002. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  9003. case 23:
  9004. _context29.next = 27;
  9005. break;
  9006. case 25:
  9007. if (!(line < 0)) {
  9008. _context29.next = 27;
  9009. break;
  9010. }
  9011. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9012. case 27:
  9013. if (!(column !== null && mustBeArray.columns === 0)) {
  9014. _context29.next = 29;
  9015. break;
  9016. }
  9017. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(exp.id, exp.sourceInfo);
  9018. case 29:
  9019. if (!(column !== null)) {
  9020. _context29.next = 36;
  9021. break;
  9022. }
  9023. if (!(column >= mustBeArray.columns)) {
  9024. _context29.next = 34;
  9025. break;
  9026. }
  9027. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(exp.id, column, mustBeArray.columns, exp.sourceInfo);
  9028. case 34:
  9029. if (!(column < 0)) {
  9030. _context29.next = 36;
  9031. break;
  9032. }
  9033. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9034. case 36:
  9035. result = mustBeArray.getAt(line, column);
  9036. type = mustBeArray.type.innerType;
  9037. if (!Array.isArray(result)) {
  9038. _context29.next = 43;
  9039. break;
  9040. }
  9041. values = result.map(function (val, col) {
  9042. return new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, val, line, col, mustBeArray.id, mustBeArray.readOnly);
  9043. });
  9044. return _context29.abrupt("return", new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"](type, 1), values, mustBeArray.columns, null, mustBeArray.id, mustBeArray.readOnly));
  9045. case 43:
  9046. return _context29.abrupt("return", new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, result, line, column, mustBeArray.id, mustBeArray.readOnly));
  9047. case 44:
  9048. case "end":
  9049. return _context29.stop();
  9050. }
  9051. }
  9052. }, _callee29, this);
  9053. }));
  9054. function evaluateArrayAccess(_x71, _x72) {
  9055. return _evaluateArrayAccess.apply(this, arguments);
  9056. }
  9057. return evaluateArrayAccess;
  9058. }()
  9059. /**
  9060. *
  9061. * @param {Store} store
  9062. * @param {Expressions.UnaryApp} unaryApp
  9063. *
  9064. * @returns {import('./store/value/istore_value').IStoreValue}
  9065. */
  9066. }, {
  9067. key: "evaluateUnaryApp",
  9068. value: function () {
  9069. var _evaluateUnaryApp = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee30(store, unaryApp) {
  9070. var left, resultType, stringInfo, info;
  9071. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee30$(_context30) {
  9072. while (1) {
  9073. switch (_context30.prev = _context30.next) {
  9074. case 0:
  9075. _context30.next = 2;
  9076. return this.evaluateExpression(store, unaryApp.left);
  9077. case 2:
  9078. left = _context30.sent;
  9079. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterUnaryOp"])(unaryApp.op, left.type);
  9080. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9081. _context30.next = 8;
  9082. break;
  9083. }
  9084. stringInfo = left.type.stringInfo();
  9085. info = stringInfo[0];
  9086. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_unary_op_full(unaryApp.op, info.type, info.dim, unaryApp.sourceInfo);
  9087. case 8:
  9088. _context30.t0 = unaryApp.op.ord;
  9089. _context30.next = _context30.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].ADD.ord ? 11 : _context30.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].SUB.ord ? 12 : _context30.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NOT.ord ? 13 : 14;
  9090. break;
  9091. case 11:
  9092. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get()));
  9093. case 12:
  9094. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().negated()));
  9095. case 13:
  9096. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, !left.get()));
  9097. case 14:
  9098. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid UnaryApp " + unaryApp.op);
  9099. case 15:
  9100. case "end":
  9101. return _context30.stop();
  9102. }
  9103. }
  9104. }, _callee30, this);
  9105. }));
  9106. function evaluateUnaryApp(_x73, _x74) {
  9107. return _evaluateUnaryApp.apply(this, arguments);
  9108. }
  9109. return evaluateUnaryApp;
  9110. }()
  9111. /**
  9112. *
  9113. * @param {Store} store
  9114. * @param {Expressions.InfixApp} infixApp
  9115. *
  9116. * @returns {import('./store/value/istore_value').IStoreValue}
  9117. */
  9118. }, {
  9119. key: "evaluateInfixApp",
  9120. value: function () {
  9121. var _evaluateInfixApp = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee31(store, infixApp) {
  9122. var left, right, shouldImplicitCast, resultType, stringInfoLeft, infoLeft, stringInfoRight, infoRight, result, rightStr, leftStr, strLeft, strRight, leftValue, rightValue, _leftValue, _rightValue, _leftValue2, _rightValue2, _leftValue3, _rightValue3, _leftValue4, _rightValue4, _leftValue5, _rightValue5, _leftValue6, _rightValue6;
  9123. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee31$(_context31) {
  9124. while (1) {
  9125. switch (_context31.prev = _context31.next) {
  9126. case 0:
  9127. _context31.next = 2;
  9128. return this.evaluateExpression(store, infixApp.left);
  9129. case 2:
  9130. left = _context31.sent;
  9131. _context31.next = 5;
  9132. return this.evaluateExpression(store, infixApp.right);
  9133. case 5:
  9134. right = _context31.sent;
  9135. shouldImplicitCast = false;
  9136. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterInfixOp"])(infixApp.op, left.type, right.type);
  9137. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9138. _context31.next = 18;
  9139. break;
  9140. }
  9141. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(left.type, right.type))) {
  9142. _context31.next = 13;
  9143. break;
  9144. }
  9145. shouldImplicitCast = true;
  9146. _context31.next = 18;
  9147. break;
  9148. case 13:
  9149. stringInfoLeft = left.type.stringInfo();
  9150. infoLeft = stringInfoLeft[0];
  9151. stringInfoRight = right.type.stringInfo();
  9152. infoRight = stringInfoRight[0];
  9153. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_infix_op_full(infixApp.op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, infixApp.sourceInfo);
  9154. case 18:
  9155. result = null;
  9156. _context31.t0 = infixApp.op.ord;
  9157. _context31.next = _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].ADD.ord ? 22 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].SUB.ord ? 39 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].MULT.ord ? 40 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].DIV.ord ? 42 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].MOD.ord ? 46 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT.ord ? 51 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GE.ord ? 55 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LT.ord ? 59 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LE.ord ? 63 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].EQ.ord ? 67 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NEQ.ord ? 71 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].AND.ord ? 75 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].OR.ord ? 76 : 77;
  9158. break;
  9159. case 22:
  9160. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9161. _context31.next = 27;
  9162. break;
  9163. }
  9164. rightStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9165. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() + rightStr));
  9166. case 27:
  9167. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(right.type)) {
  9168. _context31.next = 32;
  9169. break;
  9170. }
  9171. leftStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9172. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, leftStr + right.get()));
  9173. case 32:
  9174. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9175. _context31.next = 38;
  9176. break;
  9177. }
  9178. strLeft = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9179. strRight = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9180. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, strLeft + strRight));
  9181. case 38:
  9182. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().plus(right.get())));
  9183. case 39:
  9184. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().minus(right.get())));
  9185. case 40:
  9186. result = left.get().times(right.get());
  9187. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9188. case 42:
  9189. if (!(right.get() == 0)) {
  9190. _context31.next = 44;
  9191. break;
  9192. }
  9193. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].divsion_by_zero_full(infixApp.toString(), infixApp.sourceInfo);
  9194. case 44:
  9195. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(resultType)) result = left.get().divToInt(right.get());else result = left.get().div(right.get());
  9196. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9197. case 46:
  9198. leftValue = left.get();
  9199. rightValue = right.get();
  9200. if (shouldImplicitCast) {
  9201. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER;
  9202. leftValue = leftValue.trunc();
  9203. rightValue = rightValue.trunc();
  9204. }
  9205. result = leftValue.modulo(rightValue);
  9206. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9207. case 51:
  9208. _leftValue = left.get();
  9209. _rightValue = right.get();
  9210. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9211. result = _leftValue.length > _rightValue.length;
  9212. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9213. result = _leftValue.charCodeAt(0) > _rightValue.charCodeAt(0);
  9214. } else {
  9215. if (shouldImplicitCast) {
  9216. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9217. _leftValue = _leftValue.trunc();
  9218. _rightValue = _rightValue.trunc();
  9219. }
  9220. result = _leftValue.gt(_rightValue);
  9221. }
  9222. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9223. case 55:
  9224. _leftValue2 = left.get();
  9225. _rightValue2 = right.get();
  9226. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9227. result = _leftValue2.length >= _rightValue2.length;
  9228. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9229. result = _leftValue2.charCodeAt(0) >= _rightValue2.charCodeAt(0);
  9230. } else {
  9231. if (shouldImplicitCast) {
  9232. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9233. _leftValue2 = _leftValue2.trunc();
  9234. _rightValue2 = _rightValue2.trunc();
  9235. }
  9236. result = _leftValue2.gte(_rightValue2);
  9237. }
  9238. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9239. case 59:
  9240. _leftValue3 = left.get();
  9241. _rightValue3 = right.get();
  9242. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9243. result = _leftValue3.length < _rightValue3.length;
  9244. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9245. result = _leftValue3.charCodeAt(0) < _rightValue3.charCodeAt(0);
  9246. } else {
  9247. if (shouldImplicitCast) {
  9248. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9249. _leftValue3 = _leftValue3.trunc();
  9250. _rightValue3 = _rightValue3.trunc();
  9251. }
  9252. result = _leftValue3.lt(_rightValue3);
  9253. }
  9254. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9255. case 63:
  9256. _leftValue4 = left.get();
  9257. _rightValue4 = right.get();
  9258. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9259. result = _leftValue4.length <= _rightValue4.length;
  9260. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9261. result = _leftValue4.charCodeAt(0) <= _rightValue4.charCodeAt(0);
  9262. } else {
  9263. if (shouldImplicitCast) {
  9264. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9265. _leftValue4 = _leftValue4.trunc();
  9266. _rightValue4 = _rightValue4.trunc();
  9267. }
  9268. result = _leftValue4.lte(_rightValue4);
  9269. }
  9270. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9271. case 67:
  9272. _leftValue5 = left.get();
  9273. _rightValue5 = right.get();
  9274. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9275. if (shouldImplicitCast) {
  9276. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9277. _leftValue5 = _leftValue5.trunc();
  9278. _rightValue5 = _rightValue5.trunc();
  9279. }
  9280. result = _leftValue5.eq(_rightValue5);
  9281. } else {
  9282. result = _leftValue5 === _rightValue5;
  9283. }
  9284. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9285. case 71:
  9286. _leftValue6 = left.get();
  9287. _rightValue6 = right.get();
  9288. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9289. if (shouldImplicitCast) {
  9290. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9291. _leftValue6 = _leftValue6.trunc();
  9292. _rightValue6 = _rightValue6.trunc();
  9293. }
  9294. result = !_leftValue6.eq(_rightValue6);
  9295. } else {
  9296. result = _leftValue6 !== _rightValue6;
  9297. }
  9298. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9299. case 75:
  9300. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() && right.get()));
  9301. case 76:
  9302. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() || right.get()));
  9303. case 77:
  9304. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid InfixApp " + infixApp.op);
  9305. case 78:
  9306. case "end":
  9307. return _context31.stop();
  9308. }
  9309. }
  9310. }, _callee31, this);
  9311. }));
  9312. function evaluateInfixApp(_x75, _x76) {
  9313. return _evaluateInfixApp.apply(this, arguments);
  9314. }
  9315. return evaluateInfixApp;
  9316. }()
  9317. }]);
  9318. return IVProgProcessor;
  9319. }();
  9320. /***/ }),
  9321. /***/ "./js/processor/lib/arrays.js":
  9322. /*!************************************!*\
  9323. !*** ./js/processor/lib/arrays.js ***!
  9324. \************************************/
  9325. /*! exports provided: createNumElementsFun, createMatrixLinesFun, createMatrixColumnsFun */
  9326. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9327. "use strict";
  9328. __webpack_require__.r(__webpack_exports__);
  9329. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumElementsFun", function() { return createNumElementsFun; });
  9330. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixLinesFun", function() { return createMatrixLinesFun; });
  9331. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixColumnsFun", function() { return createMatrixColumnsFun; });
  9332. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9333. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9334. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9335. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9336. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9337. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9338. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  9339. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9340. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  9341. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__);
  9342. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9343. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  9344. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9345. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  9346. /**
  9347. * num_elements
  9348. * matrix_lines
  9349. * matrix_columns
  9350. */
  9351. function createNumElementsFun() {
  9352. var numElementsFun = /*#__PURE__*/function () {
  9353. var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(sto, _) {
  9354. var vector, temp;
  9355. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9356. while (1) {
  9357. switch (_context.prev = _context.next) {
  9358. case 0:
  9359. vector = sto.applyStore("vector");
  9360. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(vector.lines));
  9361. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9362. sto.insertStore("$", temp);
  9363. return _context.abrupt("return", sto);
  9364. case 5:
  9365. case "end":
  9366. return _context.stop();
  9367. }
  9368. }
  9369. }, _callee);
  9370. }));
  9371. return function numElementsFun(_x, _x2) {
  9372. return _ref.apply(this, arguments);
  9373. };
  9374. }();
  9375. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](numElementsFun)]);
  9376. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$numElements', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__["ArrayType"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 1), 'vector', false)], block);
  9377. return func;
  9378. }
  9379. function createMatrixLinesFun() {
  9380. var matrixLinesFun = /*#__PURE__*/function () {
  9381. var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(sto, _) {
  9382. var matrix, temp;
  9383. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9384. while (1) {
  9385. switch (_context2.prev = _context2.next) {
  9386. case 0:
  9387. matrix = sto.applyStore("matrix");
  9388. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(matrix.lines));
  9389. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9390. sto.insertStore("$", temp);
  9391. return _context2.abrupt("return", sto);
  9392. case 5:
  9393. case "end":
  9394. return _context2.stop();
  9395. }
  9396. }
  9397. }, _callee2);
  9398. }));
  9399. return function matrixLinesFun(_x3, _x4) {
  9400. return _ref2.apply(this, arguments);
  9401. };
  9402. }();
  9403. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixLinesFun)]);
  9404. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$matrixLines', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__["ArrayType"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 2), 'matrix', false)], block);
  9405. return func;
  9406. }
  9407. function createMatrixColumnsFun() {
  9408. var matrixColumnsFun = /*#__PURE__*/function () {
  9409. var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(sto, _) {
  9410. var matrix, temp;
  9411. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  9412. while (1) {
  9413. switch (_context3.prev = _context3.next) {
  9414. case 0:
  9415. matrix = sto.applyStore("matrix");
  9416. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(matrix.columns));
  9417. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9418. sto.insertStore("$", temp);
  9419. return _context3.abrupt("return", sto);
  9420. case 5:
  9421. case "end":
  9422. return _context3.stop();
  9423. }
  9424. }
  9425. }, _callee3);
  9426. }));
  9427. return function matrixColumnsFun(_x5, _x6) {
  9428. return _ref3.apply(this, arguments);
  9429. };
  9430. }();
  9431. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixColumnsFun)]);
  9432. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$matrixColumns', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__["ArrayType"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 2), 'matrix', false)], block);
  9433. return func;
  9434. }
  9435. /***/ }),
  9436. /***/ "./js/processor/lib/io.js":
  9437. /*!********************************!*\
  9438. !*** ./js/processor/lib/io.js ***!
  9439. \********************************/
  9440. /*! exports provided: createOutputFun, createInputFun */
  9441. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9442. "use strict";
  9443. __webpack_require__.r(__webpack_exports__);
  9444. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createOutputFun", function() { return createOutputFun; });
  9445. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInputFun", function() { return createInputFun; });
  9446. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9447. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9448. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9449. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9450. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9451. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9452. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_3__);
  9453. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9454. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9455. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__);
  9456. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9457. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9458. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  9459. function createOutputFun() {
  9460. var writeFunction = /*#__PURE__*/function () {
  9461. var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(store, _) {
  9462. var totalSV, total, i, val;
  9463. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9464. while (1) {
  9465. switch (_context.prev = _context.next) {
  9466. case 0:
  9467. totalSV = store.applyStore("p1.0");
  9468. total = totalSV.get();
  9469. for (i = 1; i < total; i += 1) {
  9470. val = store.applyStore("p1.".concat(i));
  9471. this.output.sendOutput(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type));
  9472. }
  9473. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9474. return _context.abrupt("return", store);
  9475. case 5:
  9476. case "end":
  9477. return _context.stop();
  9478. }
  9479. }
  9480. }, _callee, this);
  9481. }));
  9482. return function writeFunction(_x, _x2) {
  9483. return _ref.apply(this, arguments);
  9484. };
  9485. }();
  9486. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](writeFunction)]);
  9487. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]("$write", _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].VOID, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].ALL, "p1", false, true)], block);
  9488. return func;
  9489. }
  9490. function createInputFun() {
  9491. var readFunction = /*#__PURE__*/function () {
  9492. var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(store, _) {
  9493. var text, typeToConvert, type, result, stringInfo, realObject, arrayInfo, dim, stoValue;
  9494. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9495. while (1) {
  9496. switch (_context2.prev = _context2.next) {
  9497. case 0:
  9498. _context2.next = 2;
  9499. return this.input.requestInput();
  9500. case 2:
  9501. text = _context2.sent;
  9502. typeToConvert = store.applyStore("p1").type;
  9503. type = null;
  9504. result = null;
  9505. _context2.prev = 6;
  9506. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER)) {
  9507. _context2.next = 12;
  9508. break;
  9509. }
  9510. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"](text.trim()).trunc();
  9511. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER;
  9512. _context2.next = 33;
  9513. break;
  9514. case 12:
  9515. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL)) {
  9516. _context2.next = 17;
  9517. break;
  9518. }
  9519. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toReal"](text.trim());
  9520. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL;
  9521. _context2.next = 33;
  9522. break;
  9523. case 17:
  9524. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN)) {
  9525. _context2.next = 22;
  9526. break;
  9527. }
  9528. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toBool"](text.trim());
  9529. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN;
  9530. _context2.next = 33;
  9531. break;
  9532. case 22:
  9533. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING)) {
  9534. _context2.next = 27;
  9535. break;
  9536. }
  9537. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toString"](text);
  9538. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING;
  9539. _context2.next = 33;
  9540. break;
  9541. case 27:
  9542. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR)) {
  9543. _context2.next = 32;
  9544. break;
  9545. }
  9546. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toChar"](text);
  9547. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR;
  9548. _context2.next = 33;
  9549. break;
  9550. case 32:
  9551. throw new Error("!!!!Critical error: Unknown type in readFunction!!!!");
  9552. case 33:
  9553. _context2.next = 47;
  9554. break;
  9555. case 35:
  9556. _context2.prev = 35;
  9557. _context2.t0 = _context2["catch"](6);
  9558. if (!(this.mode == _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].ABORT)) {
  9559. _context2.next = 40;
  9560. break;
  9561. }
  9562. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9563. return _context2.abrupt("return", store);
  9564. case 40:
  9565. stringInfo = typeToConvert.stringInfo()[0];
  9566. realObject = store.getStoreObject("p1");
  9567. if (!(realObject.getReferenceDimension() > 0)) {
  9568. _context2.next = 46;
  9569. break;
  9570. }
  9571. arrayInfo = realObject.type.stringInfo()[0];
  9572. dim = realObject.getReferenceDimension();
  9573. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__["ProcessorErrorFactory"].invalid_read_type_array(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), arrayInfo.type, dim, this.function_call_stack.pop());
  9574. case 46:
  9575. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__["ProcessorErrorFactory"].invalid_read_type(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), this.function_call_stack.pop());
  9576. case 47:
  9577. stoValue = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](type, result);
  9578. store.updateStore("p1", stoValue);
  9579. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9580. return _context2.abrupt("return", store);
  9581. case 51:
  9582. case "end":
  9583. return _context2.stop();
  9584. }
  9585. }
  9586. }, _callee2, this, [[6, 35]]);
  9587. }));
  9588. return function readFunction(_x3, _x4) {
  9589. return _ref2.apply(this, arguments);
  9590. };
  9591. }();
  9592. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](readFunction)]);
  9593. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]("$read", _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].VOID, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].ALL, "p1", true)], block);
  9594. return func;
  9595. }
  9596. /***/ }),
  9597. /***/ "./js/processor/lib/lang.js":
  9598. /*!**********************************!*\
  9599. !*** ./js/processor/lib/lang.js ***!
  9600. \**********************************/
  9601. /*! exports provided: createIsRealFun, createIsIntFun, createIsBoolFun, createCastRealFun, createCastIntFun, createCastBoolFun, createCastStringFun, createCastCharFun */
  9602. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9603. "use strict";
  9604. __webpack_require__.r(__webpack_exports__);
  9605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsRealFun", function() { return createIsRealFun; });
  9606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsIntFun", function() { return createIsIntFun; });
  9607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsBoolFun", function() { return createIsBoolFun; });
  9608. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastRealFun", function() { return createCastRealFun; });
  9609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastIntFun", function() { return createCastIntFun; });
  9610. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastBoolFun", function() { return createCastBoolFun; });
  9611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastStringFun", function() { return createCastStringFun; });
  9612. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastCharFun", function() { return createCastCharFun; });
  9613. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9614. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9615. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9616. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9617. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9618. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9619. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  9620. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9621. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  9622. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  9623. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9624. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_7__);
  9625. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  9626. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__);
  9627. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9628. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9629. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  9630. /**
  9631. *
  9632. * is_real
  9633. * is_int
  9634. * is_bool
  9635. * cast_real
  9636. * cast_int
  9637. * cast_bool
  9638. * cast_string
  9639. * cast_char
  9640. */
  9641. function createIsRealFun() {
  9642. var isRealFun = /*#__PURE__*/function () {
  9643. var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(sto, _) {
  9644. var str, parser, result, val, temp;
  9645. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9646. while (1) {
  9647. switch (_context.prev = _context.next) {
  9648. case 0:
  9649. str = sto.applyStore("str");
  9650. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  9651. result = false;
  9652. try {
  9653. val = parser.parseTerm();
  9654. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"]) {
  9655. result = true;
  9656. }
  9657. } catch (error) {// ignore
  9658. }
  9659. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  9660. sto.insertStore("$", temp);
  9661. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9662. return _context.abrupt("return", sto);
  9663. case 8:
  9664. case "end":
  9665. return _context.stop();
  9666. }
  9667. }
  9668. }, _callee);
  9669. }));
  9670. return function isRealFun(_x, _x2) {
  9671. return _ref.apply(this, arguments);
  9672. };
  9673. }();
  9674. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isRealFun)]);
  9675. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$isReal', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
  9676. return func;
  9677. }
  9678. function createIsIntFun() {
  9679. var isIntFun = /*#__PURE__*/function () {
  9680. var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(sto, _) {
  9681. var str, parser, result, val, temp;
  9682. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9683. while (1) {
  9684. switch (_context2.prev = _context2.next) {
  9685. case 0:
  9686. str = sto.applyStore("str");
  9687. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  9688. result = false;
  9689. try {
  9690. val = parser.parseTerm();
  9691. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"]) {
  9692. result = true;
  9693. }
  9694. } catch (_unused) {// ignore
  9695. }
  9696. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  9697. sto.insertStore("$", temp);
  9698. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9699. return _context2.abrupt("return", sto);
  9700. case 8:
  9701. case "end":
  9702. return _context2.stop();
  9703. }
  9704. }
  9705. }, _callee2);
  9706. }));
  9707. return function isIntFun(_x3, _x4) {
  9708. return _ref2.apply(this, arguments);
  9709. };
  9710. }();
  9711. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isIntFun)]);
  9712. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$isInt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
  9713. return func;
  9714. }
  9715. function createIsBoolFun() {
  9716. var isBoolFun = function isBoolFun(sto, _) {
  9717. var str = sto.applyStore("str");
  9718. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  9719. var result = false;
  9720. try {
  9721. var val = parser.parseTerm();
  9722. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"]) {
  9723. result = true;
  9724. }
  9725. } catch (error) {// ignore
  9726. }
  9727. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  9728. sto.insertStore("$", temp);
  9729. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9730. return sto;
  9731. };
  9732. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isBoolFun)]);
  9733. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$isBool', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
  9734. return func;
  9735. }
  9736. function createCastRealFun() {
  9737. var castRealFun = /*#__PURE__*/function () {
  9738. var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(sto, _) {
  9739. var val, value, temp, parser, result, _temp, typeStringInfoArray, typeInfo;
  9740. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  9741. while (1) {
  9742. switch (_context3.prev = _context3.next) {
  9743. case 0:
  9744. val = sto.applyStore("val");
  9745. value = val.get();
  9746. _context3.t0 = val.type.ord;
  9747. _context3.next = _context3.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.ord ? 5 : _context3.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.ord ? 10 : 22;
  9748. break;
  9749. case 5:
  9750. value = value.toNumber();
  9751. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toReal"](value));
  9752. sto.insertStore("$", temp);
  9753. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9754. return _context3.abrupt("return", sto);
  9755. case 10:
  9756. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  9757. _context3.prev = 11;
  9758. result = parser.parseTerm();
  9759. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"])) {
  9760. _context3.next = 18;
  9761. break;
  9762. }
  9763. _temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, result.value);
  9764. sto.insertStore("$", _temp);
  9765. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9766. return _context3.abrupt("return", sto);
  9767. case 18:
  9768. _context3.next = 22;
  9769. break;
  9770. case 20:
  9771. _context3.prev = 20;
  9772. _context3.t1 = _context3["catch"](11);
  9773. case 22:
  9774. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.stringInfo();
  9775. typeInfo = typeStringInfoArray[0];
  9776. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  9777. case 25:
  9778. case "end":
  9779. return _context3.stop();
  9780. }
  9781. }
  9782. }, _callee3, null, [[11, 20]]);
  9783. }));
  9784. return function castRealFun(_x5, _x6) {
  9785. return _ref3.apply(this, arguments);
  9786. };
  9787. }();
  9788. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castRealFun)]);
  9789. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castReal', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING]), 'val', false)], block);
  9790. return func;
  9791. }
  9792. function createCastIntFun() {
  9793. var castIntFun = /*#__PURE__*/function () {
  9794. var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee4(sto, _) {
  9795. var val, value, temp, _temp2, parser, result, _temp3, typeStringInfoArray, typeInfo;
  9796. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  9797. while (1) {
  9798. switch (_context4.prev = _context4.next) {
  9799. case 0:
  9800. val = sto.applyStore("val");
  9801. value = val.get();
  9802. _context4.t0 = val.type.ord;
  9803. _context4.next = _context4.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.ord ? 5 : _context4.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR.ord ? 10 : _context4.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.ord ? 14 : 26;
  9804. break;
  9805. case 5:
  9806. value = value.toNumber();
  9807. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Math.floor(value));
  9808. sto.insertStore("$", temp);
  9809. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9810. return _context4.abrupt("return", sto);
  9811. case 10:
  9812. _temp2 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, value.charCodeAt(0));
  9813. sto.insertStore("$", _temp2);
  9814. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9815. return _context4.abrupt("return", sto);
  9816. case 14:
  9817. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  9818. _context4.prev = 15;
  9819. result = parser.parseTerm();
  9820. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"])) {
  9821. _context4.next = 22;
  9822. break;
  9823. }
  9824. _temp3 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, result.value);
  9825. sto.insertStore("$", _temp3);
  9826. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9827. return _context4.abrupt("return", sto);
  9828. case 22:
  9829. _context4.next = 26;
  9830. break;
  9831. case 24:
  9832. _context4.prev = 24;
  9833. _context4.t1 = _context4["catch"](15);
  9834. case 26:
  9835. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.stringInfo();
  9836. typeInfo = typeStringInfoArray[0];
  9837. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  9838. case 29:
  9839. case "end":
  9840. return _context4.stop();
  9841. }
  9842. }
  9843. }, _callee4, null, [[15, 24]]);
  9844. }));
  9845. return function castIntFun(_x7, _x8) {
  9846. return _ref4.apply(this, arguments);
  9847. };
  9848. }();
  9849. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castIntFun)]);
  9850. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castInt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING]), 'val', false)], block);
  9851. return func;
  9852. }
  9853. function createCastBoolFun() {
  9854. var castBoolFun = /*#__PURE__*/function () {
  9855. var _ref5 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee5(sto, _) {
  9856. var str, value, parser, val, temp, typeStringInfoArray, typeInfo;
  9857. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  9858. while (1) {
  9859. switch (_context5.prev = _context5.next) {
  9860. case 0:
  9861. str = sto.applyStore("str");
  9862. value = str.get();
  9863. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  9864. _context5.prev = 3;
  9865. val = parser.parseTerm();
  9866. if (!(val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"])) {
  9867. _context5.next = 10;
  9868. break;
  9869. }
  9870. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, val.value);
  9871. sto.insertStore("$", temp);
  9872. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9873. return _context5.abrupt("return", sto);
  9874. case 10:
  9875. _context5.next = 14;
  9876. break;
  9877. case 12:
  9878. _context5.prev = 12;
  9879. _context5.t0 = _context5["catch"](3);
  9880. case 14:
  9881. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN.stringInfo();
  9882. typeInfo = typeStringInfoArray[0];
  9883. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  9884. case 17:
  9885. case "end":
  9886. return _context5.stop();
  9887. }
  9888. }
  9889. }, _callee5, null, [[3, 12]]);
  9890. }));
  9891. return function castBoolFun(_x9, _x10) {
  9892. return _ref5.apply(this, arguments);
  9893. };
  9894. }();
  9895. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castBoolFun)]);
  9896. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castBool', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
  9897. return func;
  9898. }
  9899. function createCastStringFun() {
  9900. var castStringFun = /*#__PURE__*/function () {
  9901. var _ref6 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee6(store, _) {
  9902. var val, result, temp;
  9903. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee6$(_context6) {
  9904. while (1) {
  9905. switch (_context6.prev = _context6.next) {
  9906. case 0:
  9907. val = store.applyStore('str');
  9908. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type);
  9909. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  9910. store.insertStore("$", temp);
  9911. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9912. return _context6.abrupt("return", store);
  9913. case 6:
  9914. case "end":
  9915. return _context6.stop();
  9916. }
  9917. }
  9918. }, _callee6);
  9919. }));
  9920. return function castStringFun(_x11, _x12) {
  9921. return _ref6.apply(this, arguments);
  9922. };
  9923. }();
  9924. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castStringFun)]);
  9925. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castString', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 'str', false)], block);
  9926. return func;
  9927. }
  9928. function createCastCharFun() {
  9929. var castCharFun = function castCharFun(store, _) {
  9930. var valSV = store.applyStore('charCode'); // Force the int value to the range [0, 255]
  9931. var value = valSV.get().toNumber() & 0xFF;
  9932. var result = String.fromCharCode(value);
  9933. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, result);
  9934. store.insertStore("$", temp);
  9935. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9936. return store;
  9937. };
  9938. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castCharFun)]);
  9939. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castChar', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, 'charCode', false)], block);
  9940. return func;
  9941. }
  9942. /***/ }),
  9943. /***/ "./js/processor/lib/math.js":
  9944. /*!**********************************!*\
  9945. !*** ./js/processor/lib/math.js ***!
  9946. \**********************************/
  9947. /*! exports provided: createSinFun, createCosFun, createTanFun, createSqrtFun, createPowFun, createLogFun, createAbsFun, createNegateFun, createInvertFun, createMaxFun, createMinFun, createRandFun, createSetSeedFun */
  9948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9949. "use strict";
  9950. __webpack_require__.r(__webpack_exports__);
  9951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSinFun", function() { return createSinFun; });
  9952. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCosFun", function() { return createCosFun; });
  9953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTanFun", function() { return createTanFun; });
  9954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSqrtFun", function() { return createSqrtFun; });
  9955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPowFun", function() { return createPowFun; });
  9956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLogFun", function() { return createLogFun; });
  9957. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAbsFun", function() { return createAbsFun; });
  9958. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNegateFun", function() { return createNegateFun; });
  9959. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInvertFun", function() { return createInvertFun; });
  9960. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMaxFun", function() { return createMaxFun; });
  9961. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMinFun", function() { return createMinFun; });
  9962. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRandFun", function() { return createRandFun; });
  9963. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSetSeedFun", function() { return createSetSeedFun; });
  9964. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  9965. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  9966. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9967. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  9968. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9969. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  9970. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9971. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9972. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__);
  9973. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9974. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  9975. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_6__);
  9976. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  9977. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__);
  9978. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  9979. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  9980. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9981. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_9__);
  9982. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9983. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  9984. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9985. /**
  9986. * sin
  9987. * cos
  9988. * tan
  9989. * sqrt
  9990. * pow
  9991. * log
  9992. * abs
  9993. * negate
  9994. * invert
  9995. * max
  9996. * min
  9997. */
  9998. function convertToRadians(degrees) {
  9999. return degrees.times(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].acos(-1)).div(180);
  10000. }
  10001. function createSinFun() {
  10002. var sinFun = /*#__PURE__*/function () {
  10003. var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(sto, _) {
  10004. var x, angle, result, temp;
  10005. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  10006. while (1) {
  10007. switch (_context.prev = _context.next) {
  10008. case 0:
  10009. x = sto.applyStore('x');
  10010. angle = x.get().mod(360);
  10011. result = null;
  10012. if (angle.eq(90)) {
  10013. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](1);
  10014. } else if (angle.eq(180)) {
  10015. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10016. } else if (angle.eq(270)) {
  10017. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10018. } else {
  10019. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].sin(convertToRadians(angle));
  10020. }
  10021. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10022. sto.insertStore("$", temp);
  10023. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10024. return _context.abrupt("return", sto);
  10025. case 8:
  10026. case "end":
  10027. return _context.stop();
  10028. }
  10029. }
  10030. }, _callee);
  10031. }));
  10032. return function sinFun(_x, _x2) {
  10033. return _ref.apply(this, arguments);
  10034. };
  10035. }();
  10036. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sinFun)]);
  10037. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$sin", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
  10038. return func;
  10039. }
  10040. function createCosFun() {
  10041. var cosFun = /*#__PURE__*/function () {
  10042. var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2(sto, _) {
  10043. var x, angle, result, temp;
  10044. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  10045. while (1) {
  10046. switch (_context2.prev = _context2.next) {
  10047. case 0:
  10048. x = sto.applyStore('x');
  10049. angle = x.get().mod(360);
  10050. result = null;
  10051. if (angle.eq(90)) {
  10052. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10053. } else if (angle.eq(180)) {
  10054. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10055. } else if (angle.eq(270)) {
  10056. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10057. }
  10058. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].cos(convertToRadians(angle));
  10059. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10060. sto.insertStore("$", temp);
  10061. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10062. return _context2.abrupt("return", sto);
  10063. case 9:
  10064. case "end":
  10065. return _context2.stop();
  10066. }
  10067. }
  10068. }, _callee2);
  10069. }));
  10070. return function cosFun(_x3, _x4) {
  10071. return _ref2.apply(this, arguments);
  10072. };
  10073. }();
  10074. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](cosFun)]);
  10075. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$cos", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
  10076. return func;
  10077. }
  10078. function createTanFun() {
  10079. var tanFun = /*#__PURE__*/function () {
  10080. var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee3(sto, _) {
  10081. var x, angle, result, temp;
  10082. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  10083. while (1) {
  10084. switch (_context3.prev = _context3.next) {
  10085. case 0:
  10086. x = sto.applyStore('x');
  10087. angle = x.get().mod(360);
  10088. if (!(angle.eq(90) || angle.eq(270))) {
  10089. _context3.next = 4;
  10090. break;
  10091. }
  10092. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].undefined_tanget_value(x.get().toNumber(), this.function_call_stack.pop());
  10093. case 4:
  10094. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].tan(convertToRadians(angle));
  10095. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10096. sto.insertStore("$", temp);
  10097. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10098. return _context3.abrupt("return", sto);
  10099. case 9:
  10100. case "end":
  10101. return _context3.stop();
  10102. }
  10103. }
  10104. }, _callee3, this);
  10105. }));
  10106. return function tanFun(_x5, _x6) {
  10107. return _ref3.apply(this, arguments);
  10108. };
  10109. }();
  10110. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](tanFun)]);
  10111. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$tan", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
  10112. return func;
  10113. }
  10114. function createSqrtFun() {
  10115. var sqrtFun = /*#__PURE__*/function () {
  10116. var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee4(sto, _) {
  10117. var x, result, temp;
  10118. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  10119. while (1) {
  10120. switch (_context4.prev = _context4.next) {
  10121. case 0:
  10122. x = sto.applyStore('x');
  10123. if (!x.get().isNeg()) {
  10124. _context4.next = 3;
  10125. break;
  10126. }
  10127. return _context4.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_sqrt_value(this.function_call_stack.pop())));
  10128. case 3:
  10129. result = x.get().sqrt();
  10130. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10131. sto.insertStore("$", temp);
  10132. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10133. return _context4.abrupt("return", sto);
  10134. case 8:
  10135. case "end":
  10136. return _context4.stop();
  10137. }
  10138. }
  10139. }, _callee4, this);
  10140. }));
  10141. return function sqrtFun(_x7, _x8) {
  10142. return _ref4.apply(this, arguments);
  10143. };
  10144. }();
  10145. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sqrtFun)]);
  10146. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$sqrt", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
  10147. return func;
  10148. }
  10149. function createPowFun() {
  10150. var powFun = /*#__PURE__*/function () {
  10151. var _ref5 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee5(sto, _) {
  10152. var x, y, result, temp;
  10153. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  10154. while (1) {
  10155. switch (_context5.prev = _context5.next) {
  10156. case 0:
  10157. x = sto.applyStore('x');
  10158. y = sto.applyStore('y');
  10159. result = x.get().pow(y.get());
  10160. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10161. sto.insertStore("$", temp);
  10162. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10163. return _context5.abrupt("return", sto);
  10164. case 7:
  10165. case "end":
  10166. return _context5.stop();
  10167. }
  10168. }
  10169. }, _callee5);
  10170. }));
  10171. return function powFun(_x9, _x10) {
  10172. return _ref5.apply(this, arguments);
  10173. };
  10174. }();
  10175. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](powFun)]);
  10176. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$pow", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false), new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "y", false)], block);
  10177. return func;
  10178. }
  10179. function createLogFun() {
  10180. var logFun = /*#__PURE__*/function () {
  10181. var _ref6 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee6(sto, _) {
  10182. var x, result, temp;
  10183. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  10184. while (1) {
  10185. switch (_context6.prev = _context6.next) {
  10186. case 0:
  10187. x = sto.applyStore('x');
  10188. if (!x.get().isNegative()) {
  10189. _context6.next = 3;
  10190. break;
  10191. }
  10192. return _context6.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_log_value(this.function_call_stack.pop())));
  10193. case 3:
  10194. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].log10(x.get());
  10195. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10196. sto.insertStore("$", temp);
  10197. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10198. return _context6.abrupt("return", sto);
  10199. case 8:
  10200. case "end":
  10201. return _context6.stop();
  10202. }
  10203. }
  10204. }, _callee6, this);
  10205. }));
  10206. return function logFun(_x11, _x12) {
  10207. return _ref6.apply(this, arguments);
  10208. };
  10209. }();
  10210. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](logFun)]);
  10211. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$log", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
  10212. return func;
  10213. }
  10214. function createAbsFun() {
  10215. var absFun = /*#__PURE__*/function () {
  10216. var _ref7 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee7(sto, _) {
  10217. var x, result, temp;
  10218. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  10219. while (1) {
  10220. switch (_context7.prev = _context7.next) {
  10221. case 0:
  10222. x = sto.applyStore('x');
  10223. result = x.get().abs();
  10224. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10225. sto.insertStore("$", temp);
  10226. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10227. return _context7.abrupt("return", sto);
  10228. case 6:
  10229. case "end":
  10230. return _context7.stop();
  10231. }
  10232. }
  10233. }, _callee7);
  10234. }));
  10235. return function absFun(_x13, _x14) {
  10236. return _ref7.apply(this, arguments);
  10237. };
  10238. }();
  10239. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](absFun)]);
  10240. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$abs", new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
  10241. return func;
  10242. }
  10243. function createNegateFun() {
  10244. var negateFun = /*#__PURE__*/function () {
  10245. var _ref8 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee8(sto, _) {
  10246. var x, result, temp;
  10247. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  10248. while (1) {
  10249. switch (_context8.prev = _context8.next) {
  10250. case 0:
  10251. x = sto.applyStore('x');
  10252. result = x.get().negated();
  10253. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10254. sto.insertStore("$", temp);
  10255. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10256. return _context8.abrupt("return", sto);
  10257. case 6:
  10258. case "end":
  10259. return _context8.stop();
  10260. }
  10261. }
  10262. }, _callee8);
  10263. }));
  10264. return function negateFun(_x15, _x16) {
  10265. return _ref8.apply(this, arguments);
  10266. };
  10267. }();
  10268. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](negateFun)]);
  10269. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$negate", new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
  10270. return func;
  10271. }
  10272. function createInvertFun() {
  10273. var invertFun = /*#__PURE__*/function () {
  10274. var _ref9 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee9(sto, _) {
  10275. var x, result, temp;
  10276. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  10277. while (1) {
  10278. switch (_context9.prev = _context9.next) {
  10279. case 0:
  10280. x = sto.applyStore('x');
  10281. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__["toReal"](1).dividedBy(x.get());
  10282. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10283. sto.insertStore("$", temp);
  10284. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10285. return _context9.abrupt("return", sto);
  10286. case 6:
  10287. case "end":
  10288. return _context9.stop();
  10289. }
  10290. }
  10291. }, _callee9);
  10292. }));
  10293. return function invertFun(_x17, _x18) {
  10294. return _ref9.apply(this, arguments);
  10295. };
  10296. }();
  10297. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](invertFun)]);
  10298. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$invert", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
  10299. return func;
  10300. }
  10301. function createMaxFun() {
  10302. var maxFun = /*#__PURE__*/function () {
  10303. var _ref10 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee10(sto, _) {
  10304. var x, numbers, result, temp;
  10305. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  10306. while (1) {
  10307. switch (_context10.prev = _context10.next) {
  10308. case 0:
  10309. x = sto.applyStore('x');
  10310. numbers = x.get().map(function (sto_addrs) {
  10311. return sto_addrs.get();
  10312. });
  10313. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].max.apply(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"], _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(numbers));
  10314. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10315. sto.insertStore("$", temp);
  10316. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10317. return _context10.abrupt("return", sto);
  10318. case 7:
  10319. case "end":
  10320. return _context10.stop();
  10321. }
  10322. }
  10323. }, _callee10);
  10324. }));
  10325. return function maxFun(_x19, _x20) {
  10326. return _ref10.apply(this, arguments);
  10327. };
  10328. }();
  10329. var paramType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), 1);
  10330. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](maxFun)]);
  10331. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$max", new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](paramType, "x", false)], block);
  10332. return func;
  10333. }
  10334. function createMinFun() {
  10335. var minFun = /*#__PURE__*/function () {
  10336. var _ref11 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee11(sto, _) {
  10337. var x, numbers, result, temp;
  10338. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  10339. while (1) {
  10340. switch (_context11.prev = _context11.next) {
  10341. case 0:
  10342. x = sto.applyStore('x');
  10343. numbers = x.get().map(function (sto_addrs) {
  10344. return sto_addrs.get();
  10345. });
  10346. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].min.apply(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"], _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(numbers));
  10347. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10348. sto.insertStore("$", temp);
  10349. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10350. return _context11.abrupt("return", sto);
  10351. case 7:
  10352. case "end":
  10353. return _context11.stop();
  10354. }
  10355. }
  10356. }, _callee11);
  10357. }));
  10358. return function minFun(_x21, _x22) {
  10359. return _ref11.apply(this, arguments);
  10360. };
  10361. }();
  10362. var paramType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), 1);
  10363. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](minFun)]);
  10364. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$min", new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](paramType, "x", false)], block);
  10365. return func;
  10366. }
  10367. var seed = Date.now();
  10368. function createRandFun() {
  10369. var a = 16807;
  10370. var m = 2147483647;
  10371. var c = 12345;
  10372. var randFun = /*#__PURE__*/function () {
  10373. var _ref12 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee12(sto, _) {
  10374. var val, temp;
  10375. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  10376. while (1) {
  10377. switch (_context12.prev = _context12.next) {
  10378. case 0:
  10379. seed = (a * seed + c) % m;
  10380. val = seed / (m - 1);
  10381. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](val));
  10382. sto.insertStore("$", temp);
  10383. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10384. return _context12.abrupt("return", sto);
  10385. case 6:
  10386. case "end":
  10387. return _context12.stop();
  10388. }
  10389. }
  10390. }, _callee12);
  10391. }));
  10392. return function randFun(_x23, _x24) {
  10393. return _ref12.apply(this, arguments);
  10394. };
  10395. }();
  10396. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](randFun)]);
  10397. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$rand", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [], block);
  10398. return func;
  10399. }
  10400. function createSetSeedFun() {
  10401. var setSeedFun = /*#__PURE__*/function () {
  10402. var _ref13 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee13(sto, _) {
  10403. var value;
  10404. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  10405. while (1) {
  10406. switch (_context13.prev = _context13.next) {
  10407. case 0:
  10408. value = sto.applyStore("x");
  10409. seed = value.get().toNumber();
  10410. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10411. return _context13.abrupt("return", sto);
  10412. case 4:
  10413. case "end":
  10414. return _context13.stop();
  10415. }
  10416. }
  10417. }, _callee13);
  10418. }));
  10419. return function setSeedFun(_x25, _x26) {
  10420. return _ref13.apply(this, arguments);
  10421. };
  10422. }();
  10423. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](setSeedFun)]);
  10424. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$setSeed", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].VOID, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, "x", false)], block);
  10425. return func;
  10426. }
  10427. /***/ }),
  10428. /***/ "./js/processor/lib/strings.js":
  10429. /*!*************************************!*\
  10430. !*** ./js/processor/lib/strings.js ***!
  10431. \*************************************/
  10432. /*! exports provided: createSubstringFun, createLengthFun, createUppercaseFun, createLowercaseFun, createrCharAtFun */
  10433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10434. "use strict";
  10435. __webpack_require__.r(__webpack_exports__);
  10436. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSubstringFun", function() { return createSubstringFun; });
  10437. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLengthFun", function() { return createLengthFun; });
  10438. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUppercaseFun", function() { return createUppercaseFun; });
  10439. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLowercaseFun", function() { return createLowercaseFun; });
  10440. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createrCharAtFun", function() { return createrCharAtFun; });
  10441. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10442. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  10443. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10444. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  10445. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10446. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10447. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  10448. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10449. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10450. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_5__);
  10451. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10452. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_6__);
  10453. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10454. /*
  10455. * substring
  10456. * length
  10457. * uppercase
  10458. * lowercase
  10459. * charAt
  10460. **/
  10461. function createSubstringFun() {
  10462. var substringFun = /*#__PURE__*/function () {
  10463. var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(sto, _) {
  10464. var str, start, end, result, temp;
  10465. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  10466. while (1) {
  10467. switch (_context.prev = _context.next) {
  10468. case 0:
  10469. str = sto.applyStore("str");
  10470. start = sto.applyStore("start");
  10471. end = sto.applyStore("end");
  10472. result = str.get().substring(start.get(), end.get());
  10473. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  10474. sto.insertStore("$", temp);
  10475. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10476. return _context.abrupt("return", sto);
  10477. case 8:
  10478. case "end":
  10479. return _context.stop();
  10480. }
  10481. }
  10482. }, _callee);
  10483. }));
  10484. return function substringFun(_x, _x2) {
  10485. return _ref.apply(this, arguments);
  10486. };
  10487. }();
  10488. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](substringFun)]);
  10489. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$substring', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, 'start', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, 'end', false)], block);
  10490. return func;
  10491. }
  10492. function createLengthFun() {
  10493. var lengthFun = /*#__PURE__*/function () {
  10494. var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(sto, _) {
  10495. var str, temp;
  10496. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  10497. while (1) {
  10498. switch (_context2.prev = _context2.next) {
  10499. case 0:
  10500. str = sto.applyStore("str");
  10501. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(str.value.length));
  10502. sto.insertStore("$", temp);
  10503. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10504. return _context2.abrupt("return", sto);
  10505. case 5:
  10506. case "end":
  10507. return _context2.stop();
  10508. }
  10509. }
  10510. }, _callee2);
  10511. }));
  10512. return function lengthFun(_x3, _x4) {
  10513. return _ref2.apply(this, arguments);
  10514. };
  10515. }();
  10516. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lengthFun)]);
  10517. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$length', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
  10518. return func;
  10519. }
  10520. function createUppercaseFun() {
  10521. var uppercaseFun = /*#__PURE__*/function () {
  10522. var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(sto, _) {
  10523. var str, temp;
  10524. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  10525. while (1) {
  10526. switch (_context3.prev = _context3.next) {
  10527. case 0:
  10528. str = sto.applyStore("str");
  10529. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toUpperCase());
  10530. sto.insertStore("$", temp);
  10531. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10532. return _context3.abrupt("return", sto);
  10533. case 5:
  10534. case "end":
  10535. return _context3.stop();
  10536. }
  10537. }
  10538. }, _callee3);
  10539. }));
  10540. return function uppercaseFun(_x5, _x6) {
  10541. return _ref3.apply(this, arguments);
  10542. };
  10543. }();
  10544. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](uppercaseFun)]);
  10545. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$uppercase', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
  10546. return func;
  10547. }
  10548. function createLowercaseFun() {
  10549. var lowercaseFun = /*#__PURE__*/function () {
  10550. var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee4(sto, _) {
  10551. var str, temp;
  10552. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  10553. while (1) {
  10554. switch (_context4.prev = _context4.next) {
  10555. case 0:
  10556. str = sto.applyStore("str");
  10557. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toLowerCase());
  10558. sto.insertStore("$", temp);
  10559. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10560. return _context4.abrupt("return", sto);
  10561. case 5:
  10562. case "end":
  10563. return _context4.stop();
  10564. }
  10565. }
  10566. }, _callee4);
  10567. }));
  10568. return function lowercaseFun(_x7, _x8) {
  10569. return _ref4.apply(this, arguments);
  10570. };
  10571. }();
  10572. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lowercaseFun)]);
  10573. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$lowercase', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
  10574. return func;
  10575. }
  10576. function createrCharAtFun() {
  10577. var charAtFun = /*#__PURE__*/function () {
  10578. var _ref5 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee5(sto, _) {
  10579. var str, idx, temp;
  10580. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  10581. while (1) {
  10582. switch (_context5.prev = _context5.next) {
  10583. case 0:
  10584. str = sto.applyStore("str");
  10585. idx = sto.applyStore("index");
  10586. if (!(idx.get().toNumber() < 0 || idx.get().toNumber() >= str.get().length)) {
  10587. _context5.next = 4;
  10588. break;
  10589. }
  10590. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__["ProcessorErrorFactory"].invalid_string_index(idx.get().toNumber(), str.get(), this.function_call_stack.pop());
  10591. case 4:
  10592. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, str.get().charAt(idx.get().toNumber()));
  10593. sto.insertStore("$", temp);
  10594. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10595. return _context5.abrupt("return", sto);
  10596. case 8:
  10597. case "end":
  10598. return _context5.stop();
  10599. }
  10600. }
  10601. }, _callee5, this);
  10602. }));
  10603. return function charAtFun(_x9, _x10) {
  10604. return _ref5.apply(this, arguments);
  10605. };
  10606. }();
  10607. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](charAtFun)]);
  10608. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$charAt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, 'index', false)], block);
  10609. return func;
  10610. }
  10611. /***/ }),
  10612. /***/ "./js/processor/modes.ts":
  10613. /*!*******************************!*\
  10614. !*** ./js/processor/modes.ts ***!
  10615. \*******************************/
  10616. /*! no static exports found */
  10617. /***/ (function(module, exports, __webpack_require__) {
  10618. "use strict";
  10619. Object.defineProperty(exports, "__esModule", { value: true });
  10620. exports.Modes = void 0;
  10621. exports.Modes = Object.freeze({
  10622. RETURN: Symbol('mode:return'),
  10623. BREAK: Symbol('mode:break'),
  10624. PAUSE: Symbol('mode:pause'),
  10625. RUN: Symbol('mode:run'),
  10626. ABORT: Symbol('mode:abort')
  10627. });
  10628. /***/ }),
  10629. /***/ "./js/processor/semantic/semanticAnalyser.js":
  10630. /*!***************************************************!*\
  10631. !*** ./js/processor/semantic/semanticAnalyser.js ***!
  10632. \***************************************************/
  10633. /*! exports provided: SemanticAnalyser */
  10634. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10635. "use strict";
  10636. __webpack_require__.r(__webpack_exports__);
  10637. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticAnalyser", function() { return SemanticAnalyser; });
  10638. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  10639. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  10640. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  10641. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  10642. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10643. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../definedFunctions */ "./js/processor/definedFunctions.js");
  10644. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../services/languageService */ "./js/services/languageService.js");
  10645. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/commands */ "./js/ast/commands/index.js");
  10646. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  10647. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  10648. /* harmony import */ var _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ast/expressions/literal */ "./js/ast/expressions/literal.js");
  10649. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../compatibilityTable */ "./js/processor/compatibilityTable.ts");
  10650. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__);
  10651. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  10652. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__);
  10653. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  10654. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__);
  10655. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  10656. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__);
  10657. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
  10658. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_13__);
  10659. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../store/store */ "./js/processor/store/store.ts");
  10660. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_14__);
  10661. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  10662. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  10663. var SemanticAnalyser = /*#__PURE__*/function () {
  10664. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, null, [{
  10665. key: "analyseFromSource",
  10666. value: function analyseFromSource(stringCode) {
  10667. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__["IVProgParser"].createParser(stringCode);
  10668. var semantic = new SemanticAnalyser(parser.parseTree());
  10669. return semantic.analyseTree();
  10670. }
  10671. }]);
  10672. function SemanticAnalyser(ast) {
  10673. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticAnalyser);
  10674. this.ast = ast;
  10675. this.lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_4__["LanguageService"].getCurrentLexer();
  10676. var lexer = new this.lexerClass(null);
  10677. this.literalNames = lexer.literalNames;
  10678. this.symbolMap = null;
  10679. this.currentFunction = null;
  10680. }
  10681. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, [{
  10682. key: "pushMap",
  10683. value: function pushMap() {
  10684. if (this.symbolMap === null) {
  10685. this.symbolMap = {
  10686. map: {},
  10687. next: null
  10688. };
  10689. } else {
  10690. var n = {
  10691. map: {},
  10692. next: this.symbolMap
  10693. };
  10694. this.symbolMap = n;
  10695. }
  10696. }
  10697. }, {
  10698. key: "popMap",
  10699. value: function popMap() {
  10700. if (this.symbolMap !== null) {
  10701. this.symbolMap = this.symbolMap.next;
  10702. }
  10703. }
  10704. }, {
  10705. key: "insertSymbol",
  10706. value: function insertSymbol(id, typeInfo) {
  10707. this.symbolMap.map[id] = typeInfo;
  10708. }
  10709. }, {
  10710. key: "findSymbol",
  10711. value: function findSymbol(id, symbol_map) {
  10712. if (!symbol_map.map[id]) {
  10713. if (symbol_map.next) {
  10714. return this.findSymbol(id, symbol_map.next);
  10715. }
  10716. return null;
  10717. } else {
  10718. return symbol_map.map[id];
  10719. }
  10720. }
  10721. }, {
  10722. key: "getMainFunction",
  10723. value: function getMainFunction() {
  10724. return this.ast.functions.find(function (v) {
  10725. return v.isMain;
  10726. });
  10727. }
  10728. }, {
  10729. key: "findFunction",
  10730. value: function findFunction(name) {
  10731. if (name.match(/^\$.+$/)) {
  10732. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getFunction(name);
  10733. if (!fun) {
  10734. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].not_implemented(name);
  10735. }
  10736. return fun;
  10737. } else {
  10738. var val = this.ast.functions.find(function (v) {
  10739. return v.name === name;
  10740. });
  10741. if (!val) {
  10742. return null;
  10743. }
  10744. return val;
  10745. }
  10746. }
  10747. }, {
  10748. key: "analyseTree",
  10749. value: function analyseTree() {
  10750. var globalVars = this.ast.global;
  10751. this.pushMap();
  10752. this.assertDeclarations(globalVars);
  10753. var functions = this.ast.functions;
  10754. var mainFunc = functions.filter(function (f) {
  10755. return f.name === null;
  10756. });
  10757. if (mainFunc.length <= 0) {
  10758. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].main_missing();
  10759. }
  10760. for (var i = 0; i < functions.length; i++) {
  10761. var fun = functions[i];
  10762. this.assertFunction(fun);
  10763. }
  10764. return this.ast;
  10765. }
  10766. }, {
  10767. key: "assertDeclarations",
  10768. value: function assertDeclarations(list) {
  10769. for (var i = 0; i < list.length; i++) {
  10770. this.assertDeclaration(list[i]);
  10771. }
  10772. }
  10773. }, {
  10774. key: "assertDeclaration",
  10775. value: function assertDeclaration(declaration) {
  10776. if (declaration instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]) {
  10777. this.assertArrayDeclaration(declaration);
  10778. this.insertSymbol(declaration.id, {
  10779. id: declaration.id,
  10780. lines: declaration.lines,
  10781. columns: declaration.columns,
  10782. type: declaration.type,
  10783. isConst: declaration.isConst
  10784. });
  10785. } else {
  10786. if (declaration.initial === null) {
  10787. this.insertSymbol(declaration.id, {
  10788. id: declaration.id,
  10789. type: declaration.type,
  10790. isConst: declaration.isConst
  10791. });
  10792. return;
  10793. }
  10794. var resultType = this.evaluateExpressionType(declaration.initial);
  10795. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  10796. if (!resultType.isCompatible(declaration.type)) {
  10797. var stringInfo = declaration.type.stringInfo();
  10798. var info = stringInfo[0];
  10799. var result_string_info = resultType.stringInfo();
  10800. var result_info = result_string_info[0];
  10801. var exp = declaration.initial;
  10802. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, result_info.type, result_info.dim, exp.toString(), declaration.sourceInfo);
  10803. }
  10804. this.insertSymbol(declaration.id, {
  10805. id: declaration.id,
  10806. type: declaration.type,
  10807. isConst: declaration.isConst
  10808. });
  10809. } else if (!declaration.type.isCompatible(resultType) && !_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !declaration.type.isCompatible(resultType) && _util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(declaration.type, resultType)) {
  10810. var _stringInfo = declaration.type.stringInfo();
  10811. var _info = _stringInfo[0];
  10812. var _result_string_info = resultType.stringInfo();
  10813. var _result_info = _result_string_info[0];
  10814. var _exp = declaration.initial;
  10815. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(_info.type, _info.dim, _result_info.type, _result_info.dim, _exp.toString(), declaration.sourceInfo);
  10816. } else {
  10817. this.insertSymbol(declaration.id, {
  10818. id: declaration.id,
  10819. type: declaration.type,
  10820. isConst: declaration.isConst
  10821. });
  10822. }
  10823. }
  10824. }
  10825. }, {
  10826. key: "assertArrayDeclaration",
  10827. value: function assertArrayDeclaration(declaration) {
  10828. if (declaration.initial === null) {
  10829. var lineType = this.evaluateExpressionType(declaration.lines);
  10830. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  10831. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  10832. }
  10833. if (declaration.columns !== null) {
  10834. var columnType = this.evaluateExpressionType(declaration.columns);
  10835. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  10836. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  10837. }
  10838. }
  10839. } else {
  10840. this.evaluateArrayLiteral(declaration);
  10841. }
  10842. this.insertSymbol(declaration.id, {
  10843. id: declaration.id,
  10844. lines: declaration.lines,
  10845. columns: declaration.columns,
  10846. type: declaration.type
  10847. });
  10848. return;
  10849. }
  10850. }, {
  10851. key: "evaluateExpressionType",
  10852. value: function evaluateExpressionType(expression) {
  10853. // TODO: Throw operator error in case type == UNDEFINED
  10854. if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["UnaryApp"]) {
  10855. var op = expression.op;
  10856. var resultType = this.evaluateExpressionType(expression.left);
  10857. var finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterUnaryOp"])(op, resultType);
  10858. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(finalResult)) {
  10859. var stringInfo = resultType.stringInfo();
  10860. var info = stringInfo[0];
  10861. var expString = expression.toString();
  10862. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_unary_op_full(expString, op, info.type, info.dim, expression.sourceInfo);
  10863. }
  10864. return finalResult;
  10865. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["InfixApp"]) {
  10866. var _op = expression.op;
  10867. var resultTypeLeft = this.evaluateExpressionType(expression.left);
  10868. var resultTypeRight = this.evaluateExpressionType(expression.right);
  10869. var _finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterInfixOp"])(_op, resultTypeLeft, resultTypeRight);
  10870. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(_finalResult)) {
  10871. var stringInfoLeft = resultTypeLeft.stringInfo();
  10872. var infoLeft = stringInfoLeft[0];
  10873. var stringInfoRight = resultTypeRight.stringInfo();
  10874. var infoRight = stringInfoRight[0];
  10875. var _expString = expression.toString();
  10876. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_infix_op_full(_expString, _op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, expression.sourceInfo);
  10877. }
  10878. return _finalResult;
  10879. } else if (expression instanceof _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__["Literal"]) {
  10880. return this.evaluateLiteralType(expression);
  10881. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  10882. if (expression.isMainCall) {
  10883. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName(), expression.sourceInfo);
  10884. }
  10885. var fun = this.findFunction(expression.id);
  10886. if (fun === null) {
  10887. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(expression.id, expression.sourceInfo);
  10888. }
  10889. if (fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  10890. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(expression.id, expression.sourceInfo);
  10891. }
  10892. this.assertParameters(fun, expression.actualParameters);
  10893. return fun.returnType;
  10894. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"]) {
  10895. var arrayTypeInfo = this.findSymbol(expression.id, this.symbolMap);
  10896. if (arrayTypeInfo === null) {
  10897. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(expression.id, expression.sourceInfo);
  10898. }
  10899. if (!(arrayTypeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  10900. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(expression.id, expression.sourceInfo);
  10901. }
  10902. var lineType = this.evaluateExpressionType(expression.line);
  10903. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  10904. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  10905. }
  10906. if (expression.column !== null) {
  10907. if (arrayTypeInfo.columns === null) {
  10908. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(expression.id, expression.sourceInfo);
  10909. }
  10910. var columnType = this.evaluateExpressionType(expression.column);
  10911. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  10912. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  10913. }
  10914. }
  10915. var arrType = arrayTypeInfo.type;
  10916. if (expression.column !== null) {
  10917. // indexing matrix
  10918. return arrType.innerType;
  10919. } else {
  10920. if (arrayTypeInfo.columns === null) {
  10921. return arrType.innerType;
  10922. }
  10923. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](arrType.innerType, 1);
  10924. }
  10925. }
  10926. }
  10927. }, {
  10928. key: "evaluateLiteralType",
  10929. value: function evaluateLiteralType(literal) {
  10930. if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["IntLiteral"]) {
  10931. return literal.type;
  10932. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["RealLiteral"]) {
  10933. return literal.type;
  10934. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["StringLiteral"]) {
  10935. return literal.type;
  10936. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["BoolLiteral"]) {
  10937. return literal.type;
  10938. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["CharLiteral"]) {
  10939. return literal.type;
  10940. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  10941. var typeInfo = this.findSymbol(literal.id, this.symbolMap);
  10942. if (typeInfo === null) {
  10943. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(literal.id, literal.sourceInfo);
  10944. }
  10945. if (typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  10946. return typeInfo.type;
  10947. }
  10948. return typeInfo.type;
  10949. } else {
  10950. // console.warn("Evaluating type only for an array literal...");
  10951. var last = null;
  10952. if (literal.value.length === 1) {
  10953. last = this.evaluateExpressionType(literal.value[0]);
  10954. } else {
  10955. for (var i = 0; i < literal.value.length; i++) {
  10956. var e = this.evaluateExpressionType(literal.value[i]);
  10957. if (last === null) {
  10958. last = e;
  10959. } else if (!last.isCompatible(e)) {
  10960. var strInfo = last.stringInfo();
  10961. var info = strInfo[0];
  10962. var strExp = literal.toString();
  10963. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_array_full(strExp, info.type, info.dim, literal.sourceInfo);
  10964. }
  10965. }
  10966. }
  10967. if (last instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  10968. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last.innerType, last.dimensions + 1);
  10969. }
  10970. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last, 1);
  10971. }
  10972. }
  10973. }, {
  10974. key: "evaluateArrayLiteral",
  10975. value: function evaluateArrayLiteral(arrayDeclaration) {
  10976. var type = arrayDeclaration.type;
  10977. var literal = arrayDeclaration.initial; // console.log(arrayDeclaration);
  10978. if (arrayDeclaration.isVector) {
  10979. this.evaluateVectorLiteralType(literal, type);
  10980. } else {
  10981. // TODO matrix type check
  10982. for (var i = 0; i < literal.lines; ++i) {
  10983. var line_literal = literal.value[i];
  10984. this.evaluateVectorLiteralType(line_literal, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](type.innerType, 1));
  10985. }
  10986. }
  10987. return true;
  10988. }
  10989. }, {
  10990. key: "assertFunction",
  10991. value: function assertFunction(fun) {
  10992. var _this = this;
  10993. this.pushMap();
  10994. this.currentFunction = fun;
  10995. fun.formalParameters.forEach(function (formalParam) {
  10996. if (formalParam.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  10997. if (formalParam.type.dimensions > 1) {
  10998. _this.insertSymbol(formalParam.id, {
  10999. id: formalParam.id,
  11000. lines: -1,
  11001. columns: -1,
  11002. type: formalParam.type
  11003. });
  11004. } else {
  11005. _this.insertSymbol(formalParam.id, {
  11006. id: formalParam.id,
  11007. lines: -1,
  11008. columns: null,
  11009. type: formalParam.type
  11010. });
  11011. }
  11012. } else {
  11013. _this.insertSymbol(formalParam.id, {
  11014. id: formalParam.id,
  11015. type: formalParam.type
  11016. });
  11017. }
  11018. });
  11019. this.assertDeclarations(fun.variablesDeclarations);
  11020. var optional = fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID);
  11021. var valid = this.assertReturn(fun, optional);
  11022. if (!valid) {
  11023. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_no_return(fun.name);
  11024. }
  11025. this.popMap();
  11026. }
  11027. }, {
  11028. key: "assertReturn",
  11029. value: function assertReturn(fun, optional) {
  11030. var _this2 = this;
  11031. return fun.commands.reduce(function (last, next) {
  11032. return _this2.checkCommand(fun.returnType, next, optional) || last;
  11033. }, optional);
  11034. }
  11035. }, {
  11036. key: "checkCommand",
  11037. value: function checkCommand(type, cmd, optional) {
  11038. if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["While"]) {
  11039. var resultType = this.evaluateExpressionType(cmd.expression);
  11040. if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11041. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  11042. }
  11043. this.checkCommands(type, cmd.commands, optional);
  11044. return false;
  11045. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["For"]) {
  11046. var var_type = this.evaluateExpressionType(cmd.for_id);
  11047. if (!var_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11048. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_variable(cmd.for_id, cmd.sourceInfo);
  11049. }
  11050. var from_type = this.evaluateExpressionType(cmd.for_from);
  11051. if (!from_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11052. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_from(cmd.for_from, cmd.sourceInfo);
  11053. }
  11054. var to_type = this.evaluateExpressionType(cmd.for_to);
  11055. if (!to_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11056. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_to(cmd.for_to, cmd.sourceInfo);
  11057. }
  11058. if (cmd.for_pass != null) {
  11059. var pass_type = this.evaluateExpressionType(cmd.for_pass);
  11060. if (!pass_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11061. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_pass(cmd.for_pass, cmd.sourceInfo);
  11062. }
  11063. }
  11064. this.checkCommands(type, cmd.commands, optional);
  11065. return false;
  11066. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Switch"]) {
  11067. var sType = this.evaluateExpressionType(cmd.expression);
  11068. var result = optional;
  11069. var hasDefault = false;
  11070. for (var i = 0; i < cmd.cases.length; i++) {
  11071. var aCase = cmd.cases[i];
  11072. if (aCase.expression !== null) {
  11073. var caseType = this.evaluateExpressionType(aCase.expression);
  11074. if (!sType.isCompatible(caseType)) {
  11075. var strInfo = sType.stringInfo();
  11076. var info = strInfo[0];
  11077. var strExp = aCase.expression.toString();
  11078. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_case_type_full(strExp, info.type, info.dim, aCase.sourceInfo);
  11079. }
  11080. } else {
  11081. hasDefault = true;
  11082. }
  11083. result = result && this.checkCommands(type, aCase.commands, result);
  11084. }
  11085. return result && hasDefault;
  11086. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayIndexAssign"]) {
  11087. // TODO - rework!!!!!
  11088. var used_dims = 0;
  11089. var typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11090. if (typeInfo === null) {
  11091. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11092. }
  11093. if (typeInfo.isConst) {
  11094. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11095. }
  11096. if (!(typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11097. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  11098. }
  11099. var exp = cmd.expression;
  11100. var lineExp = cmd.line;
  11101. var lineType = this.evaluateExpressionType(lineExp);
  11102. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11103. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11104. }
  11105. used_dims += 1;
  11106. var columnExp = cmd.column;
  11107. if (typeInfo.columns === null && columnExp !== null) {
  11108. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(cmd.id, cmd.sourceInfo);
  11109. } else if (columnExp !== null) {
  11110. var columnType = this.evaluateExpressionType(columnExp);
  11111. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11112. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11113. }
  11114. used_dims += 1;
  11115. } // exp a single value exp or an array access
  11116. var exp_type = this.evaluateExpressionType(exp);
  11117. var access_type = typeInfo.type;
  11118. var compatible = false;
  11119. if (exp_type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11120. var _type = access_type;
  11121. if (access_type.dimensions - used_dims == 0) {
  11122. _type = access_type.innerType;
  11123. } else {
  11124. _type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](access_type.innerType, Math.max(0, access_type.dimensions - used_dims));
  11125. }
  11126. compatible = exp_type.isCompatible(_type);
  11127. } else {
  11128. compatible = access_type.canAccept(exp_type, used_dims);
  11129. }
  11130. if (!compatible) {
  11131. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(access_type, exp_type)) {
  11132. var access_type_string_info = access_type.stringInfo();
  11133. var access_type_info = access_type_string_info[0];
  11134. var exp_type_string_info = exp_type.stringInfo();
  11135. var exp_type_info = exp_type_string_info[0];
  11136. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(access_type_info.type, access_type_info.dim - used_dims, exp_type_info.type, exp_type_info.dim, exp.toString(), cmd.sourceInfo);
  11137. }
  11138. }
  11139. return optional;
  11140. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Assign"]) {
  11141. // TODO - rework since there is no literal array assignment
  11142. var _typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11143. if (_typeInfo === null) {
  11144. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11145. }
  11146. if (_typeInfo.isConst) {
  11147. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11148. }
  11149. var _exp2 = cmd.expression;
  11150. var _exp_type = this.evaluateExpressionType(_exp2);
  11151. if (_exp_type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11152. if (!(_typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11153. // TODO better error message
  11154. throw new Error("Cannot assign an array to a non-array variable ");
  11155. } // Both are arrays...
  11156. // if both don't have same dimensions and type, cannot perform assignment
  11157. if (!_exp_type.isCompatible(_typeInfo.type)) {
  11158. if (_exp_type.dimensions === _typeInfo.type.dimensions && !_exp_type.innerType.isCompatible(_typeInfo.type.innerType)) {
  11159. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(_typeInfo.type.innerType, _exp_type.innerType)) {
  11160. var stringInfo = _typeInfo.type.stringInfo();
  11161. var _info2 = stringInfo[0];
  11162. var _exp_type_string_info = _exp_type.stringInfo();
  11163. var _exp_type_info = _exp_type_string_info[0];
  11164. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(_info2.type, _info2.dim, _exp_type_info.type, _exp_type_info.dim, _exp2.toString(), cmd.sourceInfo);
  11165. }
  11166. } else {
  11167. switch (_exp_type.dimensions) {
  11168. case 1:
  11169. {
  11170. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].vector_to_matrix_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11171. }
  11172. case 2:
  11173. {
  11174. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].matrix_to_vector_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11175. }
  11176. }
  11177. }
  11178. }
  11179. } else if (!_exp_type.isCompatible(_typeInfo.type)) {
  11180. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(_typeInfo.type, _exp_type)) {
  11181. var _stringInfo2 = _typeInfo.type.stringInfo();
  11182. var _info3 = _stringInfo2[0];
  11183. var _exp_type_string_info2 = _exp_type.stringInfo();
  11184. var _exp_type_info2 = _exp_type_string_info2[0];
  11185. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(_info3.type, _info3.dim, _exp_type_info2.type, _exp_type_info2.dim, _exp2.toString(), cmd.sourceInfo);
  11186. }
  11187. }
  11188. return optional;
  11189. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Break"]) {
  11190. return optional;
  11191. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11192. var _resultType = this.evaluateExpressionType(cmd.condition);
  11193. if (!_resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11194. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  11195. }
  11196. if (cmd.ifFalse instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11197. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommand(type, cmd.ifFalse, optional);
  11198. } else if (cmd.ifFalse != null) {
  11199. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommands(type, cmd.ifFalse.commands, optional);
  11200. } else {
  11201. return this.checkCommands(type, cmd.ifTrue.commands, optional);
  11202. }
  11203. } else if (cmd instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  11204. var fun = null;
  11205. if (cmd.isMainCall) {
  11206. fun = this.getMainFunction();
  11207. } else {
  11208. fun = this.findFunction(cmd.id);
  11209. }
  11210. if (fun === null) {
  11211. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(cmd.id, cmd.sourceInfo);
  11212. }
  11213. this.assertParameters(fun, cmd.actualParameters);
  11214. return optional;
  11215. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Return"]) {
  11216. var funcName = this.currentFunction.isMain ? _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName() : this.currentFunction.name;
  11217. if (cmd.expression === null && !type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  11218. var _stringInfo3 = type.stringInfo();
  11219. var _info4 = _stringInfo3[0];
  11220. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_void_return_full(funcName, _info4.type, _info4.dim, cmd.sourceInfo);
  11221. } else if (cmd.expression !== null) {
  11222. var _resultType2 = this.evaluateExpressionType(cmd.expression);
  11223. if (!type.isCompatible(_resultType2)) {
  11224. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type, _resultType2)) {
  11225. var _stringInfo4 = type.stringInfo();
  11226. var _info5 = _stringInfo4[0];
  11227. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_return_type_full(funcName, _info5.type, _info5.dim, cmd.sourceInfo);
  11228. }
  11229. }
  11230. return true;
  11231. } else {
  11232. return true;
  11233. }
  11234. }
  11235. }
  11236. }, {
  11237. key: "checkCommands",
  11238. value: function checkCommands(type, cmds, optional) {
  11239. var _this3 = this;
  11240. return cmds.reduce(function (last, next) {
  11241. return _this3.checkCommand(type, next, optional) || last;
  11242. }, optional);
  11243. }
  11244. /**
  11245. *
  11246. * @param {import('./../../ast/commands/function').Function} fun
  11247. * @param {Expression[]} actualParametersList
  11248. */
  11249. }, {
  11250. key: "assertParameters",
  11251. value: function assertParameters(fun, actualParametersList) {
  11252. var parameterList = fun.formalParameters;
  11253. if (parameterList.length > actualParametersList.length || parameterList.length !== actualParametersList.length && !fun.hasVariadic()) {
  11254. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameters_size_full(fun.name, actualParametersList.length, fun.formalParameters.length, null);
  11255. }
  11256. for (var i = 0, j = 0; i < parameterList.length && j < actualParametersList.length; i += 1, j += 1) {
  11257. var formalParam = parameterList[i];
  11258. if (formalParam.variadic && i + 1 !== parameterList.length) {
  11259. throw "A function variadic parameter must be its last parameter!";
  11260. }
  11261. if (formalParam.variadic) {
  11262. j = this.assertVariadicParameter(fun, formalParam, j, actualParametersList);
  11263. } else {
  11264. var param = actualParametersList[j];
  11265. this.assertParameter(fun, formalParam, param);
  11266. }
  11267. }
  11268. }
  11269. }, {
  11270. key: "evaluateVectorLiteralType",
  11271. value: function evaluateVectorLiteralType(literal, type) {
  11272. // console.log(literal);
  11273. for (var i = 0; i < literal.value.length; i += 1) {
  11274. var exp = literal.value[i];
  11275. var expType = this.evaluateExpressionType(exp);
  11276. var compatible = false;
  11277. if (expType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11278. compatible = expType.isCompatible(type.innerType);
  11279. } else {
  11280. compatible = type.canAccept(expType, 1);
  11281. }
  11282. if (!compatible) {
  11283. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type.innerType, expType)) {
  11284. var stringInfo = type.stringInfo();
  11285. var info = stringInfo[0];
  11286. var result_string_info = expType.stringInfo();
  11287. var result_info = result_string_info[0];
  11288. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(info.type, 0, result_info.type, result_info.dim, exp.toString(), literal.sourceInfo);
  11289. }
  11290. }
  11291. }
  11292. return type;
  11293. }
  11294. /**
  11295. *
  11296. * @param {import('./../../ast/commands/function').Function} fun
  11297. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11298. * @param {number} index
  11299. * @param {Expression[]} actualParametersList
  11300. */
  11301. }, {
  11302. key: "assertVariadicParameter",
  11303. value: function assertVariadicParameter(fun, formalParam, index, actualParametersList) {
  11304. var i;
  11305. for (i = index; i < actualParametersList.length; i += 1) {
  11306. this.assertParameter(fun, formalParam, actualParametersList[i]);
  11307. }
  11308. return i - 1;
  11309. }
  11310. /**
  11311. *
  11312. * @param {import('./../../ast/commands/function').Function} fun
  11313. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11314. * @param {Expression} actualParameter
  11315. */
  11316. }, {
  11317. key: "assertParameter",
  11318. value: function assertParameter(fun, formalParam, actualParameter) {
  11319. // const id = formalParam.id;
  11320. if (formalParam.byRef) {
  11321. if (actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  11322. var variable = this.findSymbol(actualParameter.id, this.symbolMap);
  11323. if (variable.isConst) {
  11324. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_ref_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11325. }
  11326. } else if (!(actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"] || actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"])) {
  11327. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11328. }
  11329. }
  11330. var resultType = this.evaluateExpressionType(actualParameter);
  11331. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"] && formalParam.type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11332. var shared = 0;
  11333. for (var j = 0; j < resultType.types.length; ++j) {
  11334. var element = resultType.types[j];
  11335. if (formalParam.type.types.indexOf(element) !== -1) {
  11336. shared += 1;
  11337. }
  11338. }
  11339. if (shared <= 0) {
  11340. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11341. if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER) && !resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].REAL) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].REAL)) {
  11342. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11343. }
  11344. }
  11345. }
  11346. } else if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11347. if (!resultType.isCompatible(formalParam.type)) {
  11348. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11349. if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER) && !resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].REAL) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].REAL)) {
  11350. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11351. }
  11352. }
  11353. }
  11354. } else if (!formalParam.type.isCompatible(resultType)) {
  11355. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11356. if (!_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(formalParam.type, resultType)) {
  11357. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11358. }
  11359. }
  11360. }
  11361. }
  11362. }]);
  11363. return SemanticAnalyser;
  11364. }();
  11365. /***/ }),
  11366. /***/ "./js/processor/store/store.ts":
  11367. /*!*************************************!*\
  11368. !*** ./js/processor/store/store.ts ***!
  11369. \*************************************/
  11370. /*! no static exports found */
  11371. /***/ (function(module, exports, __webpack_require__) {
  11372. "use strict";
  11373. Object.defineProperty(exports, "__esModule", { value: true });
  11374. exports.Store = void 0;
  11375. /* eslint-disable @typescript-eslint/no-non-null-assertion */
  11376. const modes_1 = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  11377. const types_1 = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  11378. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  11379. const storeObjectRef_1 = __webpack_require__(/*! ./storeObjectRef */ "./js/processor/store/storeObjectRef.ts");
  11380. const array_type_1 = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11381. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  11382. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  11383. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  11384. const store_value_1 = __webpack_require__(/*! ./value/store_value */ "./js/processor/store/value/store_value.ts");
  11385. const store_value_address_1 = __webpack_require__(/*! ./value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
  11386. const store_value_ref_1 = __webpack_require__(/*! ./value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
  11387. const array_store_value_ref_1 = __webpack_require__(/*! ./value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
  11388. const store_object_array_ref_1 = __webpack_require__(/*! ./store_object_array_ref */ "./js/processor/store/store_object_array_ref.ts");
  11389. class Store {
  11390. constructor(name) {
  11391. this.name = name;
  11392. this.store = new Map();
  11393. this.mode = modes_1.Modes.RUN;
  11394. }
  11395. static canImplicitTypeCast(castType, sourceType) {
  11396. if (castType.isCompatible(types_1.Types.INTEGER) || castType.isCompatible(types_1.Types.REAL)) {
  11397. if (sourceType.isCompatible(types_1.Types.INTEGER) || sourceType.isCompatible(types_1.Types.REAL)) {
  11398. return true;
  11399. }
  11400. }
  11401. return false;
  11402. }
  11403. static doImplicitCasting(castType, stoObj) {
  11404. if (!Store.canImplicitTypeCast(castType, stoObj.type)) {
  11405. throw new Error("!!!Critical error: attempted to type cast invalid types");
  11406. }
  11407. if (castType.isCompatible(types_1.Types.INTEGER)) {
  11408. return new store_value_1.StoreValue(types_1.Types.INTEGER, stoObj.get().trunc());
  11409. }
  11410. else {
  11411. return new store_value_1.StoreValue(types_1.Types.REAL, stoObj.get());
  11412. }
  11413. }
  11414. extendStore(nextStore) {
  11415. this.nextStore = nextStore;
  11416. }
  11417. applyStore(id) {
  11418. if (!this.store.has(id)) {
  11419. if (this.nextStore != null) {
  11420. return this.nextStore.applyStore(id);
  11421. }
  11422. else {
  11423. throw new Error(`Variable ${id} not found.`);
  11424. }
  11425. }
  11426. const val = this.store.get(id);
  11427. let result = null;
  11428. if (val.type instanceof array_type_1.ArrayType) {
  11429. const array = val;
  11430. const array_type = array.type;
  11431. let l = 0, c = 0;
  11432. const values = array.value.map(v => {
  11433. if (array.isVector) {
  11434. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l++, undefined, array.id, array.readOnly);
  11435. }
  11436. else {
  11437. if (c >= array.columns) {
  11438. c = 0;
  11439. l += 1;
  11440. }
  11441. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l, c++, array.id, array.readOnly);
  11442. }
  11443. });
  11444. result = new array_store_value_1.ArrayStoreValue(array_type, values, array.lines, array.columns, val.id, val.readOnly);
  11445. }
  11446. else {
  11447. result = new store_value_1.StoreValue(val.type, val.value, val.id, val.readOnly);
  11448. }
  11449. return result;
  11450. }
  11451. updateStore(id, stoValue) {
  11452. if (!this.store.has(id)) {
  11453. if (this.nextStore != null) {
  11454. this.nextStore.updateStore(id, stoValue);
  11455. return this;
  11456. }
  11457. else {
  11458. // TODO: better error message
  11459. throw new Error(`Variable ${id} not found.`);
  11460. }
  11461. }
  11462. else {
  11463. const oldObj = this.store.get(id);
  11464. if (oldObj.readOnly) {
  11465. // TODO: better error message
  11466. throw new Error("Cannot change value of a read only variable: " + id);
  11467. }
  11468. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  11469. const array_value = stoValue;
  11470. if (oldObj.isCompatible(array_value)) {
  11471. if (oldObj.isVector) {
  11472. array_value.get().forEach((val, index) => {
  11473. oldObj.setAt(val, index, undefined);
  11474. });
  11475. }
  11476. else {
  11477. let line = 0;
  11478. let column = 0;
  11479. array_value.get().forEach((val) => {
  11480. oldObj.setAt(val, line, column);
  11481. column += 1;
  11482. if (column >= oldObj.columns) {
  11483. line += 1;
  11484. column = 0;
  11485. }
  11486. });
  11487. }
  11488. return this;
  11489. }
  11490. }
  11491. else if (oldObj.isCompatible(stoValue)) {
  11492. const loc_address = oldObj.locAddress;
  11493. location_1.Location.updateAddress(loc_address, stoValue.get());
  11494. return this;
  11495. }
  11496. const oldType = oldObj.type;
  11497. const stoType = stoValue.type;
  11498. // TODO: better error message
  11499. throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  11500. }
  11501. }
  11502. /**
  11503. * Method used to update regions of an array (vector or matrix). The should only be used when update an specific
  11504. * possition since it will only update the required addresses.
  11505. * @param {string} id the variable id to be updated
  11506. * @param {IStoreValue} sto_value the value to be used in the update process
  11507. * @param {number} line the line address of the vector/matrix
  11508. * @param {number} column the matrix column, which can be undefined
  11509. */
  11510. updateStoreArray(id, sto_value, line, column) {
  11511. if (!this.store.has(id)) {
  11512. if (this.nextStore != null) {
  11513. this.nextStore.updateStoreArray(id, sto_value, line, column);
  11514. return this;
  11515. }
  11516. else {
  11517. // TODO: better error message
  11518. throw new Error(`Variable ${id} not found.`);
  11519. }
  11520. }
  11521. else {
  11522. const oldObj = this.store.get(id);
  11523. if (oldObj.readOnly) {
  11524. // TODO: better error message
  11525. throw new Error("Cannot change value of a read only variable: " + id);
  11526. }
  11527. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  11528. if (sto_value instanceof array_store_value_1.ArrayStoreValue) {
  11529. // this must be a vector or matrix line update
  11530. const actual_values = sto_value.get();
  11531. if (oldObj.isVector && sto_value.isVector()) {
  11532. for (let i = 0; i < sto_value.lines; i += 1) {
  11533. const val = actual_values[i];
  11534. oldObj.setAt(val, i, undefined);
  11535. }
  11536. }
  11537. else if (!oldObj.isVector && column == null && sto_value.isVector()) {
  11538. for (let i = 0; i < oldObj.columns; i += 1) {
  11539. const val = actual_values[i];
  11540. oldObj.setAt(val, line, i);
  11541. }
  11542. }
  11543. else {
  11544. // TODO: better error message
  11545. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  11546. }
  11547. }
  11548. else {
  11549. if (!oldObj.isVector && column == null) {
  11550. // TODO: better error message
  11551. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  11552. }
  11553. oldObj.setAt(sto_value, line, column);
  11554. }
  11555. }
  11556. else {
  11557. throw new Error("Cannot update a non-array variable using updateStoreArray");
  11558. }
  11559. // const oldType = oldObj.type;
  11560. // const stoType = sto_value.type;
  11561. // // TODO: better error message
  11562. // throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  11563. return this;
  11564. }
  11565. }
  11566. /**
  11567. * Inserts a new variable into the Store. This method should be used when declaring a new variable,
  11568. * including the special return variable $.
  11569. * @param id variable id
  11570. * @param stoValue the value to be used as the initial value of id
  11571. */
  11572. insertStore(id, stoValue) {
  11573. if (this.store.has(id)) {
  11574. // TODO: better error message
  11575. throw new Error(`${id} is already defined`);
  11576. }
  11577. // TODO check for array....
  11578. let newObj;
  11579. if (stoValue instanceof store_value_ref_1.StoreValueRef) {
  11580. newObj = new storeObjectRef_1.StoreObjectRef(stoValue);
  11581. }
  11582. else if (stoValue instanceof array_store_value_ref_1.ArrayStoreValueRef) {
  11583. newObj = new store_object_array_ref_1.StoreObjectArrayRef(stoValue, stoValue.lines, stoValue.columns);
  11584. }
  11585. else if (stoValue instanceof array_store_value_1.ArrayStoreValue) {
  11586. const columns = stoValue.isVector() ? 0 : stoValue.columns;
  11587. const addresses = [];
  11588. const all_values = stoValue.get();
  11589. if (all_values.length > 0) {
  11590. for (let i = 0; i < stoValue.get().length; i += 1) {
  11591. const val = all_values[i].get();
  11592. addresses.push(location_1.Location.allocate(val));
  11593. }
  11594. }
  11595. else {
  11596. let total = stoValue.lines;
  11597. total = stoValue.isVector() ? total : total * columns;
  11598. for (let i = 0; i < total; i += 1) {
  11599. addresses.push(location_1.Location.allocate(null));
  11600. }
  11601. }
  11602. newObj = new storeObjectArray_1.StoreObjectArray(stoValue.type, stoValue.lines, columns, addresses, stoValue.isConst);
  11603. }
  11604. else {
  11605. const loc_address = location_1.Location.allocate(stoValue.get());
  11606. newObj = new storeObject_1.StoreObject(stoValue.type, loc_address, stoValue.isConst);
  11607. }
  11608. newObj.setID(id);
  11609. this.store.set(id, newObj);
  11610. return this;
  11611. }
  11612. /**
  11613. * Helper function similar to applyStore. But it returns the actual object in the store be it ref or not
  11614. * applyStore will return the refferenced object if the object in the store is a ref
  11615. */
  11616. getStoreObject(id) {
  11617. if (!this.store.has(id)) {
  11618. if (this.nextStore != null) {
  11619. return this.nextStore.getStoreObject(id);
  11620. }
  11621. else {
  11622. throw new Error(`Variable ${id} not found.`);
  11623. }
  11624. }
  11625. return this.store.get(id);
  11626. }
  11627. destroy() {
  11628. this.store.forEach(sto => sto.destroy(), this);
  11629. }
  11630. isDefined(id) {
  11631. if (!this.store.has(id)) {
  11632. if (this.nextStore != null) {
  11633. return this.nextStore.isDefined(id);
  11634. }
  11635. else {
  11636. return false;
  11637. }
  11638. }
  11639. return true;
  11640. }
  11641. }
  11642. exports.Store = Store;
  11643. /***/ }),
  11644. /***/ "./js/processor/store/storeObject.ts":
  11645. /*!*******************************************!*\
  11646. !*** ./js/processor/store/storeObject.ts ***!
  11647. \*******************************************/
  11648. /*! no static exports found */
  11649. /***/ (function(module, exports, __webpack_require__) {
  11650. "use strict";
  11651. Object.defineProperty(exports, "__esModule", { value: true });
  11652. exports.StoreObject = void 0;
  11653. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  11654. class StoreObject {
  11655. /**
  11656. *
  11657. * @param {Type} type
  11658. * @param {Number} loc_address
  11659. * @param {Boolean} readOnly
  11660. */
  11661. constructor(type, loc_address, readOnly = false) {
  11662. this._loc_address = loc_address;
  11663. this._type = type;
  11664. this._readOnly = readOnly;
  11665. this._id = undefined;
  11666. }
  11667. setID(id) {
  11668. this._id = id;
  11669. }
  11670. get id() {
  11671. return this._id;
  11672. }
  11673. get inStore() {
  11674. return this.id !== null;
  11675. }
  11676. get type() {
  11677. return this._type;
  11678. }
  11679. /**
  11680. * Returns the actual value stored at the loccation address present in this object.
  11681. * The returned value is compatible with @prop{StoreObject.type}
  11682. */
  11683. get value() {
  11684. const address = location_1.Location.find(this._loc_address);
  11685. if (address != null) {
  11686. return address.value;
  11687. }
  11688. else {
  11689. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  11690. }
  11691. }
  11692. get number() {
  11693. throw new Error("DOT NOT USE THIS PROPERTY!");
  11694. }
  11695. get readOnly() {
  11696. return this._readOnly;
  11697. }
  11698. set readOnly(value) {
  11699. this._readOnly = value;
  11700. }
  11701. isCompatible(another) {
  11702. return this.type.isCompatible(another.type);
  11703. }
  11704. destroy() {
  11705. return location_1.Location.deallocate(this._loc_address);
  11706. }
  11707. get locAddress() {
  11708. return this._loc_address;
  11709. }
  11710. }
  11711. exports.StoreObject = StoreObject;
  11712. /***/ }),
  11713. /***/ "./js/processor/store/storeObjectArray.ts":
  11714. /*!************************************************!*\
  11715. !*** ./js/processor/store/storeObjectArray.ts ***!
  11716. \************************************************/
  11717. /*! no static exports found */
  11718. /***/ (function(module, exports, __webpack_require__) {
  11719. "use strict";
  11720. Object.defineProperty(exports, "__esModule", { value: true });
  11721. exports.StoreObjectArray = void 0;
  11722. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  11723. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  11724. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  11725. class StoreObjectArray extends storeObject_1.StoreObject {
  11726. constructor(type, _lines, _columns, loc_addresses, readOnly = false) {
  11727. super(type, -1, readOnly);
  11728. this._lines = _lines;
  11729. this._columns = _columns;
  11730. this.loc_addresses = loc_addresses;
  11731. }
  11732. get lines() {
  11733. return this._lines;
  11734. }
  11735. get columns() {
  11736. return this._columns;
  11737. }
  11738. isCompatible(another) {
  11739. if (another instanceof array_store_value_1.ArrayStoreValue) {
  11740. const cols = another.columns == null ? 0 : another.columns;
  11741. if (this.lines === another.lines && this.columns === cols) {
  11742. return super.isCompatible(another);
  11743. }
  11744. }
  11745. return false;
  11746. }
  11747. get isVector() {
  11748. return this.type.dimensions === 1;
  11749. }
  11750. /**@override
  11751. * Returns the list of values stored by this array.
  11752. * All returned values are compatible with @prop{StoreObject.type}
  11753. */
  11754. get value() {
  11755. const values = [];
  11756. for (let i = 0; i < this.addresses.length; i += 1) {
  11757. const address = location_1.Location.find(this.addresses[i]);
  11758. if (address != null) {
  11759. values.push(address.value);
  11760. }
  11761. else {
  11762. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  11763. }
  11764. }
  11765. return values;
  11766. }
  11767. destroy() {
  11768. let bool = true;
  11769. for (let i = 0; i < this.addresses.length; i += 1) {
  11770. bool = bool && location_1.Location.deallocate(this.addresses[i]);
  11771. }
  11772. return bool;
  11773. }
  11774. /**
  11775. * @override
  11776. *
  11777. * Returns the address that contains a list of all addresses of the values present in the array
  11778. */
  11779. get locAddress() {
  11780. throw new Error("!!!Internal Error: Cannot invoke locAddress on StoreObjectArray");
  11781. }
  11782. get addresses() {
  11783. return this.loc_addresses;
  11784. }
  11785. getAt(line, column) {
  11786. if (this.isVector) {
  11787. if (column != null) {
  11788. throw new Error(this.id + " is not a matrix!");
  11789. }
  11790. column = line;
  11791. line = 0;
  11792. }
  11793. else if (column == null) {
  11794. // this is a whole line...
  11795. const values = [];
  11796. for (let col = 0; col < this.columns; col += 1) {
  11797. const index = this.getIndexOf(line, col);
  11798. const address = location_1.Location.find(this.addresses[index]);
  11799. values.push(address.value);
  11800. }
  11801. return values;
  11802. }
  11803. const index = this.getIndexOf(line, column);
  11804. const address = location_1.Location.find(this.addresses[index]);
  11805. return address.value;
  11806. }
  11807. setAt(value, line, column) {
  11808. let used_dims = 1;
  11809. if (column != null) {
  11810. used_dims += 1;
  11811. }
  11812. if (!this.type.canAccept(value.type, used_dims)) {
  11813. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  11814. }
  11815. if (this.isVector) {
  11816. if (column != null) {
  11817. throw new Error(this.id + " is not a matrix!");
  11818. }
  11819. column = line;
  11820. line = 0;
  11821. }
  11822. else if (column == null) {
  11823. throw new Error("!!!Internal Error: Attempting to insert a line into matrix " + this.id);
  11824. }
  11825. const pos = this.getIndexOf(line, column);
  11826. location_1.Location.updateAddress(this.addresses[pos], value.get());
  11827. }
  11828. getIndexOf(line, column) {
  11829. return line * this.columns + column;
  11830. }
  11831. getLocAddressOf(line, column) {
  11832. if (this.isVector) {
  11833. if (column != null) {
  11834. throw new Error(this.id + " is not a matrix!");
  11835. }
  11836. column = line;
  11837. line = 0;
  11838. }
  11839. else if (column == null) {
  11840. // this is a whole line...
  11841. const values = [];
  11842. for (let col = 0; col < this.columns; col += 1) {
  11843. const index = this.getIndexOf(line, col);
  11844. values.push(this.addresses[index]);
  11845. }
  11846. return values;
  11847. }
  11848. const index = this.getIndexOf(line, column);
  11849. return this.addresses[index];
  11850. }
  11851. }
  11852. exports.StoreObjectArray = StoreObjectArray;
  11853. /***/ }),
  11854. /***/ "./js/processor/store/storeObjectRef.ts":
  11855. /*!**********************************************!*\
  11856. !*** ./js/processor/store/storeObjectRef.ts ***!
  11857. \**********************************************/
  11858. /*! no static exports found */
  11859. /***/ (function(module, exports, __webpack_require__) {
  11860. "use strict";
  11861. Object.defineProperty(exports, "__esModule", { value: true });
  11862. exports.StoreObjectRef = void 0;
  11863. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  11864. class StoreObjectRef extends storeObject_1.StoreObject {
  11865. /**
  11866. *
  11867. * @param {StoreObject} stoValue
  11868. */
  11869. constructor(stoValue) {
  11870. super(stoValue.type, stoValue.getRefAddress(), false);
  11871. this.refObj = stoValue.id;
  11872. this.reference_dimension = stoValue.getReferenceDimension();
  11873. }
  11874. get isRef() {
  11875. return true;
  11876. }
  11877. getRefObj() {
  11878. return this.refObj;
  11879. }
  11880. getReferenceDimension() {
  11881. return this.reference_dimension;
  11882. }
  11883. destroy() {
  11884. return false;
  11885. }
  11886. }
  11887. exports.StoreObjectRef = StoreObjectRef;
  11888. /***/ }),
  11889. /***/ "./js/processor/store/store_object_array_ref.ts":
  11890. /*!******************************************************!*\
  11891. !*** ./js/processor/store/store_object_array_ref.ts ***!
  11892. \******************************************************/
  11893. /*! no static exports found */
  11894. /***/ (function(module, exports, __webpack_require__) {
  11895. "use strict";
  11896. Object.defineProperty(exports, "__esModule", { value: true });
  11897. exports.StoreObjectArrayRef = void 0;
  11898. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  11899. class StoreObjectArrayRef extends storeObjectArray_1.StoreObjectArray {
  11900. constructor(stoValue, lines, columns) {
  11901. super(stoValue.type, lines, columns, stoValue.getAddresses(), false);
  11902. this.refObj = stoValue.id;
  11903. }
  11904. get isRef() {
  11905. return true;
  11906. }
  11907. getRefObj() {
  11908. return this.refObj;
  11909. }
  11910. destroy() {
  11911. return false;
  11912. }
  11913. }
  11914. exports.StoreObjectArrayRef = StoreObjectArrayRef;
  11915. /***/ }),
  11916. /***/ "./js/processor/store/value/array_store_value.ts":
  11917. /*!*******************************************************!*\
  11918. !*** ./js/processor/store/value/array_store_value.ts ***!
  11919. \*******************************************************/
  11920. /*! no static exports found */
  11921. /***/ (function(module, exports, __webpack_require__) {
  11922. "use strict";
  11923. Object.defineProperty(exports, "__esModule", { value: true });
  11924. exports.ArrayStoreValue = void 0;
  11925. const array_type_1 = __webpack_require__(/*! ../../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11926. const store_value_address_1 = __webpack_require__(/*! ./store_value_address */ "./js/processor/store/value/store_value_address.ts");
  11927. class ArrayStoreValue {
  11928. constructor(type, values, lines, columns, id, isConst = false) {
  11929. this.type = type;
  11930. this.id = id;
  11931. this.isConst = isConst;
  11932. this.values = values;
  11933. this.lines = lines;
  11934. this.columns = columns;
  11935. }
  11936. get() {
  11937. return this.values;
  11938. }
  11939. /**
  11940. * @deprecated
  11941. * Potential not necessary since array access is occuring directly in the StoreObject
  11942. * @param line
  11943. * @param column
  11944. */
  11945. getAt(line, column) {
  11946. console.log("Column ", column);
  11947. if (this.isVector()) {
  11948. if (column != null) {
  11949. throw new Error(this.id + " is not a matrix!");
  11950. }
  11951. column = line;
  11952. line = 0;
  11953. }
  11954. else if (column == null) {
  11955. const values = [];
  11956. for (let col = 0; col < this.columns; col += 1) {
  11957. const index = line * this.lines + col;
  11958. values.push(this.values[index]);
  11959. }
  11960. const array_type = this.type;
  11961. const vector_type = new array_type_1.ArrayType(array_type.innerType, array_type.dimensions - 1);
  11962. return new ArrayStoreValue(vector_type, values, this.columns, 0, this.id, this.isConst);
  11963. }
  11964. const index = line * this.lines + column;
  11965. console.log("Get at: ", index);
  11966. return this.values[index];
  11967. }
  11968. setAt(value, line, column) {
  11969. let used_dims = 1;
  11970. if (column != null) {
  11971. used_dims += 1;
  11972. }
  11973. let actual_line = line;
  11974. let actual_column = column;
  11975. if (!this.type.canAccept(value.type, used_dims)) {
  11976. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  11977. }
  11978. if (this.isVector()) {
  11979. if (column != null) {
  11980. throw new Error(this.id + " is not a matrix!");
  11981. }
  11982. actual_column = actual_line;
  11983. actual_line = 0;
  11984. }
  11985. else if (column == null) {
  11986. if (!(value instanceof ArrayStoreValue)) {
  11987. throw new Error("Attempting to insert a single value as a line of matrix " + this.id);
  11988. }
  11989. const actual_values = value.get();
  11990. for (let i = 0; i < this.columns; i += 1) {
  11991. const pos = actual_line * this.columns + i;
  11992. const val = actual_values[i];
  11993. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, val.get(), actual_line, i, this.id, this.isConst);
  11994. }
  11995. }
  11996. const columns = this.columns == null ? 0 : this.columns;
  11997. const pos = actual_line * columns + actual_column;
  11998. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, value.get(), line, column, this.id, this.isConst);
  11999. }
  12000. inStore() {
  12001. return this.id != null;
  12002. }
  12003. isVector() {
  12004. return this.type.dimensions == 1;
  12005. }
  12006. }
  12007. exports.ArrayStoreValue = ArrayStoreValue;
  12008. /***/ }),
  12009. /***/ "./js/processor/store/value/array_store_value_ref.ts":
  12010. /*!***********************************************************!*\
  12011. !*** ./js/processor/store/value/array_store_value_ref.ts ***!
  12012. \***********************************************************/
  12013. /*! no static exports found */
  12014. /***/ (function(module, exports, __webpack_require__) {
  12015. "use strict";
  12016. Object.defineProperty(exports, "__esModule", { value: true });
  12017. exports.ArrayStoreValueRef = void 0;
  12018. class ArrayStoreValueRef {
  12019. constructor(type, values, addresses, lines, columns, id) {
  12020. this.type = type;
  12021. this.values = values;
  12022. this.addresses = addresses;
  12023. this.lines = lines;
  12024. this.columns = columns;
  12025. this.id = id;
  12026. this.isConst = false;
  12027. }
  12028. get() {
  12029. return this.values;
  12030. }
  12031. getAddresses() {
  12032. return this.addresses;
  12033. }
  12034. inStore() {
  12035. return this.id != null;
  12036. }
  12037. }
  12038. exports.ArrayStoreValueRef = ArrayStoreValueRef;
  12039. /***/ }),
  12040. /***/ "./js/processor/store/value/store_value.ts":
  12041. /*!*************************************************!*\
  12042. !*** ./js/processor/store/value/store_value.ts ***!
  12043. \*************************************************/
  12044. /*! no static exports found */
  12045. /***/ (function(module, exports, __webpack_require__) {
  12046. "use strict";
  12047. Object.defineProperty(exports, "__esModule", { value: true });
  12048. exports.StoreValue = void 0;
  12049. class StoreValue {
  12050. constructor(type, value, id, isConst = false) {
  12051. this.type = type;
  12052. this.id = id;
  12053. this.isConst = isConst;
  12054. this.value = value;
  12055. }
  12056. get() {
  12057. return this.value;
  12058. }
  12059. inStore() {
  12060. return this.id != null;
  12061. }
  12062. }
  12063. exports.StoreValue = StoreValue;
  12064. /***/ }),
  12065. /***/ "./js/processor/store/value/store_value_address.ts":
  12066. /*!*********************************************************!*\
  12067. !*** ./js/processor/store/value/store_value_address.ts ***!
  12068. \*********************************************************/
  12069. /*! no static exports found */
  12070. /***/ (function(module, exports, __webpack_require__) {
  12071. "use strict";
  12072. Object.defineProperty(exports, "__esModule", { value: true });
  12073. exports.StoreValueAddress = void 0;
  12074. const store_value_1 = __webpack_require__(/*! ./store_value */ "./js/processor/store/value/store_value.ts");
  12075. class StoreValueAddress extends store_value_1.StoreValue {
  12076. constructor(type, value, line, column, id, isConst = false) {
  12077. super(type, value, id, isConst);
  12078. this.line = line;
  12079. this.column = column;
  12080. }
  12081. }
  12082. exports.StoreValueAddress = StoreValueAddress;
  12083. /***/ }),
  12084. /***/ "./js/processor/store/value/store_value_ref.ts":
  12085. /*!*****************************************************!*\
  12086. !*** ./js/processor/store/value/store_value_ref.ts ***!
  12087. \*****************************************************/
  12088. /*! no static exports found */
  12089. /***/ (function(module, exports, __webpack_require__) {
  12090. "use strict";
  12091. Object.defineProperty(exports, "__esModule", { value: true });
  12092. exports.StoreValueRef = void 0;
  12093. class StoreValueRef {
  12094. constructor(type, value, loc_address, id) {
  12095. this.type = type;
  12096. this.value = value;
  12097. this.loc_address = loc_address;
  12098. this.id = id;
  12099. this.isConst = false;
  12100. this.reference_dimesion = 0;
  12101. }
  12102. get() {
  12103. return this.value;
  12104. }
  12105. getRefAddress() {
  12106. return this.loc_address;
  12107. }
  12108. inStore() {
  12109. return this.id != null;
  12110. }
  12111. getReferenceDimension() {
  12112. return this.reference_dimesion;
  12113. }
  12114. setReferenceDimension(dimension) {
  12115. this.reference_dimesion = dimension;
  12116. }
  12117. }
  12118. exports.StoreValueRef = StoreValueRef;
  12119. /***/ }),
  12120. /***/ "./js/runner.js":
  12121. /*!**********************!*\
  12122. !*** ./js/runner.js ***!
  12123. \**********************/
  12124. /*! exports provided: runner */
  12125. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12126. "use strict";
  12127. __webpack_require__.r(__webpack_exports__);
  12128. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return runner; });
  12129. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast/ivprogParser */ "./js/ast/ivprogParser.js");
  12130. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  12131. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./io/domConsole */ "./js/io/domConsole.js");
  12132. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/languageService */ "./js/services/languageService.js");
  12133. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  12134. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memory/location */ "./js/memory/location.ts");
  12135. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_5__);
  12136. function runner() {
  12137. var ivprogLexer = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer(); // const lexer = new ivprogLexer(new InputStream(input));
  12138. // const stream = new CommonTokenStream(lexer);
  12139. // stream.fill();
  12140. // let i = 1;
  12141. // let token = null;
  12142. // while ((token = stream.LT(i)).type !== ivprogLexer.EOF && token.type !== ivprogLexer.WHITESPACE) {
  12143. // console.log(`${token.type}-${token.text}`);
  12144. // console.log('\n')
  12145. // i++;
  12146. // }
  12147. // const anaSin = new IVProgParser(input, ivprogLexer);
  12148. var editor = new window.JsonEditor('#json-renderer', {});
  12149. var domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"]("#console", true);
  12150. domConsole.hide(); // proc.interpretAST().then( sto => {
  12151. // console.log(sto.applyStore('a'));
  12152. // }).catch(e => console.log(e));
  12153. try {
  12154. window.$('#btn').click(function () {
  12155. var input = window.$('#input').val();
  12156. var analiser = new _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__["IVProgParser"](input, ivprogLexer);
  12157. try {
  12158. var data = analiser.parseTree();
  12159. var semAna = new _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__["SemanticAnalyser"](data);
  12160. var proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](semAna.analyseTree());
  12161. proc.registerInput(domConsole);
  12162. domConsole.clear();
  12163. proc.registerOutput(domConsole);
  12164. proc.interpretAST().then(function (sto) {
  12165. console.log(sto);
  12166. editor.load(sto.store);
  12167. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12168. })["catch"](function (e) {
  12169. alert(e);
  12170. console.log(e);
  12171. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12172. });
  12173. } catch (error) {
  12174. alert(error);
  12175. console.log(error);
  12176. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12177. }
  12178. });
  12179. } catch (a) {
  12180. console.log(a);
  12181. }
  12182. }
  12183. /***/ }),
  12184. /***/ "./js/services/i18nHelper.js":
  12185. /*!***********************************!*\
  12186. !*** ./js/services/i18nHelper.js ***!
  12187. \***********************************/
  12188. /*! exports provided: i18nHelper */
  12189. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12190. "use strict";
  12191. __webpack_require__.r(__webpack_exports__);
  12192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18nHelper", function() { return i18nHelper; });
  12193. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12194. /* harmony import */ var _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localizedStringsService */ "./js/services/localizedStringsService.js");
  12195. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_0__["default"].StringTypes;
  12196. var i18nHelper = Object.freeze({
  12197. i18n: function i18n(identifier) {
  12198. var opts = identifier.split(':');
  12199. var type = opts[0].toLowerCase();
  12200. var id = opts[1];
  12201. if (StringTypes.ERROR === type) {
  12202. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getError(id);
  12203. } else if (StringTypes.MESSAGE === type) {
  12204. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getMessage(id);
  12205. } else if (StringTypes.UI === type) {
  12206. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI(id);
  12207. } else {
  12208. console.warn("A string has been passed to the i18n helper function that was not in the form type:id -> " + identifier);
  12209. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getString(identifier, type);
  12210. }
  12211. }
  12212. });
  12213. /***/ }),
  12214. /***/ "./js/services/languageService.js":
  12215. /*!****************************************!*\
  12216. !*** ./js/services/languageService.js ***!
  12217. \****************************************/
  12218. /*! exports provided: LanguageService */
  12219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12220. "use strict";
  12221. __webpack_require__.r(__webpack_exports__);
  12222. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageService", function() { return LanguageService; });
  12223. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12224. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12225. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12226. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12227. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12228. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12229. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12230. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12231. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12232. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12233. /* harmony import */ var _grammar___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../grammar/ */ "./grammar/index.js");
  12234. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12235. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  12236. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  12237. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  12238. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  12239. /* global iLMparameters*/
  12240. var LanguageServiceExtended = /*#__PURE__*/function (_line_i18n$LanguageSe) {
  12241. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(LanguageServiceExtended, _line_i18n$LanguageSe);
  12242. var _super = _createSuper(LanguageServiceExtended);
  12243. function LanguageServiceExtended() {
  12244. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, LanguageServiceExtended);
  12245. return _super.call(this, typeof iLMparameters === "undefined" ? _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].default_lang : iLMparameters.lang);
  12246. }
  12247. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(LanguageServiceExtended, [{
  12248. key: "getDefaultLang",
  12249. value: function getDefaultLang() {
  12250. return "en";
  12251. }
  12252. }, {
  12253. key: "getCurrentLexer",
  12254. value: function getCurrentLexer() {
  12255. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12256. if (langInfo === null || langInfo === undefined) {
  12257. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].lexer;
  12258. } else {
  12259. return langInfo.lexer;
  12260. }
  12261. }
  12262. }, {
  12263. key: "getCurrentLangFuncs",
  12264. value: function getCurrentLangFuncs() {
  12265. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12266. if (langInfo === null || langInfo === undefined) {
  12267. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langFuncs;
  12268. } else {
  12269. return langInfo.langFuncs;
  12270. }
  12271. }
  12272. }, {
  12273. key: "getCurrentLangLibs",
  12274. value: function getCurrentLangLibs() {
  12275. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12276. if (langInfo === null || langInfo === undefined) {
  12277. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langLibs;
  12278. }
  12279. return langInfo.langLibs;
  12280. }
  12281. }]);
  12282. return LanguageServiceExtended;
  12283. }(line_i18n__WEBPACK_IMPORTED_MODULE_6__["default"].LanguageServiceNoLS);
  12284. var LanguageService = new LanguageServiceExtended();
  12285. /***/ }),
  12286. /***/ "./js/services/localizedStringsService.js":
  12287. /*!************************************************!*\
  12288. !*** ./js/services/localizedStringsService.js ***!
  12289. \************************************************/
  12290. /*! exports provided: LocalizedStrings, getInstance */
  12291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12292. "use strict";
  12293. __webpack_require__.r(__webpack_exports__);
  12294. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  12295. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInstance", function() { return getInstance; });
  12296. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12297. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12298. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12299. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12300. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12301. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12302. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12303. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12304. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12305. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12306. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12307. /* harmony import */ var _languageService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./languageService */ "./js/services/languageService.js");
  12308. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  12309. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../i18n */ "./i18n/index.ts");
  12310. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_i18n__WEBPACK_IMPORTED_MODULE_8__);
  12311. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  12312. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  12313. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  12314. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  12315. var IVProgLocalizedStrings = /*#__PURE__*/function (_line_i18n$LocalizedS) {
  12316. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IVProgLocalizedStrings, _line_i18n$LocalizedS);
  12317. var _super = _createSuper(IVProgLocalizedStrings);
  12318. function IVProgLocalizedStrings(langService, langsJsons) {
  12319. var shouldListenToChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  12320. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgLocalizedStrings);
  12321. return _super.call(this, langService, langsJsons, shouldListenToChange);
  12322. }
  12323. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgLocalizedStrings, [{
  12324. key: "translateType",
  12325. value: function translateType(type, dim) {
  12326. var type_string = this.getUI("type_".concat(type));
  12327. switch (dim) {
  12328. case 0:
  12329. return type_string;
  12330. default:
  12331. if (dim > 1) return this.getUI("matrix_info_string", [type_string]);else return this.getUI("vector_info_string", [type_string]);
  12332. }
  12333. }
  12334. }, {
  12335. key: "translateOp",
  12336. value: function translateOp(op) {
  12337. switch (op.ord) {
  12338. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].AND.ord:
  12339. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].OR.ord:
  12340. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NOT.ord:
  12341. return this.getUI("logic_operator_".concat(op.value));
  12342. default:
  12343. return op.value;
  12344. }
  12345. }
  12346. }, {
  12347. key: "translateInternalFunction",
  12348. value: function translateInternalFunction(name) {
  12349. var category = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  12350. if (category == null) {
  12351. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName(name);
  12352. } else {
  12353. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName("".concat(category, ".").concat(name));
  12354. }
  12355. }
  12356. }]);
  12357. return IVProgLocalizedStrings;
  12358. }(line_i18n__WEBPACK_IMPORTED_MODULE_5__["default"].LocalizedStrings);
  12359. var LocalizedStrings = Object.freeze(new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a, true));
  12360. var _instance = null;
  12361. function getInstance() {
  12362. if (_instance == null) {
  12363. _instance = new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a);
  12364. }
  12365. return _instance;
  12366. }
  12367. /***/ }),
  12368. /***/ "./js/services/userLog.js":
  12369. /*!********************************!*\
  12370. !*** ./js/services/userLog.js ***!
  12371. \********************************/
  12372. /*! exports provided: ActionTypes, registerClick, registerUserEvent, registerSystemEvent, getLogs, setRebuildMode, getLogsAsString, parseLogs */
  12373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12374. "use strict";
  12375. __webpack_require__.r(__webpack_exports__);
  12376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return ActionTypes; });
  12377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return registerClick; });
  12378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return registerUserEvent; });
  12379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSystemEvent", function() { return registerSystemEvent; });
  12380. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return getLogs; });
  12381. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setRebuildMode", function() { return setRebuildMode; });
  12382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return getLogsAsString; });
  12383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return parseLogs; });
  12384. var clicks = [];
  12385. var inRebuildMode = false;
  12386. var ActionTypes = Object.freeze({
  12387. // registerUserEvent payload:
  12388. // (function_name, insert action)
  12389. INSERT_FUNCTION: "INSERT_FUNCTION",
  12390. // (function_name, remove action)
  12391. REMOVE_FUNCTION: "REMOVE_FUNCTION",
  12392. // (var_name,insert action, type, dim)
  12393. INSERT_GLOBAL_VAR: "INSERT_GLOBAL_VAR",
  12394. // (var name, remove action)
  12395. REMOVE_GLOBAL_VAR: "REMOVE_GLOBAL_VAR",
  12396. // (old function name, rename action, new function name)
  12397. RENAME_FUNCTION: "RENAME_FUNCTION",
  12398. // (old var name, rename action. new var name)
  12399. RENAME_GLOBAL_VAR: "RENAME_GLOBAL_VAR",
  12400. // (var name, set const action)
  12401. SET_GLOBAL_CONST: "SET_GLOBAL_CONST",
  12402. // (function name, change return action, type, dim)
  12403. CHANGE_FUNCTION_RETURN: "CHANGE_FUNCTION_RETURN",
  12404. // (var name, change type action, type, dim, rows?, columns?)
  12405. CHANGE_GLOBAL_TYPE: "CHANGE_GLOBAL_TYPE",
  12406. // (var name, change value action, value)
  12407. CHANGE_GLOBAL_VALUE: "CHANGE_GLOBAL_VALUE",
  12408. // (function name, insert param action, param varname, type, dim)
  12409. INSERT_FUNCTION_PARAM: "INSERT_FUNCTION_PARAM",
  12410. // (function name, remove param action, param varname)
  12411. REMOVE_FUNCTION_PARAM: "REMOVE_FUNCTION_PARAM",
  12412. // (function name, change param type action, type, dim)
  12413. CHANGE_PARAM_TYPE: "CHANGE_PARAM_TYPE",
  12414. // (function name, rename param action, old param name, new param name)
  12415. RENAME_FUNCTION_PARAM: "RENAME_FUNCTION_PARAM",
  12416. // (function name, insert var action, var name, type, dim)
  12417. INSERT_FUNCTION_VAR: "INSERT_FUCNTION_VAR",
  12418. // (function name, remove var action, var name)
  12419. REMOVE_FUNCTION_VAR: "REMOVE_FUNCTION_VAR",
  12420. // (function name, rename var action, old var name, new var name)
  12421. RENAME_FUNCTION_VAR: "RENAME_FUNCTION_VAR",
  12422. // (function name, change var type action, var name, type, dim, rows?, columns?)
  12423. CHANGE_VAR_TYPE: "CHANGE_VAR_TYPE",
  12424. // (function name, change var value action, var name, value)
  12425. CHANGE_VAR_VALUE: "CHANGE_VAR_VALUE",
  12426. // (function name, insert command action, command, path)
  12427. INSERT_COMMAND: "INSERT_COMMAND",
  12428. // (function name, remove command action, path)
  12429. REMOVE_COMMAND: "REMOVE_COMMAND",
  12430. // (function name, change command exp action, path, exp)
  12431. CHANGE_COMMAND_EXP: "CHANGE_COMMAND_EXP",
  12432. // (function name, change attrib exp action, path, exp)
  12433. CHANGE_ATTRIB_EXP: "CHANGE_ATTRIB_EXP",
  12434. // (function name, change attrib var action, path, var name, row_exp?, column_exp?)
  12435. CHANGE_ATTRIB_VAR: "CHANGE_ATTRIB_VAR",
  12436. // (function name, move command action, old path, new path)
  12437. MOVE_COMMAND: "MOVE_COMMAND",
  12438. // (function name, enter change name action, var name)
  12439. ENTER_CHANGE_VAR_NAME: 'ENTER_CHANGE_VAR_NAME',
  12440. // (function name, enter change value action, var name)
  12441. ENTER_CHANGE_VAR_VALUE: 'ENTER_CHANGE_VAR_VALUE',
  12442. // (var name, enter change name action)
  12443. ENTER_CHANGE_GLOBAL_NAME: 'ENTER_CHANGE_GLOBAL_NAME',
  12444. // (var name, enter change value action)
  12445. ENTER_CHANGE_GLOBAL_VALUE: 'ENTER_CHANGE_GLOBAL_VALUE',
  12446. // (function name, enter change name action, param name)
  12447. ENTER_CHANGE_PARAM_NAME: 'ENTER_CHANGE_PARAM_NAME'
  12448. });
  12449. function registerClick(x, y, details) {
  12450. if (inRebuildMode) {
  12451. return;
  12452. }
  12453. clicks.push([x, y, Date.now(), details]);
  12454. }
  12455. function registerUserEvent(command, action) {
  12456. for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  12457. params[_key - 2] = arguments[_key];
  12458. }
  12459. registerEvent('user_event', command, action, params);
  12460. }
  12461. function registerSystemEvent(command, action) {
  12462. for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  12463. params[_key2 - 2] = arguments[_key2];
  12464. }
  12465. registerEvent('system_event', command, action, params);
  12466. }
  12467. function registerEvent(tag, command, action, params) {
  12468. if (inRebuildMode) {
  12469. return;
  12470. }
  12471. var event = {
  12472. context: command,
  12473. action: action,
  12474. params: params
  12475. };
  12476. clicks.push([tag, Date.now(), event]);
  12477. }
  12478. function getLogs() {
  12479. return clicks;
  12480. }
  12481. function setRebuildMode(flag) {
  12482. inRebuildMode = flag;
  12483. }
  12484. function getLogsAsString() {
  12485. return JSON.stringify(clicks);
  12486. }
  12487. function parseLogs(logData) {
  12488. clicks = JSON.parse(logData);
  12489. }
  12490. /***/ }),
  12491. /***/ "./js/typeSystem/array_type.ts":
  12492. /*!*************************************!*\
  12493. !*** ./js/typeSystem/array_type.ts ***!
  12494. \*************************************/
  12495. /*! no static exports found */
  12496. /***/ (function(module, exports, __webpack_require__) {
  12497. "use strict";
  12498. Object.defineProperty(exports, "__esModule", { value: true });
  12499. exports.ArrayType = void 0;
  12500. class ArrayType {
  12501. constructor(type, dimensions) {
  12502. this.dimensions = dimensions;
  12503. this.innerType = type;
  12504. }
  12505. get isVector() {
  12506. return this.dimensions == 1;
  12507. }
  12508. isCompatible(another) {
  12509. if (another instanceof ArrayType) {
  12510. if (this.dimensions !== another.dimensions) {
  12511. return false;
  12512. }
  12513. return this.innerType.isCompatible(another.innerType);
  12514. }
  12515. return false;
  12516. }
  12517. stringInfo() {
  12518. const list = this.innerType.stringInfo();
  12519. list.forEach(v => {
  12520. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  12521. const tmp = v;
  12522. tmp.dim = this.dimensions;
  12523. });
  12524. return list;
  12525. }
  12526. get value() {
  12527. return undefined;
  12528. }
  12529. get ord() {
  12530. return undefined;
  12531. }
  12532. canAccept(another, used_dims) {
  12533. const free_dims = this.dimensions - used_dims;
  12534. if (another instanceof ArrayType) {
  12535. return free_dims == another.dimensions && this.innerType.isCompatible(another.innerType);
  12536. }
  12537. else {
  12538. return free_dims == 0 && this.innerType.isCompatible(another);
  12539. }
  12540. }
  12541. }
  12542. exports.ArrayType = ArrayType;
  12543. /***/ }),
  12544. /***/ "./js/typeSystem/multiType.ts":
  12545. /*!************************************!*\
  12546. !*** ./js/typeSystem/multiType.ts ***!
  12547. \************************************/
  12548. /*! no static exports found */
  12549. /***/ (function(module, exports, __webpack_require__) {
  12550. "use strict";
  12551. Object.defineProperty(exports, "__esModule", { value: true });
  12552. exports.MultiType = void 0;
  12553. class MultiType {
  12554. constructor(types) {
  12555. this.types = types;
  12556. }
  12557. get value() {
  12558. return undefined;
  12559. }
  12560. get ord() {
  12561. return undefined;
  12562. }
  12563. stringInfo() {
  12564. let list = [];
  12565. for (let i = 0; i < this.types.length; i++) {
  12566. const t = this.types[i];
  12567. list = list.concat(t.stringInfo());
  12568. }
  12569. return list;
  12570. }
  12571. isCompatible(another) {
  12572. for (let i = 0; i < this.types.length; i++) {
  12573. const t = this.types[i];
  12574. if (another.isCompatible(t)) {
  12575. return true;
  12576. }
  12577. }
  12578. return false;
  12579. }
  12580. }
  12581. exports.MultiType = MultiType;
  12582. /***/ }),
  12583. /***/ "./js/typeSystem/parsers.js":
  12584. /*!**********************************!*\
  12585. !*** ./js/typeSystem/parsers.js ***!
  12586. \**********************************/
  12587. /*! exports provided: toInt, toString, toChar, toReal, toBool, convertBoolToString, convertToString */
  12588. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12589. "use strict";
  12590. __webpack_require__.r(__webpack_exports__);
  12591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toInt", function() { return toInt; });
  12592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return toString; });
  12593. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toChar", function() { return toChar; });
  12594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toReal", function() { return toReal; });
  12595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toBool", function() { return toBool; });
  12596. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBoolToString", function() { return convertBoolToString; });
  12597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToString", function() { return convertToString; });
  12598. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  12599. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ "./js/typeSystem/types.ts");
  12600. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_1__);
  12601. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  12602. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
  12603. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  12604. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_3__);
  12605. function toInt(str) {
  12606. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(str);
  12607. }
  12608. function toString(str) {
  12609. var value = str.replace(/^"/, "");
  12610. value = value.replace(/"$/, "");
  12611. value = value.replace(/\\b/g, "\b");
  12612. value = value.replace(/\\t/g, "\t");
  12613. value = value.replace(/\\n/g, "\n");
  12614. value = value.replace(/\\r/g, "\r");
  12615. value = value.replace(/\\"/g, '"');
  12616. value = value.replace(/\\'/g, "'");
  12617. value = value.replace(/\\\\/g, "\\");
  12618. return value;
  12619. }
  12620. function toChar(str) {
  12621. console.debug(str, str.length);
  12622. var value = str.replace(/^'/, "");
  12623. value = value.replace(/'$/, "");
  12624. value = value.replace(/\\b/g, "\b");
  12625. value = value.replace(/\\t/g, "\t");
  12626. value = value.replace(/\\n/g, "\n");
  12627. value = value.replace(/\\r/g, "\r");
  12628. value = value.replace(/\\"/g, '"');
  12629. value = value.replace(/\\'/g, "'");
  12630. value = value[0];
  12631. return value;
  12632. }
  12633. function toReal(value) {
  12634. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(value);
  12635. }
  12636. function toBool(str) {
  12637. var val = "'" + str + "'";
  12638. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  12639. var instance = new lexer(null);
  12640. if (instance.literalNames[lexer.RK_TRUE] === val) {
  12641. return true;
  12642. } else if (instance.literalNames[lexer.RK_FALSE] === val) {
  12643. return false;
  12644. } else {
  12645. // TODO: better error message
  12646. throw new Error(str + "not a valid boolean");
  12647. }
  12648. }
  12649. function convertBoolToString(bool) {
  12650. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  12651. var instance = new lexer(null);
  12652. var result = null;
  12653. if (bool) {
  12654. result = instance.literalNames[lexer.RK_TRUE];
  12655. } else {
  12656. result = instance.literalNames[lexer.RK_FALSE];
  12657. }
  12658. return result.replace(/'/g, "");
  12659. }
  12660. function convertToString(value, type) {
  12661. switch (type.ord) {
  12662. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER.ord:
  12663. return value.toString();
  12664. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL.ord:
  12665. {
  12666. if (value.dp() <= 0) {
  12667. return value.toFixed(1);
  12668. } else {
  12669. return value.toFixed(_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].decimalPlaces);
  12670. }
  12671. }
  12672. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN.ord:
  12673. return convertBoolToString(value);
  12674. default:
  12675. return value;
  12676. }
  12677. }
  12678. /***/ }),
  12679. /***/ "./js/typeSystem/type.ts":
  12680. /*!*******************************!*\
  12681. !*** ./js/typeSystem/type.ts ***!
  12682. \*******************************/
  12683. /*! no static exports found */
  12684. /***/ (function(module, exports, __webpack_require__) {
  12685. "use strict";
  12686. Object.defineProperty(exports, "__esModule", { value: true });
  12687. exports.Type = void 0;
  12688. class Type {
  12689. constructor(value, ord) {
  12690. this.value = value;
  12691. this.ord = ord;
  12692. }
  12693. stringInfo() {
  12694. return [{ type: this.value, dim: 0 }];
  12695. }
  12696. isCompatible(another) {
  12697. return this.value === another.value && this.ord === another.ord;
  12698. }
  12699. }
  12700. exports.Type = Type;
  12701. /***/ }),
  12702. /***/ "./js/typeSystem/types.ts":
  12703. /*!********************************!*\
  12704. !*** ./js/typeSystem/types.ts ***!
  12705. \********************************/
  12706. /*! no static exports found */
  12707. /***/ (function(module, exports, __webpack_require__) {
  12708. "use strict";
  12709. Object.defineProperty(exports, "__esModule", { value: true });
  12710. exports.fromOrdToType = exports.Types = void 0;
  12711. const type_1 = __webpack_require__(/*! ./type */ "./js/typeSystem/type.ts");
  12712. const multiType_1 = __webpack_require__(/*! ./multiType */ "./js/typeSystem/multiType.ts");
  12713. const maybe_1 = __webpack_require__(/*! ../util/maybe */ "./js/util/maybe.ts");
  12714. const INTEGER = new type_1.Type("integer", 0);
  12715. const REAL = new type_1.Type("real", 1);
  12716. const STRING = new type_1.Type("text", 2);
  12717. const BOOLEAN = new type_1.Type("boolean", 3);
  12718. const CHAR = new type_1.Type("char", 4);
  12719. const VOID = new type_1.Type("void", 5);
  12720. const UNDEFINED = new type_1.Type("undefined", 6);
  12721. const ALL = new multiType_1.MultiType([INTEGER, REAL, STRING, CHAR, BOOLEAN]);
  12722. exports.Types = Object.freeze({
  12723. INTEGER: INTEGER,
  12724. REAL: REAL,
  12725. STRING: STRING,
  12726. CHAR: CHAR,
  12727. BOOLEAN: BOOLEAN,
  12728. VOID: VOID,
  12729. UNDEFINED: UNDEFINED,
  12730. ALL: ALL
  12731. });
  12732. function fromOrdToType(ord) {
  12733. const typeMap = exports.Types;
  12734. for (const t in typeMap) {
  12735. if (typeMap[t].ord && typeMap[t].ord === ord) {
  12736. return maybe_1.Maybe.some(typeMap[t]);
  12737. }
  12738. }
  12739. return maybe_1.Maybe.none();
  12740. }
  12741. exports.fromOrdToType = fromOrdToType;
  12742. /***/ }),
  12743. /***/ "./js/util/auto_gen_output.js":
  12744. /*!************************************!*\
  12745. !*** ./js/util/auto_gen_output.js ***!
  12746. \************************************/
  12747. /*! exports provided: autoGenerateTestCaseOutput */
  12748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12749. "use strict";
  12750. __webpack_require__.r(__webpack_exports__);
  12751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return autoGenerateTestCaseOutput; });
  12752. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  12753. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  12754. /* harmony import */ var _inputTest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inputTest */ "./js/util/inputTest.js");
  12755. /* harmony import */ var _outputTest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./outputTest */ "./js/util/outputTest.js");
  12756. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  12757. function autoGenerateTestCaseOutput(program_text, testCases) {
  12758. var copyTestCases = testCases.map(function (test) {
  12759. return Object.assign({}, test);
  12760. });
  12761. try {
  12762. var program = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__["SemanticAnalyser"].analyseFromSource(program_text);
  12763. var resultList = testCases.map(function (test, id) {
  12764. var input = new _inputTest__WEBPACK_IMPORTED_MODULE_2__["InputTest"](test.input);
  12765. var output = new _outputTest__WEBPACK_IMPORTED_MODULE_3__["OutputTest"]();
  12766. var exec = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](program);
  12767. exec.registerInput(input);
  12768. exec.registerOutput(output);
  12769. return exec.interpretAST().then(function (_) {
  12770. return {
  12771. id: id,
  12772. program: exec
  12773. };
  12774. });
  12775. });
  12776. return Promise.all(resultList).then(function (result_final) {
  12777. for (var i = 0; i < result_final.length; ++i) {
  12778. var result = result_final[i];
  12779. var output = result.program.output.list;
  12780. var input = result.program.input;
  12781. if (input.index != input.inputList.length) {
  12782. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_unused_input", [result.id + 1]));
  12783. return Promise.resolve(false);
  12784. }
  12785. if (output.length == 0) {
  12786. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_empty", [result.id + 1]));
  12787. }
  12788. copyTestCases[result.id].output = output;
  12789. }
  12790. window.outputGenerated(copyTestCases);
  12791. return Promise.resolve(true);
  12792. });
  12793. } catch (error) {
  12794. return Promise.reject(error);
  12795. }
  12796. }
  12797. /***/ }),
  12798. /***/ "./js/util/config.ts":
  12799. /*!***************************!*\
  12800. !*** ./js/util/config.ts ***!
  12801. \***************************/
  12802. /*! no static exports found */
  12803. /***/ (function(module, exports, __webpack_require__) {
  12804. "use strict";
  12805. Object.defineProperty(exports, "__esModule", { value: true });
  12806. exports.Config = void 0;
  12807. class ConfigObject {
  12808. constructor() {
  12809. this.decimalPlaces = 8;
  12810. this.intConvertRoundMode = 2;
  12811. this.default_lang = 'pt';
  12812. this.enable_type_casting = true;
  12813. this.idle_input_interval = 5000;
  12814. this.suspend_threshold = 100;
  12815. // this.max_instruction_count = 350250; - automated evaluation limit
  12816. this.max_instruction_count = Number.MAX_SAFE_INTEGER;
  12817. }
  12818. setConfig(opts) {
  12819. const otherConfig = opts;
  12820. for (const key in otherConfig) {
  12821. if (Object.prototype.hasOwnProperty.call(this, key)) {
  12822. this[key] = otherConfig[key];
  12823. }
  12824. }
  12825. }
  12826. }
  12827. const config = new ConfigObject();
  12828. exports.Config = config;
  12829. /***/ }),
  12830. /***/ "./js/util/editorMode2.js":
  12831. /*!********************************!*\
  12832. !*** ./js/util/editorMode2.js ***!
  12833. \********************************/
  12834. /*! exports provided: CodeEditorMode */
  12835. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12836. "use strict";
  12837. __webpack_require__.r(__webpack_exports__);
  12838. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditorMode", function() { return CodeEditorMode; });
  12839. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./js/util/utils.js");
  12840. /**
  12841. * Source: https://raw.githubusercontent.com/codemirror/CodeMirror/master/mode/clike/clike.js
  12842. * @author arijn Haverbeke and others
  12843. * @author Lucas de Souza
  12844. * @param {CodeMirror} CodeMirror
  12845. */
  12846. function CodeEditorMode(CodeMirror) {
  12847. "use strict";
  12848. function Context(indented, column, type, info, align, prev) {
  12849. this.indented = indented;
  12850. this.column = column;
  12851. this.type = type;
  12852. this.info = info;
  12853. this.align = align;
  12854. this.prev = prev;
  12855. }
  12856. function pushContext(state, col, type, info) {
  12857. var indent = state.indented;
  12858. if (state.context && state.context.type == "statement" && type != "statement") indent = state.context.indented;
  12859. return state.context = new Context(indent, col, type, info, null, state.context);
  12860. }
  12861. function popContext(state) {
  12862. var t = state.context.type;
  12863. if (t == ")" || t == "]" || t == "}") state.indented = state.context.indented;
  12864. return state.context = state.context.prev;
  12865. }
  12866. function typeBefore(stream, state, pos) {
  12867. if (state.prevToken == "variable" || state.prevToken == "type") return true;
  12868. if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
  12869. if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
  12870. }
  12871. function isTopScope(context) {
  12872. for (;;) {
  12873. if (!context || context.type == "top") return true;
  12874. if (context.type == "}" && context.prev.info != "namespace") return false;
  12875. context = context.prev;
  12876. }
  12877. }
  12878. function contains(words, word) {
  12879. if (typeof words === "function") {
  12880. return words(word);
  12881. } else {
  12882. return Object.propertyIsEnumerable.call(words, word);
  12883. }
  12884. }
  12885. function tokenComment(stream, state) {
  12886. var maybeEnd = false,
  12887. ch;
  12888. while (ch = stream.next()) {
  12889. if (ch == "/" && maybeEnd) {
  12890. state.tokenize = null;
  12891. break;
  12892. }
  12893. maybeEnd = ch == "*";
  12894. }
  12895. return "comment";
  12896. }
  12897. CodeMirror.defineMode("ivprog", function (config, parserConfig) {
  12898. var indentUnit = config.indentUnit,
  12899. statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
  12900. dontAlignCalls = parserConfig.dontAlignCalls,
  12901. keywords = parserConfig.keywords || {},
  12902. switchKeyword = parserConfig.switchKeyword,
  12903. caseKeyword = parserConfig.caseKeyword,
  12904. defaultKeyword = parserConfig.defaultKeyword,
  12905. caseRegex = new RegExp("^\\s*(?:".concat(caseKeyword, " .*?:|").concat(defaultKeyword, ":|\\{\\}?|\\})$")),
  12906. ////,
  12907. types = parserConfig.types || {},
  12908. builtin = parserConfig.builtin || {},
  12909. blockKeywords = parserConfig.blockKeywords || {},
  12910. defKeywords = parserConfig.defKeywords || {},
  12911. atoms = parserConfig.atoms || {},
  12912. hooks = parserConfig.hooks || {},
  12913. multiLineStrings = parserConfig.multiLineStrings,
  12914. indentStatements = false,
  12915. namespaceSeparator = null,
  12916. isPunctuationChar = /[[\]{}(),;:\n]/,
  12917. numberStart = /[\d.]/,
  12918. number = /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)$/i,
  12919. isOperatorChar = /[+\-*%=<>!/&]/,
  12920. isIdentifierChar = /[a-zA-Z0-9_]/,
  12921. // An optional function that takes a {string} token and returns true if it
  12922. // should be treated as a builtin.
  12923. isReservedIdentifier = parserConfig.isReservedIdentifier || false;
  12924. var curPunc, isDefKeyword;
  12925. var tokenString = function tokenString() {
  12926. /*SKIP*/
  12927. };
  12928. function tokenBase(stream, state) {
  12929. var ch = stream.next();
  12930. if (hooks[ch]) {
  12931. var result = hooks[ch](stream, state);
  12932. if (result !== false) return result;
  12933. }
  12934. if (ch == '"') {
  12935. state.tokenize = tokenString(ch);
  12936. return state.tokenize(stream, state);
  12937. }
  12938. if (isPunctuationChar.test(ch)) {
  12939. curPunc = ch;
  12940. return null;
  12941. }
  12942. if (numberStart.test(ch)) {
  12943. stream.backUp(1);
  12944. if (stream.match(number)) return "number";
  12945. stream.next();
  12946. }
  12947. if (ch == "/") {
  12948. if (stream.eat("*")) {
  12949. state.tokenize = tokenComment;
  12950. return tokenComment(stream, state);
  12951. }
  12952. if (stream.eat("/")) {
  12953. stream.skipToEnd();
  12954. return "comment";
  12955. }
  12956. }
  12957. if (isOperatorChar.test(ch)) {
  12958. while (!stream.match(/^\/[/*]/, false) && stream.eat(isOperatorChar)) {
  12959. /* SKIP */
  12960. }
  12961. return "operator";
  12962. }
  12963. stream.eatWhile(isIdentifierChar);
  12964. if (namespaceSeparator) while (stream.match(namespaceSeparator)) {
  12965. stream.eatWhile(isIdentifierChar);
  12966. }
  12967. var cur = stream.current();
  12968. if (contains(keywords, cur)) {
  12969. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  12970. if (contains(defKeywords, cur)) isDefKeyword = true;
  12971. return "keyword";
  12972. }
  12973. if (contains(types, cur)) return "type";
  12974. if (contains(builtin, cur) || isReservedIdentifier && isReservedIdentifier(cur)) {
  12975. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  12976. return "builtin";
  12977. }
  12978. if (contains(atoms, cur)) return "atom";
  12979. return "variable";
  12980. }
  12981. tokenString = function tokenString(quote) {
  12982. return function (stream, state) {
  12983. var escaped = false,
  12984. next,
  12985. end = false;
  12986. while ((next = stream.next()) != null) {
  12987. if (next == quote && !escaped) {
  12988. end = true;
  12989. break;
  12990. }
  12991. escaped = !escaped && next == "\\";
  12992. }
  12993. if (end || !(escaped || multiLineStrings)) state.tokenize = null;
  12994. return "string";
  12995. };
  12996. };
  12997. function maybeEOL(stream, state) {
  12998. if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) state.typeAtEndOfLine = typeBefore(stream, state, stream.pos);
  12999. } // Interface
  13000. return {
  13001. startState: function startState(basecolumn) {
  13002. return {
  13003. tokenize: null,
  13004. context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
  13005. indented: 0,
  13006. startOfLine: true,
  13007. prevToken: null
  13008. };
  13009. },
  13010. token: function token(stream, state) {
  13011. var ctx = state.context;
  13012. if (stream.sol()) {
  13013. if (ctx.align == null) ctx.align = false;
  13014. state.indented = stream.indentation();
  13015. state.startOfLine = true;
  13016. }
  13017. if (stream.eatSpace()) {
  13018. maybeEOL(stream, state);
  13019. return null;
  13020. }
  13021. curPunc = isDefKeyword = null;
  13022. var style = (state.tokenize || tokenBase)(stream, state);
  13023. if (style == "comment" || style == "meta") return style;
  13024. if (ctx.align == null) ctx.align = true;
  13025. if (curPunc == ";" || curPunc == ":" || curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)) while (state.context.type == "statement") {
  13026. popContext(state);
  13027. } else if (curPunc == "{") pushContext(state, stream.column(), "}");else if (curPunc == "[") pushContext(state, stream.column(), "]");else if (curPunc == "(") pushContext(state, stream.column(), ")");else if (curPunc == "}") {
  13028. while (ctx.type == "statement") {
  13029. ctx = popContext(state);
  13030. }
  13031. if (ctx.type == "}") ctx = popContext(state);
  13032. while (ctx.type == "statement") {
  13033. ctx = popContext(state);
  13034. }
  13035. } else if (curPunc == ctx.type) popContext(state);else if (indentStatements && ((ctx.type == "}" || ctx.type == "top") && curPunc != ";" || ctx.type == "statement" && curPunc == "newstatement")) {
  13036. pushContext(state, stream.column(), "statement", stream.current());
  13037. }
  13038. if (style == "variable" && (state.prevToken == "def" || parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && isTopScope(state.context) && stream.match(/^\s*\(/, false))) style = "def";
  13039. if (hooks.token) {
  13040. var result = hooks.token(stream, state, style);
  13041. if (result !== undefined) style = result;
  13042. }
  13043. if (style == "def" && parserConfig.styleDefs === false) style = "variable";
  13044. state.startOfLine = false;
  13045. state.prevToken = isDefKeyword ? "def" : style || curPunc;
  13046. maybeEOL(stream, state);
  13047. return style;
  13048. },
  13049. indent: function indent(state, textAfter) {
  13050. if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
  13051. var ctx = state.context;
  13052. var firstChar = textAfter && textAfter.charAt(0);
  13053. var closing = firstChar == ctx.type;
  13054. if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
  13055. if (parserConfig.dontIndentStatements) while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) {
  13056. ctx = ctx.prev;
  13057. }
  13058. if (hooks.indent) {
  13059. var hook = hooks.indent(state, ctx, textAfter, indentUnit);
  13060. if (typeof hook == "number") return hook;
  13061. }
  13062. var switchBlock = ctx.prev && ctx.prev.info == switchKeyword;
  13063. if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
  13064. while (ctx.type != "top" && ctx.type != "}") {
  13065. ctx = ctx.prev;
  13066. }
  13067. return ctx.indented;
  13068. }
  13069. if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
  13070. if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
  13071. if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
  13072. var caseTestRegex = new RegExp("^(?:".concat(caseKeyword, "|").concat(defaultKeyword, ")\b"));
  13073. return ctx.indented + (closing ? 0 : indentUnit) + (!closing && switchBlock && !caseTestRegex.test(textAfter) ? indentUnit : 0);
  13074. },
  13075. electricInput: caseRegex,
  13076. blockCommentStart: "/*",
  13077. blockCommentEnd: "*/",
  13078. blockCommentContinue: " * ",
  13079. lineComment: "//",
  13080. fold: "brace"
  13081. };
  13082. });
  13083. function words(str) {
  13084. var obj = {},
  13085. words = str.split(" ");
  13086. for (var i = 0; i < words.length; ++i) {
  13087. obj[words[i]] = true;
  13088. }
  13089. return obj;
  13090. }
  13091. var codeConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getCodeEditorModeConfig"])();
  13092. var ivprogKeywords = codeConfig.keywords.join(" ");
  13093. var basicTypes = words(codeConfig.types.join(" "));
  13094. function ivprogTypes(identifier) {
  13095. return contains(basicTypes, identifier);
  13096. }
  13097. var ivprogBlockKeywords = codeConfig.blocks.join(" ");
  13098. var ivprogDefKeywords = "funcao const";
  13099. function def(mimes, mode) {
  13100. if (typeof mimes == "string") mimes = [mimes];
  13101. var words = [];
  13102. function add(obj) {
  13103. if (obj) {
  13104. for (var prop in obj) {
  13105. if (Object.hasOwnProperty.call(obj, prop)) {
  13106. words.push(prop);
  13107. }
  13108. }
  13109. }
  13110. }
  13111. add(mode.keywords);
  13112. add(mode.types);
  13113. add(mode.builtin);
  13114. add(mode.atoms);
  13115. if (words.length) {
  13116. mode.helperType = mimes[0];
  13117. CodeMirror.registerHelper("hintWords", mimes[0], words);
  13118. }
  13119. for (var i = 0; i < mimes.length; ++i) {
  13120. CodeMirror.defineMIME(mimes[i], mode);
  13121. }
  13122. }
  13123. def(["text/x-ivprog"], {
  13124. name: "ivprog",
  13125. keywords: words(ivprogKeywords),
  13126. types: ivprogTypes,
  13127. blockKeywords: words(ivprogBlockKeywords),
  13128. defKeywords: words(ivprogDefKeywords),
  13129. typeFirstDefinitions: true,
  13130. atoms: words(codeConfig.atoms.join(" ")),
  13131. switchKeyword: codeConfig.switchString,
  13132. caseKeyword: codeConfig.case_default[0],
  13133. defaultKeyword: codeConfig.case_default[1],
  13134. modeProps: {
  13135. fold: ["brace"]
  13136. }
  13137. });
  13138. }
  13139. /***/ }),
  13140. /***/ "./js/util/iassignHelpers.js":
  13141. /*!***********************************!*\
  13142. !*** ./js/util/iassignHelpers.js ***!
  13143. \***********************************/
  13144. /*! exports provided: prepareActivityToStudentHelper, autoEval */
  13145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13146. "use strict";
  13147. __webpack_require__.r(__webpack_exports__);
  13148. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return prepareActivityToStudentHelper; });
  13149. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return autoEval; });
  13150. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../visualUI/functions */ "./js/visualUI/functions.js");
  13151. /* harmony import */ var _visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../visualUI/code_generator */ "./js/visualUI/code_generator.js");
  13152. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  13153. /* harmony import */ var _testConsole__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./testConsole */ "./js/util/testConsole.js");
  13154. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  13155. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  13156. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./maybe */ "./js/util/maybe.ts");
  13157. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_maybe__WEBPACK_IMPORTED_MODULE_6__);
  13158. function parseActivityData(data) {
  13159. var algorithm_in_ilm = null;
  13160. if (data.split("\n::algorithm::")[1]) {
  13161. algorithm_in_ilm = data.split("\n::algorithm::")[1].split("\n::logs::")[0];
  13162. var logs = data.split("\n::algorithm::")[1].split("\n::logs::")[1];
  13163. if (logs != null) {
  13164. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"])(logs);
  13165. }
  13166. }
  13167. var content;
  13168. try {
  13169. content = JSON.parse(data.split("\n::algorithm::")[0]);
  13170. content["algorithm_in_ilm"] = algorithm_in_ilm;
  13171. } catch (e) {
  13172. console.error(e);
  13173. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].none();
  13174. }
  13175. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].some(content);
  13176. }
  13177. function prepareActivityToStudentHelper(ilm_cont) {
  13178. var maybe_content = parseActivityData(ilm_cont);
  13179. return maybe_content.map(function (content) {
  13180. var testCases = content.testcases;
  13181. Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["setTestCases"])(testCases);
  13182. var prog_type = null;
  13183. if (content.settings_programming_type) {
  13184. prog_type = content.settings_programming_type[0].value;
  13185. } else {
  13186. prog_type = "visual";
  13187. }
  13188. return {
  13189. settingsProgrammingType: prog_type,
  13190. settingsDataTypes: content.settings_data_types,
  13191. settingsCommands: content.settings_commands,
  13192. settingsFunctions: content.settings_functions,
  13193. algorithmInIlm: content.algorithm_in_ilm,
  13194. settingsFilter: content.settings_filter
  13195. };
  13196. });
  13197. }
  13198. function compareArray(a, b) {
  13199. for (var i = 0; i < a.length; ++i) {
  13200. var elementA = a[i];
  13201. var elementB = b[i];
  13202. if (elementA != elementB) {
  13203. return false;
  13204. }
  13205. }
  13206. return true;
  13207. }
  13208. function compareTestcases(original, student) {
  13209. if (original.length != student.length) {
  13210. return false;
  13211. }
  13212. for (var i = 0; i < original.length; ++i) {
  13213. var elementO = original[i];
  13214. var elementS = student[i];
  13215. if (!compareArray(elementO.input, elementS.input)) {
  13216. return false;
  13217. }
  13218. if (!compareArray(elementO.output, elementS.output)) {
  13219. return false;
  13220. }
  13221. }
  13222. return true;
  13223. }
  13224. function autoEval(originalData, callback) {
  13225. var code = Object(_visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__["generate"])(); //console.debug(code);
  13226. var original = parseActivityData(originalData).getOrElse(undefined);
  13227. if (original == null) {
  13228. alert("iAssign did not provide the original activity data!");
  13229. return callback(null);
  13230. }
  13231. if (code == null) {
  13232. return callback(-1); // @FeedbackConvention Casos de teste vazios
  13233. } else {
  13234. if (!compareTestcases(original.testcases, Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["getTestCases"])())) {
  13235. return callback(-2); // @FeedbackConvention Casos de teste alterados pelo aluno
  13236. }
  13237. try {
  13238. var ast_code = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__["SemanticAnalyser"].analyseFromSource(code);
  13239. var con = new _testConsole__WEBPACK_IMPORTED_MODULE_3__["TestConsole"]([]);
  13240. var autoAssessment = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__["IVProgAssessment"](ast_code, original.testcases, con);
  13241. autoAssessment.runTest().then(function (grade) {
  13242. return callback(grade);
  13243. })["catch"](function (err) {
  13244. console.log(err);
  13245. callback(-5); // @FeedbackConvention Falha na execução
  13246. });
  13247. } catch (e) {
  13248. console.error(e);
  13249. callback(-5);
  13250. }
  13251. }
  13252. }
  13253. /***/ }),
  13254. /***/ "./js/util/inputTest.js":
  13255. /*!******************************!*\
  13256. !*** ./js/util/inputTest.js ***!
  13257. \******************************/
  13258. /*! exports provided: InputTest */
  13259. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13260. "use strict";
  13261. __webpack_require__.r(__webpack_exports__);
  13262. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputTest", function() { return InputTest; });
  13263. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13264. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13265. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13266. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13267. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13268. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13269. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13270. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13271. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13272. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13273. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13274. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13275. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  13276. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  13277. var InputTest = /*#__PURE__*/function (_Input) {
  13278. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputTest, _Input);
  13279. var _super = _createSuper(InputTest);
  13280. function InputTest(inputList) {
  13281. var _this;
  13282. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputTest);
  13283. _this = _super.call(this);
  13284. _this.index = 0;
  13285. _this.inputList = inputList;
  13286. return _this;
  13287. }
  13288. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputTest, [{
  13289. key: "requestInput",
  13290. value: function requestInput() {
  13291. var _this2 = this;
  13292. var promise = new Promise(function (resolve, reject) {
  13293. if (_this2.index < _this2.inputList.length) {
  13294. resolve(_this2.inputList[_this2.index]);
  13295. _this2.index++;
  13296. } else {
  13297. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13298. }
  13299. });
  13300. return promise;
  13301. }
  13302. }]);
  13303. return InputTest;
  13304. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13305. /***/ }),
  13306. /***/ "./js/util/input_assessment.js":
  13307. /*!*************************************!*\
  13308. !*** ./js/util/input_assessment.js ***!
  13309. \*************************************/
  13310. /*! exports provided: InputAssessment */
  13311. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13312. "use strict";
  13313. __webpack_require__.r(__webpack_exports__);
  13314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputAssessment", function() { return InputAssessment; });
  13315. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13316. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13317. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13318. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13319. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13320. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13321. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13322. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13323. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13324. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13325. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13326. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13327. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  13328. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  13329. var InputAssessment = /*#__PURE__*/function (_Input) {
  13330. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputAssessment, _Input);
  13331. var _super = _createSuper(InputAssessment);
  13332. function InputAssessment(input_list) {
  13333. var _this;
  13334. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputAssessment);
  13335. _this = _super.call(this);
  13336. _this.index = 0;
  13337. _this.input_list = input_list.map(function (val) {
  13338. return {
  13339. "value": val,
  13340. "read": false
  13341. };
  13342. });
  13343. return _this;
  13344. }
  13345. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputAssessment, [{
  13346. key: "requestInput",
  13347. value: function requestInput() {
  13348. var _this2 = this;
  13349. var promise = new Promise(function (resolve, reject) {
  13350. if (_this2.index < _this2.input_list.length) {
  13351. var input = _this2.input_list[_this2.index];
  13352. input.read = true;
  13353. _this2.index += 1;
  13354. resolve(input.value);
  13355. } else {
  13356. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13357. }
  13358. });
  13359. return promise;
  13360. }
  13361. }, {
  13362. key: "isInputAvailable",
  13363. value: function isInputAvailable() {
  13364. return this.index < this.input_list.length;
  13365. }
  13366. }]);
  13367. return InputAssessment;
  13368. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13369. /***/ }),
  13370. /***/ "./js/util/maybe.ts":
  13371. /*!**************************!*\
  13372. !*** ./js/util/maybe.ts ***!
  13373. \**************************/
  13374. /*! no static exports found */
  13375. /***/ (function(module, exports, __webpack_require__) {
  13376. "use strict";
  13377. Object.defineProperty(exports, "__esModule", { value: true });
  13378. exports.Maybe = void 0;
  13379. /**
  13380. *
  13381. * Maybe Monad
  13382. * @Source: https://codewithstyle.info/advanced-functional-programming-in-typescript-maybe-monad/
  13383. * @Modified by: @lucascalion - 28/08/2019
  13384. *
  13385. **/
  13386. class Maybe {
  13387. constructor(value) {
  13388. this.value = value;
  13389. }
  13390. static some(value) {
  13391. if (!value) {
  13392. throw Error("Provided value must not be empty");
  13393. }
  13394. return new Maybe(value);
  13395. }
  13396. static none() {
  13397. return new Maybe(null);
  13398. }
  13399. static fromValue(value) {
  13400. return value ? Maybe.some(value) : Maybe.none();
  13401. }
  13402. getOrElse(defaultValue) {
  13403. return this.value === null ? defaultValue : this.value;
  13404. }
  13405. map(f) {
  13406. if (this.value === null) {
  13407. return Maybe.none();
  13408. }
  13409. else {
  13410. return Maybe.fromValue(f(this.value));
  13411. }
  13412. }
  13413. }
  13414. exports.Maybe = Maybe;
  13415. /***/ }),
  13416. /***/ "./js/util/outputTest.js":
  13417. /*!*******************************!*\
  13418. !*** ./js/util/outputTest.js ***!
  13419. \*******************************/
  13420. /*! exports provided: OutputTest */
  13421. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13422. "use strict";
  13423. __webpack_require__.r(__webpack_exports__);
  13424. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputTest", function() { return OutputTest; });
  13425. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13426. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13427. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13428. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13429. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13430. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13431. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13432. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13433. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13434. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13435. /* harmony import */ var _io_output__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/output */ "./js/io/output.js");
  13436. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  13437. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  13438. var OutputTest = /*#__PURE__*/function (_Output) {
  13439. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(OutputTest, _Output);
  13440. var _super = _createSuper(OutputTest);
  13441. function OutputTest() {
  13442. var _this;
  13443. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputTest);
  13444. _this = _super.call(this);
  13445. _this.list = [];
  13446. _this.currentLine = null;
  13447. return _this;
  13448. }
  13449. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputTest, [{
  13450. key: "write",
  13451. value: function write(text) {
  13452. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13453. if (this.currentLine == null) {
  13454. this.currentLine = this.list.push('') - 1;
  13455. }
  13456. this.list[this.currentLine] += text;
  13457. if (newLine) {
  13458. this.currentLine = null;
  13459. }
  13460. }
  13461. }, {
  13462. key: "sendOutput",
  13463. value: function sendOutput(text) {
  13464. var _this2 = this;
  13465. var output = '' + text;
  13466. if (output.indexOf('\n') !== -1) {
  13467. var outputList = output.split('\n');
  13468. var last = outputList.pop();
  13469. outputList.forEach(function (t) {
  13470. t = t.replace(/\t/g, '&#x0020;&#x0020;');
  13471. t = t.replace(/\s/g, "&#x0020;");
  13472. if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
  13473. });
  13474. last = last.replace(/\t/g, '&#x0020;&#x0020;');
  13475. last = last.replace(/\s/g, "&#x0020;");
  13476. if (last.length != 0) this.write(last);
  13477. } else {
  13478. output = output.replace(/\t/g, '&#x0020;&#x0020;');
  13479. output = output.replace(/\s/g, "&#x0020;");
  13480. this.write(output);
  13481. }
  13482. }
  13483. }]);
  13484. return OutputTest;
  13485. }(_io_output__WEBPACK_IMPORTED_MODULE_5__["Output"]);
  13486. /***/ }),
  13487. /***/ "./js/util/string_diff.js":
  13488. /*!********************************!*\
  13489. !*** ./js/util/string_diff.js ***!
  13490. \********************************/
  13491. /*! exports provided: default */
  13492. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13493. "use strict";
  13494. __webpack_require__.r(__webpack_exports__);
  13495. /**
  13496. * Author: @jhchen - https://github.com/jhchen
  13497. * Modified by: @lucascalion - 23/07/2019
  13498. * This library modifies the diff-patch-match library by Neil Fraser
  13499. * by removing the patch and match functionality and certain advanced
  13500. * options in the diff function. The original license is as follows:
  13501. *
  13502. * ===
  13503. *
  13504. * Diff Match and Patch
  13505. *
  13506. * Copyright 2006 Google Inc.
  13507. * http://code.google.com/p/google-diff-match-patch/
  13508. *
  13509. * Licensed under the Apache License, Version 2.0 (the "License");
  13510. * you may not use this file except in compliance with the License.
  13511. * You may obtain a copy of the License at
  13512. *
  13513. * http://www.apache.org/licenses/LICENSE-2.0
  13514. *
  13515. * Unless required by applicable law or agreed to in writing, software
  13516. * distributed under the License is distributed on an "AS IS" BASIS,
  13517. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13518. * See the License for the specific language governing permissions and
  13519. * limitations under the License.
  13520. */
  13521. /**
  13522. * The data structure representing a diff is an array of tuples:
  13523. * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
  13524. * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
  13525. */
  13526. var DIFF_DELETE = -1;
  13527. var DIFF_INSERT = 1;
  13528. var DIFF_EQUAL = 0;
  13529. /**
  13530. * Find the differences between two texts. Simplifies the problem by stripping
  13531. * any common prefix or suffix off the texts before diffing.
  13532. * @param {string} text1 Old string to be diffed.
  13533. * @param {string} text2 New string to be diffed.
  13534. * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info
  13535. * @return {Array} Array of diff tuples.
  13536. */
  13537. function diff_main(text1, text2, cursor_pos, _fix_unicode) {
  13538. // Check for equality
  13539. if (text1 === text2) {
  13540. if (text1) {
  13541. return [[DIFF_EQUAL, text1]];
  13542. }
  13543. return [];
  13544. }
  13545. if (cursor_pos != null) {
  13546. var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
  13547. if (editdiff) {
  13548. return editdiff;
  13549. }
  13550. } // Trim off common prefix (speedup).
  13551. var commonlength = diff_commonPrefix(text1, text2);
  13552. var commonprefix = text1.substring(0, commonlength);
  13553. text1 = text1.substring(commonlength);
  13554. text2 = text2.substring(commonlength); // Trim off common suffix (speedup).
  13555. commonlength = diff_commonSuffix(text1, text2);
  13556. var commonsuffix = text1.substring(text1.length - commonlength);
  13557. text1 = text1.substring(0, text1.length - commonlength);
  13558. text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block.
  13559. var diffs = diff_compute_(text1, text2); // Restore the prefix and suffix.
  13560. if (commonprefix) {
  13561. diffs.unshift([DIFF_EQUAL, commonprefix]);
  13562. }
  13563. if (commonsuffix) {
  13564. diffs.push([DIFF_EQUAL, commonsuffix]);
  13565. }
  13566. diff_cleanupMerge(diffs, _fix_unicode);
  13567. return diffs;
  13568. }
  13569. /**
  13570. * Find the differences between two texts. Assumes that the texts do not
  13571. * have any common prefix or suffix.
  13572. * @param {string} text1 Old string to be diffed.
  13573. * @param {string} text2 New string to be diffed.
  13574. * @return {Array} Array of diff tuples.
  13575. */
  13576. function diff_compute_(text1, text2) {
  13577. var diffs;
  13578. if (!text1) {
  13579. // Just add some text (speedup).
  13580. return [[DIFF_INSERT, text2]];
  13581. }
  13582. if (!text2) {
  13583. // Just delete some text (speedup).
  13584. return [[DIFF_DELETE, text1]];
  13585. }
  13586. var longtext = text1.length > text2.length ? text1 : text2;
  13587. var shorttext = text1.length > text2.length ? text2 : text1;
  13588. var i = longtext.indexOf(shorttext);
  13589. if (i !== -1) {
  13590. // Shorter text is inside the longer text (speedup).
  13591. diffs = [[DIFF_INSERT, longtext.substring(0, i)], [DIFF_EQUAL, shorttext], [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; // Swap insertions for deletions if diff is reversed.
  13592. if (text1.length > text2.length) {
  13593. diffs[0][0] = diffs[2][0] = DIFF_DELETE;
  13594. }
  13595. return diffs;
  13596. }
  13597. if (shorttext.length === 1) {
  13598. // Single character string.
  13599. // After the previous speedup, the character can't be an equality.
  13600. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  13601. } // Check to see if the problem can be split in two.
  13602. var hm = diff_halfMatch_(text1, text2);
  13603. if (hm) {
  13604. // A half-match was found, sort out the return data.
  13605. var text1_a = hm[0];
  13606. var text1_b = hm[1];
  13607. var text2_a = hm[2];
  13608. var text2_b = hm[3];
  13609. var mid_common = hm[4]; // Send both pairs off for separate processing.
  13610. var diffs_a = diff_main(text1_a, text2_a);
  13611. var diffs_b = diff_main(text1_b, text2_b); // Merge the results.
  13612. return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
  13613. }
  13614. return diff_bisect_(text1, text2);
  13615. }
  13616. /**
  13617. * Find the 'middle snake' of a diff, split the problem in two
  13618. * and return the recursively constructed diff.
  13619. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
  13620. * @param {string} text1 Old string to be diffed.
  13621. * @param {string} text2 New string to be diffed.
  13622. * @return {Array} Array of diff tuples.
  13623. * @private
  13624. */
  13625. function diff_bisect_(text1, text2) {
  13626. // Cache the text lengths to prevent multiple calls.
  13627. var text1_length = text1.length;
  13628. var text2_length = text2.length;
  13629. var max_d = Math.ceil((text1_length + text2_length) / 2);
  13630. var v_offset = max_d;
  13631. var v_length = 2 * max_d;
  13632. var v1 = new Array(v_length);
  13633. var v2 = new Array(v_length); // Setting all elements to -1 is faster in Chrome & Firefox than mixing
  13634. // integers and undefined.
  13635. for (var x = 0; x < v_length; x++) {
  13636. v1[x] = -1;
  13637. v2[x] = -1;
  13638. }
  13639. v1[v_offset + 1] = 0;
  13640. v2[v_offset + 1] = 0;
  13641. var delta = text1_length - text2_length; // If the total number of characters is odd, then the front path will collide
  13642. // with the reverse path.
  13643. var front = delta % 2 !== 0; // Offsets for start and end of k loop.
  13644. // Prevents mapping of space beyond the grid.
  13645. var k1start = 0;
  13646. var k1end = 0;
  13647. var k2start = 0;
  13648. var k2end = 0;
  13649. for (var d = 0; d < max_d; d++) {
  13650. // Walk the front path one step.
  13651. for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
  13652. var k1_offset = v_offset + k1;
  13653. var x1 = void 0;
  13654. if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
  13655. x1 = v1[k1_offset + 1];
  13656. } else {
  13657. x1 = v1[k1_offset - 1] + 1;
  13658. }
  13659. var y1 = x1 - k1;
  13660. while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
  13661. x1++;
  13662. y1++;
  13663. }
  13664. v1[k1_offset] = x1;
  13665. if (x1 > text1_length) {
  13666. // Ran off the right of the graph.
  13667. k1end += 2;
  13668. } else if (y1 > text2_length) {
  13669. // Ran off the bottom of the graph.
  13670. k1start += 2;
  13671. } else if (front) {
  13672. var k2_offset = v_offset + delta - k1;
  13673. if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
  13674. // Mirror x2 onto top-left coordinate system.
  13675. var x2 = text1_length - v2[k2_offset];
  13676. if (x1 >= x2) {
  13677. // Overlap detfrontected.
  13678. return diff_bisectSplit_(text1, text2, x1, y1);
  13679. }
  13680. }
  13681. }
  13682. } // Walk the reverse path one step.
  13683. for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
  13684. var _k2_offset = v_offset + k2;
  13685. var _x = void 0;
  13686. if (k2 === -d || k2 !== d && v2[_k2_offset - 1] < v2[_k2_offset + 1]) {
  13687. _x = v2[_k2_offset + 1];
  13688. } else {
  13689. _x = v2[_k2_offset - 1] + 1;
  13690. }
  13691. var y2 = _x - k2;
  13692. while (_x < text1_length && y2 < text2_length && text1.charAt(text1_length - _x - 1) === text2.charAt(text2_length - y2 - 1)) {
  13693. _x++;
  13694. y2++;
  13695. }
  13696. v2[_k2_offset] = _x;
  13697. if (_x > text1_length) {
  13698. // Ran off the left of the graph.
  13699. k2end += 2;
  13700. } else if (y2 > text2_length) {
  13701. // Ran off the top of the graph.
  13702. k2start += 2;
  13703. } else if (!front) {
  13704. var _k1_offset = v_offset + delta - k2;
  13705. if (_k1_offset >= 0 && _k1_offset < v_length && v1[_k1_offset] !== -1) {
  13706. var _x2 = v1[_k1_offset];
  13707. var _y = v_offset + _x2 - _k1_offset; // Mirror x2 onto top-left coordinate system.
  13708. _x = text1_length - _x;
  13709. if (_x2 >= _x) {
  13710. // Overlap detected.
  13711. return diff_bisectSplit_(text1, text2, _x2, _y);
  13712. }
  13713. }
  13714. }
  13715. }
  13716. } // Diff took too long and hit the deadline or
  13717. // number of diffs equals number of characters, no commonality at all.
  13718. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  13719. }
  13720. /**
  13721. * Given the location of the 'middle snake', split the diff in two parts
  13722. * and recurse.
  13723. * @param {string} text1 Old string to be diffed.
  13724. * @param {string} text2 New string to be diffed.
  13725. * @param {number} x Index of split point in text1.
  13726. * @param {number} y Index of split point in text2.
  13727. * @return {Array} Array of diff tuples.
  13728. */
  13729. function diff_bisectSplit_(text1, text2, x, y) {
  13730. var text1a = text1.substring(0, x);
  13731. var text2a = text2.substring(0, y);
  13732. var text1b = text1.substring(x);
  13733. var text2b = text2.substring(y); // Compute both diffs serially.
  13734. var diffs = diff_main(text1a, text2a);
  13735. var diffsb = diff_main(text1b, text2b);
  13736. return diffs.concat(diffsb);
  13737. }
  13738. /**
  13739. * Determine the common prefix of two strings.
  13740. * @param {string} text1 First string.
  13741. * @param {string} text2 Second string.
  13742. * @return {number} The number of characters common to the start of each
  13743. * string.
  13744. */
  13745. function diff_commonPrefix(text1, text2) {
  13746. // Quick check for common null cases.
  13747. if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
  13748. return 0;
  13749. } // Binary search.
  13750. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  13751. var pointermin = 0;
  13752. var pointermax = Math.min(text1.length, text2.length);
  13753. var pointermid = pointermax;
  13754. var pointerstart = 0;
  13755. while (pointermin < pointermid) {
  13756. if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
  13757. pointermin = pointermid;
  13758. pointerstart = pointermin;
  13759. } else {
  13760. pointermax = pointermid;
  13761. }
  13762. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  13763. }
  13764. if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
  13765. pointermid--;
  13766. }
  13767. return pointermid;
  13768. }
  13769. /**
  13770. * Determine the common suffix of two strings.
  13771. * @param {string} text1 First string.
  13772. * @param {string} text2 Second string.
  13773. * @return {number} The number of characters common to the end of each string.
  13774. */
  13775. function diff_commonSuffix(text1, text2) {
  13776. // Quick check for common null cases.
  13777. if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
  13778. return 0;
  13779. } // Binary search.
  13780. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  13781. var pointermin = 0;
  13782. var pointermax = Math.min(text1.length, text2.length);
  13783. var pointermid = pointermax;
  13784. var pointerend = 0;
  13785. while (pointermin < pointermid) {
  13786. if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
  13787. pointermin = pointermid;
  13788. pointerend = pointermin;
  13789. } else {
  13790. pointermax = pointermid;
  13791. }
  13792. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  13793. }
  13794. if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
  13795. pointermid--;
  13796. }
  13797. return pointermid;
  13798. }
  13799. /**
  13800. * Do the two texts share a substring which is at least half the length of the
  13801. * longer text?
  13802. * This speedup can produce non-minimal diffs.
  13803. * @param {string} text1 First string.
  13804. * @param {string} text2 Second string.
  13805. * @return {Array.<string>} Five element Array, containing the prefix of
  13806. * text1, the suffix of text1, the prefix of text2, the suffix of
  13807. * text2 and the common middle. Or null if there was no match.
  13808. */
  13809. function diff_halfMatch_(text1, text2) {
  13810. var longtext = text1.length > text2.length ? text1 : text2;
  13811. var shorttext = text1.length > text2.length ? text2 : text1;
  13812. if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
  13813. return null; // Pointless.
  13814. }
  13815. /**
  13816. * Does a substring of shorttext exist within longtext such that the substring
  13817. * is at least half the length of longtext?
  13818. * Closure, but does not reference any external variables.
  13819. * @param {string} longtext Longer string.
  13820. * @param {string} shorttext Shorter string.
  13821. * @param {number} i Start index of quarter length substring within longtext.
  13822. * @return {Array.<string>} Five element Array, containing the prefix of
  13823. * longtext, the suffix of longtext, the prefix of shorttext, the suffix
  13824. * of shorttext and the common middle. Or null if there was no match.
  13825. * @private
  13826. */
  13827. function diff_halfMatchI_(longtext, shorttext, i) {
  13828. // Start with a 1/4 length substring at position i as a seed.
  13829. var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
  13830. var j = -1;
  13831. var best_common = '';
  13832. var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
  13833. while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {
  13834. var prefixLength = diff_commonPrefix(longtext.substring(i), shorttext.substring(j));
  13835. var suffixLength = diff_commonSuffix(longtext.substring(0, i), shorttext.substring(0, j));
  13836. if (best_common.length < suffixLength + prefixLength) {
  13837. best_common = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength);
  13838. best_longtext_a = longtext.substring(0, i - suffixLength);
  13839. best_longtext_b = longtext.substring(i + prefixLength);
  13840. best_shorttext_a = shorttext.substring(0, j - suffixLength);
  13841. best_shorttext_b = shorttext.substring(j + prefixLength);
  13842. }
  13843. }
  13844. if (best_common.length * 2 >= longtext.length) {
  13845. return [best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common];
  13846. } else {
  13847. return null;
  13848. }
  13849. } // First check if the second quarter is the seed for a half-match.
  13850. var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter.
  13851. var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
  13852. var hm;
  13853. if (!hm1 && !hm2) {
  13854. return null;
  13855. } else if (!hm2) {
  13856. hm = hm1;
  13857. } else if (!hm1) {
  13858. hm = hm2;
  13859. } else {
  13860. // Both matched. Select the longest.
  13861. hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
  13862. } // A half-match was found, sort out the return data.
  13863. var text1_a, text1_b, text2_a, text2_b;
  13864. if (text1.length > text2.length) {
  13865. text1_a = hm[0];
  13866. text1_b = hm[1];
  13867. text2_a = hm[2];
  13868. text2_b = hm[3];
  13869. } else {
  13870. text2_a = hm[0];
  13871. text2_b = hm[1];
  13872. text1_a = hm[2];
  13873. text1_b = hm[3];
  13874. }
  13875. var mid_common = hm[4];
  13876. return [text1_a, text1_b, text2_a, text2_b, mid_common];
  13877. }
  13878. /**
  13879. * Reorder and merge like edit sections. Merge equalities.
  13880. * Any edit section can move as long as it doesn't cross an equality.
  13881. * @param {Array} diffs Array of diff tuples.
  13882. * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff
  13883. */
  13884. function diff_cleanupMerge(diffs, fix_unicode) {
  13885. diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
  13886. var pointer = 0;
  13887. var count_delete = 0;
  13888. var count_insert = 0;
  13889. var text_delete = '';
  13890. var text_insert = '';
  13891. var commonlength;
  13892. var previous_equality;
  13893. while (pointer < diffs.length) {
  13894. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  13895. diffs.splice(pointer, 1);
  13896. continue;
  13897. }
  13898. switch (diffs[pointer][0]) {
  13899. case DIFF_INSERT:
  13900. count_insert++;
  13901. text_insert += diffs[pointer][1];
  13902. pointer++;
  13903. break;
  13904. case DIFF_DELETE:
  13905. count_delete++;
  13906. text_delete += diffs[pointer][1];
  13907. pointer++;
  13908. break;
  13909. case DIFF_EQUAL:
  13910. previous_equality = pointer - count_insert - count_delete - 1;
  13911. if (fix_unicode) {
  13912. // prevent splitting of unicode surrogate pairs. when fix_unicode is true,
  13913. // we assume that the old and new text in the diff are complete and correct
  13914. // unicode-encoded JS strings, but the tuple boundaries may fall between
  13915. // surrogate pairs. we fix this by shaving off stray surrogates from the end
  13916. // of the previous equality and the beginning of this equality. this may create
  13917. // empty equalities or a common prefix or suffix. for example, if AB and AC are
  13918. // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and
  13919. // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this
  13920. // particular case, both equalities go away, we absorb any previous inequalities,
  13921. // and we keep scanning for the next equality before rewriting the tuples.
  13922. if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
  13923. var stray = diffs[previous_equality][1].slice(-1);
  13924. diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
  13925. text_delete = stray + text_delete;
  13926. text_insert = stray + text_insert;
  13927. if (!diffs[previous_equality][1]) {
  13928. // emptied out previous equality, so delete it and include previous delete/insert
  13929. diffs.splice(previous_equality, 1);
  13930. pointer--;
  13931. var k = previous_equality - 1;
  13932. if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
  13933. count_insert++;
  13934. text_insert = diffs[k][1] + text_insert;
  13935. k--;
  13936. }
  13937. if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
  13938. count_delete++;
  13939. text_delete = diffs[k][1] + text_delete;
  13940. k--;
  13941. }
  13942. previous_equality = k;
  13943. }
  13944. }
  13945. if (starts_with_pair_end(diffs[pointer][1])) {
  13946. var _stray = diffs[pointer][1].charAt(0);
  13947. diffs[pointer][1] = diffs[pointer][1].slice(1);
  13948. text_delete += _stray;
  13949. text_insert += _stray;
  13950. }
  13951. }
  13952. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  13953. // for empty equality not at end, wait for next equality
  13954. diffs.splice(pointer, 1);
  13955. break;
  13956. }
  13957. if (text_delete.length > 0 || text_insert.length > 0) {
  13958. // note that diff_commonPrefix and diff_commonSuffix are unicode-aware
  13959. if (text_delete.length > 0 && text_insert.length > 0) {
  13960. // Factor out any common prefixes.
  13961. commonlength = diff_commonPrefix(text_insert, text_delete);
  13962. if (commonlength !== 0) {
  13963. if (previous_equality >= 0) {
  13964. diffs[previous_equality][1] += text_insert.substring(0, commonlength);
  13965. } else {
  13966. diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
  13967. pointer++;
  13968. }
  13969. text_insert = text_insert.substring(commonlength);
  13970. text_delete = text_delete.substring(commonlength);
  13971. } // Factor out any common suffixes.
  13972. commonlength = diff_commonSuffix(text_insert, text_delete);
  13973. if (commonlength !== 0) {
  13974. diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
  13975. text_insert = text_insert.substring(0, text_insert.length - commonlength);
  13976. text_delete = text_delete.substring(0, text_delete.length - commonlength);
  13977. }
  13978. } // Delete the offending records and add the merged ones.
  13979. var n = count_insert + count_delete;
  13980. if (text_delete.length === 0 && text_insert.length === 0) {
  13981. diffs.splice(pointer - n, n);
  13982. pointer = pointer - n;
  13983. } else if (text_delete.length === 0) {
  13984. diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
  13985. pointer = pointer - n + 1;
  13986. } else if (text_insert.length === 0) {
  13987. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
  13988. pointer = pointer - n + 1;
  13989. } else {
  13990. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
  13991. pointer = pointer - n + 2;
  13992. }
  13993. }
  13994. if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
  13995. // Merge this equality with the previous one.
  13996. diffs[pointer - 1][1] += diffs[pointer][1];
  13997. diffs.splice(pointer, 1);
  13998. } else {
  13999. pointer++;
  14000. }
  14001. count_insert = 0;
  14002. count_delete = 0;
  14003. text_delete = '';
  14004. text_insert = '';
  14005. break;
  14006. }
  14007. }
  14008. if (diffs[diffs.length - 1][1] === '') {
  14009. diffs.pop(); // Remove the dummy entry at the end.
  14010. } // Second pass: look for single edits surrounded on both sides by equalities
  14011. // which can be shifted sideways to eliminate an equality.
  14012. // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
  14013. var changes = false;
  14014. pointer = 1; // Intentionally ignore the first and last element (don't need checking).
  14015. while (pointer < diffs.length - 1) {
  14016. if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
  14017. // This is a single edit surrounded by equalities.
  14018. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
  14019. // Shift the edit over the previous equality.
  14020. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
  14021. diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
  14022. diffs.splice(pointer - 1, 1);
  14023. changes = true;
  14024. } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
  14025. // Shift the edit over the next equality.
  14026. diffs[pointer - 1][1] += diffs[pointer + 1][1];
  14027. diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
  14028. diffs.splice(pointer + 1, 1);
  14029. changes = true;
  14030. }
  14031. }
  14032. pointer++;
  14033. } // If shifts were made, the diff needs reordering and another shift sweep.
  14034. if (changes) {
  14035. diff_cleanupMerge(diffs, fix_unicode);
  14036. }
  14037. }
  14038. function is_surrogate_pair_start(charCode) {
  14039. return charCode >= 0xD800 && charCode <= 0xDBFF;
  14040. }
  14041. function is_surrogate_pair_end(charCode) {
  14042. return charCode >= 0xDC00 && charCode <= 0xDFFF;
  14043. }
  14044. function starts_with_pair_end(str) {
  14045. return is_surrogate_pair_end(str.charCodeAt(0));
  14046. }
  14047. function ends_with_pair_start(str) {
  14048. return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
  14049. }
  14050. function remove_empty_tuples(tuples) {
  14051. var ret = [];
  14052. for (var i = 0; i < tuples.length; i++) {
  14053. if (tuples[i][1].length > 0) {
  14054. ret.push(tuples[i]);
  14055. }
  14056. }
  14057. return ret;
  14058. }
  14059. function make_edit_splice(before, oldMiddle, newMiddle, after) {
  14060. if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
  14061. return null;
  14062. }
  14063. return remove_empty_tuples([[DIFF_EQUAL, before], [DIFF_DELETE, oldMiddle], [DIFF_INSERT, newMiddle], [DIFF_EQUAL, after]]);
  14064. }
  14065. function find_cursor_edit_diff(oldText, newText, cursor_pos) {
  14066. // note: this runs after equality check has ruled out exact equality
  14067. var oldRange = typeof cursor_pos === 'number' ? {
  14068. index: cursor_pos,
  14069. length: 0
  14070. } : cursor_pos.oldRange;
  14071. var newRange = typeof cursor_pos === 'number' ? null : cursor_pos.newRange; // take into account the old and new selection to generate the best diff
  14072. // possible for a text edit. for example, a text change from "xxx" to "xx"
  14073. // could be a delete or forwards-delete of any one of the x's, or the
  14074. // result of selecting two of the x's and typing "x".
  14075. var oldLength = oldText.length;
  14076. var newLength = newText.length;
  14077. if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
  14078. // see if we have an insert or delete before or after cursor
  14079. var oldCursor = oldRange.index;
  14080. var oldBefore = oldText.slice(0, oldCursor);
  14081. var oldAfter = oldText.slice(oldCursor);
  14082. var maybeNewCursor = newRange ? newRange.index : null;
  14083. editBefore: {
  14084. // is this an insert or delete right before oldCursor?
  14085. var newCursor = oldCursor + newLength - oldLength;
  14086. if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
  14087. break editBefore;
  14088. }
  14089. if (newCursor < 0 || newCursor > newLength) {
  14090. break editBefore;
  14091. }
  14092. var newBefore = newText.slice(0, newCursor);
  14093. var newAfter = newText.slice(newCursor);
  14094. if (newAfter !== oldAfter) {
  14095. break editBefore;
  14096. }
  14097. var prefixLength = Math.min(oldCursor, newCursor);
  14098. var oldPrefix = oldBefore.slice(0, prefixLength);
  14099. var newPrefix = newBefore.slice(0, prefixLength);
  14100. if (oldPrefix !== newPrefix) {
  14101. break editBefore;
  14102. }
  14103. var oldMiddle = oldBefore.slice(prefixLength);
  14104. var newMiddle = newBefore.slice(prefixLength);
  14105. return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
  14106. }
  14107. editAfter: {
  14108. // is this an insert or delete right after oldCursor?
  14109. if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
  14110. break editAfter;
  14111. }
  14112. var cursor = oldCursor;
  14113. var _newBefore = newText.slice(0, cursor);
  14114. var _newAfter = newText.slice(cursor);
  14115. if (_newBefore !== oldBefore) {
  14116. break editAfter;
  14117. }
  14118. var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
  14119. var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
  14120. var newSuffix = _newAfter.slice(_newAfter.length - suffixLength);
  14121. if (oldSuffix !== newSuffix) {
  14122. break editAfter;
  14123. }
  14124. var _oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
  14125. var _newMiddle = _newAfter.slice(0, _newAfter.length - suffixLength);
  14126. return make_edit_splice(oldBefore, _oldMiddle, _newMiddle, oldSuffix);
  14127. }
  14128. }
  14129. if (oldRange.length > 0 && newRange && newRange.length === 0) {
  14130. replaceRange: {
  14131. // see if diff could be a splice of the old selection range
  14132. var _oldPrefix = oldText.slice(0, oldRange.index);
  14133. var _oldSuffix = oldText.slice(oldRange.index + oldRange.length);
  14134. var _prefixLength = _oldPrefix.length;
  14135. var _suffixLength = _oldSuffix.length;
  14136. if (newLength < _prefixLength + _suffixLength) {
  14137. break replaceRange;
  14138. }
  14139. var _newPrefix = newText.slice(0, _prefixLength);
  14140. var _newSuffix = newText.slice(newLength - _suffixLength);
  14141. if (_oldPrefix !== _newPrefix || _oldSuffix !== _newSuffix) {
  14142. break replaceRange;
  14143. }
  14144. var _oldMiddle2 = oldText.slice(_prefixLength, oldLength - _suffixLength);
  14145. var _newMiddle2 = newText.slice(_prefixLength, newLength - _suffixLength);
  14146. return make_edit_splice(_oldPrefix, _oldMiddle2, _newMiddle2, _oldSuffix);
  14147. }
  14148. }
  14149. return null;
  14150. }
  14151. function diff(text1, text2, cursor_pos) {
  14152. // only pass fix_unicode=true at the top level, not when diff_main is
  14153. // recursively invoked
  14154. return diff_main(text1, text2, cursor_pos, true);
  14155. }
  14156. diff.INSERT = DIFF_INSERT;
  14157. diff.DELETE = DIFF_DELETE;
  14158. diff.EQUAL = DIFF_EQUAL;
  14159. /* harmony default export */ __webpack_exports__["default"] = (diff);
  14160. /***/ }),
  14161. /***/ "./js/util/testConsole.js":
  14162. /*!********************************!*\
  14163. !*** ./js/util/testConsole.js ***!
  14164. \********************************/
  14165. /*! exports provided: TestConsole */
  14166. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14167. "use strict";
  14168. __webpack_require__.r(__webpack_exports__);
  14169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestConsole", function() { return TestConsole; });
  14170. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  14171. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  14172. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  14173. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  14174. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../io/domConsole */ "./js/io/domConsole.js");
  14175. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14176. var LocalizedStrings = Object(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["getInstance"])();
  14177. var TestConsole = /*#__PURE__*/function () {
  14178. function TestConsole(inputList) {
  14179. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, TestConsole);
  14180. this.index = 0;
  14181. this.inputList = inputList;
  14182. this.list = [];
  14183. this.currentLine = null;
  14184. }
  14185. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(TestConsole, [{
  14186. key: "writeRawHTML",
  14187. value: function writeRawHTML(text) {
  14188. this._appendTextLn(text);
  14189. }
  14190. }, {
  14191. key: "write",
  14192. value: function write(text) {
  14193. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14194. this._appendText(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER, newLine);
  14195. }
  14196. }, {
  14197. key: "info",
  14198. value: function info(text) {
  14199. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO);
  14200. }
  14201. }, {
  14202. key: "err",
  14203. value: function err(text) {
  14204. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR);
  14205. }
  14206. }, {
  14207. key: "_appendText",
  14208. value: function _appendText(text, _type) {
  14209. var newLine = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14210. if (this.currentLine == null) {
  14211. this.currentLine = this.list.push('') - 1;
  14212. }
  14213. this.list[this.currentLine] += text;
  14214. if (newLine) {
  14215. this.currentLine = null;
  14216. }
  14217. }
  14218. }, {
  14219. key: "_appendTextLn",
  14220. value: function _appendTextLn(text) {
  14221. this.list.push(text);
  14222. this.currentLine = null;
  14223. }
  14224. }, {
  14225. key: "getClassForType",
  14226. value: function getClassForType(type) {
  14227. switch (type) {
  14228. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER:
  14229. return "ivprog-term-userText";
  14230. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO:
  14231. return "ivprog-term-info";
  14232. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR:
  14233. return "ivprog-term-error";
  14234. }
  14235. }
  14236. }, {
  14237. key: "requestInput",
  14238. value: function requestInput() {
  14239. var _this = this;
  14240. var promise = new Promise(function (resolve, reject) {
  14241. if (_this.index < _this.inputList.length) {
  14242. resolve(_this.inputList[_this.index]);
  14243. _this.index++;
  14244. } else {
  14245. reject(new Error(LocalizedStrings.getError("exceeded_input_request")));
  14246. }
  14247. });
  14248. return promise;
  14249. }
  14250. }, {
  14251. key: "sendOutput",
  14252. value: function sendOutput(text) {
  14253. var _this2 = this;
  14254. var output = '' + text;
  14255. if (output.indexOf('\n') !== -1) {
  14256. var outputList = output.split('\n');
  14257. var last = outputList.pop();
  14258. outputList.forEach(function (t) {
  14259. t = t.replace(/\t/g, '&#x0020;&#x0020;');
  14260. t = t.replace(/\s/g, "&#x0020;");
  14261. if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
  14262. });
  14263. last = last.replace(/\t/g, '&#x0020;&#x0020;');
  14264. last = last.replace(/\s/g, "&#x0020;");
  14265. if (last.length != 0) this.write(last);
  14266. } else {
  14267. output = output.replace(/\t/g, '&#x0020;&#x0020;');
  14268. output = output.replace(/\s/g, "&#x0020;");
  14269. this.write(output);
  14270. }
  14271. }
  14272. }]);
  14273. return TestConsole;
  14274. }();
  14275. /***/ }),
  14276. /***/ "./js/util/utils.js":
  14277. /*!**************************!*\
  14278. !*** ./js/util/utils.js ***!
  14279. \**************************/
  14280. /*! exports provided: scrollIt, isElementInViewport, isKeyword, isValidIdentifier, getCodeEditorModeConfig, levenshteinDistance, openAssessmentDetail, range, sleep */
  14281. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14282. "use strict";
  14283. __webpack_require__.r(__webpack_exports__);
  14284. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollIt", function() { return scrollIt; });
  14285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementInViewport", function() { return isElementInViewport; });
  14286. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyword", function() { return isKeyword; });
  14287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidIdentifier", function() { return isValidIdentifier; });
  14288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeEditorModeConfig", function() { return getCodeEditorModeConfig; });
  14289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "levenshteinDistance", function() { return levenshteinDistance; });
  14290. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return openAssessmentDetail; });
  14291. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
  14292. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sleep", function() { return sleep; });
  14293. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  14294. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  14295. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  14296. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  14297. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  14298. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);
  14299. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../services/languageService */ "./js/services/languageService.js");
  14300. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14301. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  14302. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_5__);
  14303. /**
  14304. * source: https://pawelgrzybek.com/page-scroll-in-vanilla-javascript/
  14305. *
  14306. */
  14307. function scrollIt(destination) {
  14308. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
  14309. var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'linear';
  14310. var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  14311. var easings = {
  14312. linear: function linear(t) {
  14313. return t;
  14314. },
  14315. easeInQuad: function easeInQuad(t) {
  14316. return t * t;
  14317. },
  14318. easeOutQuad: function easeOutQuad(t) {
  14319. return t * (2 - t);
  14320. },
  14321. easeInOutQuad: function easeInOutQuad(t) {
  14322. return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
  14323. },
  14324. easeInCubic: function easeInCubic(t) {
  14325. return t * t * t;
  14326. },
  14327. easeOutCubic: function easeOutCubic(t) {
  14328. return --t * t * t + 1;
  14329. },
  14330. easeInOutCubic: function easeInOutCubic(t) {
  14331. return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
  14332. },
  14333. easeInQuart: function easeInQuart(t) {
  14334. return t * t * t * t;
  14335. },
  14336. easeOutQuart: function easeOutQuart(t) {
  14337. return 1 - --t * t * t * t;
  14338. },
  14339. easeInOutQuart: function easeInOutQuart(t) {
  14340. return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
  14341. },
  14342. easeInQuint: function easeInQuint(t) {
  14343. return t * t * t * t * t;
  14344. },
  14345. easeOutQuint: function easeOutQuint(t) {
  14346. return 1 + --t * t * t * t * t;
  14347. },
  14348. easeInOutQuint: function easeInOutQuint(t) {
  14349. return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
  14350. }
  14351. };
  14352. var start = window.pageYOffset;
  14353. var startTime = 'now' in window.performance ? performance.now() : new Date().getTime();
  14354. var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
  14355. var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
  14356. var destinationOffset = typeof destination === 'number' ? destination : destination.offsetTop;
  14357. var destinationOffsetToScroll = Math.round(documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset);
  14358. if ('requestAnimationFrame' in window === false) {
  14359. window.scroll(0, destinationOffsetToScroll);
  14360. if (callback) {
  14361. callback();
  14362. }
  14363. return;
  14364. }
  14365. function scroll() {
  14366. var now = 'now' in window.performance ? performance.now() : new Date().getTime();
  14367. var time = Math.min(1, (now - startTime) / duration);
  14368. var timeFunction = easings[easing](time);
  14369. window.scroll(0, Math.ceil(timeFunction * (destinationOffsetToScroll - start) + start));
  14370. if (window.pageYOffset === destinationOffsetToScroll) {
  14371. if (callback) {
  14372. callback();
  14373. }
  14374. return;
  14375. }
  14376. requestAnimationFrame(scroll);
  14377. }
  14378. scroll();
  14379. }
  14380. /**
  14381. *
  14382. * source: https://stackoverflow.com/a/16270434
  14383. */
  14384. function isElementInViewport(el) {
  14385. var rect = el.getBoundingClientRect();
  14386. return rect.bottom > 0 && rect.right > 0 && rect.left < (window.innerWidth || document.documentElement.clientWidth) && rect.top < (window.innerHeight || document.documentElement.clientHeight);
  14387. }
  14388. var cacheMainList = null;
  14389. var cacheOp = null;
  14390. function fillCache() {
  14391. if (cacheMainList == null) {
  14392. cacheMainList = [];
  14393. var mainList = ["RK_PROGRAM", "RK_REAL", "RK_VOID", "RK_BOOLEAN", "RK_STRING", "RK_INTEGER", "RK_CHARACTER", "RK_SWITCH", "RK_CASE", "RK_DEFAULT", "RK_CONST", "RK_FUNCTION", "RK_RETURN", "RK_FOR", "RK_BREAK", "RK_DO", "RK_WHILE", "RK_IF", "RK_ELSE", "RK_FALSE", "RK_TRUE"];
  14394. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  14395. var nullLexer = new lexerClass();
  14396. for (var key = 0; key < mainList.length; ++key) {
  14397. var word = mainList[key];
  14398. var keyword = nullLexer.literalNames[lexerClass[word]];
  14399. cacheMainList.push(keyword.substring(1, keyword.length - 1));
  14400. }
  14401. }
  14402. if (cacheOp == null) {
  14403. cacheOp = [];
  14404. var logicOpList = [_ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].AND.value, _ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].OR.value, _ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].NOT.value];
  14405. for (var op = 0; op < logicOpList.length; ++op) {
  14406. var lOp = "logic_operator_".concat(logicOpList[op]);
  14407. cacheOp.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp));
  14408. }
  14409. }
  14410. }
  14411. function isKeyword(text) {
  14412. fillCache();
  14413. for (var key = 0; key < cacheMainList.length; ++key) {
  14414. var keyword = cacheMainList[key];
  14415. if (keyword == text) {
  14416. return true;
  14417. }
  14418. } // not in main list, check op
  14419. for (var op = 0; op < cacheOp.length; op++) {
  14420. var lOp = cacheOp[op];
  14421. if (lOp == text) {
  14422. return true;
  14423. }
  14424. }
  14425. return false;
  14426. }
  14427. function isValidIdentifier(identifier_str) {
  14428. var validRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  14429. if (!validRegex) {
  14430. return false;
  14431. }
  14432. return !isKeyword(identifier_str);
  14433. }
  14434. function getCodeEditorModeConfig() {
  14435. var blockList = ["RK_SWITCH", "RK_PROGRAM", "RK_CASE", "RK_DEFAULT", "RK_FOR", "RK_FOR_ALT", "RK_FUNCTION", "RK_DO", "RK_WHILE", "RK_WHILE_ALT", "RK_IF", "RK_ELSE"];
  14436. var keywordsList = ["RK_CONST", "RK_RETURN", "RK_BREAK", "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS", "RK_DO_UNTIL"];
  14437. var typeList = ["RK_REAL", "RK_VOID", "RK_BOOLEAN", "RK_STRING", "RK_INTEGER", "RK_CHARACTER"];
  14438. var atomList = ["RK_FALSE", "RK_TRUE"];
  14439. var case_default = [];
  14440. var blocks = [];
  14441. var keywords = [];
  14442. var types = [];
  14443. var atoms = [];
  14444. var switchString = "";
  14445. cacheMainList = [];
  14446. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  14447. var nullLexer = new lexerClass();
  14448. blockList.forEach(function (v) {
  14449. var keyword = nullLexer.literalNames[lexerClass[v]];
  14450. var value = keyword.substring(1, keyword.length - 1);
  14451. cacheMainList.push(value);
  14452. keywords.push(value);
  14453. blocks.push(value);
  14454. if (v == "RK_SWITCH") {
  14455. switchString = value;
  14456. } else if (v == "RK_CASE" || v == "RK_DEFAULT") {
  14457. case_default.push(value);
  14458. }
  14459. });
  14460. keywordsList.forEach(function (v) {
  14461. var keyword = nullLexer.literalNames[lexerClass[v]];
  14462. var value = keyword.substring(1, keyword.length - 1);
  14463. cacheMainList.push(value);
  14464. keywords.push(value);
  14465. });
  14466. typeList.forEach(function (v) {
  14467. var keyword = nullLexer.literalNames[lexerClass[v]];
  14468. var value = keyword.substring(1, keyword.length - 1);
  14469. cacheMainList.push(value);
  14470. types.push(value);
  14471. });
  14472. atomList.forEach(function (v) {
  14473. var keyword = nullLexer.literalNames[lexerClass[v]];
  14474. var value = keyword.substring(1, keyword.length - 1);
  14475. cacheMainList.push(value);
  14476. atoms.push(value);
  14477. });
  14478. cacheOp = [];
  14479. var logicOpList = [_ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].AND.value, _ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].OR.value, _ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].NOT.value];
  14480. for (var op = 0; op < logicOpList.length; ++op) {
  14481. var lOp = "logic_operator_".concat(logicOpList[op]);
  14482. var value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp);
  14483. cacheOp.push(value);
  14484. keywords.push(value);
  14485. }
  14486. return {
  14487. case_default: case_default,
  14488. atoms: atoms,
  14489. keywords: keywords,
  14490. switchString: switchString,
  14491. types: types,
  14492. blocks: blocks
  14493. };
  14494. }
  14495. /**
  14496. * Source: https://gist.github.com/andrei-m/982927
  14497. * @param {string} a
  14498. * @param {string} b
  14499. */
  14500. function levenshteinDistance(a, b) {
  14501. if (a.length == 0) return b.length;
  14502. if (b.length == 0) return a.length;
  14503. var matrix = []; // increment along the first column of each row
  14504. var i;
  14505. for (i = 0; i <= b.length; i++) {
  14506. matrix[i] = [i];
  14507. } // increment each column in the first row
  14508. var j;
  14509. for (j = 0; j <= a.length; j++) {
  14510. matrix[0][j] = j;
  14511. } // Fill in the rest of the matrix
  14512. for (i = 1; i <= b.length; i++) {
  14513. for (j = 1; j <= a.length; j++) {
  14514. if (b.charCodeAt(i - 1) == a.charCodeAt(j - 1)) {
  14515. matrix[i][j] = matrix[i - 1][j - 1];
  14516. } else {
  14517. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
  14518. Math.min(matrix[i][j - 1] + 1, // insertion
  14519. matrix[i - 1][j] + 1)); // deletion
  14520. }
  14521. }
  14522. }
  14523. return matrix[b.length][a.length];
  14524. }
  14525. var win = null;
  14526. function openAssessmentDetail(event) {
  14527. event.preventDefault();
  14528. var page_code = event.currentTarget.dataset.page;
  14529. if (win != null) {
  14530. win.close();
  14531. }
  14532. win = window.open("", "DetailWindow", "width=550,height=600");
  14533. win.document.open();
  14534. win.document.write(page_code);
  14535. win.document.close();
  14536. }
  14537. function range(size) {
  14538. var startAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  14539. return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(Array(size).keys()).map(function (i) {
  14540. return i + startAt;
  14541. });
  14542. }
  14543. /**
  14544. *
  14545. * @param {number} ms
  14546. */
  14547. function sleep(_x) {
  14548. return _sleep.apply(this, arguments);
  14549. }
  14550. function _sleep() {
  14551. _sleep = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(ms) {
  14552. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  14553. while (1) {
  14554. switch (_context.prev = _context.next) {
  14555. case 0:
  14556. return _context.abrupt("return", new Promise(function (res, _) {
  14557. return setTimeout(res, ms);
  14558. }));
  14559. case 1:
  14560. case "end":
  14561. return _context.stop();
  14562. }
  14563. }
  14564. }, _callee);
  14565. }));
  14566. return _sleep.apply(this, arguments);
  14567. }
  14568. /***/ }),
  14569. /***/ "./js/visualUI/algorithm.js":
  14570. /*!**********************************!*\
  14571. !*** ./js/visualUI/algorithm.js ***!
  14572. \**********************************/
  14573. /*! exports provided: renderAlgorithm */
  14574. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14575. "use strict";
  14576. __webpack_require__.r(__webpack_exports__);
  14577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderAlgorithm", function() { return renderAlgorithm; });
  14578. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  14579. /* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions */ "./js/visualUI/functions.js");
  14580. window.block_render = false;
  14581. function renderAlgorithm() {
  14582. if (window.block_render) {
  14583. return;
  14584. }
  14585. if (window.draging) {
  14586. return;
  14587. }
  14588. window.block_render = true;
  14589. $('.all_functions').children().off();
  14590. $('.all_functions').empty();
  14591. $('.list_globals').children().off();
  14592. $('.list_globals').empty();
  14593. for (var i = 0; i < window.program_obj.functions.length; i++) {
  14594. _functions__WEBPACK_IMPORTED_MODULE_1__["renderFunction"](window.program_obj.functions[i]);
  14595. }
  14596. for (var i = 0; i < window.program_obj.globals.length; i++) {
  14597. _globals__WEBPACK_IMPORTED_MODULE_0__["renderGlobal"](window.program_obj.globals[i]);
  14598. }
  14599. setTimeout(function () {
  14600. window.block_render = false;
  14601. }, 100);
  14602. if (settingsFilter && settingsFilter[0]) {
  14603. blockAllEditingOptions();
  14604. }
  14605. }
  14606. /***/ }),
  14607. /***/ "./js/visualUI/code_generator.js":
  14608. /*!***************************************!*\
  14609. !*** ./js/visualUI/code_generator.js ***!
  14610. \***************************************/
  14611. /*! exports provided: generate, repeatNtimesHeader, elementExpressionCode */
  14612. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14613. "use strict";
  14614. __webpack_require__.r(__webpack_exports__);
  14615. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
  14616. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeatNtimesHeader", function() { return repeatNtimesHeader; });
  14617. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementExpressionCode", function() { return elementExpressionCode; });
  14618. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  14619. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  14620. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14621. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  14622. /* eslint-disable @typescript-eslint/no-use-before-define */
  14623. /* globals $*/
  14624. function generate() {
  14625. $(".ivprog_visual_panel").find(".error_icon").remove();
  14626. var code = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("program") + " { ";
  14627. code += globalsCode();
  14628. code += "\n";
  14629. var has_error = false;
  14630. for (var i = 0; i < window.program_obj.functions.length; i++) {
  14631. var n_code = functionsCode(window.program_obj.functions[i]);
  14632. if (n_code == null) {
  14633. has_error = true;
  14634. }
  14635. code += n_code;
  14636. code += "\n";
  14637. }
  14638. code += "\n}";
  14639. if (has_error) {
  14640. return null;
  14641. } else {
  14642. return code;
  14643. }
  14644. }
  14645. function functionsCode(function_obj) {
  14646. var ret = "\n\t" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + " ";
  14647. var has_error = false;
  14648. switch (function_obj.return_type) {
  14649. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  14650. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  14651. break;
  14652. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  14653. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  14654. break;
  14655. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  14656. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  14657. break;
  14658. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  14659. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  14660. break;
  14661. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  14662. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  14663. break;
  14664. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID:
  14665. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_void");
  14666. break;
  14667. }
  14668. ret += " ";
  14669. if (function_obj.return_dimensions == 1) {
  14670. ret += "[] ";
  14671. } else if (function_obj.return_dimensions == 2) {
  14672. ret += "[][] ";
  14673. }
  14674. if (function_obj.is_main) {
  14675. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("start");
  14676. } else {
  14677. ret += function_obj.name;
  14678. }
  14679. ret += " ( ";
  14680. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  14681. ret += parametersCode(function_obj.parameters_list[j]);
  14682. if (j + 1 < function_obj.parameters_list.length) {
  14683. ret += ", ";
  14684. }
  14685. }
  14686. ret += " ) {";
  14687. for (var _j = 0; _j < function_obj.variables_list.length; _j++) {
  14688. ret += variablesCode(function_obj.variables_list[_j]);
  14689. }
  14690. for (var _j2 = 0; _j2 < function_obj.commands.length; _j2++) {
  14691. //try {
  14692. ret += commandsCode(function_obj.commands[_j2]);
  14693. /*} catch (err) {
  14694. has_error = true;
  14695. console.error(err.message);
  14696. var todos = $('body').find('.command_container');
  14697. for (var i = 0; i < todos.length; i++) {
  14698. if ($(todos[i]).data('command') == function_obj.commands[j]) {
  14699. $( todos[i] ).prepend( ' <i class="ui icon red exclamation triangle error_icon"></i> ' );
  14700. break;
  14701. }
  14702. }
  14703. }*/
  14704. }
  14705. ret += "\n\t}";
  14706. if (has_error) {
  14707. return null;
  14708. } else {
  14709. return ret;
  14710. }
  14711. }
  14712. function commandsCode(command_obj) {
  14713. var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  14714. switch (command_obj.type) {
  14715. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["break"]:
  14716. return breaksCode(command_obj, indentation);
  14717. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].comment:
  14718. return commentsCode(command_obj, indentation);
  14719. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].reader:
  14720. return readersCode(command_obj, indentation);
  14721. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer:
  14722. return writersCode(command_obj, indentation);
  14723. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].functioncall:
  14724. return functioncallsCode(command_obj, indentation);
  14725. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution:
  14726. return attributionsCode(command_obj, indentation);
  14727. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].whiletrue:
  14728. return whiletruesCode(command_obj, indentation);
  14729. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].dowhiletrue:
  14730. return doWhilesCode(command_obj, indentation);
  14731. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].iftrue:
  14732. return iftruesCode(command_obj, indentation);
  14733. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].repeatNtimes:
  14734. return repeatNtimesCode(command_obj, indentation);
  14735. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["switch"]:
  14736. return switchsCode(command_obj, indentation);
  14737. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["return"]:
  14738. return returnsCode(command_obj, indentation);
  14739. }
  14740. }
  14741. function returnsCode(command_obj, indentation) {
  14742. var ret = "\n";
  14743. for (var i = 0; i < indentation; i++) {
  14744. ret += "\t";
  14745. }
  14746. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_return");
  14747. if (command_obj.variable_value_menu) {
  14748. try {
  14749. ret += " " + elementExpressionCode(command_obj.variable_value_menu); //ret += ' ' + variableValueMenuCode(command_obj.variable_value_menu, true);
  14750. } catch (err) {//Empty block
  14751. }
  14752. }
  14753. return ret;
  14754. }
  14755. function breaksCode(_command_obj, indentation) {
  14756. var ret = "\n";
  14757. for (var i = 0; i < indentation; i++) {
  14758. ret += "\t";
  14759. }
  14760. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_break");
  14761. return ret;
  14762. }
  14763. function switchsCode(command_obj, indentation) {
  14764. var ret = "\n";
  14765. for (var i = 0; i < indentation; i++) {
  14766. ret += "\t";
  14767. }
  14768. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_switch") + " ( ";
  14769. ret += variableValueMenuCode(command_obj.variable);
  14770. ret += " ) { ";
  14771. if (command_obj.cases) {
  14772. for (var _i = 0; _i < command_obj.cases.length; _i++) {
  14773. ret += switchcasesCode(command_obj.cases[_i], indentation + 1);
  14774. }
  14775. }
  14776. ret += "\n";
  14777. for (var _i2 = 0; _i2 < indentation; _i2++) {
  14778. ret += "\t";
  14779. }
  14780. ret += "} ";
  14781. return ret;
  14782. }
  14783. function switchcasesCode(switchcase, indentation) {
  14784. var ret = "\n";
  14785. for (var i = 0; i < indentation; i++) {
  14786. ret += "\t";
  14787. }
  14788. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_case") + " ";
  14789. ret += variableValueMenuCode(switchcase.variable_value_menu);
  14790. ret += " :";
  14791. if (switchcase.commands_block) {
  14792. for (var _i3 = 0; _i3 < switchcase.commands_block.length; _i3++) {
  14793. ret += commandsCode(switchcase.commands_block[_i3], indentation + 1);
  14794. }
  14795. }
  14796. return ret;
  14797. }
  14798. function repeatNtimesHeader(command_obj) {
  14799. var ret = "";
  14800. if (command_obj.var_attribution) {
  14801. ret += '<span class="repeatN_text_par_1">';
  14802. ret += variableValueMenuCode(command_obj.var_attribution);
  14803. ret += '</span>';
  14804. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
  14805. ret += '<span class="repeatN_text_par_2">';
  14806. ret += variableValueMenuCode(command_obj.expression1);
  14807. ret += '</span>';
  14808. }
  14809. if (command_obj.expression2) {
  14810. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
  14811. ret += '<span class="repeatN_text_par_3">';
  14812. ret += variableValueMenuCode(command_obj.expression2);
  14813. ret += '</span>';
  14814. }
  14815. if (command_obj.expression3) {
  14816. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
  14817. ret += '<span class="repeatN_text_par_4">';
  14818. switch (command_obj.expression3.itens[1]) {
  14819. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  14820. ret += " +";
  14821. break;
  14822. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  14823. ret += " -";
  14824. break;
  14825. }
  14826. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  14827. ret += '</span>';
  14828. }
  14829. return ret;
  14830. }
  14831. function repeatNtimesCode(command_obj, indentation) {
  14832. var ret = "\n";
  14833. for (var i = 0; i < indentation; i++) {
  14834. ret += "\t";
  14835. }
  14836. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_for") + " ";
  14837. if (command_obj.var_attribution) {
  14838. ret += variableValueMenuCode(command_obj.var_attribution);
  14839. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
  14840. ret += variableValueMenuCode(command_obj.expression1);
  14841. }
  14842. if (command_obj.expression2) {
  14843. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
  14844. ret += variableValueMenuCode(command_obj.expression2);
  14845. }
  14846. if (command_obj.expression3) {
  14847. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
  14848. switch (command_obj.expression3.itens[1]) {
  14849. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  14850. ret += " +";
  14851. break;
  14852. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  14853. ret += " -";
  14854. break;
  14855. }
  14856. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  14857. }
  14858. ret += " { ";
  14859. if (command_obj.commands_block) {
  14860. for (var _i4 = 0; _i4 < command_obj.commands_block.length; _i4++) {
  14861. ret += commandsCode(command_obj.commands_block[_i4], indentation + 1);
  14862. }
  14863. }
  14864. ret += "\n";
  14865. for (var _i5 = 0; _i5 < indentation; _i5++) {
  14866. ret += "\t";
  14867. }
  14868. ret += "}";
  14869. return ret;
  14870. }
  14871. function iftruesCode(command_obj, indentation) {
  14872. var ret = "\n";
  14873. for (var i = 0; i < indentation; i++) {
  14874. ret += "\t";
  14875. }
  14876. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_if");
  14877. if (!command_obj.expression) {
  14878. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  14879. } else {
  14880. ret += " ( ";
  14881. ret += elementExpressionCode(command_obj.expression);
  14882. ret += " ) ";
  14883. }
  14884. /*switch (command_obj.expression.expression.type) {
  14885. case Models.EXPRESSION_TYPES.exp_logic:
  14886. ret += logicExpressionCode(command_obj.expression.expression);
  14887. break;
  14888. case Models.EXPRESSION_TYPES.exp_arithmetic:
  14889. ret += arithmeticExpressionCode(command_obj.expression.expression);
  14890. break;
  14891. }*/
  14892. ret += " { ";
  14893. if (command_obj.commands_block) {
  14894. for (var _i6 = 0; _i6 < command_obj.commands_block.length; _i6++) {
  14895. ret += commandsCode(command_obj.commands_block[_i6], indentation + 1);
  14896. }
  14897. }
  14898. ret += "\n";
  14899. for (var _i7 = 0; _i7 < indentation; _i7++) {
  14900. ret += "\t";
  14901. }
  14902. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_else") + " {";
  14903. if (command_obj.commands_else) {
  14904. for (var _i8 = 0; _i8 < command_obj.commands_else.length; _i8++) {
  14905. ret += commandsCode(command_obj.commands_else[_i8], indentation + 1);
  14906. }
  14907. }
  14908. ret += "\n";
  14909. for (var _i9 = 0; _i9 < indentation; _i9++) {
  14910. ret += "\t";
  14911. }
  14912. ret += "}";
  14913. return ret;
  14914. }
  14915. function doWhilesCode(command_obj, indentation) {
  14916. var ret = "\n";
  14917. for (var i = 0; i < indentation; i++) {
  14918. ret += "\t";
  14919. }
  14920. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do") + " { ";
  14921. if (command_obj.commands_block) {
  14922. for (var _i10 = 0; _i10 < command_obj.commands_block.length; _i10++) {
  14923. ret += commandsCode(command_obj.commands_block[_i10], indentation + 1);
  14924. }
  14925. }
  14926. ret += "\n";
  14927. for (var _i11 = 0; _i11 < indentation; _i11++) {
  14928. ret += "\t";
  14929. }
  14930. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do_until");
  14931. if (!command_obj.expression) {
  14932. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  14933. }
  14934. /*switch (command_obj.expression.expression.type) {
  14935. case Models.EXPRESSION_TYPES.exp_logic:
  14936. ret += logicExpressionCode(command_obj.expression.expression);
  14937. break;
  14938. case Models.EXPRESSION_TYPES.exp_arithmetic:
  14939. ret += arithmeticExpressionCode(command_obj.expression.expression);
  14940. break;
  14941. }*/
  14942. if (command_obj.expression) {
  14943. ret += " ( ";
  14944. ret += elementExpressionCode(command_obj.expression);
  14945. ret += " ) ";
  14946. }
  14947. return ret;
  14948. }
  14949. function whiletruesCode(command_obj, indentation) {
  14950. var ret = "\n";
  14951. for (var i = 0; i < indentation; i++) {
  14952. ret += "\t";
  14953. }
  14954. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_while");
  14955. if (!command_obj.expression) {
  14956. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  14957. }
  14958. /*switch (command_obj.expression.expression.type) {
  14959. case Models.EXPRESSION_TYPES.exp_logic:
  14960. ret += logicExpressionCode(command_obj.expression.expression);
  14961. break;
  14962. case Models.EXPRESSION_TYPES.exp_arithmetic:
  14963. ret += arithmeticExpressionCode(command_obj.expression.expression);
  14964. break;
  14965. }*/
  14966. if (command_obj.expression) {
  14967. ret += " ( ";
  14968. ret += elementExpressionCode(command_obj.expression);
  14969. ret += " ) ";
  14970. }
  14971. ret += " { ";
  14972. if (command_obj.commands_block) {
  14973. for (var _i12 = 0; _i12 < command_obj.commands_block.length; _i12++) {
  14974. ret += commandsCode(command_obj.commands_block[_i12], indentation + 1);
  14975. }
  14976. }
  14977. ret += "\n";
  14978. for (var _i13 = 0; _i13 < indentation; _i13++) {
  14979. ret += "\t";
  14980. }
  14981. ret += "}";
  14982. return ret;
  14983. }
  14984. function logicExpressionCode(expression) {
  14985. var ret = " ( ";
  14986. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  14987. ret += logicExpressionCode(expression.first_operand);
  14988. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  14989. ret += arithmeticExpressionCode(expression.first_operand);
  14990. } else {
  14991. ret += variableValueMenuCode(expression.first_operand);
  14992. }
  14993. if (expression.operator) {
  14994. switch (expression.operator) {
  14995. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  14996. ret += " == ";
  14997. break;
  14998. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  14999. ret += " != ";
  15000. break;
  15001. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15002. ret += " && ";
  15003. break;
  15004. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15005. ret += " || ";
  15006. break;
  15007. }
  15008. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15009. ret += logicExpressionCode(expression.second_operand);
  15010. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15011. ret += arithmeticExpressionCode(expression.second_operand);
  15012. } else {
  15013. ret += variableValueMenuCode(expression.second_operand);
  15014. }
  15015. }
  15016. ret += " ) ";
  15017. return ret;
  15018. }
  15019. function arithmeticExpressionCode(expression) {
  15020. var ret = " ( ";
  15021. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15022. ret += logicExpressionCode(expression.first_operand);
  15023. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15024. ret += arithmeticExpressionCode(expression.first_operand);
  15025. } else {
  15026. ret += variableValueMenuCode(expression.first_operand);
  15027. }
  15028. switch (expression.operator) {
  15029. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15030. ret += " > ";
  15031. break;
  15032. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15033. ret += " < ";
  15034. break;
  15035. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to:
  15036. ret += " == ";
  15037. break;
  15038. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to:
  15039. ret += " != ";
  15040. break;
  15041. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15042. ret += " >= ";
  15043. break;
  15044. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15045. ret += " <= ";
  15046. break;
  15047. }
  15048. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15049. ret += logicExpressionCode(expression.second_operand);
  15050. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15051. ret += arithmeticExpressionCode(expression.second_operand);
  15052. } else {
  15053. ret += variableValueMenuCode(expression.second_operand);
  15054. }
  15055. ret += " ) ";
  15056. return ret;
  15057. }
  15058. function attributionsCode(command_obj, indentation) {
  15059. var ret = "\n";
  15060. for (var i = 0; i < indentation; i++) {
  15061. ret += "\t";
  15062. }
  15063. ret += variableValueMenuCode(command_obj.variable) + " <- ";
  15064. /*for (var i = 0; i < command_obj.expression.length; i++) {
  15065. ret += elementExpressionCode(command_obj.expression[i]);
  15066. }*/
  15067. ret += elementExpressionCode(command_obj.expression);
  15068. return ret;
  15069. }
  15070. function elementExpressionCode(expression_obj) {
  15071. var ret = "";
  15072. for (var i = 0; i < expression_obj.length; i++) {
  15073. if (expression_obj[i].type) {
  15074. ret += variableValueMenuCode(expression_obj[i]);
  15075. } else if (expression_obj[i].type_op) {
  15076. switch (expression_obj[i].item) {
  15077. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15078. ret += " + ";
  15079. break;
  15080. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15081. ret += " - ";
  15082. break;
  15083. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication:
  15084. ret += " * ";
  15085. break;
  15086. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division:
  15087. ret += " / ";
  15088. break;
  15089. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module:
  15090. ret += " % ";
  15091. break;
  15092. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  15093. ret += " == ";
  15094. break;
  15095. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  15096. ret += " != ";
  15097. break;
  15098. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15099. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + " ";
  15100. break;
  15101. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15102. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_or") + " ";
  15103. break;
  15104. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not:
  15105. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_not") + " ";
  15106. break;
  15107. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15108. ret += " > ";
  15109. break;
  15110. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15111. ret += " < ";
  15112. break;
  15113. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15114. ret += " >= ";
  15115. break;
  15116. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15117. ret += " <= ";
  15118. break;
  15119. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep:
  15120. ret += ", ";
  15121. break;
  15122. }
  15123. } else {
  15124. ret += " " + expression_obj[i] + " ";
  15125. }
  15126. }
  15127. return ret;
  15128. }
  15129. function functioncallsCode(command_obj, indentation) {
  15130. var ret = "\n";
  15131. for (var i = 0; i < indentation; i++) {
  15132. ret += "\t";
  15133. }
  15134. ret += variableValueMenuCode(command_obj.function_called);
  15135. return ret;
  15136. }
  15137. function readersCode(command_obj, indentation) {
  15138. var ret = "\n";
  15139. for (var i = 0; i < indentation; i++) {
  15140. ret += "\t";
  15141. }
  15142. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_read") + " ( ";
  15143. ret += variableValueMenuCode(command_obj.variable_value_menu);
  15144. ret += " ) ";
  15145. return ret;
  15146. }
  15147. function variableValueMenuCode(variable_obj) {
  15148. var is_return = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  15149. var ret = "";
  15150. try {
  15151. if (variable_obj.function_called) {
  15152. if (variable_obj.function_called.name) {
  15153. ret += variable_obj.function_called.name + " ( ";
  15154. } else {
  15155. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + " ( ";
  15156. }
  15157. if (variable_obj.parameters_list) {
  15158. for (var i = 0; i < variable_obj.parameters_list.length; i++) {
  15159. ret += variableValueMenuCode(variable_obj.parameters_list[i]);
  15160. if (i + 1 < variable_obj.parameters_list.length) {
  15161. ret += ", ";
  15162. }
  15163. }
  15164. }
  15165. ret += " )";
  15166. } else if (variable_obj.content.type) {
  15167. ret += variable_obj.content.name;
  15168. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  15169. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15170. }
  15171. if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  15172. ret += " [ " + variableValueMenuCode(variable_obj.row) + " ] ";
  15173. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15174. }
  15175. } else {
  15176. var content = String(variable_obj.content);
  15177. if (isNaN(content)) {
  15178. // console.debug("Content length: ", content.length);
  15179. // console.debug("Char code at 0", content.charCodeAt(0));
  15180. var isBackslash = content.charCodeAt(0) === 92;
  15181. if (content.length === 1 || content.length === 2 && isBackslash) {
  15182. ret += "'".concat(content, "'");
  15183. } else {
  15184. ret += '"' + variable_obj.content + '"';
  15185. }
  15186. } else if (content.length == 0) {
  15187. ret += '""';
  15188. } else if (content.trim().length == 0) {
  15189. ret += '"' + content + '"';
  15190. } else {
  15191. ret += variable_obj.content;
  15192. }
  15193. }
  15194. } catch (err) {
  15195. if (!is_return) {
  15196. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_content"));
  15197. throw err;
  15198. }
  15199. }
  15200. return ret;
  15201. }
  15202. function writersCode(command_obj, indentation) {
  15203. var ret = "\n";
  15204. for (var i = 0; i < indentation; i++) {
  15205. ret += "\t";
  15206. }
  15207. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_write") + " ( ";
  15208. /*for (var i = 0; i < command_obj.content.length; i++) {
  15209. ret += variableValueMenuCode(command_obj.content[i]);
  15210. if ((i + 1) < command_obj.content.length) {
  15211. ret += ' + ';
  15212. }
  15213. }*/
  15214. ret += elementExpressionCode(command_obj.content);
  15215. if (command_obj.newline) {
  15216. ret += ', "\\n"';
  15217. }
  15218. ret += " ) ";
  15219. return ret;
  15220. }
  15221. function commentsCode(command_obj, indentation) {
  15222. var ret = "\n";
  15223. for (var i = 0; i < indentation; i++) {
  15224. ret += "\t";
  15225. }
  15226. ret += "// ";
  15227. ret += command_obj.comment_text.content;
  15228. return ret;
  15229. }
  15230. function parametersCode(parameter_obj) {
  15231. var ret = "";
  15232. switch (parameter_obj.type) {
  15233. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15234. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15235. break;
  15236. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15237. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15238. break;
  15239. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15240. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15241. break;
  15242. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15243. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15244. break;
  15245. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15246. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15247. break;
  15248. }
  15249. ret += parameter_obj.name + "";
  15250. if (parameter_obj.dimensions == 1) {
  15251. ret += " []";
  15252. } else if (parameter_obj.dimensions == 2) {
  15253. ret += " [][]";
  15254. }
  15255. return ret;
  15256. }
  15257. function variablesCode(variable_obj) {
  15258. var ret = "";
  15259. var temp = variable_obj;
  15260. ret += "\n\t\t";
  15261. if (temp.is_constant) {
  15262. ret += "const ";
  15263. }
  15264. switch (temp.type) {
  15265. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15266. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15267. break;
  15268. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15269. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15270. break;
  15271. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15272. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15273. break;
  15274. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15275. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15276. break;
  15277. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15278. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15279. break;
  15280. }
  15281. ret += temp.name + " ";
  15282. if (temp.dimensions == 1) {
  15283. ret += "[" + temp.columns + "] ";
  15284. switch (temp.type) {
  15285. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15286. ret += "<- {";
  15287. for (var j = 0; j < temp.value.length; j++) {
  15288. ret += temp.value[j];
  15289. if (j + 1 < temp.value.length) {
  15290. ret += ", ";
  15291. }
  15292. }
  15293. ret += "}";
  15294. break;
  15295. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15296. ret += "<- {";
  15297. for (var _j3 = 0; _j3 < temp.value.length; _j3++) {
  15298. ret += temp.value[_j3].toFixed(2);
  15299. if (_j3 + 1 < temp.value.length) {
  15300. ret += ", ";
  15301. }
  15302. }
  15303. ret += "}";
  15304. break;
  15305. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15306. ret += "<- {";
  15307. for (var _j4 = 0; _j4 < temp.value.length; _j4++) {
  15308. ret += '"' + temp.value[_j4] + '"';
  15309. if (_j4 + 1 < temp.value.length) {
  15310. ret += ", ";
  15311. }
  15312. }
  15313. ret += "}";
  15314. break;
  15315. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15316. ret += "<- {";
  15317. for (var _j5 = 0; _j5 < temp.value.length; _j5++) {
  15318. if (temp.value[_j5]) {
  15319. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15320. } else {
  15321. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15322. }
  15323. if (_j5 + 1 < temp.value.length) {
  15324. ret += ", ";
  15325. }
  15326. }
  15327. ret += "}";
  15328. break;
  15329. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15330. ret += "<- {";
  15331. for (var _j6 = 0; _j6 < temp.value.length; _j6++) {
  15332. ret += "'" + temp.value[_j6] + "'";
  15333. if (_j6 + 1 < temp.value.length) {
  15334. ret += ", ";
  15335. }
  15336. }
  15337. ret += "}";
  15338. break;
  15339. }
  15340. } else if (temp.dimensions == 2) {
  15341. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  15342. switch (temp.type) {
  15343. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15344. ret += "<- {";
  15345. for (var _j7 = 0; _j7 < temp.rows; _j7++) {
  15346. ret += "{";
  15347. for (var k = 0; k < temp.columns; k++) {
  15348. ret += temp.value[_j7][k];
  15349. if (k + 1 < temp.columns) {
  15350. ret += ", ";
  15351. }
  15352. }
  15353. ret += "}";
  15354. if (_j7 + 1 < temp.rows) {
  15355. ret += ", ";
  15356. }
  15357. }
  15358. ret += "}";
  15359. break;
  15360. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15361. ret += "<- {";
  15362. for (var _j8 = 0; _j8 < temp.rows; _j8++) {
  15363. ret += "{";
  15364. for (var _k = 0; _k < temp.columns; _k++) {
  15365. ret += temp.value[_j8][_k].toFixed(2);
  15366. if (_k + 1 < temp.columns) {
  15367. ret += ", ";
  15368. }
  15369. }
  15370. ret += "}";
  15371. if (_j8 + 1 < temp.rows) {
  15372. ret += ", ";
  15373. }
  15374. }
  15375. ret += "}";
  15376. break;
  15377. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15378. ret += "<- {";
  15379. for (var _j9 = 0; _j9 < temp.rows; _j9++) {
  15380. ret += "{";
  15381. for (var _k2 = 0; _k2 < temp.columns; _k2++) {
  15382. ret += '"' + temp.value[_j9][_k2] + '"';
  15383. if (_k2 + 1 < temp.columns) {
  15384. ret += ", ";
  15385. }
  15386. }
  15387. ret += "}";
  15388. if (_j9 + 1 < temp.rows) {
  15389. ret += ", ";
  15390. }
  15391. }
  15392. ret += "}";
  15393. break;
  15394. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15395. ret += "<- {";
  15396. for (var _j10 = 0; _j10 < temp.rows; _j10++) {
  15397. ret += "{";
  15398. for (var _k3 = 0; _k3 < temp.columns; _k3++) {
  15399. if (temp.value[_j10][_k3]) {
  15400. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15401. } else {
  15402. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15403. }
  15404. if (_k3 + 1 < temp.columns) {
  15405. ret += ", ";
  15406. }
  15407. }
  15408. ret += "}";
  15409. if (_j10 + 1 < temp.rows) {
  15410. ret += ", ";
  15411. }
  15412. }
  15413. ret += "}";
  15414. break;
  15415. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15416. ret += "<- {";
  15417. for (var _j11 = 0; _j11 < temp.rows; _j11++) {
  15418. ret += "{";
  15419. for (var _k4 = 0; _k4 < temp.columns; _k4++) {
  15420. ret += "'" + temp.value[_j11][_k4] + "'";
  15421. if (_k4 + 1 < temp.columns) {
  15422. ret += ", ";
  15423. }
  15424. }
  15425. ret += "}";
  15426. if (_j11 + 1 < temp.rows) {
  15427. ret += ", ";
  15428. }
  15429. }
  15430. ret += "}";
  15431. break;
  15432. }
  15433. } else {
  15434. switch (temp.type) {
  15435. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15436. ret += "<- " + temp.value;
  15437. break;
  15438. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15439. ret += "<- " + temp.value.toFixed(2);
  15440. break;
  15441. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15442. ret += '<- "' + temp.value + '"';
  15443. break;
  15444. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15445. ret += "<- ";
  15446. if (temp.value) {
  15447. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15448. } else {
  15449. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15450. }
  15451. break;
  15452. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15453. ret += "<- '" + temp.value + "'";
  15454. break;
  15455. }
  15456. }
  15457. return ret;
  15458. }
  15459. function globalsCode() {
  15460. var ret = "";
  15461. if (window.program_obj.globals) {
  15462. for (var i = 0; i < window.program_obj.globals.length; i++) {
  15463. var temp = window.program_obj.globals[i];
  15464. ret += "\n\t";
  15465. if (temp.is_constant) {
  15466. ret += "const ";
  15467. }
  15468. switch (temp.type) {
  15469. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15470. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  15471. break;
  15472. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15473. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  15474. break;
  15475. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15476. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  15477. break;
  15478. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15479. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  15480. break;
  15481. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15482. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  15483. break;
  15484. }
  15485. ret += " " + temp.name + " ";
  15486. if (temp.dimensions == 1) {
  15487. ret += "[" + temp.columns + "] ";
  15488. switch (temp.type) {
  15489. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15490. ret += "<- {";
  15491. for (var j = 0; j < temp.value.length; j++) {
  15492. ret += temp.value[j];
  15493. if (j + 1 < temp.value.length) {
  15494. ret += ", ";
  15495. }
  15496. }
  15497. ret += "}";
  15498. break;
  15499. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15500. ret += "<- {";
  15501. for (var _j12 = 0; _j12 < temp.value.length; _j12++) {
  15502. ret += temp.value[_j12].toFixed(2);
  15503. if (_j12 + 1 < temp.value.length) {
  15504. ret += ", ";
  15505. }
  15506. }
  15507. ret += "}";
  15508. break;
  15509. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15510. ret += "<- {";
  15511. for (var _j13 = 0; _j13 < temp.value.length; _j13++) {
  15512. ret += '"' + temp.value[_j13] + '"';
  15513. if (_j13 + 1 < temp.value.length) {
  15514. ret += ", ";
  15515. }
  15516. }
  15517. ret += "}";
  15518. break;
  15519. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15520. ret += "<- {";
  15521. for (var _j14 = 0; _j14 < temp.value.length; _j14++) {
  15522. if (temp.value[_j14]) {
  15523. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15524. } else {
  15525. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15526. }
  15527. if (_j14 + 1 < temp.value.length) {
  15528. ret += ", ";
  15529. }
  15530. }
  15531. ret += "}";
  15532. break;
  15533. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15534. ret += "<- {";
  15535. for (var _j15 = 0; _j15 < temp.value.length; _j15++) {
  15536. ret += "'" + temp.value[_j15] + "'";
  15537. if (_j15 + 1 < temp.value.length) {
  15538. ret += ", ";
  15539. }
  15540. }
  15541. ret += "}";
  15542. break;
  15543. }
  15544. } else if (temp.dimensions == 2) {
  15545. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  15546. switch (temp.type) {
  15547. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15548. ret += "<- {";
  15549. for (var _j16 = 0; _j16 < temp.rows; _j16++) {
  15550. ret += "{";
  15551. for (var k = 0; k < temp.columns; k++) {
  15552. ret += temp.value[_j16][k];
  15553. if (k + 1 < temp.columns) {
  15554. ret += ", ";
  15555. }
  15556. }
  15557. ret += "}";
  15558. if (_j16 + 1 < temp.rows) {
  15559. ret += ", ";
  15560. }
  15561. }
  15562. ret += "}";
  15563. break;
  15564. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15565. ret += "<- {";
  15566. for (var _j17 = 0; _j17 < temp.rows; _j17++) {
  15567. ret += "{";
  15568. for (var _k5 = 0; _k5 < temp.columns; _k5++) {
  15569. ret += temp.value[_j17][_k5].toFixed(2);
  15570. if (_k5 + 1 < temp.columns) {
  15571. ret += ", ";
  15572. }
  15573. }
  15574. ret += "}";
  15575. if (_j17 + 1 < temp.rows) {
  15576. ret += ", ";
  15577. }
  15578. }
  15579. ret += "}";
  15580. break;
  15581. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15582. ret += "<- {";
  15583. for (var _j18 = 0; _j18 < temp.rows; _j18++) {
  15584. ret += "{";
  15585. for (var _k6 = 0; _k6 < temp.columns; _k6++) {
  15586. ret += '"' + temp.value[_j18][_k6] + '"';
  15587. if (_k6 + 1 < temp.columns) {
  15588. ret += ", ";
  15589. }
  15590. }
  15591. ret += "}";
  15592. if (_j18 + 1 < temp.rows) {
  15593. ret += ", ";
  15594. }
  15595. }
  15596. ret += "}";
  15597. break;
  15598. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15599. ret += "<- {";
  15600. for (var _j19 = 0; _j19 < temp.rows; _j19++) {
  15601. ret += "{";
  15602. for (var _k7 = 0; _k7 < temp.columns; _k7++) {
  15603. if (temp.value[_j19][_k7]) {
  15604. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15605. } else {
  15606. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15607. }
  15608. if (_k7 + 1 < temp.columns) {
  15609. ret += ", ";
  15610. }
  15611. }
  15612. ret += "}";
  15613. if (_j19 + 1 < temp.rows) {
  15614. ret += ", ";
  15615. }
  15616. }
  15617. ret += "}";
  15618. break;
  15619. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15620. ret += "<- {";
  15621. for (var _j20 = 0; _j20 < temp.rows; _j20++) {
  15622. ret += "{";
  15623. for (var _k8 = 0; _k8 < temp.columns; _k8++) {
  15624. ret += "'" + temp.value[_j20][_k8] + "'";
  15625. if (_k8 + 1 < temp.columns) {
  15626. ret += ", ";
  15627. }
  15628. }
  15629. ret += "}";
  15630. if (_j20 + 1 < temp.rows) {
  15631. ret += ", ";
  15632. }
  15633. }
  15634. ret += "}";
  15635. break;
  15636. }
  15637. } else {
  15638. switch (temp.type) {
  15639. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15640. ret += "<- " + temp.value;
  15641. break;
  15642. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15643. ret += "<- " + temp.value.toFixed(2);
  15644. break;
  15645. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15646. ret += '<- "' + temp.value + '"';
  15647. break;
  15648. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15649. ret += "<- ";
  15650. if (temp.value) {
  15651. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15652. } else {
  15653. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15654. }
  15655. break;
  15656. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15657. ret += "<- '" + temp.value + "'";
  15658. break;
  15659. }
  15660. }
  15661. }
  15662. }
  15663. return ret;
  15664. }
  15665. /***/ }),
  15666. /***/ "./js/visualUI/commands.js":
  15667. /*!*********************************!*\
  15668. !*** ./js/visualUI/commands.js ***!
  15669. \*********************************/
  15670. /*! exports provided: removeCommand, createFloatingCommand, renderCommand, genericCreateCommand */
  15671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15672. "use strict";
  15673. __webpack_require__.r(__webpack_exports__);
  15674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCommand", function() { return removeCommand; });
  15675. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  15676. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  15677. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericCreateCommand", function() { return genericCreateCommand; });
  15678. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15679. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15680. /* harmony import */ var _commands_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commands/comment */ "./js/visualUI/commands/comment.js");
  15681. /* harmony import */ var _commands_reader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/reader */ "./js/visualUI/commands/reader.js");
  15682. /* harmony import */ var _commands_writer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/writer */ "./js/visualUI/commands/writer.js");
  15683. /* harmony import */ var _commands_attribution__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/attribution */ "./js/visualUI/commands/attribution.js");
  15684. /* harmony import */ var _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/iftrue */ "./js/visualUI/commands/iftrue.js");
  15685. /* harmony import */ var _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  15686. /* harmony import */ var _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/whiletrue */ "./js/visualUI/commands/whiletrue.js");
  15687. /* harmony import */ var _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/dowhiletrue */ "./js/visualUI/commands/dowhiletrue.js");
  15688. /* harmony import */ var _commands_switch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/switch */ "./js/visualUI/commands/switch.js");
  15689. /* harmony import */ var _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/functioncall */ "./js/visualUI/commands/functioncall.js");
  15690. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  15691. /* harmony import */ var _commands_break__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/break */ "./js/visualUI/commands/break.js");
  15692. /* harmony import */ var _commands_return__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/return */ "./js/visualUI/commands/return.js");
  15693. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  15694. // let has_element_created_draged = false;
  15695. // let which_element_is_draged = null;
  15696. function removeCommand(command, function_obj, dom_obj) {
  15697. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_COMMAND, command.type, '/', 0);
  15698. if (function_obj.commands.indexOf(command) > -1) {
  15699. function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  15700. return true;
  15701. } // Utilize dois parantNode, pois o primeiro é o div de comandos
  15702. try {
  15703. if (dom_obj.parent().parent().data('command').commands_block.indexOf(command) > -1) {
  15704. dom_obj.parent().parent().data('command').commands_block.splice(dom_obj.parent().parent().data('command').commands_block.indexOf(command), 1);
  15705. return true;
  15706. }
  15707. } catch (err) {}
  15708. try {
  15709. if (dom_obj.parent().parent().data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  15710. if (dom_obj.parent().parent().data('command').commands_else.indexOf(command) > -1) {
  15711. dom_obj.parent().parent().data('command').commands_else.splice(dom_obj.parent().parent().data('command').commands_else.indexOf(command), 1);
  15712. return true;
  15713. }
  15714. }
  15715. } catch (err) {}
  15716. if (dom_obj.parent().data('switchcase')) {
  15717. dom_obj.parent().data('switchcase').commands_block.splice(dom_obj.parent().data('switchcase').commands_block.indexOf(command), 1);
  15718. return true;
  15719. }
  15720. return false;
  15721. }
  15722. window.function_container_active = null;
  15723. function createFloatingCommand(function_obj, function_container, command_type, mouse_event) {
  15724. var floatingObject;
  15725. switch (command_type) {
  15726. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  15727. floatingObject = _commands_break__WEBPACK_IMPORTED_MODULE_13__["createFloatingCommand"]();
  15728. break;
  15729. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  15730. floatingObject = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"]();
  15731. break;
  15732. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  15733. floatingObject = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["createFloatingCommand"]();
  15734. break;
  15735. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  15736. floatingObject = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["createFloatingCommand"]();
  15737. break;
  15738. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  15739. floatingObject = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"]();
  15740. break;
  15741. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  15742. floatingObject = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["createFloatingCommand"]();
  15743. break;
  15744. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  15745. floatingObject = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["createFloatingCommand"]();
  15746. break;
  15747. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  15748. floatingObject = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["createFloatingCommand"]();
  15749. break;
  15750. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  15751. floatingObject = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["createFloatingCommand"]();
  15752. break;
  15753. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  15754. floatingObject = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["createFloatingCommand"]();
  15755. break;
  15756. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  15757. floatingObject = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["createFloatingCommand"]();
  15758. break;
  15759. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  15760. floatingObject = _commands_return__WEBPACK_IMPORTED_MODULE_14__["createFloatingCommand"]();
  15761. break;
  15762. }
  15763. floatingObject.draggable().appendTo("body");
  15764. $('body').mouseup(function (evt) {
  15765. manageCommand(function_obj, function_container, evt, command_type);
  15766. $('body').off('mouseup');
  15767. $('body').off('mouseover');
  15768. });
  15769. if (!function_container.hasClass('function_div') || function_container.length < 1) {
  15770. window.mouse_event = mouse_event;
  15771. function_container = $(mouse_event.originalEvent.srcElement.closest('.function_div'));
  15772. }
  15773. function_container_active = function_container;
  15774. function_container.find('.commands_list_div').on('mousemove', function (evt) {
  15775. addGhostDiv(evt);
  15776. });
  15777. function_container.find('.commands_list_div').find("*").on('mousemove', function (evt) {
  15778. addGhostDiv(evt);
  15779. });
  15780. function_container.on('mouseout', function (event) {
  15781. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  15782. if (el.closest('.commands_list_div').length < 1) {
  15783. window.ghostDiv.remove();
  15784. }
  15785. });
  15786. floatingObject.css("position", "absolute");
  15787. mouse_event.type = "mousedown.draggable";
  15788. mouse_event.target = floatingObject[0];
  15789. floatingObject.css("left", mouse_event.pageX - window.divx);
  15790. floatingObject.css("top", mouse_event.pageY);
  15791. floatingObject.trigger(mouse_event);
  15792. }
  15793. window.divx = 100;
  15794. window.ghostDiv = $('<div class="ghost_div">');
  15795. window.active_container = null;
  15796. function addGhostToEmptyBlock(element, evt) {
  15797. $('.ghost_div').remove();
  15798. var container = element.closest('.command_container');
  15799. if (container.hasClass('switch')) {
  15800. container = $(evt.target).closest('.case_div');
  15801. }
  15802. if (!container.hasClass('dowhiletrue') && !container.hasClass('iftrue') && !container.hasClass('repeatNtimes') && !container.hasClass('case_div') && !container.hasClass('whiletrue')) {
  15803. addGhostToNotEmptyBlock(element, evt);
  15804. return;
  15805. }
  15806. if (window.active_container != null) {
  15807. if (window.active_container.is(container)) {//console.log('é o mesmo, não mudou!');
  15808. } else {
  15809. if (container.length < 1) {
  15810. container = element.closest('.commands_list_div');
  15811. if (window.active_container.is(container)) {//console.log('é o mesmo command list');
  15812. } else {
  15813. //console.log('mudou para um command list');
  15814. window.active_container = container;
  15815. }
  15816. } else {//console.log('mudou para um outro container?');
  15817. }
  15818. }
  15819. }
  15820. window.active_container = container;
  15821. if (container.hasClass('iftrue')) {
  15822. var containerIf = container.find('.commands_if').get(0);
  15823. var containerElse = container.find('.commands_else').get(0);
  15824. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  15825. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  15826. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  15827. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  15828. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  15829. $(containerIf).append(window.ghostDiv);
  15830. } else {
  15831. $(containerElse).append(window.ghostDiv);
  15832. }
  15833. } else if (container.hasClass('case_div')) {
  15834. container.find('.case_commands_block').append(window.ghostDiv);
  15835. } else {
  15836. container.find('.block_commands').append(window.ghostDiv);
  15837. }
  15838. }
  15839. function addGhostToNotEmptyBlock(element, evt) {
  15840. $('.ghost_div').remove();
  15841. var container = element.closest('.dowhiletrue, .iftrue, .repeatNtimes, .case_div, .whiletrue'); //console.log("\n\nNOT EMPTY: ", container);
  15842. //if (window.active_container != null) {
  15843. //}
  15844. if (container.length < 1) {
  15845. container = element.closest('.commands_list_div');
  15846. window.active_container = container;
  15847. addGhostToFunctionArea(element, evt);
  15848. } else {//console.log('mudou para um outro container?');
  15849. }
  15850. window.active_container = container; // quem está mais próximo? // Essa regra se aplica somente quando o over está sobre um comando
  15851. var allfilhos;
  15852. if (container.hasClass('iftrue')) {
  15853. if ($(evt.target).closest('.data_block_if').length > 0) {
  15854. allfilhos = container.find('.commands_if').children('.command_container');
  15855. } else if ($(evt.target).closest('.data_block_else').length > 0) {
  15856. allfilhos = container.find('.commands_else').children('.command_container');
  15857. } else {
  15858. var containerIf = container.find('.commands_if').get(0);
  15859. var containerElse = container.find('.commands_else').get(0);
  15860. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  15861. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  15862. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  15863. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  15864. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  15865. allfilhos = $(containerIf).children('.command_container');
  15866. } else {
  15867. allfilhos = $(containerElse).children('.command_container');
  15868. }
  15869. }
  15870. } else if (container.hasClass('case_div')) {
  15871. allfilhos = container.children('.case_commands_block').children('.command_container');
  15872. } else if (container.hasClass('commands_list_div')) {
  15873. allfilhos = container.children('.command_container');
  15874. } else {
  15875. allfilhos = container.children('.block_commands').children('.command_container');
  15876. }
  15877. var topDistances = [];
  15878. var bottomDistances = [];
  15879. for (var i = 0; i < allfilhos.length; i++) {
  15880. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  15881. topDistances.push(topD);
  15882. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  15883. bottomDistances.push(botD);
  15884. }
  15885. var menorTop = Math.min.apply(null, topDistances);
  15886. var indiceTop = topDistances.indexOf(menorTop);
  15887. var menorBot = Math.min.apply(null, bottomDistances);
  15888. var indiceBot = bottomDistances.indexOf(menorBot);
  15889. if (menorTop < menorBot) {
  15890. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  15891. } else {
  15892. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  15893. }
  15894. }
  15895. function addGhostToFunctionArea(undermouse, evt) {
  15896. $('.ghost_div').remove();
  15897. var allfilhos = undermouse.closest('.commands_list_div').children('.command_container');
  15898. var topDistances = [];
  15899. var bottomDistances = [];
  15900. for (var i = 0; i < allfilhos.length; i++) {
  15901. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  15902. topDistances.push(topD);
  15903. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  15904. bottomDistances.push(botD);
  15905. }
  15906. var menorTop = Math.min.apply(null, topDistances);
  15907. var indiceTop = topDistances.indexOf(menorTop);
  15908. var menorBot = Math.min.apply(null, bottomDistances);
  15909. var indiceBot = bottomDistances.indexOf(menorBot);
  15910. if (menorTop < menorBot) {
  15911. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  15912. } else {
  15913. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  15914. }
  15915. }
  15916. function addGhostDiv(evt) {
  15917. var undermouse = $(evt.target);
  15918. if (undermouse.hasClass('ghost_div')) {
  15919. return;
  15920. } else if (undermouse.hasClass('commands_list_div')) {
  15921. addGhostToFunctionArea(undermouse, evt);
  15922. return;
  15923. } else if (undermouse.hasClass('block_commands')) {
  15924. if (undermouse.find('.command_container').length > 0) {
  15925. addGhostToNotEmptyBlock(undermouse, evt);
  15926. } else {
  15927. addGhostToEmptyBlock(undermouse, evt);
  15928. }
  15929. } else if (undermouse.hasClass('case_div')) {
  15930. if (undermouse.find('.case_commands_block').find('.command_container').length > 0) {
  15931. addGhostToNotEmptyBlock(undermouse, evt);
  15932. } else {
  15933. addGhostToEmptyBlock(undermouse, evt);
  15934. }
  15935. } else {
  15936. addGhostToNotEmptyBlock(undermouse, evt);
  15937. }
  15938. }
  15939. function borderMouseDragCommand(function_obj, function_container, evt) {
  15940. function_container.find('.over_command_drag').each(function (index) {
  15941. $(this).removeClass('over_command_drag');
  15942. });
  15943. var prev = null;
  15944. function_container.find('.commands_list_div').each(function (index) {
  15945. prev = $(this);
  15946. if (prev) {
  15947. var objLeft = prev.offset().left;
  15948. var objTop = prev.offset().top;
  15949. var objRight = objLeft + prev.width();
  15950. var objBottom = objTop + prev.height();
  15951. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  15952. prev.addClass("over_command_drag");
  15953. }
  15954. }
  15955. });
  15956. function_container.find('.command_container').each(function (index) {
  15957. var obj = $(this);
  15958. var objLeft = obj.offset().left;
  15959. var objTop = obj.offset().top;
  15960. var objRight = objLeft + obj.width();
  15961. var objBottom = objTop + obj.height();
  15962. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  15963. if (prev) {
  15964. prev.removeClass('over_command_drag');
  15965. }
  15966. obj.addClass("over_command_drag");
  15967. return;
  15968. }
  15969. });
  15970. } // before_after_inside: 1 -> before, 2 -> after, 3 -> inside
  15971. function renderCommand(command, element_reference, before_after_inside, function_obj) {
  15972. var createdElement;
  15973. switch (command.type) {
  15974. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  15975. createdElement = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command, function_obj);
  15976. break;
  15977. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  15978. createdElement = _commands_break__WEBPACK_IMPORTED_MODULE_13__["renderCommand"](command, function_obj);
  15979. break;
  15980. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  15981. createdElement = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["renderCommand"](command, function_obj);
  15982. break;
  15983. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  15984. createdElement = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["renderCommand"](command, function_obj);
  15985. break;
  15986. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  15987. createdElement = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](command, function_obj);
  15988. break;
  15989. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  15990. createdElement = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["renderCommand"](command, function_obj);
  15991. break;
  15992. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  15993. createdElement = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["renderCommand"](command, function_obj);
  15994. break;
  15995. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  15996. createdElement = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["renderCommand"](command, function_obj);
  15997. break;
  15998. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  15999. createdElement = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["renderCommand"](command, function_obj);
  16000. break;
  16001. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16002. createdElement = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["renderCommand"](command, function_obj);
  16003. break;
  16004. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16005. createdElement = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["renderCommand"](command, function_obj);
  16006. break;
  16007. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16008. createdElement = _commands_return__WEBPACK_IMPORTED_MODULE_14__["renderCommand"](command, function_obj);
  16009. break;
  16010. }
  16011. switch (before_after_inside) {
  16012. case 1:
  16013. createdElement.insertBefore(element_reference);
  16014. break;
  16015. case 2:
  16016. createdElement.insertAfter(element_reference);
  16017. break;
  16018. case 3:
  16019. element_reference.append(createdElement);
  16020. break;
  16021. }
  16022. }
  16023. function genericCreateCommand(command_type) {
  16024. switch (command_type) {
  16025. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16026. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Break"]();
  16027. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16028. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Comment"](new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].only_value, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_comment'), null, null, false));
  16029. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16030. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Reader"](new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].only_variable, null, null, null, false));
  16031. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16032. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Writer"]([new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)]);
  16033. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16034. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Attribution"](new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].only_variable, null, null, null, false), []);
  16035. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16036. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["FunctionCall"](new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].only_function, null, null, null, false), null);
  16037. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16038. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["IfTrue"]([new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)]);
  16039. //(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block)
  16040. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16041. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["RepeatNTimes"](new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].only_variable, null, null, null, false), new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].only_variable, null, null, null, false), null, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), null, null);
  16042. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16043. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["WhileTrue"]([new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null);
  16044. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16045. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["DoWhileTrue"]([new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null);
  16046. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16047. var sc = [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SwitchCase"](new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].all, null, null, null, true))];
  16048. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Switch"](new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].variable_and_function, null, null, null, true), sc);
  16049. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16050. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Return"]([new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)]);
  16051. }
  16052. }
  16053. function dragTrash(event) {
  16054. $('.ghost_div').remove();
  16055. var trash = $('<i class="ui icon trash alternate outline"></i>');
  16056. $('body').append(trash);
  16057. trash.css('position', 'absolute');
  16058. trash.css('top', event.clientY);
  16059. trash.css('left', event.clientX - 20);
  16060. trash.css('font-size', '3em');
  16061. trash.css('display', 'none');
  16062. function_container_active.find('.commands_list_div').off('mousemove');
  16063. function_container_active.find('.commands_list_div').find("*").off('mousemove');
  16064. trash.fadeIn(200, function () {
  16065. trash.fadeOut(200, function () {
  16066. trash.remove();
  16067. });
  16068. });
  16069. }
  16070. function findSingleElement(searching, query) {
  16071. if (!searching || !query) {
  16072. return '';
  16073. }
  16074. if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes || searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue || searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue) {
  16075. if (searching.commands_block) {
  16076. return '' + searching.commands_block.indexOf(query);
  16077. } else {
  16078. return '0';
  16079. }
  16080. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16081. if (searching.commands_block == null) {
  16082. searching.commands_block = [];
  16083. }
  16084. if (searching.commands_else == null) {
  16085. searching.commands_else = [];
  16086. }
  16087. if (searching.commands_block.indexOf(query) >= 0) {
  16088. return 'if[' + searching.commands_block.indexOf(query) + ']';
  16089. } else {
  16090. return 'else[' + searching.commands_else.indexOf(query) + ']';
  16091. }
  16092. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16093. for (var i = 0; i < searching.cases.length; i++) {
  16094. if (searching.cases[i].commands_block.indexOf(query) >= 0) {
  16095. return 'case[' + searching.cases[i].commands_block.indexOf(query) + ']';
  16096. }
  16097. }
  16098. }
  16099. }
  16100. function findPathRecursive(starter_index, hierarquia_bottom_up, function_obj) {
  16101. var index_command = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
  16102. var actual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  16103. var full_path = '';
  16104. for (var i = 0; i <= hierarquia_bottom_up.length; i++) {
  16105. full_path += findSingleElement(hierarquia_bottom_up[i], hierarquia_bottom_up[i + 1]) + '-';
  16106. }
  16107. return full_path;
  16108. }
  16109. function manageCommand(function_obj, function_container, event, command_type) {
  16110. $(".created_element").each(function (index) {
  16111. $(this).remove();
  16112. });
  16113. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16114. if (el.hasClass('ghost_div')) {
  16115. if (el.closest('.command_container').length < 1) {
  16116. el.closest('.commands_list_div').css('height', el.closest('.commands_list_div').css('height') + 30); //$('.ghost_div').remove();
  16117. el = el.closest('.commands_list_div');
  16118. }
  16119. } // Primeiro verificar se ele soltou no espaço da função correta:
  16120. var hier = el.parentsUntil(".all_functions");
  16121. var esta_correto = false;
  16122. var esta_na_div_correta = false;
  16123. if (el.hasClass("commands_list_div")) {
  16124. esta_na_div_correta = true;
  16125. }
  16126. for (var i = 0; i < hier.length; i++) {
  16127. var temp = $(hier[i]);
  16128. if (temp.hasClass("commands_list_div")) {
  16129. esta_na_div_correta = true;
  16130. }
  16131. if (temp.data('fun') == function_obj) {
  16132. esta_correto = true;
  16133. break;
  16134. }
  16135. }
  16136. if (!esta_correto) {
  16137. // has_element_created_draged = false;
  16138. // which_element_is_draged = null;
  16139. dragTrash(event);
  16140. return;
  16141. } else {
  16142. if (!esta_na_div_correta) {
  16143. // has_element_created_draged = false;
  16144. // which_element_is_draged = null;
  16145. dragTrash(event);
  16146. return;
  16147. }
  16148. }
  16149. var hierarquia_bottom_up = null; // Agora é descobrir qual o escopo para adicionar o comando:
  16150. // Se o elemento clicado possuir o atributo "fun", então, é direto na div dos comandos:
  16151. if (typeof el.data('fun') !== 'undefined') {
  16152. // Se a lista de comandos estiver vazia, então é o primeiro.
  16153. // Portanto, ele deve soltar o elemento obrigatoriamente no objeto vazio
  16154. if (el.data('fun').commands == null || el.data('fun').commands.length == 0) {
  16155. // pode adicionar
  16156. el.data('fun').commands = [];
  16157. var new_cmd = genericCreateCommand(command_type);
  16158. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', 0);
  16159. el.data('fun').commands.push(new_cmd);
  16160. renderCommand(new_cmd, $(function_container).find('.commands_list_div'), 3, function_obj);
  16161. } else {
  16162. // Entra nesse else, caso já existam outros comandos no bloco:
  16163. findNearbyCommandToAddInFunctionScope(el, event, $(function_container).find('.commands_list_div'), function_obj, command_type);
  16164. }
  16165. } else {
  16166. // descobrir em qual comando ele soltou:
  16167. var hier_find = el.parentsUntil(".commands_list_div");
  16168. hierarquia_bottom_up = [];
  16169. if (typeof el.data('command') !== 'undefined') {
  16170. hierarquia_bottom_up.push(el.data('command'));
  16171. }
  16172. for (var i = 0; i < hier_find.length; i++) {
  16173. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16174. hierarquia_bottom_up.push($(hier_find[i]).data('command'));
  16175. }
  16176. } // Se for do tipo break, verificar se está no contexto correto:
  16177. // Caso não esteja no contexto, apenas retorna sem dar continuidade:
  16178. var is_correct_context = false;
  16179. if (command_type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]) {
  16180. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  16181. if (hierarquia_bottom_up[i].type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes || hierarquia_bottom_up[i].type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue || hierarquia_bottom_up[i].type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue || hierarquia_bottom_up[i].type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16182. is_correct_context = true;
  16183. break;
  16184. }
  16185. }
  16186. if (!is_correct_context) {
  16187. console.error("Context not allowed to insert BREAK COMMAND!");
  16188. return;
  16189. }
  16190. } // se a hierarquia possuir apenas um elemento, então está na raiz dos comandos:
  16191. if (hierarquia_bottom_up.length == 1) {
  16192. var sub_elemento = false;
  16193. for (var i = 0; i < hier_find.length; i++) {
  16194. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16195. findBeforeOrAfterCommandToAdd(hier_find[i], event, function_obj, command_type);
  16196. sub_elemento = true;
  16197. break;
  16198. }
  16199. }
  16200. if (!sub_elemento) {
  16201. findBeforeOrAfterCommandToAdd(el[0], event, function_obj, command_type);
  16202. }
  16203. } else {
  16204. // caso exista mais de um elemento na hierarquia:
  16205. if (typeof $(el).data('command') !== 'undefined') {
  16206. insertCommandInBlockHierar(el[0], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16207. } else {
  16208. var sub_elemento = false;
  16209. for (var i = 0; i < hier_find.length; i++) {
  16210. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16211. insertCommandInBlockHierar(hier_find[i], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16212. sub_elemento = true;
  16213. break;
  16214. }
  16215. }
  16216. }
  16217. }
  16218. } // has_element_created_draged = false;
  16219. // which_element_is_draged = null;
  16220. if (hierarquia_bottom_up) {
  16221. var i = hierarquia_bottom_up.length - 1;
  16222. var starter_index = window.program_obj.functions[window.program_obj.functions.indexOf(function_obj)].commands.indexOf(hierarquia_bottom_up[i]);
  16223. var all_str_path = starter_index + '-' + findPathRecursive(starter_index, hierarquia_bottom_up, function_obj);
  16224. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', all_str_path);
  16225. }
  16226. renderAlgorithm();
  16227. }
  16228. function insertCommandInBlockHierar(el, event, function_obj, command_type, hier_dom, hier_obj) {
  16229. var el_jq = $(el);
  16230. var command_parent = el_jq.data('command');
  16231. if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes || el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue || el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue || el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16232. if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes || el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue || el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue) {
  16233. // Se não tiver outro comando ainda no bloco, só adiciona:
  16234. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16235. command_parent.commands_block = [];
  16236. var recentComand = genericCreateCommand(command_type);
  16237. command_parent.commands_block.push(recentComand);
  16238. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/' + el_jq.data('command').type, 0);
  16239. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  16240. } else {
  16241. // Se já tem algum comando no bloco:
  16242. findNearbyCommandToAddInBlockScope(el, event, el, function_obj, command_type, command_parent);
  16243. }
  16244. } else {
  16245. // QUANDO FOR BLOCO DO TIPO IF OU SWITCH/CASE:
  16246. addCommandToSwitchCase(event, function_obj, command_type);
  16247. }
  16248. } else {
  16249. // entra neste bloco, se soltou o comando sobre outro comando dentro de um subbloco:
  16250. findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type);
  16251. }
  16252. }
  16253. function findNearbyCommandToAddInBlockScope(el, event, node_list_commands, function_obj, command_type, command_parent) {
  16254. var all_sub = $(node_list_commands).find('div.command_container');
  16255. var menor_distancia = 999999999;
  16256. var elemento_menor_distancia = null;
  16257. var antes = true;
  16258. var t_bot;
  16259. var t_top; // Descobrindo o elemento mais próximo:
  16260. for (var i = 0; i < all_sub.length; i++) {
  16261. t_top = all_sub[i].getBoundingClientRect().top;
  16262. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16263. if (t_top - event.clientY < menor_distancia) {
  16264. menor_distancia = event.clientY - t_top;
  16265. elemento_menor_distancia = all_sub[i];
  16266. }
  16267. }
  16268. var borda_inferior = elemento_menor_distancia.parentNode.getBoundingClientRect().top + elemento_menor_distancia.parentNode.getBoundingClientRect().height; // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16269. if (borda_inferior - event.clientY < menor_distancia) {
  16270. var recentComand = genericCreateCommand(command_type);
  16271. command_parent.commands_block.push(recentComand); //
  16272. renderCommand(recentComand, node_list_commands, 3, function_obj);
  16273. } else {
  16274. var recentComand = genericCreateCommand(command_type);
  16275. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16276. if (index > -1) {
  16277. command_parent.commands_block.splice(index, 0, recentComand);
  16278. }
  16279. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16280. }
  16281. }
  16282. function findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type) {
  16283. var el_jq = $(el);
  16284. var command_parent = $(el.parentNode.parentNode).data('command');
  16285. var command_target = el_jq.data('command');
  16286. var temp_parent = $(el.parentNode.parentNode);
  16287. var is_in_else = false;
  16288. if (!command_parent) {
  16289. command_parent = el_jq.data('command');
  16290. temp_parent = el_jq;
  16291. var hier = el_jq.parentsUntil(".command_container");
  16292. for (var i = 0; i < hier.length; i++) {
  16293. var temp = $(hier[i]);
  16294. if (typeof temp.data('else') != 'undefined') {
  16295. is_in_else = true;
  16296. }
  16297. if (typeof temp.data('command') != 'undefined') {
  16298. command_parent = temp.data('command');
  16299. temp_parent = temp;
  16300. }
  16301. }
  16302. }
  16303. var hier = el_jq.parentsUntil(".command_container");
  16304. for (var i = 0; i < hier.length; i++) {
  16305. var temp = $(hier[i]);
  16306. if (typeof temp.data('else') != 'undefined') {
  16307. is_in_else = true;
  16308. }
  16309. }
  16310. if (command_parent == command_target) {
  16311. var hier = el_jq.parentsUntil(".command_container");
  16312. for (var i = 0; i < hier.length; i++) {
  16313. var temp = $(hier[i]);
  16314. if (typeof temp.data('else') !== 'undefined') {
  16315. is_in_else = true;
  16316. break;
  16317. }
  16318. }
  16319. }
  16320. if (command_parent.type != _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue && command_parent.type != _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16321. var hier = temp_parent.parentsUntil(".all_cases_div");
  16322. for (var i = 0; i < hier.length; i++) {
  16323. var temp = $(hier[i]);
  16324. if (typeof temp.data('switchcase') !== 'undefined') {
  16325. command_parent = temp.data('switchcase');
  16326. is_in_else = false;
  16327. break;
  16328. }
  16329. }
  16330. }
  16331. var menor_distancia = 999999999;
  16332. var antes = true;
  16333. var t_bot;
  16334. var t_top;
  16335. t_top = el.getBoundingClientRect().top;
  16336. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  16337. var d_top = event.clientY - t_top; // distancia topo
  16338. var d_bot = t_bot - event.clientY; // distancia baixo
  16339. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16340. if (d_top < d_bot) {
  16341. var recentComand = genericCreateCommand(command_type);
  16342. if (is_in_else) {
  16343. if (command_parent == command_target) {
  16344. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16345. command_parent.commands_else = [];
  16346. var recentComand = genericCreateCommand(command_type);
  16347. command_parent.commands_else.push(recentComand);
  16348. renderCommand(recentComand, el_jq, 3, function_obj);
  16349. } else {
  16350. // Se já tem algum comando no bloco:
  16351. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16352. }
  16353. return;
  16354. }
  16355. var index = command_parent.commands_else.indexOf(command_target);
  16356. if (index > -1) {
  16357. command_parent.commands_else.splice(index, 0, recentComand);
  16358. }
  16359. renderCommand(recentComand, el, 1, function_obj);
  16360. } else {
  16361. if (command_parent == command_target) {
  16362. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16363. command_parent.commands_block = [];
  16364. var recentComand = genericCreateCommand(command_type);
  16365. command_parent.commands_block.push(recentComand);
  16366. renderCommand(recentComand, el_jq, 3, function_obj);
  16367. } else {
  16368. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16369. }
  16370. return;
  16371. }
  16372. var index = command_parent.commands_block.indexOf(command_target);
  16373. if (index > -1) {
  16374. command_parent.commands_block.splice(index, 0, recentComand);
  16375. }
  16376. renderCommand(recentComand, el, 1, function_obj);
  16377. }
  16378. } else {
  16379. var recentComand = genericCreateCommand(command_type);
  16380. if (is_in_else) {
  16381. if (command_parent == command_target) {
  16382. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16383. command_parent.commands_else = [];
  16384. var recentComand = genericCreateCommand(command_type);
  16385. command_parent.commands_else.push(recentComand);
  16386. renderCommand(recentComand, el_jq, 3, function_obj);
  16387. } else {
  16388. // Se já tem algum comando no bloco:
  16389. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16390. }
  16391. return;
  16392. }
  16393. var index = command_parent.commands_else.indexOf(command_target);
  16394. if (index > -1) {
  16395. command_parent.commands_else.splice(index + 1, 0, recentComand);
  16396. }
  16397. renderCommand(recentComand, el, 2, function_obj);
  16398. } else {
  16399. if (command_parent == command_target) {
  16400. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16401. command_parent.commands_block = [];
  16402. var recentComand = genericCreateCommand(command_type);
  16403. command_parent.commands_block.push(recentComand);
  16404. renderCommand(recentComand, el_jq, 3, function_obj);
  16405. } else {
  16406. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16407. }
  16408. return;
  16409. }
  16410. var index = command_parent.commands_block.indexOf(command_target);
  16411. if (index > -1) {
  16412. command_parent.commands_block.splice(index + 1, 0, recentComand);
  16413. }
  16414. renderCommand(recentComand, el, 2, function_obj);
  16415. }
  16416. }
  16417. }
  16418. function insertCommandInBlock(el, event, function_obj, command_type) {
  16419. var el_jq = $(el);
  16420. var command_parent = el_jq.data('command');
  16421. if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes || el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue || el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue) {
  16422. // Se não tiver outro comando ainda no bloco, só adiciona:
  16423. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16424. command_parent.commands_block = [];
  16425. var recentComand = genericCreateCommand(command_type);
  16426. command_parent.commands_block.push(recentComand);
  16427. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  16428. } else {
  16429. // Se já tem algum comando no bloco:
  16430. findInBlockCorrectPlace(el, event, function_obj, command_type);
  16431. }
  16432. } else if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16433. // no if ou no else?
  16434. var correct_div = $(document.elementFromPoint(event.pageX, event.pageY));
  16435. var is_in_if = true;
  16436. if (correct_div.data('if')) {
  16437. is_in_if = true;
  16438. } else if (correct_div.data('else')) {
  16439. is_in_if = false;
  16440. } else {
  16441. var hier = correct_div.parentsUntil(".command_container");
  16442. for (var i = 0; i < hier.length; i++) {
  16443. var temp = $(hier[i]);
  16444. if (typeof temp.data('if') !== 'undefined') {
  16445. is_in_if = true;
  16446. break;
  16447. }
  16448. if (typeof temp.data('else') !== 'undefined') {
  16449. is_in_if = false;
  16450. break;
  16451. }
  16452. }
  16453. }
  16454. if (is_in_if) {
  16455. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16456. command_parent.commands_block = [];
  16457. var recentComand = genericCreateCommand(command_type);
  16458. command_parent.commands_block.push(recentComand);
  16459. renderCommand(recentComand, el_jq.find('.commands_if'), 3, function_obj);
  16460. } else {
  16461. // Se já tem algum comando no bloco:
  16462. findInBlockCorrectPlace(el_jq.find('.commands_if'), event, function_obj, command_type);
  16463. }
  16464. } else {
  16465. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16466. command_parent.commands_else = [];
  16467. var recentComand = genericCreateCommand(command_type);
  16468. command_parent.commands_else.push(recentComand);
  16469. renderCommand(recentComand, el_jq.find('.commands_else'), 3, function_obj);
  16470. } else {
  16471. // Se já tem algum comando no bloco:
  16472. findInBlockCorrectPlace(el_jq.find('.commands_else'), event, function_obj, command_type, true);
  16473. }
  16474. }
  16475. } else {
  16476. // é do tipo switch
  16477. addCommandToSwitchCase(event, function_obj, command_type);
  16478. }
  16479. }
  16480. function addCommandToSwitchCase(event, function_obj, command_type) {
  16481. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16482. var which_case = el.data('switchcase');
  16483. var case_div = el;
  16484. if (!which_case) {
  16485. var hier_find = el.parentsUntil(".all_cases_div");
  16486. for (var i = 0; i < hier_find.length; i++) {
  16487. if (typeof $(hier_find[i]).data('switchcase') !== 'undefined') {
  16488. which_case = $(hier_find[i]).data('switchcase');
  16489. case_div = $(hier_find[i]);
  16490. break;
  16491. }
  16492. }
  16493. }
  16494. if (which_case.commands_block == null || which_case.commands_block.length < 1) {
  16495. which_case.commands_block = [];
  16496. var recentComand = genericCreateCommand(command_type);
  16497. which_case.commands_block.push(recentComand);
  16498. renderCommand(recentComand, case_div.find('.case_commands_block'), 3, function_obj);
  16499. } else {
  16500. findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type);
  16501. }
  16502. }
  16503. function findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type) {
  16504. var all_sub = case_div.find('div.command_container');
  16505. var menor_distancia = 999999999;
  16506. var elemento_menor_distancia = null;
  16507. var antes = true;
  16508. var t_bot;
  16509. var t_top; // Descobrindo o elemento mais próximo:
  16510. for (var i = 0; i < all_sub.length; i++) {
  16511. t_top = all_sub[i].getBoundingClientRect().top;
  16512. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16513. if (t_top - event.clientY < menor_distancia) {
  16514. menor_distancia = event.clientY - t_top;
  16515. elemento_menor_distancia = all_sub[i];
  16516. }
  16517. }
  16518. var borda_inferior = elemento_menor_distancia.parentNode.getBoundingClientRect().top + elemento_menor_distancia.parentNode.getBoundingClientRect().height; // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16519. if (borda_inferior - event.clientY < menor_distancia) {
  16520. var recentComand = genericCreateCommand(command_type);
  16521. which_case.commands_block.push(recentComand);
  16522. renderCommand(recentComand, $(case_div.find('.case_commands_block')[0]), 3, function_obj);
  16523. } else {
  16524. var recentComand = genericCreateCommand(command_type);
  16525. var index = which_case.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16526. if (index > -1) {
  16527. which_case.commands_block.splice(index, 0, recentComand);
  16528. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16529. }
  16530. }
  16531. }
  16532. function findInBlockCorrectPlace(el, event, function_obj, command_type) {
  16533. var is_in_else = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  16534. var el_jq = $(el);
  16535. var all_sub = el_jq.find('div.command_container');
  16536. var menor_distancia = 999999999;
  16537. var elemento_menor_distancia = null;
  16538. var antes = true;
  16539. var t_bot;
  16540. var t_top; // Descobrindo o elemento mais próximo:
  16541. for (var i = 0; i < all_sub.length; i++) {
  16542. t_top = all_sub[i].getBoundingClientRect().top;
  16543. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16544. if (t_top - event.clientY < menor_distancia) {
  16545. menor_distancia = event.clientY - t_top;
  16546. elemento_menor_distancia = all_sub[i];
  16547. }
  16548. }
  16549. var borda_inferior = elemento_menor_distancia.parentNode.getBoundingClientRect().top + elemento_menor_distancia.parentNode.getBoundingClientRect().height; // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16550. if (borda_inferior - event.clientY < menor_distancia) {
  16551. var recentComand = genericCreateCommand(command_type);
  16552. var command_parent = el_jq.data('command');
  16553. if (is_in_else) {
  16554. command_parent.commands_else.push(recentComand);
  16555. renderCommand(recentComand, el_jq, 3, function_obj);
  16556. } else {
  16557. command_parent.commands_block.push(recentComand);
  16558. renderCommand(recentComand, $(el_jq.find('.block_commands')[0]), 3, function_obj);
  16559. }
  16560. } else {
  16561. var recentComand = genericCreateCommand(command_type);
  16562. var command_parent = el_jq.data('command');
  16563. if (is_in_else) {
  16564. var index = command_parent.commands_else.indexOf($(elemento_menor_distancia).data('command'));
  16565. if (index > -1) {
  16566. command_parent.commands_else.splice(index, 0, recentComand);
  16567. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16568. }
  16569. } else {
  16570. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16571. if (index > -1) {
  16572. command_parent.commands_block.splice(index, 0, recentComand);
  16573. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16574. }
  16575. }
  16576. }
  16577. }
  16578. function findBeforeOrAfterCommandToAdd(el, event, function_obj, command_type) {
  16579. switch ($(el).data('command').type) {
  16580. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16581. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16582. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16583. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16584. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16585. insertCommandInBlock(el, event, function_obj, command_type);
  16586. return;
  16587. }
  16588. var menor_distancia = 999999999;
  16589. var antes = true;
  16590. var t_bot;
  16591. var t_top;
  16592. t_top = el.getBoundingClientRect().top;
  16593. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  16594. var d_top = event.clientY - t_top; // distancia topo
  16595. var d_bot = t_bot - event.clientY; // distancia baixo
  16596. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16597. if (d_top < d_bot) {
  16598. var recentComand = genericCreateCommand(command_type);
  16599. var index = function_obj.commands.indexOf($(el).data('command'));
  16600. if (index > -1) {
  16601. function_obj.commands.splice(index, 0, recentComand);
  16602. }
  16603. renderCommand(recentComand, el, 1, function_obj);
  16604. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  16605. } else {
  16606. var recentComand = genericCreateCommand(command_type);
  16607. var index = function_obj.commands.indexOf($(el).data('command'));
  16608. if (index > -1) {
  16609. function_obj.commands.splice(index + 1, 0, recentComand);
  16610. }
  16611. renderCommand(recentComand, el, 2, function_obj);
  16612. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  16613. }
  16614. }
  16615. function findNearbyCommandToAddInFunctionScope(el, event, node_list_commands, function_obj, command_type) {
  16616. var all_sub = $(node_list_commands).find('div.command_container');
  16617. var menor_distancia = 999999999;
  16618. var elemento_menor_distancia = null;
  16619. var antes = true;
  16620. var t_bot;
  16621. var t_top; // Descobrindo o elemento mais próximo:
  16622. for (var i = 0; i < all_sub.length; i++) {
  16623. t_top = all_sub[i].getBoundingClientRect().top;
  16624. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16625. if (t_top - event.clientY < menor_distancia) {
  16626. menor_distancia = event.clientY - t_top;
  16627. elemento_menor_distancia = all_sub[i];
  16628. }
  16629. }
  16630. var borda_inferior = elemento_menor_distancia.parentNode.getBoundingClientRect().top + elemento_menor_distancia.parentNode.getBoundingClientRect().height; // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16631. if (borda_inferior - event.clientY < menor_distancia) {
  16632. var recentComand = genericCreateCommand(command_type);
  16633. function_obj.commands.push(recentComand); //
  16634. renderCommand(recentComand, node_list_commands, 3, function_obj);
  16635. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', function_obj.commands.length - 1);
  16636. } else {
  16637. var recentComand = genericCreateCommand(command_type);
  16638. var index = function_obj.commands.indexOf($(elemento_menor_distancia).data('command'));
  16639. if (index > -1) {
  16640. function_obj.commands.splice(index, 0, recentComand);
  16641. }
  16642. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16643. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  16644. }
  16645. }
  16646. /***/ }),
  16647. /***/ "./js/visualUI/commands/attribution.js":
  16648. /*!*********************************************!*\
  16649. !*** ./js/visualUI/commands/attribution.js ***!
  16650. \*********************************************/
  16651. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, renderMenuOperations */
  16652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16653. "use strict";
  16654. __webpack_require__.r(__webpack_exports__);
  16655. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16656. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16657. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  16658. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenuOperations", function() { return renderMenuOperations; });
  16659. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  16660. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16661. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16662. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  16663. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  16664. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  16665. function createFloatingCommand() {
  16666. return $('<div class="ui attribution created_element"> <i class="ui icon small arrow left"></i> <span> x <&#8212; 1 + 1 </span></div>');
  16667. }
  16668. function renderCommand(command, function_obj) {
  16669. var el = $('<div class="ui attribution command_container"><i class="ui icon small arrow left command_drag"></i> <i class="ui icon times red button_remove_command"></i> <div class="var_attributed"></div> <span class="text_attr_receives span_command_spec">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_receives') + '</span> ' + '<div class="expression_elements"></div> <span class="textual_expression"></span> <i class="ui icon unlock button_alternate_expression"></i> </div>');
  16670. el.data('command', command);
  16671. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.var_attributed'), function_obj);
  16672. if (!command.expression || command.expression.length < 1) {
  16673. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true);
  16674. command.expression.push(exp);
  16675. }
  16676. addHandlers(command, function_obj, el);
  16677. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.expression);
  16678. if (command.lockexpression) {
  16679. if (command.expression) {
  16680. try {
  16681. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  16682. if (text) {
  16683. $(el.find('.expression_elements')[0]).toggle();
  16684. $(el.find('.textual_expression')[0]).text(text);
  16685. $(el.find('.textual_expression')[0]).toggle();
  16686. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  16687. }
  16688. } catch (e) {
  16689. command.lockexpression = false;
  16690. }
  16691. }
  16692. }
  16693. return el;
  16694. }
  16695. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, selectedItem, expression_element) {
  16696. var index_to_move = expression_element.itens.indexOf(ref_object);
  16697. switch (selectedItem.data('exp')) {
  16698. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  16699. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ExpressionElement"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp, [expression_element.itens[index_to_move], _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)]);
  16700. expression_element.itens[index_to_move] = exp;
  16701. break;
  16702. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  16703. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ExpressionElement"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp, [_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus, expression_element.itens[index_to_move]]);
  16704. expression_element.itens[index_to_move] = exp;
  16705. break;
  16706. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  16707. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ExpressionElement"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par, [expression_element.itens[index_to_move]]);
  16708. expression_element.itens[index_to_move] = exp;
  16709. break;
  16710. }
  16711. renderExpressionElements(command, function_obj, dom_object);
  16712. }
  16713. function renderExpressionElements(command, function_obj, el) {
  16714. var expression_div = el.find('.expression_elements');
  16715. var command_container;
  16716. if (el.hasClass("command_container") == false) {
  16717. var hier = el.parentsUntil(".command_container");
  16718. for (var i = 0; i < hier.length; i++) {
  16719. if ($(hier[i]).hasClass("command_container")) {
  16720. command_container = $(hier[i]);
  16721. break;
  16722. }
  16723. if ($(hier[i]).hasClass("expression_elements")) {
  16724. expression_div = $(hier[i]);
  16725. break;
  16726. }
  16727. }
  16728. }
  16729. if (command_container) {
  16730. expression_div = command_container.find('.expression_elements');
  16731. }
  16732. expression_div.text('');
  16733. for (var i = 0; i < command.expression.length; i++) {
  16734. var temp = $('<div class="expression_element"></div>');
  16735. temp.data('ref_element', command.expression[i]);
  16736. temp.data('ref_index', i);
  16737. expression_div.append(temp);
  16738. renderElement(command, function_obj, temp, command.expression[i]);
  16739. }
  16740. }
  16741. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  16742. var context_menu = '<div class="ui dropdown"><div class="text">';
  16743. switch (expression_element.itens[index_op]) {
  16744. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  16745. context_menu += '+';
  16746. break;
  16747. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  16748. context_menu += '-';
  16749. break;
  16750. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  16751. context_menu += '*';
  16752. break;
  16753. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  16754. context_menu += '/';
  16755. break;
  16756. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  16757. context_menu += '%';
  16758. break;
  16759. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none:
  16760. context_menu += '...';
  16761. break;
  16762. }
  16763. context_menu += '</div><div class="menu">';
  16764. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus + '">+</div>';
  16765. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus + '">-</div>';
  16766. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  16767. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division + '">/</div>';
  16768. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module + '">%</div>';
  16769. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none + '" data-text="...">Nenhum</div>';
  16770. context_menu += '</div></div>';
  16771. context_menu = $(context_menu);
  16772. temp_op.append(context_menu);
  16773. context_menu.dropdown({
  16774. onChange: function onChange(value, text, $selectedItem) {
  16775. expression_element.itens[index_op] = value;
  16776. }
  16777. });
  16778. }
  16779. function renderMenuAddExpression(command, function_obj, el, dom_append_menu, expression_append_new_expression) {
  16780. if (el.hasClass("command_container") == false) {
  16781. var hier = el.parentsUntil(".commands_list_div");
  16782. for (var i = 0; i < hier.length; i++) {
  16783. if ($(hier[i]).hasClass("command_container")) {
  16784. el = $(hier[i]);
  16785. break;
  16786. }
  16787. }
  16788. }
  16789. if (dom_append_menu.hasClass("expression_elements") == false) {
  16790. var hier = el.parentsUntil(".commands_list_div");
  16791. for (var i = 0; i < hier.length; i++) {
  16792. if ($(hier[i]).hasClass("expression_elements")) {
  16793. dom_append_menu = $(hier[i]);
  16794. break;
  16795. }
  16796. }
  16797. }
  16798. var context_menu = '<div class="ui dropdown"><div class="text"></div><i class="ui icon arrow alternate circle right outline"></i><div class="menu">';
  16799. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp + '">EXP OP EXP</div>';
  16800. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp + '">OP EXP</div>';
  16801. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par + '">( EXP )</div>';
  16802. context_menu += '</div></div>';
  16803. context_menu = $(context_menu);
  16804. dom_append_menu.append(context_menu);
  16805. context_menu.dropdown({
  16806. onChange: function onChange(value, text, $selectedItem) {
  16807. switch (value) {
  16808. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  16809. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ExpressionElement"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)]);
  16810. expression_append_new_expression.push(exp);
  16811. break;
  16812. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  16813. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ExpressionElement"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp, [_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)]);
  16814. expression_append_new_expression.push(exp);
  16815. break;
  16816. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  16817. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ExpressionElement"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)]);
  16818. expression_append_new_expression.push(exp);
  16819. break;
  16820. }
  16821. renderExpressionElements(command, function_obj, el);
  16822. }
  16823. });
  16824. }
  16825. function renderElement(command, function_obj, el, expression_element) {
  16826. switch (expression_element.type_exp) {
  16827. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  16828. var temp_op = $('<div class="component_element"></div>');
  16829. var temp_exp_1 = $('<div class="component_element"></div>');
  16830. var temp_exp_2 = $('<div class="component_element"></div>');
  16831. el.append(temp_exp_1);
  16832. el.append(temp_op);
  16833. el.append(temp_exp_2);
  16834. if (expression_element.itens[0].type) {
  16835. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[0], temp_exp_1, function_obj, 2, expression_element);
  16836. } else {
  16837. renderElement(command, function_obj, temp_exp_1, expression_element.itens[0]);
  16838. }
  16839. renderOperator(command, function_obj, temp_op, expression_element, 1);
  16840. if (expression_element.itens[2].type) {
  16841. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[2], temp_exp_2, function_obj, 2, expression_element);
  16842. } else {
  16843. renderElement(command, function_obj, temp_exp_2, expression_element.itens[2]);
  16844. }
  16845. break;
  16846. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  16847. var temp_op = $('<div class="component_element"></div>');
  16848. var temp_exp = $('<div class="component_element"></div>');
  16849. el.append(temp_op);
  16850. el.append(temp_exp);
  16851. renderOperator(command, function_obj, temp_op, expression_element, 0);
  16852. if (expression_element.itens[1].type) {
  16853. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[1], temp_exp, function_obj, 2, expression_element);
  16854. } else {
  16855. renderElement(command, function_obj, temp_exp, expression_element.itens[1]);
  16856. }
  16857. break;
  16858. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  16859. var temp_par_1 = $('<div class="component_element"> ( </div>');
  16860. var temp_exp = $('<div class="component_element"></div>');
  16861. var temp_par_2 = $('<div class="component_element"> ) </div>');
  16862. el.append(temp_par_1);
  16863. el.append(temp_exp);
  16864. for (var j = 0; j < expression_element.itens.length; j++) {
  16865. if (expression_element.itens[j].type) {
  16866. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[j], temp_exp, function_obj, 2, expression_element);
  16867. } else {
  16868. renderElement(command, function_obj, temp_exp, expression_element.itens[j]);
  16869. }
  16870. } //renderMenuAddExpression(command, function_obj, el, el, expression_element.itens);
  16871. el.append(temp_par_2);
  16872. break;
  16873. }
  16874. }
  16875. function renderExpression(command, function_obj, el) {
  16876. var expression_div = el.find('.expression_elements');
  16877. expression_div.text('');
  16878. var menu_add_item = $('<div class="menu_add_item"></div>');
  16879. menu_add_item.data('index_add', 0);
  16880. expression_div.append(menu_add_item);
  16881. for (var i = 0; i < command.expression.length; i++) {
  16882. if (command.expression[i].type) {
  16883. var temp = $('<div class="expression_element"></div>');
  16884. temp.data('ref_element', command.expression[i]);
  16885. temp.data('ref_index', i);
  16886. expression_div.append(temp);
  16887. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.expression[i], temp, function_obj);
  16888. } else if (command.expression[i] == "(" || command.expression[i] == ")") {
  16889. var temp = $('<div class="expression_element">' + command.expression[i] + '</div>');
  16890. temp.data('ref_element', command.expression[i]);
  16891. temp.data('ref_index', i);
  16892. expression_div.append(temp);
  16893. } else {
  16894. var temp = '<div class="expression_element">';
  16895. switch (command.expression[i]) {
  16896. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  16897. temp += '+';
  16898. break;
  16899. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  16900. temp += '-';
  16901. break;
  16902. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  16903. temp += '*';
  16904. break;
  16905. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  16906. temp += '/';
  16907. break;
  16908. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  16909. temp += '%';
  16910. break;
  16911. }
  16912. temp += '</div>';
  16913. temp = $(temp);
  16914. temp.data('ref_element', command.expression[i]);
  16915. temp.data('ref_index', i);
  16916. expression_div.append(temp);
  16917. }
  16918. var menu_add_item_seq = $('<div class="menu_add_item"></div>');
  16919. var index_temp = i + 1;
  16920. menu_add_item_seq.data('index_add', index_temp);
  16921. expression_div.append(menu_add_item_seq);
  16922. }
  16923. addMenuItens(command, function_obj, el);
  16924. }
  16925. function addMenuItens(command, function_obj, expression_div) {
  16926. var divs_expression = expression_div.find('.menu_add_item');
  16927. for (var i = 0; i < divs_expression.length; i++) {
  16928. var temp = $(divs_expression[i]).data('index_add');
  16929. var context_menu = '<div class="ui dropdown context_menu_clear"><i class="ui icon plus square outline"></i><div class="menu">';
  16930. context_menu += '<div class="item" data-option="value" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_value') + '</div>';
  16931. context_menu += '<div class="item" data-option="operator" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_operator') + '</div>';
  16932. context_menu += '<div class="item" data-option="parentheses" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_parentheses') + '</div>';
  16933. context_menu += '</div></div>';
  16934. context_menu = $(context_menu);
  16935. $(divs_expression[i]).append(context_menu);
  16936. context_menu.dropdown({
  16937. on: 'hover',
  16938. onChange: function onChange(value, text, $selectedItem) {
  16939. switch ($selectedItem.data('option')) {
  16940. case "value":
  16941. command.expression.splice($selectedItem.data('index'), 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  16942. renderExpression(command, function_obj, expression_div);
  16943. break;
  16944. case "operator":
  16945. command.expression.splice($selectedItem.data('index'), 0, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus);
  16946. renderExpression(command, function_obj, expression_div);
  16947. break;
  16948. case "parentheses":
  16949. command.expression.splice($selectedItem.data('index'), 0, "(");
  16950. command.expression.splice($selectedItem.data('index') + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  16951. command.expression.splice($selectedItem.data('index') + 2, 0, ")");
  16952. renderExpression(command, function_obj, expression_div);
  16953. break;
  16954. }
  16955. }
  16956. });
  16957. }
  16958. }
  16959. function addHandlers(command, function_obj, attribution_dom) {
  16960. $(attribution_dom.find('.textual_expression')[0]).toggle();
  16961. attribution_dom.find('.button_alternate_expression').on('click', function () {
  16962. if (command.expression) {
  16963. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  16964. if (text) {
  16965. $(attribution_dom.find('.expression_elements')[0]).toggle();
  16966. $(attribution_dom.find('.textual_expression')[0]).text(text);
  16967. $(attribution_dom.find('.textual_expression')[0]).toggle();
  16968. $(this).toggleClass('unlock').toggleClass('lock');
  16969. command.lockexpression = !command.lockexpression;
  16970. }
  16971. }
  16972. });
  16973. attribution_dom.find('.button_remove_command').on('click', function () {
  16974. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, attribution_dom)) {
  16975. attribution_dom.fadeOut(400, function () {
  16976. attribution_dom.remove();
  16977. });
  16978. }
  16979. });
  16980. attribution_dom.find('.button_refresh_attribution').on('click', function () {
  16981. renderExpressionElements(command, function_obj, attribution_dom);
  16982. });
  16983. }
  16984. function renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected) {
  16985. /*console.log("recebido o seguinte DOM: ");
  16986. console.log(dom_object);
  16987. if (dom_object.hasClass('var_attributed')) {
  16988. return;
  16989. } else {
  16990. var hier = dom_object.parentsUntil(".command_container");
  16991. for (var i = 0; i < hier.length; i++) {
  16992. if ($(hier[i]).hasClass('var_attributed') || $(hier[i]).hasClass('parameters_function_called')) {
  16993. return;
  16994. }
  16995. }
  16996. }
  16997. dom_object.find('.context_menu_clear').remove();
  16998. var menu_operations = '<div class="ui dropdown menu_operations"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  16999. for (var tm in Models.ARITHMETIC_TYPES) {
  17000. menu_operations += '<div class="item" data-option="'+tm+'">'+LocalizedStrings.getUI('btn_arithmetic_' + tm)+'</div>';
  17001. }
  17002. menu_operations += '<div class="item" data-option="clear">'+LocalizedStrings.getUI('btn_clear')+'</div>';
  17003. menu_operations += '</div></div>';
  17004. menu_operations = $(menu_operations);
  17005. dom_object.append(menu_operations);
  17006. menu_operations.dropdown({
  17007. onChange: function(value, text, $selectedItem) {
  17008. switch ($($selectedItem).data('option')) {
  17009. case "clear":
  17010. $(dom_object).text('');
  17011. VariableValueMenu.renderMenu(command, ref_object, dom_object, function_obj);
  17012. break;
  17013. default:
  17014. createExpressionAround(command, ref_object, dom_object, function_obj);
  17015. menu_operations.find('.text').text('');
  17016. }
  17017. }
  17018. });*/
  17019. }
  17020. function createExpressionAround(command, ref_object, dom_object, function_obj) {
  17021. $('<span> ( </span>').insertBefore(dom_object);
  17022. $('<span> ) </span>').insertAfter(dom_object);
  17023. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), dom_object, function_obj);
  17024. }
  17025. /***/ }),
  17026. /***/ "./js/visualUI/commands/break.js":
  17027. /*!***************************************!*\
  17028. !*** ./js/visualUI/commands/break.js ***!
  17029. \***************************************/
  17030. /*! exports provided: createFloatingCommand, renderCommand */
  17031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17032. "use strict";
  17033. __webpack_require__.r(__webpack_exports__);
  17034. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17036. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17037. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17038. function createFloatingCommand() {
  17039. return $('<div class="ui comment created_element"> <i class="ui icon small pause"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_break') + ' </span></div>');
  17040. }
  17041. function renderCommand(command, function_obj) {
  17042. var el = $('<div class="ui comment command_container"> <i class="ui icon small pause"></i> <i class="ui icon times red button_remove_command"></i> <span>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_break') + '</span> </div>');
  17043. el.data('command', command);
  17044. addHandlers(command, function_obj, el);
  17045. return el;
  17046. }
  17047. function addHandlers(command, function_obj, break_dom) {
  17048. break_dom.find('.button_remove_command').on('click', function () {
  17049. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, break_dom)) {
  17050. break_dom.fadeOut(400, function () {
  17051. break_dom.remove();
  17052. });
  17053. }
  17054. });
  17055. }
  17056. /***/ }),
  17057. /***/ "./js/visualUI/commands/comment.js":
  17058. /*!*****************************************!*\
  17059. !*** ./js/visualUI/commands/comment.js ***!
  17060. \*****************************************/
  17061. /*! exports provided: createFloatingCommand, renderCommand */
  17062. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17063. "use strict";
  17064. __webpack_require__.r(__webpack_exports__);
  17065. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17067. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17068. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17069. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17070. function createFloatingCommand() {
  17071. return $('<div class="ui comment created_element"> <i class="ui icon small quote left"></i> <span class="span_comment_text" "> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_comment') + ' </span></div>');
  17072. }
  17073. function renderCommand(command, function_obj) {
  17074. var el = $('<div class="ui comment command_container"> <i class="ui icon small quote left command_drag"></i> <i class="ui icon times red button_remove_command"></i> <div class="var_value_menu_div"></div> <div class="div_comment_text">' + '</div> </div>');
  17075. el.data('command', command);
  17076. addHandlers(command, function_obj, el);
  17077. renderTextComment(command, function_obj, el);
  17078. return el;
  17079. }
  17080. function renderTextComment(command, function_obj, el) {
  17081. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.comment_text, el.find('.var_value_menu_div'), function_obj, 20);
  17082. }
  17083. function addHandlers(command, function_obj, comment_dom) {
  17084. comment_dom.find('.button_remove_command').on('click', function () {
  17085. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, comment_dom)) {
  17086. comment_dom.fadeOut(400, function () {
  17087. comment_dom.remove();
  17088. });
  17089. }
  17090. });
  17091. }
  17092. /***/ }),
  17093. /***/ "./js/visualUI/commands/conditional_expression.js":
  17094. /*!********************************************************!*\
  17095. !*** ./js/visualUI/commands/conditional_expression.js ***!
  17096. \********************************************************/
  17097. /*! exports provided: renderExpression */
  17098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17099. "use strict";
  17100. __webpack_require__.r(__webpack_exports__);
  17101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17102. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17103. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17104. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17105. function renderExpression(command, expression, function_obj, initial_el_to_render) {
  17106. expression.dom_object = initial_el_to_render;
  17107. if (expression.expression == null || expression.expression.length < 1) {
  17108. renderStartMenu(command, expression, function_obj, initial_el_to_render);
  17109. } else {
  17110. var main_div = $('<div class="expression_elements"></div>');
  17111. switch (expression.expression.type) {
  17112. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17113. renderLogicExpression(command, expression, expression.expression, function_obj, main_div, initial_el_to_render);
  17114. break;
  17115. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17116. renderArithmeticExpression(command, expression, expression.expression, function_obj, main_div);
  17117. break;
  17118. }
  17119. initial_el_to_render.append(main_div);
  17120. var restartMenu = $('<div class="ui restart_expression"><i class="ui icon undo"></i></div>');
  17121. initial_el_to_render.append(restartMenu);
  17122. restartMenu.on('click', function (e) {
  17123. expression.expression = null;
  17124. initial_el_to_render.empty();
  17125. renderExpression(command, expression, function_obj, initial_el_to_render);
  17126. });
  17127. }
  17128. }
  17129. function renderArithmeticOperator(command, all_expression, expression_arithmetic, arithmetic_operator, function_obj, element_to_append) {
  17130. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17131. menu_operator.dropdown({
  17132. values: [{
  17133. name: '>',
  17134. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than,
  17135. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than
  17136. }, {
  17137. name: '<',
  17138. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than,
  17139. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than
  17140. }, {
  17141. name: '==',
  17142. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to,
  17143. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to
  17144. }, {
  17145. name: '!=',
  17146. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to,
  17147. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to
  17148. }, {
  17149. name: '>=',
  17150. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to,
  17151. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to
  17152. }, {
  17153. name: '<=',
  17154. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to,
  17155. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to
  17156. }],
  17157. onChange: function onChange(value, text, $selectedItem) {
  17158. expression_arithmetic.operator = value;
  17159. }
  17160. });
  17161. element_to_append.append(menu_operator);
  17162. }
  17163. function renderLogicOperator(command, all_expression, expression_logic, logic_operator, function_obj, element_to_append, initial_el_to_render) {
  17164. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17165. menu_operator.dropdown({
  17166. values: [{
  17167. name: '==',
  17168. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to,
  17169. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to
  17170. }, {
  17171. name: '!=',
  17172. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to,
  17173. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to
  17174. }, {
  17175. name: '&&',
  17176. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and,
  17177. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and
  17178. }, {
  17179. name: '||',
  17180. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or,
  17181. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or
  17182. }],
  17183. onChange: function onChange(value, text, $selectedItem) {
  17184. if ($selectedItem) {
  17185. expression_logic.operator = value;
  17186. if (expression_logic.second_operand == null) {
  17187. expression_logic.second_operand = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true);
  17188. initial_el_to_render.empty();
  17189. renderExpression(command, all_expression, function_obj, initial_el_to_render);
  17190. }
  17191. }
  17192. }
  17193. });
  17194. element_to_append.append(menu_operator);
  17195. }
  17196. function renderLogicExpression(command, all_expression, expression_logic, function_obj, element_to_append, initial_el_to_render) {
  17197. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17198. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17199. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17200. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17201. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17202. if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17203. renderLogicExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17204. } else if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17205. renderArithmeticExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17206. } else {
  17207. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.first_operand, exp_el_expr_el_1, function_obj);
  17208. }
  17209. element_to_append.append(exp_el_par_1);
  17210. element_to_append.append(exp_el_expr_el_1);
  17211. renderLogicOperator(command, all_expression, expression_logic, expression_logic.operator, function_obj, exp_el_expr_operand, initial_el_to_render);
  17212. element_to_append.append(exp_el_expr_operand);
  17213. if (expression_logic.second_operand) {
  17214. if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17215. renderLogicExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17216. } else if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17217. renderArithmeticExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17218. } else {
  17219. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.second_operand, exp_el_expr_el_2, function_obj);
  17220. }
  17221. element_to_append.append(exp_el_expr_el_2);
  17222. }
  17223. element_to_append.append(exp_el_par_2);
  17224. }
  17225. function renderArithmeticExpression(command, all_expression, expression_arithmetic, function_obj, element_to_append) {
  17226. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17227. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17228. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17229. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17230. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17231. if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17232. renderLogicExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17233. } else if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17234. renderArithmeticExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17235. } else {
  17236. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.first_operand, exp_el_expr_el_1, function_obj);
  17237. }
  17238. if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17239. renderLogicExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17240. } else if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17241. renderArithmeticExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17242. } else {
  17243. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.second_operand, exp_el_expr_el_2, function_obj);
  17244. }
  17245. renderArithmeticOperator(command, all_expression, expression_arithmetic, expression_arithmetic.operator, function_obj, exp_el_expr_operand);
  17246. element_to_append.append(exp_el_par_1);
  17247. element_to_append.append(exp_el_expr_el_1);
  17248. element_to_append.append(exp_el_expr_operand);
  17249. element_to_append.append(exp_el_expr_el_2);
  17250. element_to_append.append(exp_el_par_2);
  17251. }
  17252. function renderStartMenu(command, expression, function_obj, initial_el_to_render) {
  17253. var start_menu = '';
  17254. start_menu += '<div class="ui dropdown menu_start_rendered"><div class="text"><i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('expression_menu_select') + '</i></div><i class="dropdown icon"></i><div class="menu">';
  17255. start_menu += '<div class="item" data-exp="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_logic_expression') + ' (EL == EL and EL)</div>';
  17256. start_menu += '<div class="item" data-exp="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_arithmetic_expression') + ' (EA < EA)</div>';
  17257. start_menu += '</div></div>';
  17258. start_menu = $(start_menu);
  17259. start_menu.dropdown({
  17260. onChange: function onChange(value, text, $selectedItem) {
  17261. switch ($selectedItem.data('exp')) {
  17262. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17263. expression.expression = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LogicExpression"](false, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  17264. break;
  17265. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17266. expression.expression = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ArithmeticExpression"](new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than);
  17267. break;
  17268. }
  17269. initial_el_to_render.html('');
  17270. renderExpression(command, expression, function_obj, initial_el_to_render);
  17271. },
  17272. selectOnKeydown: false
  17273. });
  17274. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17275. initial_el_to_render.append(start_menu);
  17276. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17277. }
  17278. /***/ }),
  17279. /***/ "./js/visualUI/commands/contextualized_menu.js":
  17280. /*!*****************************************************!*\
  17281. !*** ./js/visualUI/commands/contextualized_menu.js ***!
  17282. \*****************************************************/
  17283. /*! exports provided: renderMenu */
  17284. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17285. "use strict";
  17286. __webpack_require__.r(__webpack_exports__);
  17287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  17288. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17289. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17290. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17291. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17292. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./switch */ "./js/visualUI/commands/switch.js");
  17293. function renderMenu(command, dom_where_render, function_obj, dom_command) {
  17294. var menu_div = '<div class="ui dropdown menu_commands pause" ><button><i class="icon code"></i></button> <div class="menu"> ';
  17295. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes || command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue || command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue) {
  17296. menu_div += '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"] + '"><i class="pause icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_break') + ' </a>';
  17297. } else {
  17298. menu_div += '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"] + '"><i class="pause icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_break') + ' </a>';
  17299. menu_div += '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase + '"><i class="plus icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_case') + ' </a>';
  17300. }
  17301. menu_div += '</div></div>';
  17302. menu_div = $(menu_div);
  17303. dom_where_render.append(menu_div);
  17304. addHandlers(command, dom_where_render, function_obj, dom_command);
  17305. if (command.collapsed) {
  17306. dom_command.children('.ui.block_commands').toggle();
  17307. }
  17308. }
  17309. function addHandlers(command, dom_where_render, function_obj, dom_command) {
  17310. dom_where_render.find('.menu_commands').dropdown({
  17311. on: 'hover'
  17312. });
  17313. dom_where_render.find('.menu_commands a').on('click', function (evt) {
  17314. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes || command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue || command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue) {
  17315. if (command.commands_block == null || command.commands_block.length == 0) {
  17316. command.commands_block = [];
  17317. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_2__["genericCreateCommand"]($(this).data('command'));
  17318. command.commands_block.push(new_cmd);
  17319. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](new_cmd, dom_command.find('.block_commands'), 3, function_obj);
  17320. } else {
  17321. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  17322. }
  17323. } else {
  17324. switch ($(this).data('command')) {
  17325. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  17326. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  17327. break;
  17328. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase:
  17329. addCaseToSwitch(command, dom_where_render, function_obj, dom_command);
  17330. break;
  17331. }
  17332. }
  17333. });
  17334. }
  17335. function addCaseToSwitch(command, dom_where_render, function_obj, dom_command) {
  17336. if (command.cases == null) {
  17337. command.cases = [];
  17338. }
  17339. var sc = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SwitchCase"](new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  17340. command.cases.push(sc);
  17341. _switch__WEBPACK_IMPORTED_MODULE_4__["renderCase"](sc, command, function_obj, dom_command.find('.all_cases_div'));
  17342. }
  17343. /***/ }),
  17344. /***/ "./js/visualUI/commands/dowhiletrue.js":
  17345. /*!*********************************************!*\
  17346. !*** ./js/visualUI/commands/dowhiletrue.js ***!
  17347. \*********************************************/
  17348. /*! exports provided: createFloatingCommand, renderCommand */
  17349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17350. "use strict";
  17351. __webpack_require__.r(__webpack_exports__);
  17352. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17353. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17354. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17355. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17356. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  17357. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  17358. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  17359. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  17360. function createFloatingCommand() {
  17361. return $('<div class="ui dowhiletrue created_element"> <i class="ui icon small sync"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_do') + ' <br> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_do_until') + '(x < 10) </span></div>');
  17362. }
  17363. function renderCommand(command, function_obj) {
  17364. var ret = '';
  17365. ret += '<div class="ui dowhiletrue command_container"> <i class="ui icon small sync command_drag"></i> <i class="ui icon times red button_remove_command"></i> <button class="ui icon button minimize_block_button tiny"><i class="icon window minimize"></i></button> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_do') + ' </span>';
  17366. ret += '<div class="ui block_commands" data-subblock="" data-idcommand="">';
  17367. ret += '</div>';
  17368. ret += ' <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_do_until') + ' </span> <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="textual_expression"></span> <span class="span_command_spec"> ) </span>';
  17369. ret += ' <i class="ui icon unlock button_alternate_expression"></i> <div class="ui context_menu"></div> ';
  17370. ret += '</div>';
  17371. var el = $(ret);
  17372. el.data('command', command);
  17373. el.find('.block_commands').data('command', command);
  17374. addHandlers(command, function_obj, el);
  17375. _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
  17376. if (command.expression) {
  17377. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  17378. }
  17379. if (command.commands_block) {
  17380. for (var j = 0; j < command.commands_block.length; j++) {
  17381. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  17382. }
  17383. }
  17384. if (command.lockexpression) {
  17385. if (command.expression) {
  17386. try {
  17387. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  17388. if (text) {
  17389. $(el.find('.conditional_expression')[el.find('.conditional_expression').length - 1]).toggle();
  17390. $(el.find('.textual_expression')[el.find('.textual_expression').length - 1]).text(text);
  17391. $(el.find('.textual_expression')[el.find('.textual_expression').length - 1]).toggle();
  17392. $(el.find('.button_alternate_expression')[el.find('.button_alternate_expression').length - 1]).toggleClass('unlock').toggleClass('lock');
  17393. }
  17394. } catch (e) {
  17395. command.lockexpression = false;
  17396. }
  17397. }
  17398. }
  17399. return el;
  17400. }
  17401. function addHandlers(command, function_obj, dowhiletrue_dom) {
  17402. dowhiletrue_dom.find('.minimize_block_button').on('click', function (evt) {
  17403. dowhiletrue_dom.children('.ui.block_commands').toggle();
  17404. command.collapsed = !command.collapsed;
  17405. });
  17406. $(dowhiletrue_dom.find('.textual_expression')[0]).toggle();
  17407. dowhiletrue_dom.find('.button_alternate_expression').on('click', function () {
  17408. if (command.expression) {
  17409. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  17410. if (text) {
  17411. $(dowhiletrue_dom.find('.conditional_expression')[dowhiletrue_dom.find('.conditional_expression').length - 1]).toggle();
  17412. $(dowhiletrue_dom.find('.textual_expression')[dowhiletrue_dom.find('.textual_expression').length - 1]).text(text);
  17413. $(dowhiletrue_dom.find('.textual_expression')[dowhiletrue_dom.find('.textual_expression').length - 1]).toggle();
  17414. $(this).toggleClass('unlock').toggleClass('lock');
  17415. command.lockexpression = !command.lockexpression;
  17416. }
  17417. }
  17418. });
  17419. dowhiletrue_dom.find('.button_remove_command').on('click', function () {
  17420. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, dowhiletrue_dom)) {
  17421. dowhiletrue_dom.fadeOut(400, function () {
  17422. dowhiletrue_dom.remove();
  17423. });
  17424. }
  17425. });
  17426. }
  17427. /***/ }),
  17428. /***/ "./js/visualUI/commands/functioncall.js":
  17429. /*!**********************************************!*\
  17430. !*** ./js/visualUI/commands/functioncall.js ***!
  17431. \**********************************************/
  17432. /*! exports provided: createFloatingCommand, renderCommand */
  17433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17434. "use strict";
  17435. __webpack_require__.r(__webpack_exports__);
  17436. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17437. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17438. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17439. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17440. function createFloatingCommand() {
  17441. return $('<div class="ui functioncall created_element"> <i class="hand point right icon"></i> <span> funcao() </span></div>');
  17442. }
  17443. function renderCommand(command, function_obj) {
  17444. var el = $('<div class="ui functioncall command_container"> <i class="hand point right icon command_drag"></i> <i class="ui icon times red button_remove_command"></i> <div class="var_value_menu_div"></div> </div>');
  17445. el.data('command', command);
  17446. _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__["renderMenu"](command, command.function_called, el.find('.var_value_menu_div'), function_obj);
  17447. addHandlers(command, function_obj, el);
  17448. return el;
  17449. }
  17450. function addHandlers(command, function_obj, functioncall_dom) {
  17451. functioncall_dom.find('.button_remove_command').on('click', function () {
  17452. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, functioncall_dom)) {
  17453. functioncall_dom.fadeOut(400, function () {
  17454. functioncall_dom.remove();
  17455. });
  17456. }
  17457. });
  17458. }
  17459. /***/ }),
  17460. /***/ "./js/visualUI/commands/generic_expression.js":
  17461. /*!****************************************************!*\
  17462. !*** ./js/visualUI/commands/generic_expression.js ***!
  17463. \****************************************************/
  17464. /*! exports provided: renderExpression */
  17465. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17466. "use strict";
  17467. __webpack_require__.r(__webpack_exports__);
  17468. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17469. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  17470. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17471. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17472. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17473. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../services/userLog */ "./js/services/userLog.js");
  17474. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  17475. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__);
  17476. window.timer = false;
  17477. function renderExpression(command, function_obj, div_to_render, expression_array) {
  17478. div_to_render.empty();
  17479. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command, "expression");
  17480. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command, "expression", function () {
  17481. if (window.timer) return;
  17482. var m = div_to_render.find(".single_element_expression").not(".mouse_distance").not(".add_parentheses");
  17483. var s = "";
  17484. m.each(function (e) {
  17485. if ($(this).hasClass("parentheses_in_expression")) {
  17486. s += $(this).text() + " ";
  17487. } else {
  17488. s += $(this).find(".text").text();
  17489. s += $(this).find(".var_name").text();
  17490. s += $(this).find(".parameters_function_called").text();
  17491. s += $(this).find(".value_rendered").text();
  17492. s += " ";
  17493. }
  17494. });
  17495. if (s) {
  17496. window.timer = true;
  17497. } else {
  17498. return;
  17499. }
  17500. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_COMMAND_EXP, command.type, "/", s);
  17501. setTimeout(function () {
  17502. window.timer = false;
  17503. }, 200);
  17504. }, 20, true);
  17505. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution) {
  17506. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command.variable);
  17507. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command.variable, function () {
  17508. renderExpression(command, function_obj, div_to_render, expression_array);
  17509. }, 0);
  17510. if (command.variable.content) {
  17511. var types_included = [];
  17512. if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER || command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  17513. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17514. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  17515. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  17516. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  17517. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17518. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  17519. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  17520. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  17521. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17522. } else {//console.log("NÃO RECONHECI! VEJA: ", command.variable.content.type);
  17523. }
  17524. renderElements(command, function_obj, div_to_render, expression_array, types_included);
  17525. } else {
  17526. div_to_render.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("var_menu_select_var").toLowerCase());
  17527. }
  17528. } else {
  17529. var _types_included = [];
  17530. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  17531. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  17532. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer) _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep);
  17533. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17534. renderElements(command, function_obj, div_to_render, expression_array, _types_included);
  17535. }
  17536. div_to_render.children(".mouse_distance").addClass("mouse_distance_hidden");
  17537. div_to_render.children(".higher_element").on("mousemove", function (evt) {
  17538. if (!window.open_or_close) {
  17539. $(this).css("position", "relative", "!important");
  17540. $(this).children(".mouse_distance").css("opacity", "1");
  17541. }
  17542. });
  17543. div_to_render.children(".higher_element").on("mouseout", function (evt) {
  17544. if (!window.open_or_close) {
  17545. $(this).css("position", "absolute", "!important");
  17546. $(this).children(".mouse_distance").css("opacity", "0");
  17547. }
  17548. });
  17549. var lixeira = $('<div class="lixeira" draggable="true"></div>');
  17550. div_to_render.find(".single_element_expression").on("mousedown", function (evt) {
  17551. window.posX = evt.clientX;
  17552. window.posY = evt.clientY;
  17553. });
  17554. Sortable.create(div_to_render[0], {
  17555. animation: 100,
  17556. ghostClass: "ghost",
  17557. group: {
  17558. name: "shared",
  17559. put: false // Do not allow items to be put into this list
  17560. },
  17561. draggable: ".single_element_expression",
  17562. sort: false,
  17563. filter: ".not_allowed",
  17564. onStart: function onStart() {
  17565. $("body").append(lixeira);
  17566. lixeira.css("display", "block");
  17567. lixeira.css("top", window.posY + 70, "!important");
  17568. lixeira.css("left", window.posX - 20, "!important");
  17569. },
  17570. onMove: function onMove() {
  17571. lixeira.addClass("color_test");
  17572. },
  17573. onEnd: function onEnd() {
  17574. lixeira.remove();
  17575. div_to_render.find(".ghost").removeClass("ghost");
  17576. }
  17577. });
  17578. new Sortable(lixeira[0], {
  17579. group: "shared",
  17580. animation: 150,
  17581. onAdd: function onAdd(evt) {
  17582. lixeira.css("display", "none");
  17583. lixeira.find(".single_element_expression").remove();
  17584. lixeira.css("background-color", "");
  17585. lixeira.remove();
  17586. removeElement(evt, expression_array);
  17587. renderExpression(command, function_obj, div_to_render, expression_array);
  17588. }
  17589. });
  17590. }
  17591. function removeElement(event, expression_array) {
  17592. var indice = $(event.item).data("index");
  17593. var first = expression_array[0];
  17594. if (expression_array[indice].type) {
  17595. // if is alone in expression:
  17596. if (expression_array.length == 1) {
  17597. //function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  17598. expression_array.splice(0, 1);
  17599. } else if (expression_array.length > 1) {
  17600. if (indice > 0 && expression_array[indice - 1].type_op) {
  17601. if (indice < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice + 1].type_op) {
  17602. expression_array.splice(indice + 1, 1);
  17603. }
  17604. expression_array.splice(indice, 1);
  17605. expression_array.splice(indice - 1, 1);
  17606. if (indice - 2 < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice - 1] == ")") {
  17607. expression_array.splice(indice - 1, 1);
  17608. expression_array.splice(indice - 2, 1);
  17609. if (indice - 3 >= 0 && indice - 3 < expression_array.length && expression_array[indice - 3].type_op) {
  17610. expression_array.splice(indice - 3, 1);
  17611. }
  17612. }
  17613. } else if (indice < expression_array.length - 1 && expression_array[indice + 1].type_op) {
  17614. expression_array.splice(indice + 1, 1);
  17615. expression_array.splice(indice, 1);
  17616. } else if (indice < expression_array.length - 1 && indice > 0 && expression_array[indice - 1] == "(" && expression_array[indice + 1] == ")") {
  17617. if (indice > 1 && expression_array[indice - 2].type_op) {
  17618. expression_array.splice(indice + 1, 1);
  17619. expression_array.splice(indice, 1);
  17620. expression_array.splice(indice - 1, 1);
  17621. expression_array.splice(indice - 2, 1);
  17622. } else if (indice < expression_array.length - 2 && expression_array[indice + 2].type_op) {
  17623. expression_array.splice(indice + 1, 1);
  17624. expression_array.splice(indice, 1);
  17625. expression_array.splice(indice - 1, 1);
  17626. } else {
  17627. expression_array.splice(indice + 1, 1);
  17628. expression_array.splice(indice, 1);
  17629. expression_array.splice(indice - 1, 1);
  17630. }
  17631. }
  17632. }
  17633. } else if (expression_array[indice].type_op) {// iVProg doesn't support operator remove
  17634. } else {
  17635. var opening = -1;
  17636. var closing = -1;
  17637. if (expression_array[indice] == "(") {
  17638. opening = indice;
  17639. for (var i = indice + 1; i < expression_array.length; i++) {
  17640. if (expression_array[i] == ")") {
  17641. closing = i;
  17642. break;
  17643. }
  17644. }
  17645. } else {
  17646. closing = indice;
  17647. for (var i = indice - 1; i >= 0; i--) {
  17648. if (expression_array[i] == "(") {
  17649. opening = i;
  17650. break;
  17651. }
  17652. }
  17653. }
  17654. if (expression_array[opening + 1].type_op) {
  17655. expression_array.splice(closing, 1);
  17656. expression_array.splice(opening + 1, 1);
  17657. expression_array.splice(opening, 1);
  17658. } else {
  17659. expression_array.splice(closing, 1);
  17660. expression_array.splice(opening, 1);
  17661. }
  17662. } // if expression is empty, add a new var value:
  17663. if (expression_array.length == 0) {
  17664. expression_array.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  17665. }
  17666. if (first != expression_array[0] && expression_array[0].type_op) {
  17667. expression_array.splice(0, 1);
  17668. }
  17669. }
  17670. function renderElements(command, function_obj, div_to_render, expression_array, types_included) {
  17671. /*if (expression_array.length > 0) {
  17672. if (!expression_array[0].type_op) {
  17673. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  17674. }
  17675. }*/
  17676. var i = 0;
  17677. for (i = 0; i < expression_array.length; i++) {
  17678. if (expression_array[i].type == "var_value") {
  17679. var div_temp = $('<div class="single_element_expression" data-index="' + i + '"></div>');
  17680. if (i == 0) {
  17681. if (expression_array.length > 0 && !expression_array[0].type_op) {//renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  17682. }
  17683. }
  17684. _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, expression_array[i], div_temp, function_obj);
  17685. div_to_render.append(div_temp);
  17686. } else if (expression_array[i] == "(" || expression_array[i] == ")") {
  17687. if (expression_array[i] == ")") {
  17688. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i);
  17689. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  17690. } else if (expression_array[i] == "(" && !expression_array[i + 1].type_op) {
  17691. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  17692. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, i + 1);
  17693. } else {
  17694. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  17695. }
  17696. } else {
  17697. if (i == 0) {} else if (expression_array[i - 1] == "(") {}
  17698. renderOperatorMenu(command, function_obj, div_to_render, expression_array[i], types_included, i, expression_array);
  17699. }
  17700. }
  17701. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i, true);
  17702. renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included);
  17703. }
  17704. window.parentheses_activate = false;
  17705. window.open_or_close = null;
  17706. function renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included) {
  17707. var addParentheses = $('<div class="single_element_expression add_parentheses not_allowed"><img style="width: 15px; position: relative; top: 3px; left: 1px; height: 15px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOgAAAEjCAYAAAA48U27AAAasXpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZtZkhw5km3/sYpeAkYFsByMIm8Hvfw+Fx4kg6zM7HolHaykOz3MzWA63EFh5c5//7/r/osfK8m7XGqzbub5yT33OHjT/Ofn8xp8fn+/n/Pjd+H3z11MX28jr4nX9PmFna/jB5+XX1+o+evz+fvnrq7Pm9i+TvT1C078fpKurPf7a5FfJ0rx83n4+rfrX18Y9u12vv6L6+u0Xyf/89+5EoxdOF+KLp4Ukv/8/blSYhWpp8Grvb9L1CeJ9+n9HVL71/g5/Wutvw7gz3d/xM//WFn6FQ73iezXAfZHnL4+D+WPz9PPy8TfVhTizyvH7yuyEZr//vMtfvfudu/53N3I5giXfd3Uj1t57zhwEs70vmb8qfxXeF/fn86f5odfZG1zq9P5yT96iMT6hhx2GOGG815XWCwxxxMrrzGumN5nLdXY43pJyfoTbqyO/OzUyNUic4mP48+1hHfdrutxscaVd+DIGDhZ4Bu//XF/fvCf/vntRPeqDkLw7RMnyoJ1RZUsy1Dm9DdHkZBwv2JaXnyD+7z4P3+U2EQGywtz4waHn59TzBJ+1VZ6eU6+OA7N/tMvoe6vExAirl1YTEhkwFtIJVjwNcYaAnFs5Gew8phynGQgFFfiZpUxp2Qkp0Vdm+/U8I6NJX4+Bl5IRKFpKqmhgUhWziUb/dYooeFKKrmUYqWWVnoZlixbMbNqwqlRU821VKu1ttrraKnlVpq12lrrbfTYEzBWXLdee+u9j8FFRx6ca3D84IMZZ5p5lmmzzjb7HIvyWXmVZauutvoaO+60gQC3bdfddt/jhEMpnXzKsVNPO/2MS63ddPMt12697fY7fmYtfLXtb1n7M3P/nLXwlbX4EqXj6q+s8XGtP04RBCdFOSNjMQcyXpUBCjoqZ76FnKMyp5z5HpNL4BarLErODsoYGcwnxHLDz9z9ytzf5s0R3f/fvMW/ypxT6v4vMueUum+Z+9e8/UXW9nhw+yEydSExBSET7cdBIzZWA1MBNoQnLSu+tlhBoVpHT7kH8KX0vLhLP2s0Cvr61M7xdR+XzqKg2rht2eGnzjt3PzeectfiZhrRJnRXnGmWeqz68rC5/T0gBidKNzRX2/BllkZgbl473ZpL6H53fTndlNpSUy6gjTscu/ZZRIuF/4kWdqrNzwUe8WbPRcAnd0Zci59mmYWUGnqD71jvukQszVvWSW2wsHnGui3M47tdv2/LrtmYZJHc+11KZmGA6lo11DQF87OtRAI5AyyQsg+ndwqje2qFFShDy2bYbrIc3uTc5g6cydRG2UfST/SlCf769RKsk5AyKRLyeR3XynM3i34OI4aUUAPiCSjHkS3uzOi0um+t5cx2k41LYR2+3/JWco8fc7sNxrU74febzi6QnmpkDH/SDGeullbNkaBE1kA8aYA21BidFqMdLLQ4qHyHpLCknvaLAp35hnWhTjhuQ3W1ndx2o75ZYxcAL0D0VhZFpIPdRp4PQHydNyK289mdAjI6f8509wEH6nqkQnXNFjbNfcOk5SYRqcsqSydFRGar+roLvebNre/FvQbUUgynkdmdRz91IGEW/7DmqVxascOXJGVpbay8iXFjbDW7HsSeE2x5K9/8R92RlUjR3jRi3aOudK2ONSj3swEYosIdLTXhruH2XZe7FViZCeAIjbR0An6BmMZHrexKzZK601F80eqsZLAfiqqXdMlt4H43qyjm4ljQkz9U2x7cAPdTYjulNJTDEZjdQyufDVI2muX4u200NfdWhsvhNbTrwJV9uBsfy2rT1Nwcdo/tsTdg5QtkTlNIMMbwwDEszkY15UCr62SURqUgF6GnrnoK0+omImDfAcWo0RYhi3qAjYys9CtXQkyt3NAJ4/le7u69OZuiKNw0nQjs2bZpO64qONwNKOFNo4CR6wOMArG5y2sLPOxUSCmSfgjL5QFC8I8bDqVPMuJtAbMsDxS/xWqIi0YiTlRBjpSpn5DLLUgv1n4AJ2eUiB9vjf/wenum9TprPoTzgjzlltxQcUb7D+rEFc8r51+DNs1n3mxAz7nw4t5UM/hSIxAY70J3UBZzcaJN8CO33EgOt3g2WVNhEgAliw6Fx1YQ7NxQAUGKEKKgFiA+r5DTop6SVPIzzRLBoOvPnMcFOsSPA/NXoYM4hSWSypoA896oaE5Ookal4WKcVBGZOYTxtk6XAcEnjunoo7FXSnTgZSkZDj5GT4IX1G5l5RmWf/W+VVo5URhg+i4TOEZO0Vkdq+RCW0N9RsyjJd1HXT2Jj3KjndQCZ3RbIv65BrmBN9ZeKkQOV+TOpDoREVTnHplqKUlgwc/y/SRrZd3RyyFfTd2/LJZGFSAkAIgMpKVBMqOWGZYrFa1BpsYCZDuVh/Hw7dR0pkJOyy2jktPqh45q9O2MhaXFNNecWleGy1p3yWYEmULvFFb2hOSACiDYqqxmTGxAXcUSyyN8m+uPGgUqRcVFNYeZSc1x75xJfEUfdwl+qnx8p41ZLxFiPf0SshMn58NkrPYoFAZNyIbgAH5KiMuS3AaoDvVLPRfonSuNAaoY5QiCj77boq8NWAYb+fpGLKsGPX2PFzlHodwXT9XV8KkZZIiJaWpGhFq+/0xx79V95zxWB6FepYuTnQgg+IaGI98mVKWNGyAWIRBQ/f2p1GAAbqejbSCJQaI5ydFJbCaamxI/kSDXgqTrFWJIaDE8+qqUB3Cy6aVLUR60U1zbSVHcgkJZH6xDHE4o1IygnGieqyEGxfMIAXofYTSVWgJR0QHrKnuVFpGqsM1XOjhPHaJs4t0xS2bEPCZCrbDk6PFziDQAAjTiJBPseLJMkAowO6rjwiJoLrhwokWopzCRqVOEg0AMWulGD6sbNnGDvWjElxb+4s6oN4IN9yNGYN9dUoZao52IVsEpdUnoSx0+UEGr4IFDiQ9KEpjWgbwUVM2DWnaT2tf7ghLGvD6dZ2qZQ73GjPjsCen00WdfOg1B1vaxXigRGp5ujMEVaSJ14ubALTifcDeozb03lhhoQfTtjM+hUZGZRpxUN5naxBuZFERs7kwxMNp1b+QSij9cgGDkPShn6AcctIY1N/nrCn48FUemrX7XktmV3xb9d6+lgKz5zgqe5TX7Tuds2mHuBXkFVLHLT/cYSlN1DEgFhY7b2PuePqNyNhbqv3cWPSkcIL5kBC+iZkPt3M9d9brtDQGnfugbpgF8NqkFPUs7nwGW7BBNjN6hZmeRHiWun5ViGKCANhe3xiXR9DT6TiAbbY4+seUl3jqdxCIQ0hJy5BI9SEWNg4yDWJEdHg6AH+lD1zduLpvYX30Fvx1ACQz1ZbCyFJK4AO0NDmhcBSVD2XvQJ+Nu7KyKjGp38jp3Js4Txiy4AKXroEzAZd9B9+03YF2feDlrUu0wAxAFw1C3aJiL7k3XjYK34LR030sRGfq8BrX1TNAGDE83gQkRjlwxIk9NoM21N5VxLram4WnpKVYJo4A8c2GvEDKN66EqUL/5iO4q5D1REbNFMARu8wAEMS2h4Cmg+eH+F+D7q9cp4jOFGpdEG+AkS3T8ljYDHfpKE74lZ7fbvhHhfQ0XA8dt4XiRWLqAFFYEDPKFm8Vn3I6ptImq5UqAVqWPqSgaclICpsY+YX/JGizHSmUQJXRKtEejInIMKuIwnxxw2UB10m1Lzd2JoqOCj5BOINdlFNKgvS1KQBx5golqCLiL8WYJCWknKHU9ofBx6bPyrV5BNeS3EVO6QMNO1OAAGPB7NALsG9TUNdP/Xg4H6OZ7SDc3aClYF26EX3elFeGxOXPdAYPMxaljEn6VW3w6TRI3MlLnxsL+aO0DjHDd7xBlUnAjoRe6BsWQHt5z424QUiwAQXxuTsATMLsWNp8eXdkqsibNOWBk1bpmBnQ/eiJLL2B1YCZNGmD8jcsqBfnVNOhdwEP4Xhb/QR1dAWeuA6Mx8CtSvTseFzWpQCpezB3VjP5ba2AhUOg0OVDEr7LEFcte2xBeJV7hdfdj42uoNvRcrA5bYF4ThrpkwjyKrc/9aBNBjTajfnBs+JuqlMQgbZgk+9AhaL6K/SUp3XFtg9H5oICbVN6VR+r3iax2SW3r6PUMyhS6irsos3JC0jo0uQaZ8LAXWUNdKJeA6sIe1osSg64w/gcUOm1zGPp410syLwIBy08mep6qWs350EzgkxPuAsTwsCEbB9jExWkTLCDV0KlrAxMewZSj1V18FaX0TLQBTJqswIBu8KUCrABy9CuW6+UGFoWf6TcPX65UATPEJhFGBeADKLMCPVXlhUwgaHCQBwleqaAG9WnYA5thjMbAxCCoeTuxr8imVbDdROMKSGY99WnV9AMO3R+4+O++hotSIO1BUpgK7m5kgZOdjJPs+oyF3MoLVoVuItRWj/QG2l+OeEcKCmOIQJmiN0RSWShmNyGdWelM4CV1MReqFLU/T/3AYU4Z80vwK0Att2AjLsgWH09MdsaCHA1ZHir1hUduHCafuTUTglsznzQh1JYVyfT11D7NQmfTr01CGy6k+jFw40Et4nGBDsApGh9pSIYzgvkjsUADEBp4p5hOupTAFHtFgKUuurqhyrhJrOilJLqpThRCzS7/o+i7XzQWuVSm4N6qISOKrj/ZJzV3BSH7rw95Bzgd8Uu+YEK2LEMd8C8JuOiFCBDaGxYA1F6vE6TsJaOsChYrHYl+V9HcOg3yRNoCraJqWxKR8DJWjYaa3mqEEqwZFIG/IeUBz5o0BcBAgEndIVSQeOA1/EoB34thle6+05f8bm0k0+4dXvT8A+S5v/kFxQg8HY2TML9UJOqCrqv8G55tpF/sERqW8UJVO7rZyForA2KBpS5E+voZOnmvyEkkL+KbuuOMWN2F2R3aaaEINjoVbM2cwf3TKaj4InhG1wB3pukv+m+gp1gv8nAi6yB3j7X2DurCN2+0GiWrzYutkR6RsohtwOmxeIqMwt7gx4Emn2dpMsQaLnPX7xD3xzG/jsCU1DfToCpQFxRJ1pyWk9z8/PvvJeF+1kSQ+GHh6D3YICMrwSTxe4HsybMGCp+03a6BWwb58msimPwkZ4BfKobJPbSRlZ63rNkyCej+kOxtRqBYuqEAIRrM8doCobQJUjaueaozze8bDhGBh3a2z3wv/6/zm99fU3N2icLVjK8MNc9uH1uFNMXukAUU0esuJeRq0i4s8KaJEzc+F3yxd6+APxhCilGWqgSv7yylXadDZ/MGLzPWoXZgA3JjlN/LHMSpXT1x6sAdoTm5abwnuMiH5FIDAPj9kBCocbYWuhmSDmYoaFFKH3wlM3AgRcp/lNl2dNKNGgUHAlg6Kq1P9M8KhgpOxKtYhdQX+F27DEOnN8/GTinxoLZuNQbS/yhuaHhB+YFrmg6N10MBGT2GXz1gKxOBSSwii+CGrG9GbmgcfDCn9Ti0yf7CEaItwQ9MCpw0HLnG92RUKe7ONy8qDq2IR2U1CbmNekgRSPLDUb6ULNqEEpC5fQpIN9CxaBzk8cEywTJjtACGpeVaHmjieEc6I9LBjRjhWUgwIeTQ2UvQ+f69UeCPEnoV9KY1vxXR35YQOP8iyx38axkN97dl9FVEXPlTRnOPlOkJhE0nmKhzdBY2TGYUtHCJHPKDj0M8fYQskN6wmCdA36FzXiShRtbopdEiJK6x2o17robiKJLEcXGihGUAOzVXJa6I9xPj0IRuQMoUw7h1DjQwiJD2wS1RpT6HxsWRYBhW6dLtClDRMqCpWsJMdFu4DWyLYT3BNoq0JYAs6Bt0NdJqoakIkLgam9nRh3cSoxG1rYefQaWnFoOSizL7rA2ttmCtiaaaODPgJInOub/tz/qQxR0FyeLykwDfFcBXVo/y2OHP3oRJSFlkV28tI2vK21hR/yAW+z4Ukju6G/N0EgDFgiVde/8gX1AFUAnxaHwgn0ZIkCAZKYu81WfYDozPbubQz+CBVNT6q0kEIkriflm3TvOg51OmqAyrDxBqwIWVJy/HsZw3NATZUf50AapGaj0N7U1QZU2XxglrwwckME1w0L3cnLR5WHn1SYYcbgHlQ7dJHVMLHPrwAOFZuEiUvjKkEQ6Ptt0iU1LGa6WQsF5wx0ENFBQbN00P4xLEjJqtIUGyjN7ZT2qRvvN2iAztQQKWkAczqd+1dwhiXxrynKLfX7WHTW4ev0MpwK8aH9MYFA7X1RswEry1OV/8UWxBGWEJVDYuBXhMHmm3tOHBl6emC0IklPUo+p/SvJ/13FMbbTQm5YYNWJ1DqC5MDURHdyQac2qzcVDfJFlb4fQVcaoEAEnWg6qISkCVVhnV/kKEAXlEMI+kHzj4AVy8VnsBxHYQAgs69Eq7eZqWGy6ajKrYABtbbxca+UnTWHbAsaZejbp7BJzgp68zfzsv3abNfQoeXaaReFxcJ1b+gPXt5OWK9kQR1MRA2w77hdq/LO43qtd20Rk4b67EjWCUh/yhjBJ6ARD3EkrEiCRj9NGgx3S7tFysYXbNmVEOmFRgRGwXtUMWRQgkaeCQITpIa9aI5wbYoBZ8eH17mVgOlnUDqjS2H7J5brwWVh9dALYl6HMQZkMFZnqLxuGyAIrbaBRoUU5KKLaRHVvcaDmnjkqBPw7ldbCu2BQMHIHT80IqGmAf0J00DVkj1Je+SChcjfaoAyEuyiiAa/IsELR88e/TRKMckQFoSxRoEbZryJK1PZomaB/gWPRkS/F8ZEKbH6Gnjdoq2iC/l+4HE8C5qZ3DLwRzc2vi9m8PEbrH0MruYRJGJR0rFQnX6rRZSV1tPFkhchEopaj0MEb3b/MEyAO9LkRAb3VkWwfHQAPcK/kHPvGEaB2n/eS0C5JPfbY8AKmNN4VuD/wz1W0ekU0/kY1M5vrcECGttjpeXQ80YDqj85am8p/0jAFOsra+fxgoDQO4NERG62ryQehy1lMJVhrLYeUwJIhneBHkTAFIyBTthPTe2jKjCMGQQXFDlW8zaHSLINIx6uI9TdQXzhNZQuFDPumi/KU+lqGEirRF1b4qZ7EKKY5MMUzN91G0qOak7WV+UymgUva3LAy3/ynhHXm4/TvE+6+DPof8OIClz9gpKwdGXw05NdKJ4BHFqT0TDf5or904WJt/+kI65+dvPp/7r09x4q7ngfiI6LmSbK+KCodcJ8psk2X6m/oWiGVMTh+w+YxohTww5KAemENzPgvRtR0tERNTxrYaZhxMTmm8rVCRr/pqa+wBYj/fFCRuYLm6S8IeWSo4IccxQawHa+VOy+O3PKuRupYsAX9FhcPC1qMgOQJ34AxkPzWpJ2FBOnctd1BfWiIa6dhZKNV9tUMGqGf+WWA503BeZEAlIqUpNcyRtr2bxZ5oG8NKucQxY68dEWLaziPSFE7A5KCw6BYkFWhETdaA6eVe1zoUIi4SFirAXkEf7DEc0pSqxczst58X0pSPr8gbTeFw1Z7O7Nr7L2VS5Agv3zU7qW/ChaLpevJhOCRcxGLrwZyFe00ShQVRpx2eBt7OTxcCe8j5RF60LxxvowGgfCJveqDlwv23PX0b9UARgLT1tAgcCKg16gI38X2+ALmTGQ3wkMGsAAjxEg/LQ0dyC3r2JLSOTjTRek3vISJ6j0rQzJ73NLUkA1gCXyHaKXoLYy0PCwM7GtVHYk+7EQuPjqWX2oFTkfv0x4RgatdDn6gVVCkNEVfnHWC6Zpga0xdFEi9y3vZz/ZJ8iBh6sO+EpffwWRA2f7XVSK35BYA1hHHSzFmPoPQKdk+XA3456ymzSbQXugnz1SX4OU5pyVvPniXkPSe0maFJvaJ5P4O68sThr2Fdex0XgaWMncF2Uwmosvh5aCf+7KlvLYUWKJ2be5NIx82QUaoxDO0RkwPq7QAcS9NwHOI+7ykvDErUeKwTKu0Doq2ORsifp0eWwSJyV7r0yPGg6jLCdyQ/qwYVNwKkXc81QMOz8l1Sqi1UeGLO52O0HYDWckhmwPNj9Qxpif+RPChqtXYjHlFj04wFAnXoNYInB/BAEIskOuV/qTs9OpOQGHpgpGhGCWUQk6anGOhubaNMkO3u5wSq8peCBNLYZcbNbQMaOCgE+yC4h6JLBxWqJ/7IsLY/3+Zpk22kX99DR7jaZ7x46SklPZgEtOBOiIvm2RVLaXHODAClqefrNNMB46ES9Dz9PULAH2x7vaiBZTVt+Ohxifd0D+Xl9PTV1OM6zQZuBKaNEiUggl8IkojUxq3Xq+0GAcDQbJ41ovaQoVyWTAEL3rXaVHwoGzB7In8KgkgO/YAAoyCCaFTUrlp2JY3r9QAf8SLo5waiSIVg6/XoOWUfPEUx3wb3rYXuBsWSniKBFge64SIqIeaQgacWjyeFsVmmqrP+yU26o82/g0nA7X/4OaHntH9KgGESIAkX2KwPzYFWgFq0CXA02NHRGhrLTTnVf8/aD3r+Od5nG5bo8GrOtjVvhjGADWEPmpFzTk35fdMOUtGeIqgN9yuWjZsDish2EA29saMMYtOuA0aNUPB69CzLMT3rA5nLo4ZGxhb2OLugh4T1QBHZEoBEgTrr5x/FtBGBm4JWpRvxECjNQ1/DLW1YBwq49I42REeEVs/cNNHLVEpK0VYfSB370wEUtNT/fTtxehAOXrE5MMOo+gHVXxZ5XYUEWOmTCRKu+DdZKtT6J2pH+u7zMGj+2K6/PrHTmZFCoNs7sWbAxdrXoAM/FDX61R4XzFHPBmejdHxRE0MfiL+lmcBwkK/cPNUtoXWh01W69mKgPm0vPXuHPBsbINva9FR5kHoZbc3mDvDa9EAcYH9Mj1NphF/04EddtDlYCXN3aATYwe8iDjwcpL2BqF6cVqGENMbGfpUNi+hhJD15kXpASmqIFkIpA0+WsVqdLszEXNH7PNuTiB/Vg/Oqg/vS4ASl+ClIjZo/yEttocbuwX97Pc82QJwDnIMWiImsjYuZc2ifspZe69qZAwsdQRCzvHxAmPXqwUcKTVu8UaERSkOBVfYKkb+XJEhqtExGMXNm/X8ZRnHBss+yI5Y+o8zOK8aV+G2EFIKFkAB2VTN8SKj3ni2gUE1EhBjCN2A8ktMOPQV/QugDsc0dY4/CM+aqGQRZ258pFrfI4jEzS0yUMObYTQilyYMpRgSdGuydXNdrQxa/qM5whf8DWb3GXCqgM7cAAAGEaUNDUElDQyBwcm9maWxlAAAokX2RPUjDQBzFX1NrRSoKBhRxyFCdLIiKOGoVilAh1AqtOpiPfkGThiTFxVFwLTj4sVh1cHHW1cFVEAQ/QFxcnRRdpMT/JYUWMR4c9+PdvcfdO4CrlxXN6hgHNN02U4m4kMmuCuFXdCKEPvAYkBTLmBPFJHzH1z0CbL2LsSz/c3+OHjVnKUBAIJ5VDNMm3iCe3rQNxvvEvFKUVOJz4jGTLkj8yHTZ4zfGBZc5lsmb6dQ8MU8sFNpYbmOlaGrEU8RRVdMpn8t4rDLeYqyVq0rznuyFkZy+ssx0msNIYBFLECFARhUllGEjRqtOioUU7cd9/EOuXySXTK4SFHIsoAINkusH+4Pf3Vr5yQkvKRIHQi+O8zEChHeBRs1xvo8dp3ECBJ+BK73lr9SBmU/Say0tegT0bgMX1y1N3gMud4DBJ0MyJVcK0uTyeeD9jL4pC/TfAt1rXm/NfZw+AGnqKnkDHBwCowXKXvd5d1d7b/+eafb3AxZ8coJmdd3gAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH4wYFECEioUMxaQAAHgNJREFUeF7t3Xm4nVV59/HvOgMZSMKQwXAQODs0QmQKU2QeLCAiin0FqW/r++JQx2odKwJqqx5RK6iFFrWVCh0EHAEVWuDibRVQKK+nKMrFYMIUpkAgA2Q4yeof+xx6kpyz72evda+19nB/rst/cn4neO08v+d+9jOsx3nvyck5J0WaMQP4LfBSKRjpPO/9kBTqZs65q4HXSblIN3jvT5JCqaxZs4aDDjqIkZERKQrA0qVLpYioRwq0uM+QvpwPARdKIcNHgY1SKNKJzrk3SaFUZsyYwbHHHivFXlSr1aSIKGtBlafngcD7pJCCs733L0ihbue9vxe4RMopuNA5t4MUSuW1r32tFNlCbEmzFVS5nD3A14FeKRjp58AVUsi86C+BlVIo0nzgc1IolZNOOokpU6ZIMTXZCqrsvcChUkjBh3zuL+ltzHv/DPBZKafgXc65HP/+25g6dSonnHCCFNtCzBTNUlDl6TlAno3g297726SQ2cbFwANSKFIP8DXnXOojqAk1e5gbI0tBlX0VmCWFIq0DzpZCZlve+w3Ax6ScgoOAP5VCKRx//PFsv/32UmwLoVM0eUGVp+cpwOlSSMGF3vuHpJCZmPf+e8BPpZyCzzjnBqSQtv7+fk4++WQppiJpQZXLOR34Gymk4HHgfClkRB8CUn9/n0n9iCq7kMPckCmatKDKPgEMSiEFf+G9XyOFTGPe+/8ErpRyCk53zr1KCmk74ogjmDZtmhSLlqygytNzT+p75NTuB74phUxlnwCq3XYT5yvOuX4ppKmvr4+jjjpKim2j2SmarKDKvgxsJ4UUfMJ7n2OD6gre+/uBS6Wcgr0pcMLomGOOkSLRXIrLfMrT81XA9VJIwTBwkF331OWc25X6kclUKRvpOWCh9/4pKahl+fLlQVMUqt+n2+oTtB/4ihRSco6VU5/3/lHynNzbgcx3GA0MDDA4OCjFoqgXVHl6vp/64UtqP/XeXyeFTLDzgVVSSMFbnXMHSSFNoYe5Vb+LqhZUuZzzgE9KISUflwImnPf+aeACKaegh8yXXUILWpVqQZV9nvR3DAH8yHt/ixQy0S4Ecnw/PCrnI2mHHXYYvb1hdxxWmaJqBVWenocAZ0khBZuBc6SQiTd6bTnXDSBfdM5Nl0Iapk+fzpIlS6RYMLWCKvtrQLXxk7jKe/8rKWTU/C2wXAopeCkZ76U++uijpcikpCmqUlDl6XkGcLgUUuDJ81SMGeW9Xw98Ucop+bBzbhcppKGZVRaapVJQRf3kO1X+Pe/93VLIqPsG8IQUUjCd+gPkyS1atIjZs2dLsUk1mqLRBVWenu8Cfk8KKfDU1zMymY0uH/MlKafkrc65RVJIQ6opGl1QRTOp37uZww+993dJIZPMJcAKKaSgl0wnpmIvt0w2RaMKqjw9PwbMlUJKbHoW5L1fS76VEk9zzh0phWIdd9xxUiRIVEEVDQAflEJKrvXe/1IKmeQuBp6RQkqSn5iaNWsW+++/vxRraKIpGlxQ5en5aepf6nP4tBQw6XnvV5Pvrp8jnHN/IIVixVxumUxwQRW9nDw3JQBcN/ogsWkNX6X+FEoO5zvn+qRQjNjvobDtFA0qqPL0/Dzp17cdY9c9W4j3/jnyPOkCsBfwNikU48ADD1RfZSGooIoOA5pf3CXMrd77W6WQye4iYL0UUvIJ51yyVaf7+vpUDnPHT9GmC6o8PXN+H/wrKWDy894/DvyTlFOyK/AOKRRD4zB3vKYLquhI4EQppORe4BopZIr5EulXABzzcedcstUdtC+3NFVQ5emZ81rkBd77zVLIlOG9vwf4sZRTsgv1O9aSGBgYEG+Ar2Ls72iqoIqOBY6XQkqeBC6XQqa4nF9Bzk75OJrmYW7lgipPz5zfPS/23q+TQqYs7/1/ALdLOSUvAd4thUJpFbRWq1Vf1U+xoL8P3CiFlDwP7D665IZpcc65M4CrpJySJ4EFo7cdqlq3bh377LMPVbvVSKUJqlhOyPQI0KhLrZxt5fvA76SQknnUX2OpburUqey1115SrJJKBVV0EvWztzl48i3ZaRR47zeR7/Y/gI8652ZIoRAHHnigFKlELKjy9My1Sh/Ub+tL/Z5Ko+8yQP2wcxJzSHRGd/HixVKkErGgio4k3/SEfLeQGUWjt//lunEB4IPOOfXXimQpqPL0zLn27AOALUTdvnLuXAeAN0uhZi1cuJCZM2dKMVGuCbov9Zfv5nKJvcahfY2utJjjBcBjPuqcU+9C7POh0KCgytPzbPIsown1Sys53qhl0so5RfcC1J8X1ThRpL7XmMAewJlSSNG/eO9XSiHT8r4PPCaFFH1MCjSrXQr6USDpg7JbybnnNYl47zdSX6Izl0Odc6+UQs045JBDpIhowoIqHt7OBd4qhRTd4r0flkKmbXyDPG/oHqM6RWfOnMkee+whxRpKPUH/DNB9xLyxr0kB0z6898uBq6WcopOcc/HHpePEXm7ZpqCK03MaCW9InsBzwPekkGk7/yAFlH1ECjRDvaCK/hjYWQopumJ01XLTWa4nzwuXxpzhnJsvhaqKPVG0RUEVpyfA+6SAMru00oFG78/N+TxvP4q3/y1atIi+vvBzpKkm6HHAflJI0d3e+1zPEpr8cu9836l1+19/fz8HHHCAFJtUqoK+Xwooy/0PaDLy3t8H/EzKKZoPvFEKVaVSUMXD292B10khRRuBf5RCpu3l3gmrfUWL+R6aYoK+l3wLUQP82Hv/lBQybe8qYI0UUrTEOfcKKVRFdEEVp+c04O1SSFnuPaspYHRpklzLoYxR+ao2MDAQ/IJf7Qma+9LKk9hjZd3kW1JAmdoll4MPPliKTEi7oDlvTAD4rvc+561gpqyfAY9IIUX9wJ9IoSpCb1joUTy8PRgIP9gO820pYDrH6DO+V0o5ZW91CiUJLqgUaELSN0dN4GHgFilkOk7unfIgcIIUkixevDjoXI9WQacB/1sKKbvSVk3oPt77O4H7pJyy6OEzdepU9t57bym2Da2CngHsIIWUXSEFTMfK/W//eudc2GnYcRYtWiRFtqFV0Og9TJPuG92Tmu6U+zB3CgoLi+25555SZBsaBV0I6LyMorrce1DTQrz3vwXuknLKoofQggULpMg2NAoa/X88QO49qGk9ubeBfWPvLCpR0D7g/0ohZXeP7kFNd8t9VxFE3iW3YMECenqaq1xz6W2dTP3O/5xyLoFhWpT3/nfAr6WcsjOdc8FL+PT29rL77rtLsS3EFjT3pRWwgpr/kXtbmAmcKoUaafYwN6ag08n7WBnU10m9QwqZrpG7oBA5lHIW9HXA9lJI2bV2c4IZ5z+BR6WQslc754Kv+ecs6JukQAIl9pimRY3urK+RcsqmAG+QQpNp9lpoaEF3pH6CKKc1wE1SyHSdH0qBBIIPc3NN0DcAKosqNeHfvPfrpZDpOjdTXxM5p+NDnxOdPXs2M2ZUf6l3aEHt8Na0hNF3uOR+aL+HiBeCLVy4UIq8KKSg86kvq5mTJ/8/gmkfP5ICCQQPqWa+h4YU9A3kXRQMYNgWBjMN3Eh9J57TK5xzQW9GauZ7aEhBT5MCCfybFDDdy3v/BPArKZdAUBdSFnQH8h/eAtwgBUzXK7ETb7mCvpr6Qko5vUDeVcVNeypR0GOccztJoa3VarXKN81XS/2PoD1GpP+wyyumgp9S35nn1Ae8Rgptrbe3t/KLfZspaD/1CZqbHd4akfd+HfWS5hY0tKoe5jZT0GPJv+4QWEFNdSW2lZOdc1Ok0NZSFDRoTxHpCe997qUtTPsq8T10BvBKKbS1qtdCmylo7kfLAP6fFDBmzOjOfIWUS6Dp4aU9Qfel/lrB3OzsrWlWicXMm36IW7ugJ0qBRKygplkltpldnXNNLXq78847V7ppvpULuor8Syua9leioBDQkcHBQSlSqaD95F/3FuA27/1mKWTMVu4EnpdCCTRd0Dlz5kiRSgU9nPxLm0CZ7xKmzY0+fna7lEvgWOdcU3fZzZ07V4pUKmjTewYlpQ5VTPsrse3MBJpa2Fprgka/ei3ARuAXUsiYSZS4owiaHGYaBd0BOFTIpPBL732J7xGmM9wGbJJCCTRVUI1D3OPJ/3A22PQ0Ebz3q4HfSLkEljSzJKdGQY8Vfp6KvVrQxPr/UiCBXuBoKTRGo6BHCj9PpcSHazpLqZ38EVJgTOx30GnA4gY/T+UFwN5eZmK1fEFnzZpFf3/jKzONCnoo+VdPALjLez8ihYwRDFPmRNGSZq6Hzps3r+HPGxW08p5AWak9n+kgo1cB7pFyCTR15Ckd5rZiQe37p9FSamdfuTvSiaJGBT2swc9SKvWhms5TaluqfHI1tKAvA+RzwPrWA3dLIWMqKlXQyhM09BD38En+PLV7Rm92NkZDicWsof58aKUFDkInaInb+8AurxhF3vtV5H/B75glUgDCC3rAJH+emhXUaCu1TVU6kzt79uyGP5+ooA7Yf4I/z6HE/ZOms5XapioVNGSC1oBZE/x5DqX2dqZztXRBd9lll4Y/n6igpQ5vNwH3SSFjmlRqp7+rc0682Xa77bZj++0nX7BkooJWan4CD3jvN0ghY5pUaoJCxS41utTSShO01J7OdDDv/QrKLGYNFQva6Hto3wR/ZgU1neY3lFmZslJBL7vsMjZunPjy/9YF3QEYnCCXw/1SwJhA91OmoAf84T/FbdZbF3TvCVN5LJMCxgRaJgUSedmVb17YWxsaDn7sbevvoAsnTOWxTAoYE2iZFEhkO6Dam3on0SoF3Qw8JIWMCbRMCiQU1alWKehyu0neJLRUCiQU1alWKegyKWBMhOVAqWvsUZ2ygpqON/oSroelXCJRnRpf0LnUL7OUsEwKGBNpmRRIRK2gUX9RpGVSwJhIy6RAIoNLz11ceZW/rbVKQR+RAsZEKrWN9RFx88/4glZaoiGRJ6WAMZGekAIJBXdrfEF3nTSVXskPz3SHkttYcLfGF3Rg0lRaHnhKChkTqe0LGvyXRFppNymYDEoWNHj4tcIELfnBme5R8jxH8PAbK2gf0PgtLulYQU1yo0twviDlEoku6Hy2nKY5WUFNLqWmaHRBg/8CBaU+NNN9Sg2D+UvPXRw0AMd+qfHaf2k9LQWMUVJqbaJeAr9CjhW08fLWaa2SAsYoWS0FEgrq2FhBd2yYSqvkh2a6S8lhENSxVihoyQ/NdJeSwyCoY1ZQ001KbmtBHWuFgpbcq5nuYgUNUPJDM92l5DAI6thYQUutpABlPzTTXUoOg6iCBv2ykpIfmukuJbe1oI6NFbTU+0AB1koBY5SU3NaCjlLHCjqlYSote9TM5FJyWwvq2FhBgxc1iuRHl0Q0JocRKZBQUMfGCrpdw1Q6JfdopvuU3N6iChr0ywpK7tFM9ylZ0KAhaAU13aTk9hbUsR7AUX8cpoSSezTTfUpub8ETNOgXlZTco5nuU3J7C56gQb+opOQezXSfkttb0CDsodxaRADBrwY3JkDJ7S3oa2QPZcd+nxQwRlHbHS32EPiLSkp+YKb7lBwIQT0rXdCSH5jpPiUHQtAbvse+f5YqackPzHSfkgMhqGOlC1ryAzPdp+RAsAlqjKDkQAjq2FhBg9qtoOQHZrpPyYEQVdCgX9bgnLOSmlxKFjRoCI4VtNRbnyDwDgtjApQs6DopMJGxgj7XMJXWDClgjJKZUiChZ6XARMYKGvTLSkquh2S6S8ltLahjVlDTTUpua0Eda4WCljzsMN2l5LYW1LGxM6hBv6yk5F7NJHTKu598t3PubVJOk9/kz/zJ1+c9MMmPS25rQR2zgpqE3K7AwVJKU0+Pn9bgxyW3taCOtcIhbskPzXSXkttaUMdaoaAlvxeY7lJyWwvq2FhBn2qYSitoSXxjApScoCukwETGCvpYw1Rac6WAMUrmSYFE1teGhp+WQhMZK+ijDVNplfrQTPd5iRRIZLkUmMxYQVcA6xsFEyr1oZku4pxzwBwpl0jwABy/ol+pw1wrqMlhNuUeb4yeoBDxl0SygpocSm5nKhM0+C+JNN05t70UMiZS2xe01ASFsh+e6Q4lt7HgbrXCBIWyH57pDiW3seBujS/osslCGZT88Ex3KLmNPSgFJjO+oPdNmkpvdylgTKRS29h64GEpNJnxBb1/0lR6NSlgTKRBKZDIA7Wh4c1SaDLjC7qGctdCB6WAMZEGpUAiUUemW796MOovizAoBYwJ5ZzbDthFyiUS1SkrqOkGewBOCiUS1alWKeiOzjl77MykMigFEorqVKsUFOxEkUlnUAokFNWpVirooBQwJtCgFEjkBSJuUoBtC3ovMDJRMINBKWBMoEEpkMhvakPDXgo1snVB1wP3TBTMYC8pYEygUtvWsBSQbF1QUPhLAy2SAsY0a/RB7b2lXCL/JQUkVlDT6XYHSj3OGN2liQoa3fpA85xzO0shY5pUasfvUehSK01QKPdhms71cimQyNLa0PAqKSSZqKAriHjANFKpD9N0rlI7/ejpCRMXFMpN0VIfpulcpbYplQ5ZQU2nK7VNqXRosoLeMcmfp2aHuEaNc+4lQKkTj7dLgSomK+itk/x5ars753aSQsZUtFgKJLK0NjT8uBSqYrKCPglM9hLU1A6SAsZUlPXdpOOoDbjJCgqK/5EmWUGNllLbklp3WrGgpfZ6pvOU2pbUumMFNR1p9K60QSmXwGrgV1KoqkYF/TUQfSdEgD1tdQWjoNTh7e21oeFNUqiqRgXdDPyiwc9TccCBUsgYQakjMdUjz0YFBbhF+HkqpT5c0zlKTVDVzkgFvVn4eSpWUBOrxDa0kcwFvQ1YK2RSOFwKGDMZ59xcYE8pl8DPa0PDa6RQM6SCbgT+XcikMOic21UKGTOJo6RAIjdIgWZJBQW4UQokUupDNu2v1LZjBTWmghLbznMkeMikTwpQv+j6ODBfCior8SG3hYef3cBN961i2cr1PL12hGeeH2GTj1rdMZH8l7M3rH92CmUu092sef1zTJWCAtwE/JEUUra/c26W977EzRIt6fI7V3DZHStY+sx6KdoS9i5Q0KeX334A0C/lEkhypFm1oDeQv6A91M/m/qsU7HQ337+K8657hMdWb5SiXe/5VY+WmJ6Q4PsnVPsOCon+4xV0/WHuxT97grddtdTKWdGGdStL3KDwcG1o+F4pFKLqBF1OfQmH3A/AdnVBz/7xw1z1X89IMTPOyMa1+0uZBH4kBUJVnaAAV0uBBA5zzk2TQp3o0tufsnIG8H7TDCmTQLJutHpBpwJHS6FO88CKdXzuplIrn5omrSbhLbHNvnX4QepL6ed0gff+I1KoU5z67if29a5H7XlC08Y2u0ObmaAA10iBBE6UAsZ0qmYLWuIwdz/nXO6bJIxpCc0W9N+p39KUkwNOkEKdYP3IZiliukyzBd0I/EQKJdAVh7n3rmiPO4RMPs0WFMoc5nZFQR9fZTcjmC2FFPRHwPNSSNkuzrn9pFC7e2zVBiliukxIQdcC10qhBF4jBdrdyhfUH4YwbS6koADflgIJnCYF2p2nFR8ZMyWFFvQ64FkppOwVo2+rMqZrhBZ0A/B9KaTMAa+VQsZ0ktCCAvyLFEig4w9zjRkvpqA3U18KJacTnHPTpZAxnaLHh69lsxm4SgopmwqcJIWM6RQxExTsMNeYpGIL+gvgHimk7FTnXK8UMqYT9ABEHOYCfFMKKJsDHCeFjOkEsRMU4HLqN9Hn9CYpYEwneLGgEVP0SfLf+ve/nHMl1j41JiuNCQr5D3N3Al4lhYxpd1oFvR54RAops8Nc0/G2KGjEYe5m4FtSSNnrunVJTtM9tCYo1A9zgxseYAZwqhQypp1tU9CIKbqM+kuWcvpDKWBMO9OcoACXSAFlpzjnZkkhY9rVhAWNmKJXU1/cOpepwJlSyJh2pT1BNwF/K4WUvUUKGNOutAsK8PfAC1JI0eHOub2lkDHtaNLXD3rvca7ZV7cA8Azwz8DbpaCitwAfk0LtYLvekcc2bJ7yQSnXDrzzp+DzLpn61KO3MbIu/qXsM3ZacOWsnV/2cymX0ka36aGq7wdt1kXkLej/cc6d670fkYKtbnhgxdPAV6RcO9j74YE5zuUt6OMPXMfDd39NikmeBt5SGxrOeSQ4oYaHuBEni+6i/pqIXOYDr5ZCxlT0961QTkjzHXTMRVJAmZ0sMhpKnOiclFjQiCn6Q+AhKaToVOfcXClkjODq2tBwzu22IbGgETYBX5VCivqBN0shYwQXSIGcKhU0Yop+g/pZ3Vze4QJPPRsD/LQ2NHyrFMqpUkEjrAH+Rgop2osueZeoSeILUiC3ygWNmKJ/Td63ob1XChgzgV/VhoZ/LIVyWnru4uoFjbACuFQKKTrVObe7FDJmK1+UAiU0VdCIKfolINdNBL3Au6SQMeM8CFwhhXJaeu5ioMmCRngQuFIKKXq7c26KFDJm1AW1oeFcA6QpTRc0Yop+nnwrLswF3iiFjKH+FSz3oneVNV3QCL8GfiKFFNnJIlPFRbWh4ZwnMUVjh7cQWNCIKfpZKaDoFc65Q6SQ6WqryH9LalOCChrh59SX6MylIx7bMsl8pTY0vFIK5TR+ekJEQSOm6CelgKI3Oud2k0KmKz0LfFkKlRZc0Ah3ALkuCPcBH5BCpit9uTY0/KwUymnr6QmRBY2Yop+SAor+xDm3gxQyXWUlbfJQfFRBI9wJXCOFlMwE3imFTFe5oDY0HL8uiqKJpicoFDRiiv4F+a6Lvt/ehmZGPU39/vC2EF3QCL+kvo5uDrtiL1sydV+qDQ2vlkI5TTY9QamgEVP0U+Sboh+RAqbjraDFr3tuTaWgEe4CviOFlOznnGvpd4o67FnzxM6vDQ2vlUI5NZqeoFjQiCl6DrBRCik5RwqUtMPUXiliwj1I3sUDVKgVNMIDwNelkJJjnHPHSqFSZm+fapliA5xXGxpeL4VykqYnKBc0Yop+Gsj1xT3nnUxNmWMFTWWY+tsO2o5qQSG4pE+R74n2VzrnjpRCJew3fxr9PfY9NIE/rw0NB22YqVSZnpCgoBEuBJZLISUtOUVnTOnl6AUzpZhpzg21oeEbpFCrSlLQwCn6PPWbF3I4yTm3RAqVcNahtva2Ig/8uRTKrer0hEQFjXAp8FsppKQlp+hRtRkcutv2UsxU88+1oeFhKdTKkhU0cIpuAs6WQkpe45w7SAqVcM7vD0gRI1sPnCeFcmtmekLCgka4hnxvRmvJKXrAwHTee+RLpJhp7KLa0PCDUqjVJS1o4BSF+jOcm6WQgtNadVmUDx87nzMO2FmKmYk9AXxGCuXW7PSExAWF4JIOA38nhZR8TgqU8oXX7MZHjtvFbgBs3sdb7XGyUMkLGuE86g/Wpnaic+54KVTKe46YxzfPXMAuM+1puSp6+6bfDXxLyuUWMj0hU0EDp+gK8q28cL4UKOm4PWdyy/tezqdPfim1nW097kbmDCw5v9VuSojhAsvTtMC3AvZRP9zdRwoqeL33PtfzqVEefnYDN923imUr17Ni7Qgrnx9hU6Z/x2asumWHzzrHuVJOk/Ob95tx5OpfS7mtLXtmPU+uSbO4fOj0hHoBsvDeh5R0BPgz4EYpqGDIOXet9z7Hyakou+24HWcdOkeKFXfKLU9JkSSu+OPfkyLb+NS/Pso/3rlCimWX5RB3TOC0vgn4gRRSsA/wR1LImGbETE/IXNAIHwbWSSEFf2lrF+kZ2bh2RynTyWLLCQUKGjhFl1J/hWFqNeAdUshUs/bZpcdIGdNYz8aNuRYziPY56kVN7ZPOuVlSyDTmnFu8Yf1z+0q5TqUxPQF6brwxx/mXLQVO0ReA90ghBfNo8aVR2sSF4Js+K2i21HPttddKmSQCS3o9cJUUUvAB59ygFDITc86dBrTszR+paU1PGJ2ga9askXKt5APUXxuX0hTgC1LIbGv0JFuu1TE6Xt/IyAjXX389p59+upRVFzhFH3POnQNcLAUjvdE591Xv/a1S0GzhPcDLpFAnqw3pPYLaA/Cd7+RamlbNJdTfkpbal13A3RXdyjm3Ey36CF+76gG44447uPfee6Vsyxi92+ed1B/wTmkJ9sqIZnwKsGfkFL14HfSyyy5rlGs53vtfkuclOJ93zk2TQt3OObeQPGfZu8qLBf3BD37A6tW5lqZV80ngESkUaTfgQ1LI8FeA3YWl7MWCrlu3ju9+97uNsi3He7/Ge7+b994l/t+Q9P+l23nvX7/15zb3pUfZ5xZpi6dZLr/8cs4666yQp06M2Ubf5r5vbOwbuV7KaerftPl3Uqad/DepALQulhENnAAAAABJRU5ErkJggg=="></div>');
  17708. div_to_render.append(addParentheses);
  17709. addParentheses.popup({
  17710. content: "Adicionar parênteses",
  17711. delay: {
  17712. show: 750,
  17713. hide: 0
  17714. }
  17715. });
  17716. addParentheses.on("click", function (mouse_event) {
  17717. // verificar se já está ativado
  17718. if (window.parentheses_activate) {
  17719. return;
  17720. }
  17721. div_to_render.find(".usepointer").off("click");
  17722. window.parentheses_activate = true;
  17723. window.open_or_close = "open";
  17724. div_to_render.find(".dropdown").addClass("disabled");
  17725. div_to_render.find(".ghost_element").addClass("temp_class");
  17726. div_to_render.find(".ghost_element").removeClass("ghost_element");
  17727. var floatingObject = $('<div class="floating_parenthesis"> ( </div>');
  17728. floatingObject.draggable().appendTo("body");
  17729. floatingObject.css("position", "absolute");
  17730. mouse_event.type = "mousedown.draggable";
  17731. mouse_event.target = floatingObject[0];
  17732. floatingObject.css("left", mouse_event.pageX + 10);
  17733. floatingObject.css("top", mouse_event.pageY + 10);
  17734. floatingObject.trigger(mouse_event);
  17735. div_to_render.on("mousemove", function (evt) {
  17736. var actual_target = null;
  17737. if ($(evt.target).hasClass("single_element_expression")) {
  17738. actual_target = $(evt.target);
  17739. } else {
  17740. actual_target = $(evt.target).closest(".single_element_expression");
  17741. }
  17742. if ($(evt.target).hasClass("temp_class") || actual_target.length < 1 || actual_target.hasClass("add_parentheses") || actual_target.hasClass("rendered_parentheses") || $(evt.target).hasClass("expression_elements")) {
  17743. return;
  17744. }
  17745. renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array);
  17746. });
  17747. div_to_render.on("mouseleave", function () {
  17748. /*window.open_parentheses.remove();
  17749. window.close_parentheses.remove();*/
  17750. });
  17751. var floating;
  17752. $("body").on("mouseup", function (evt) {
  17753. if (window.open_or_close == "open") {
  17754. window.open_or_close = "close";
  17755. floatingObject.remove();
  17756. var comando_que_esta = $(evt.target).closest(".command_container");
  17757. var comando_certo = div_to_render.closest(".command_container");
  17758. if (!comando_que_esta.is(comando_certo)) {
  17759. window.parentheses_activate = false;
  17760. div_to_render.find(".temp_class").addClass("ghost_element");
  17761. div_to_render.find(".temp_class").removeClass("temp_class");
  17762. div_to_render.off("mousemove");
  17763. div_to_render.off("mouseleave");
  17764. $("body").off("mouseup");
  17765. window.open_parentheses.remove();
  17766. window.close_parentheses.remove();
  17767. window.inserir_open = -1;
  17768. window.inserir_close = -1;
  17769. window.open_or_close = null;
  17770. renderExpression(command, function_obj, div_to_render, expression_array);
  17771. return;
  17772. }
  17773. window.open_parentheses.addClass("parentheses_fixed");
  17774. floating = $('<div class="floating_parenthesis"> ) </div>');
  17775. floating.draggable().appendTo("body");
  17776. floating.css("position", "absolute");
  17777. floating.css("left", evt.pageX + 10);
  17778. floating.css("top", evt.pageY + 10);
  17779. $("body").on("mousemove", function (evts) {
  17780. floating.css("left", evts.pageX + 10);
  17781. floating.css("top", evts.pageY + 10);
  17782. });
  17783. } else {
  17784. floating.remove();
  17785. window.open_parentheses.removeClass("parentheses_fixed");
  17786. div_to_render.off("mousemove");
  17787. div_to_render.off("mouseleave");
  17788. $("body").off("mouseup");
  17789. setTimeout(function () {
  17790. window.parentheses_activate = false;
  17791. }, 50);
  17792. var comando_que_esta = $(evt.target).closest(".command_container");
  17793. var comando_certo = div_to_render.closest(".command_container");
  17794. var is_correct = false;
  17795. if (comando_que_esta.is(comando_certo)) {
  17796. is_correct = true;
  17797. }
  17798. if (is_correct) {
  17799. expression_array.splice(window.inserir_open, 0, "(");
  17800. expression_array.splice(window.inserir_close, 0, ")");
  17801. }
  17802. window.inserir_open = -1;
  17803. window.inserir_close = -1;
  17804. window.open_or_close = null;
  17805. renderExpression(command, function_obj, div_to_render, expression_array);
  17806. }
  17807. });
  17808. });
  17809. }
  17810. window.open_parentheses = $('<div class="parentheses_ghost">(</div>');
  17811. window.close_parentheses = $('<div class="parentheses_ghost">)</div>');
  17812. window.inserir_open = -1;
  17813. window.inserir_close = -1;
  17814. function renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array) {
  17815. /*window.open_parentheses.remove();
  17816. window.close_parentheses.remove();*/
  17817. var index_in_array = actual_target.data("index");
  17818. if (expression_array[index_in_array] == "(" || expression_array[index_in_array] == ")") {
  17819. return;
  17820. }
  17821. if (window.open_or_close == "close") {
  17822. if (index_in_array < window.inserir_open) {
  17823. return;
  17824. }
  17825. } // Tratando a situação quando é na primeira posição:
  17826. if (index_in_array == 0) {
  17827. if (expression_array[index_in_array].type == "var_value") {
  17828. if (window.open_or_close == "open") {
  17829. window.open_parentheses.insertBefore(actual_target);
  17830. window.inserir_open = index_in_array;
  17831. }
  17832. /*if (expression_array.length == 1) {
  17833. if (window.open_or_close == "close") {
  17834. window.close_parentheses.insertAfter(actual_target);
  17835. window.inserir_close = index_in_array + 2;
  17836. }*/
  17837. //} else {
  17838. var count_opened = 0;
  17839. var count_closed = 0;
  17840. for (var i = 0; i < expression_array.length; i++) {
  17841. if (expression_array[i] == "(") {
  17842. count_opened++;
  17843. }
  17844. if (expression_array[i] == ")") {
  17845. count_closed++;
  17846. }
  17847. if (count_opened != count_closed) {} else {
  17848. if (count_opened > 0) {
  17849. if (window.open_or_close == "close") {
  17850. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17851. window.inserir_close = i + 2;
  17852. }
  17853. break;
  17854. } else {
  17855. if (expression_array[i].type == "var_value") {
  17856. if (window.open_or_close == "close") {
  17857. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17858. window.inserir_close = i + 2;
  17859. }
  17860. break;
  17861. }
  17862. }
  17863. }
  17864. } //}
  17865. } else if (expression_array[index_in_array].type_op) {
  17866. if (window.open_or_close == "open") {
  17867. window.open_parentheses.insertBefore(actual_target);
  17868. window.inserir_open = index_in_array;
  17869. }
  17870. var count_opened = 0;
  17871. var count_closed = 0;
  17872. for (var i = 1; i < expression_array.length; i++) {
  17873. // $('.slide-link[data-slide="0"]')
  17874. if (expression_array[i] == "(") {
  17875. count_opened++;
  17876. }
  17877. if (expression_array[i] == ")") {
  17878. count_closed++;
  17879. }
  17880. if (count_opened != count_closed) {} else {
  17881. if (count_opened > 0) {
  17882. if (expression_array[i].type == "var_value") {
  17883. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17884. window.inserir_close = i + 2;
  17885. }
  17886. break;
  17887. } else {
  17888. if (expression_array[i].type == "var_value") {
  17889. if (expression_array[i].type == "var_value") {
  17890. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17891. window.inserir_close = i + 2;
  17892. }
  17893. break;
  17894. }
  17895. }
  17896. }
  17897. }
  17898. }
  17899. return;
  17900. } // Tratando quando não é no índice 0:
  17901. if (expression_array[index_in_array].type == "var_value") {
  17902. if (window.open_or_close == "open") {
  17903. window.open_parentheses.insertBefore(actual_target);
  17904. window.inserir_open = index_in_array;
  17905. }
  17906. if (window.open_or_close == "close") {
  17907. window.close_parentheses.insertAfter(actual_target);
  17908. window.inserir_close = index_in_array + 2;
  17909. }
  17910. return;
  17911. }
  17912. if (expression_array[index_in_array].type_op) {
  17913. // buscar para a esquerda primeiro:
  17914. if (expression_array[index_in_array - 1] == "(") {
  17915. if (window.open_or_close == "open") {
  17916. window.open_parentheses.insertBefore(actual_target);
  17917. window.inserir_open = index_in_array;
  17918. }
  17919. } else if (expression_array[index_in_array - 1] == ")") {
  17920. // buscar a abertura
  17921. var count_opened = 0;
  17922. var count_closed = 0;
  17923. for (var j = index_in_array - 1; j >= 0; j--) {
  17924. if (expression_array[j] == "(") {
  17925. count_opened++;
  17926. }
  17927. if (expression_array[j] == ")") {
  17928. count_closed++;
  17929. }
  17930. if (count_opened != count_closed) {} else {
  17931. if (count_closed > 0) {
  17932. if (window.open_or_close == "open") {
  17933. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  17934. window.inserir_open = j;
  17935. }
  17936. break;
  17937. }
  17938. }
  17939. }
  17940. } else if (expression_array[index_in_array - 1].type == "var_value") {
  17941. if (window.open_or_close == "open") {
  17942. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + (index_in_array - 1) + '"]'));
  17943. window.inserir_open = index_in_array - 1;
  17944. }
  17945. } // buscar para a direita agora:
  17946. if (expression_array[index_in_array + 1] == "(") {
  17947. // buscar o fechamento:
  17948. var count_opened = 0;
  17949. var count_closed = 0;
  17950. for (var j = index_in_array + 1; j < expression_array.length; j++) {
  17951. if (expression_array[j] == "(") {
  17952. count_opened++;
  17953. }
  17954. if (expression_array[j] == ")") {
  17955. count_closed++;
  17956. }
  17957. if (count_opened != count_closed) {} else {
  17958. if (count_opened > 0) {
  17959. if (window.open_or_close == "close") {
  17960. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  17961. window.inserir_close = j + 2;
  17962. }
  17963. break;
  17964. }
  17965. }
  17966. }
  17967. } else if (expression_array[index_in_array + 1].type == "var_value") {
  17968. if (window.open_or_close == "close") {
  17969. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + (index_in_array + 1) + '"]'));
  17970. window.inserir_close = index_in_array + 3;
  17971. }
  17972. }
  17973. }
  17974. }
  17975. function renderParenthesis(div_to_render, expression_content, command, function_obj, position, expression_array) {
  17976. var ghost_parenthesis = $('<div class="single_element_expression parentheses_in_expression" data-index="' + position + '">' + expression_content + "</div>");
  17977. div_to_render.append(ghost_parenthesis);
  17978. }
  17979. function renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, position) {
  17980. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  17981. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  17982. if (types_included.length > 1) {
  17983. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  17984. menu_final += getArithmeticOperators();
  17985. menu_final += "</div></div>";
  17986. } else {
  17987. menu_final += getArithmeticOperators();
  17988. }
  17989. }
  17990. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  17991. if (types_included.length > 1) {
  17992. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  17993. menu_final += getLogicOperators();
  17994. menu_final += "</div></div>";
  17995. } else {
  17996. menu_final += getLogicOperators();
  17997. }
  17998. }
  17999. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18000. if (types_included.length > 1) {
  18001. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18002. menu_final += getRelationalOperators();
  18003. menu_final += "</div></div>";
  18004. } else {
  18005. menu_final += getRelationalOperators();
  18006. }
  18007. }
  18008. menu_final += "</div></div>";
  18009. menu_final = $(menu_final);
  18010. var div_temp = $('<div class="single_element_expression ghost_element mouse_distance"></div>');
  18011. div_temp.append(menu_final);
  18012. var div_higher = $('<div class="higher_element"></div>');
  18013. div_higher.append(div_temp);
  18014. div_to_render.append(div_higher);
  18015. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus);
  18016. div_temp.on("click", function () {
  18017. if (!window.open_or_close) {
  18018. var sera = position;
  18019. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18020. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus));
  18021. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18022. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to));
  18023. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18024. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than));
  18025. }
  18026. renderExpression(command, function_obj, div_to_render, expression_array);
  18027. }
  18028. });
  18029. }
  18030. function renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, position) {
  18031. var is_last = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
  18032. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18033. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18034. if (types_included.length > 1) {
  18035. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18036. menu_final += getArithmeticOperators();
  18037. menu_final += "</div></div>";
  18038. } else {
  18039. menu_final += getArithmeticOperators();
  18040. }
  18041. }
  18042. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18043. if (types_included.length > 1) {
  18044. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18045. menu_final += getLogicOperators();
  18046. menu_final += "</div></div>";
  18047. } else {
  18048. menu_final += getLogicOperators();
  18049. }
  18050. }
  18051. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18052. if (types_included.length > 1) {
  18053. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18054. menu_final += getRelationalOperators();
  18055. menu_final += "</div></div>";
  18056. } else {
  18057. menu_final += getRelationalOperators();
  18058. }
  18059. }
  18060. menu_final += "</div></div>";
  18061. menu_final = $(menu_final);
  18062. var div_temp = $('<div class="simple_add mouse_distance"></div>');
  18063. var div_higher = $('<div class="higher_element"></div>');
  18064. var button = $('<button class="ui button green add_expression"><i class="plus circle inverted icon"></i></button>');
  18065. div_temp.append(button);
  18066. if (!is_last) {
  18067. div_higher.append(div_temp);
  18068. div_to_render.append(div_higher); //div_temp.append(menu_final);
  18069. div_temp.css("opacity", "0", "!important");
  18070. } else {
  18071. div_temp.removeClass("mouse_distance");
  18072. div_temp.css("opacity", "1", "!important"); //div_temp.append(menu_final);
  18073. div_to_render.append(div_temp);
  18074. }
  18075. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus);
  18076. div_temp.on("click", function () {
  18077. var sera = position;
  18078. if (expression_array[sera] == ")" && expression_array[sera - 1] == "(") {
  18079. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18080. renderExpression(command, function_obj, div_to_render, expression_array);
  18081. return;
  18082. }
  18083. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18084. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus));
  18085. expression_array.splice(sera + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18086. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18087. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to));
  18088. expression_array.splice(sera + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18089. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18090. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than));
  18091. expression_array.splice(sera + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18092. }
  18093. renderExpression(command, function_obj, div_to_render, expression_array);
  18094. });
  18095. }
  18096. function renderOperatorMenu(command, function_obj, div_to_render, expression_element, types_included, position, expression_array) {
  18097. var menu_final = '<div class="ui dropdown"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18098. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep) >= 0) {
  18099. menu_final += getSeparator();
  18100. }
  18101. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18102. if (types_included.length > 1) {
  18103. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18104. menu_final += getArithmeticOperators();
  18105. menu_final += "</div></div>";
  18106. } else {
  18107. menu_final += getArithmeticOperators();
  18108. }
  18109. }
  18110. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18111. if (types_included.length > 1) {
  18112. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18113. menu_final += getLogicOperators();
  18114. menu_final += "</div></div>";
  18115. } else {
  18116. menu_final += getLogicOperators();
  18117. }
  18118. }
  18119. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18120. if (types_included.length > 1) {
  18121. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18122. menu_final += getRelationalOperators();
  18123. menu_final += "</div></div>";
  18124. } else {
  18125. menu_final += getRelationalOperators();
  18126. }
  18127. }
  18128. menu_final += "</div></div>";
  18129. menu_final = $(menu_final);
  18130. menu_final.find(".ivprog-write-sep").popup({
  18131. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("write_seprator_menu_tooltip"),
  18132. delay: {
  18133. show: 500,
  18134. hide: 0
  18135. }
  18136. });
  18137. var div_temp = $('<div class="single_element_expression not_allowed" data-index="' + position + '"></div>');
  18138. div_temp.append(menu_final);
  18139. div_to_render.append(div_temp);
  18140. menu_final.dropdown({
  18141. onChange: function onChange(_value, _text, $selectedItem) {
  18142. expression_element.item = $selectedItem.data("value");
  18143. expression_element.type_op = $selectedItem.data("type");
  18144. }
  18145. });
  18146. menu_final.dropdown("set selected", expression_element.item);
  18147. }
  18148. function getArithmeticOperators() {
  18149. var arithmetic_operators;
  18150. arithmetic_operators = '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus + '">+</div>';
  18151. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus + '">-</div>';
  18152. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  18153. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division + '">/</div>';
  18154. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module + '">%</div>';
  18155. return arithmetic_operators;
  18156. }
  18157. function getLogicOperators() {
  18158. var logic_operators;
  18159. logic_operators = '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to + '">==</div>';
  18160. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to + '">!=</div>';
  18161. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + "</div>";
  18162. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_or") + "</div>";
  18163. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_not") + "</div>";
  18164. return logic_operators;
  18165. }
  18166. function getRelationalOperators() {
  18167. var relational_operators;
  18168. relational_operators = '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than + '">></div>';
  18169. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than + '"><</div>';
  18170. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to + '">==</div>';
  18171. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to + '">!=</div>';
  18172. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to + '">>=</div>';
  18173. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to + '"><=</div>';
  18174. return relational_operators;
  18175. }
  18176. function getSeparator() {
  18177. return "<div class=\"item ivprog-write-sep\" data-type=\"".concat(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep, "\" data-value=\"").concat(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep, "\">").concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("write_seprator_menu_text"), "</div>");
  18178. }
  18179. /***/ }),
  18180. /***/ "./js/visualUI/commands/iftrue.js":
  18181. /*!****************************************!*\
  18182. !*** ./js/visualUI/commands/iftrue.js ***!
  18183. \****************************************/
  18184. /*! exports provided: createFloatingCommand, renderCommand */
  18185. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18186. "use strict";
  18187. __webpack_require__.r(__webpack_exports__);
  18188. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18189. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18190. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18191. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18192. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18193. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  18194. function createFloatingCommand() {
  18195. return $('<div class="ui iftrue created_element"> <i class="ui icon small random"></i> <span> if (x < 1) { } </span></div>');
  18196. }
  18197. function renderCommand(command, function_obj) {
  18198. var ret = '';
  18199. ret += '<div class="ui iftrue command_container"><div class="ui data_block_if" data-if="true"> <i class="ui icon small random command_drag"></i> <i class="ui icon times red button_remove_command"></i> <button class="ui icon button minimize_block_button tiny"><i class="icon window minimize"></i></button>';
  18200. ret += '<span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_if') + '</span>';
  18201. ret += ' <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="textual_expression"></span> <span class="span_command_spec"> ) </span> ';
  18202. ret += '<i class="ui icon unlock button_alternate_expression"></i>';
  18203. ret += '<span> </span> ';
  18204. ret += '<div class="ui block_commands commands_if conditional_comands_block" data-if="true">';
  18205. ret += '</div></div>';
  18206. ret += '<div class="ui data_block_else" data-else="true"> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_else') + ' </span>';
  18207. ret += '<div class="ui block_commands commands_else conditional_comands_block" data-else="true">';
  18208. ret += '</div>';
  18209. ret += '<span></span></div>';
  18210. ret += '</div>';
  18211. var el = $(ret);
  18212. el.data('command', command);
  18213. el.find('.block_commands').data('command', command);
  18214. el.find('.data_block_if').data('command', command);
  18215. el.find('.data_block_else').data('command', command);
  18216. el.find('.commands_if').data('command', command);
  18217. addHandlers(command, function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
  18218. _generic_expression__WEBPACK_IMPORTED_MODULE_2__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  18219. if (command.commands_block) {
  18220. for (var j = 0; j < command.commands_block.length; j++) {
  18221. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.commands_if')[0]), 3, function_obj);
  18222. }
  18223. }
  18224. if (command.commands_else) {
  18225. for (var j = 0; j < command.commands_else.length; j++) {
  18226. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_else[j], $(el.find('.commands_else')[0]), 3, function_obj);
  18227. }
  18228. }
  18229. if (command.collapsed) {
  18230. el.children('.data_block_else').toggle();
  18231. $(el.find('.block_commands')[0]).toggle();
  18232. }
  18233. if (command.lockexpression) {
  18234. if (command.expression) {
  18235. try {
  18236. var text = _code_generator__WEBPACK_IMPORTED_MODULE_3__["elementExpressionCode"](command.expression);
  18237. if (text) {
  18238. $(el.find('.conditional_expression')[0]).toggle();
  18239. $(el.find('.textual_expression')[0]).text(text);
  18240. $(el.find('.textual_expression')[0]).toggle();
  18241. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  18242. }
  18243. } catch (e) {
  18244. command.lockexpression = false;
  18245. }
  18246. }
  18247. }
  18248. return el;
  18249. }
  18250. function addHandlers(command, function_obj, iftrue_dom) {
  18251. $(iftrue_dom.find('.textual_expression')[0]).toggle();
  18252. iftrue_dom.find('.button_alternate_expression').on('click', function () {
  18253. if (command.expression) {
  18254. var text = _code_generator__WEBPACK_IMPORTED_MODULE_3__["elementExpressionCode"](command.expression);
  18255. if (text) {
  18256. $(iftrue_dom.find('.conditional_expression')[0]).toggle();
  18257. $(iftrue_dom.find('.textual_expression')[0]).text(text);
  18258. $(iftrue_dom.find('.textual_expression')[0]).toggle();
  18259. $(this).toggleClass('unlock').toggleClass('lock');
  18260. command.lockexpression = !command.lockexpression;
  18261. }
  18262. }
  18263. });
  18264. iftrue_dom.find('.button_remove_command').on('click', function () {
  18265. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, iftrue_dom)) {
  18266. iftrue_dom.fadeOut(400, function () {
  18267. iftrue_dom.remove();
  18268. });
  18269. }
  18270. });
  18271. iftrue_dom.find('.minimize_block_button').on('click', function () {
  18272. iftrue_dom.children('.data_block_else').toggle();
  18273. $(iftrue_dom.find('.block_commands')[0]).toggle();
  18274. command.collapsed = !command.collapsed;
  18275. });
  18276. }
  18277. /***/ }),
  18278. /***/ "./js/visualUI/commands/reader.js":
  18279. /*!****************************************!*\
  18280. !*** ./js/visualUI/commands/reader.js ***!
  18281. \****************************************/
  18282. /*! exports provided: createFloatingCommand, renderCommand */
  18283. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18284. "use strict";
  18285. __webpack_require__.r(__webpack_exports__);
  18286. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18288. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18289. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18290. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18291. function createFloatingCommand() {
  18292. return $('<div class="ui reader created_element"> <i class="ui icon small download"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_read') + ' var </span></div>');
  18293. }
  18294. function renderCommand(command, function_obj) {
  18295. var el = '<div class="ui reader command_container"> <i class="ui icon small download command_drag"></i> <i class="ui icon times red button_remove_command"></i> <span class="span_command_spec">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_read') + ' ( </span> <div class="var_value_menu_div"></div> <span class="close_parentheses span_command_spec">)</span> </div>';
  18296. el = $(el);
  18297. el.data('command', command);
  18298. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
  18299. addHandlers(command, function_obj, el);
  18300. return el;
  18301. }
  18302. function addHandlers(command, function_obj, reader_dom) {
  18303. reader_dom.find('.button_remove_command').on('click', function () {
  18304. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, reader_dom)) {
  18305. reader_dom.fadeOut(400, function () {
  18306. reader_dom.remove();
  18307. });
  18308. }
  18309. });
  18310. }
  18311. /***/ }),
  18312. /***/ "./js/visualUI/commands/repeatNtimes.js":
  18313. /*!**********************************************!*\
  18314. !*** ./js/visualUI/commands/repeatNtimes.js ***!
  18315. \**********************************************/
  18316. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, manageClearExpressionElements */
  18317. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18318. "use strict";
  18319. __webpack_require__.r(__webpack_exports__);
  18320. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18321. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18322. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  18323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageClearExpressionElements", function() { return manageClearExpressionElements; });
  18324. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18325. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18326. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18327. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  18328. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18329. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18330. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18331. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  18332. function createFloatingCommand() {
  18333. return $('<div class="ui repeatNtimes created_element"> <i class="ui icon small sync"></i> <span> repita_para i de 0 ate 10 passo 1 <br> </span></div>');
  18334. }
  18335. function renderCommand(command, function_obj) {
  18336. var ret = "<div class=\"ui repeatNtimes command_container\"> \n\t\t<i class=\"ui icon small sync command_drag\"></i>\n\t\t<i class=\"ui icon times red button_remove_command\"></i>\n\t\t<button class=\"ui icon button minimize_block_button tiny\"><i class=\"icon window minimize\"></i></button>\n\t\t<span class=\"span_command_spec\"> ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_for'), "\n\t\t</span> <div class=\"ui attribution_expression\">\n\t\t<div class=\"ui variable_attribution\"></div>\n\t\t<span class=\"text_receives span_command_spec\" style=\"margin-left: 10px;margin-right: 20px;\"></span>\n\t\t<div class=\"ui var_value_expression div_expression_st\"></div>\n\t\t</div>\n\t\t<span class=\"span_command_spec separator_character\" style=\"margin-left: 25px; margin-right: 15px;\">\n\t\t").concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_to"), " </span>\n\t\t<div class=\"conditional_expression\"></div> <div class=\"pass_button\"></div> \n\t\t<div class=\"ui incrementation_field\"><span class=\"text_inc_receives span_command_spec\"></span>\n\t\t<div class=\"ui first_operand\"></div><div class=\"ui operator\"></div>\n\t\t<div class=\"ui second_operand\"></div></div> <span class=\"span_command_spec\"> </span>\n\t\t<span class=\"textual_expression\"></span> <i class=\"ui icon unlock button_alternate_expression\"></i>\n\t\t<div class=\"ui context_menu\"></div>");
  18337. ret += '<div class="ui block_commands">';
  18338. ret += '</div>';
  18339. ret += '<span> </span>';
  18340. ret += '</div>';
  18341. var el = $(ret);
  18342. el.data('command', command);
  18343. el.find('.block_commands').data('command', command);
  18344. addHandlers(command, function_obj, el);
  18345. _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  18346. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.var_attribution, el.find('.variable_attribution'), function_obj); //ConditionalExpressionManagement.renderExpression(command, command.expression2, function_obj, el.find('.conditional_expression'));
  18347. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression2, el.find('.conditional_expression'), function_obj); //GenericExpressionManagement.renderExpression(command, function_obj, el.find('.conditional_expression'), command.expression2);
  18348. //VariableValueMenu.renderMenu(command, command.var_incrementation, el.find('.incrementation_variable'), function_obj);
  18349. //angle double right
  18350. if (!command.expression1) {
  18351. command.expression1 = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, "0", null, null, true);
  18352. }
  18353. el.find('.text_receives').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_from"));
  18354. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, el.find('.var_value_expression'), function_obj);
  18355. if (!command.expression3) {
  18356. el.find('.pass_button').html('<button class="ui">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_pass") + '<i class="ui icon angle double right"></i></button>');
  18357. el.find('.pass_button').find('button').on('click', function () {
  18358. togglePasso(command);
  18359. });
  18360. /*var exp = new Models.ExpressionElement(Models.EXPRESSION_ELEMENTS.exp_op_exp,
  18361. [command.var_attribution,
  18362. Models.ARITHMETIC_TYPES.plus,
  18363. new Models.VariableValueMenu(VariableValueMenu.VAR_OR_VALUE_TYPES.all, "1", null, null, true)]);
  18364. command.expression3 = exp;
  18365. command.var_incrementation = command.var_attribution;*/
  18366. } else {
  18367. el.find('.pass_button').html('<button class="ui">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_pass") + '<i class="ui icon angle double left"></i></button>');
  18368. el.find('.pass_button').find('button').on('click', function () {
  18369. togglePasso(command);
  18370. });
  18371. renderOperator(command, function_obj, el.find('.operator'), command.expression3, 1);
  18372. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], el.find('.second_operand'), function_obj);
  18373. }
  18374. if (command.commands_block) {
  18375. for (var j = 0; j < command.commands_block.length; j++) {
  18376. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  18377. }
  18378. }
  18379. if (command.lockexpression) {
  18380. try {
  18381. var text = _code_generator__WEBPACK_IMPORTED_MODULE_7__["repeatNtimesHeader"](command);
  18382. if (text) {
  18383. $(el.find('.textual_expression')[0]).html(text);
  18384. $(el.find('.textual_expression')[0]).toggle();
  18385. $(el.find('.attribution_expression')[0]).toggle();
  18386. $(el.find('.span_command_spec.separator_character')[0]).toggle();
  18387. $(el.find('.conditional_expression')[0]).toggle();
  18388. $(el.find('.pass_button')[0]).toggle();
  18389. $(el.find('.incrementation_field')[0]).toggle();
  18390. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  18391. }
  18392. } catch (e) {
  18393. command.lockexpression = false;
  18394. }
  18395. }
  18396. return el;
  18397. }
  18398. function togglePasso(command) {
  18399. if (!command.expression3) {
  18400. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ExpressionElement"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp, [command.var_attribution, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, "1", null, null, true)]);
  18401. command.expression3 = exp;
  18402. command.var_incrementation = command.var_attribution;
  18403. } else {
  18404. command.expression3 = null;
  18405. }
  18406. renderAlgorithm();
  18407. }
  18408. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  18409. if (dom_object.hasClass('variable_attribution')) {
  18410. if (!command.expression3) {
  18411. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ExpressionElement"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp, [command.var_attribution, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, "1", null, null, true)]);
  18412. command.expression3 = exp;
  18413. command.var_incrementation = command.var_attribution;
  18414. var cond_exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ArithmeticExpression"](command.var_attribution, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than);
  18415. command.expression2.expression = cond_exp;
  18416. }
  18417. dom_object.parent().find('.text_receives').text('de');
  18418. command.expression1 = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, "0", null, null, true);
  18419. dom_object.parent().find('.var_value_expression').empty();
  18420. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, dom_object.parent().find('.var_value_expression'), function_obj);
  18421. renderAlgorithm();
  18422. }
  18423. if (dom_object.hasClass('incrementation_variable')) {
  18424. dom_object.parent().find('.text_inc_receives').text('de');
  18425. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ExpressionElement"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)]);
  18426. command.expression3 = exp;
  18427. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[0], dom_object.parent().find('.first_operand'), function_obj);
  18428. renderOperator(command, function_obj, dom_object.parent().find('.operator'), command.expression3, 1);
  18429. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], dom_object.parent().find('.second_operand'), function_obj);
  18430. }
  18431. }
  18432. function manageClearExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  18433. if (dom_object.hasClass('variable_attribution')) {
  18434. $(dom_object).parent().find('.text_receives').text('');
  18435. command.expression1 = null;
  18436. $(dom_object).parent().find('.var_value_expression').empty();
  18437. }
  18438. if (dom_object.hasClass('incrementation_variable')) {
  18439. $(dom_object).parent().find('.text_inc_receives').text('');
  18440. command.expression3 = null;
  18441. $(dom_object).parent().find('.first_operand').empty();
  18442. $(dom_object).parent().find('.operator').empty();
  18443. $(dom_object).parent().find('.second_operand').empty();
  18444. }
  18445. }
  18446. function addHandlers(command, function_obj, repeatNtimes_dom) {
  18447. repeatNtimes_dom.find('.minimize_block_button').on('click', function (evt) {
  18448. repeatNtimes_dom.children('.ui.block_commands').toggle();
  18449. command.collapsed = !command.collapsed;
  18450. });
  18451. $(repeatNtimes_dom.find('.textual_expression')[0]).toggle();
  18452. repeatNtimes_dom.find('.button_alternate_expression').on('click', function () {
  18453. var text = _code_generator__WEBPACK_IMPORTED_MODULE_7__["repeatNtimesHeader"](command);
  18454. if (text) {
  18455. $(repeatNtimes_dom.find('.textual_expression')[0]).html(text);
  18456. $(repeatNtimes_dom.find('.textual_expression')[0]).toggle();
  18457. $(repeatNtimes_dom.find('.attribution_expression')[0]).toggle();
  18458. $(repeatNtimes_dom.find('.span_command_spec.separator_character')[0]).toggle();
  18459. $(repeatNtimes_dom.find('.conditional_expression')[0]).toggle();
  18460. $(repeatNtimes_dom.find('.pass_button')[0]).toggle();
  18461. $(repeatNtimes_dom.find('.incrementation_field')[0]).toggle();
  18462. $(repeatNtimes_dom.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  18463. command.lockexpression = !command.lockexpression;
  18464. }
  18465. });
  18466. repeatNtimes_dom.find('.button_remove_command').on('click', function () {
  18467. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, repeatNtimes_dom)) {
  18468. repeatNtimes_dom.fadeOut(400, function () {
  18469. repeatNtimes_dom.remove();
  18470. });
  18471. }
  18472. });
  18473. }
  18474. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  18475. var menu_operator = $('<div class="ui dropdown"><div class="text"></div></div>');
  18476. menu_operator.dropdown({
  18477. values: [{
  18478. name: '+',
  18479. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus,
  18480. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus
  18481. }, {
  18482. name: '-',
  18483. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus,
  18484. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus
  18485. }],
  18486. onChange: function onChange(value, text, $selectedItem) {
  18487. expression_element.itens[index_op] = value;
  18488. }
  18489. });
  18490. temp_op.append(menu_operator);
  18491. }
  18492. /***/ }),
  18493. /***/ "./js/visualUI/commands/return.js":
  18494. /*!****************************************!*\
  18495. !*** ./js/visualUI/commands/return.js ***!
  18496. \****************************************/
  18497. /*! exports provided: createFloatingCommand, renderCommand */
  18498. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18499. "use strict";
  18500. __webpack_require__.r(__webpack_exports__);
  18501. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18502. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18503. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  18504. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18505. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18506. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18507. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18508. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18509. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  18510. function createFloatingCommand() {
  18511. return $('<div class="ui return created_element"> <i class="ui icon small reply"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_return') + ' </span></div>');
  18512. }
  18513. function renderCommand(command, function_obj) {
  18514. var el = $('<div class="ui return command_container"> <i class="ui icon small reply command_drag"></i> <i class="ui icon times red button_remove_command"></i> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_return') + ' </span> <div class="expression_elements"></div><span class="textual_expression" style="display: none; margin-left: 1rem;"></span></div>');
  18515. el.data('command', command);
  18516. if (function_obj.return_type != _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID) {
  18517. if (!command.variable_value_menu) {
  18518. command.variable_value_menu = [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_5__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)];
  18519. }
  18520. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.variable_value_menu);
  18521. el.append($('<i class="ui icon unlock button_alternate_expression" style="margin-left: 1rem;"></i>'));
  18522. if (command.lockexpression) {
  18523. if (command.variable_value_menu) {
  18524. try {
  18525. var text = _code_generator__WEBPACK_IMPORTED_MODULE_6__["elementExpressionCode"](command.variable_value_menu);
  18526. if (text) {
  18527. $(el.find('.expression_elements')[0]).toggle();
  18528. $(el.find('.textual_expression')[0]).text(text);
  18529. $(el.find('.textual_expression')[0]).toggle();
  18530. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  18531. }
  18532. } catch (e) {
  18533. command.lockexpression = false;
  18534. }
  18535. }
  18536. }
  18537. } else {
  18538. el.find('.expression_elements').remove();
  18539. command.variable_value_menu = null;
  18540. }
  18541. addHandlers(command, function_obj, el);
  18542. return el;
  18543. }
  18544. function addHandlers(command, function_obj, return_dom) {
  18545. return_dom.find('.button_alternate_expression').on('click', function () {
  18546. if (command.variable_value_menu) {
  18547. var text = _code_generator__WEBPACK_IMPORTED_MODULE_6__["elementExpressionCode"](command.variable_value_menu);
  18548. if (text) {
  18549. $(return_dom.find('.expression_elements')[0]).toggle();
  18550. $(return_dom.find('.textual_expression')[0]).text(text);
  18551. $(return_dom.find('.textual_expression')[0]).toggle();
  18552. $(this).toggleClass('unlock').toggleClass('lock');
  18553. command.lockexpression = !command.lockexpression;
  18554. }
  18555. }
  18556. });
  18557. return_dom.find('.button_remove_command').on('click', function () {
  18558. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, return_dom)) {
  18559. return_dom.fadeOut(400, function () {
  18560. return_dom.remove();
  18561. });
  18562. }
  18563. });
  18564. }
  18565. /***/ }),
  18566. /***/ "./js/visualUI/commands/switch.js":
  18567. /*!****************************************!*\
  18568. !*** ./js/visualUI/commands/switch.js ***!
  18569. \****************************************/
  18570. /*! exports provided: createFloatingCommand, renderCommand, renderCase */
  18571. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18572. "use strict";
  18573. __webpack_require__.r(__webpack_exports__);
  18574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCase", function() { return renderCase; });
  18577. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18578. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18579. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18580. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18581. function createFloatingCommand() {
  18582. return $('<div class="ui switch created_element"> <i class="ui icon small random"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_code_switch') + ' ( x ) { <br> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_code_case') + ' 1: <br> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_code_case') + ' 2: <br> } </span></div>');
  18583. }
  18584. function renderCommand(command, function_obj) {
  18585. var ret = '';
  18586. ret += '<div class="ui switch command_container"> <i class="ui icon small random command_drag" ></i> <i class="ui icon times red button_remove_command"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_code_switch') + ' ( <div class="ui variable_to_switch"></div> ) <div class="ui context_menu"></div> <div class="ui all_cases_div"></div></span>';
  18587. ret += '</div>';
  18588. var el = $(ret);
  18589. el.data('command', command);
  18590. addHandlers(command, function_obj, el);
  18591. _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  18592. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.variable_to_switch'), function_obj);
  18593. if (command.cases) {
  18594. for (var i = 0; i < command.cases.length; i++) {
  18595. renderCase(command.cases[i], command, function_obj, el.find('.all_cases_div'));
  18596. }
  18597. }
  18598. return el;
  18599. }
  18600. function renderCase(switchcase, command, function_obj, el) {
  18601. var casediv = $('<div class="ui case_div"><i class="ui icon times red button_remove_command"></i><span>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_code_case') + '</span> <div class="ui variable_case"></div>: <div class="case_commands_block"></div></div>');
  18602. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, switchcase.variable_value_menu, casediv.find('.variable_case'), function_obj);
  18603. casediv.data('switchcase', switchcase);
  18604. casediv.find('.case_commands_block').data('switchcase', switchcase);
  18605. el.append(casediv);
  18606. if (switchcase.commands_block) {
  18607. for (var j = 0; j < switchcase.commands_block.length; j++) {
  18608. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](switchcase.commands_block[j], $(casediv.find('.case_commands_block')[0]), 3, function_obj);
  18609. }
  18610. }
  18611. casediv.find('.button_remove_command').on('click', function () {
  18612. for (var i = 0; i < command.cases.length; i++) {
  18613. if (switchcase == command.cases[i]) {
  18614. delete command.cases[i];
  18615. command.cases.splice(i, 1);
  18616. casediv.remove();
  18617. break;
  18618. }
  18619. }
  18620. });
  18621. }
  18622. function addHandlers(command, function_obj, switch_dom) {
  18623. switch_dom.find('.button_remove_command').on('click', function () {
  18624. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, switch_dom)) {
  18625. switch_dom.fadeOut(400, function () {
  18626. switch_dom.remove();
  18627. });
  18628. }
  18629. });
  18630. }
  18631. /***/ }),
  18632. /***/ "./js/visualUI/commands/variable_value_menu.js":
  18633. /*!*****************************************************!*\
  18634. !*** ./js/visualUI/commands/variable_value_menu.js ***!
  18635. \*****************************************************/
  18636. /*! exports provided: VAR_OR_VALUE_TYPES, renderMenu */
  18637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18638. "use strict";
  18639. __webpack_require__.r(__webpack_exports__);
  18640. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VAR_OR_VALUE_TYPES", function() { return VAR_OR_VALUE_TYPES; });
  18641. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  18642. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18643. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18644. /* harmony import */ var _attribution__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attribution */ "./js/visualUI/commands/attribution.js");
  18645. /* harmony import */ var _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  18646. var VAR_OR_VALUE_TYPES = Object.freeze({
  18647. only_variable: 1,
  18648. only_value: 2,
  18649. only_function: 3,
  18650. variable_and_function: 4,
  18651. variable_and_value_opt: 5,
  18652. value_and_function: 6,
  18653. all: 7
  18654. });
  18655. function renderMenu(command, ref_object, dom_object, function_obj) {
  18656. var size_field = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
  18657. var expression_element = arguments.length > 5 ? arguments[5] : undefined;
  18658. // Verificar se o objeto atual trata-se de uma chamada de função e conferir se possui a quantidade correta de parâmetros
  18659. // Caso não possua, tem que adicionar as variáveis que servirão de parâmetros:
  18660. if (ref_object.function_called) {
  18661. if (ref_object.function_called.parameters_list) {
  18662. while (ref_object.function_called.parameters_list.length != ref_object.parameters_list.length) {
  18663. if (ref_object.parameters_list.length > ref_object.function_called.parameters_list.length) {
  18664. ref_object.parameters_list.pop();
  18665. } else {
  18666. ref_object.parameters_list.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true));
  18667. }
  18668. }
  18669. }
  18670. }
  18671. var menu_var_or_value = '<div class="ui dropdown menu_var_or_value_dom" data-varmenu="true"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18672. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_variable) {
  18673. menu_var_or_value = '<div class="ui dropdown menu_var_or_value_dom" data-varmenu="true"><div class="text"></div><i class="dropdown icon"></i><div class="menu menu_only_vars">';
  18674. menu_var_or_value += "</div>";
  18675. }
  18676. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.variable_and_function || ref_object.variable_and_value == VAR_OR_VALUE_TYPES.variable_and_value_opt || ref_object.variable_and_value == VAR_OR_VALUE_TYPES.all) {
  18677. menu_var_or_value += '<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("variable");
  18678. menu_var_or_value += '<div class="menu menu_only_vars">';
  18679. menu_var_or_value += "</div></div>";
  18680. }
  18681. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_value) {
  18682. menu_var_or_value = '<input type="text" class="width-dynamic" size="' + size_field + '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />';
  18683. }
  18684. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.variable_and_value_opt || ref_object.variable_and_value == VAR_OR_VALUE_TYPES.value_and_function || ref_object.variable_and_value == VAR_OR_VALUE_TYPES.all) {
  18685. menu_var_or_value += '<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_value + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_value") + "</div>";
  18686. }
  18687. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_function) {
  18688. menu_var_or_value = '<div class="ui dropdown menu_var_or_value_dom" data-varmenu="true"><div class="text"></div><i class="dropdown icon"></i><div class="menu menu_only_functions">';
  18689. menu_var_or_value += "</div>";
  18690. }
  18691. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.variable_and_function || ref_object.variable_and_value == VAR_OR_VALUE_TYPES.value_and_function || ref_object.variable_and_value == VAR_OR_VALUE_TYPES.all) {
  18692. menu_var_or_value += '<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_function + '"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_function");
  18693. menu_var_or_value += '<div class="menu menu_only_functions">';
  18694. menu_var_or_value += "</div></div>";
  18695. /* if (command.type == Models.COMMAND_TYPES.attribution) {
  18696. menu_var_or_value += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18697. menu_var_or_value += '<div class="menu">';
  18698. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18699. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18700. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18701. menu_var_or_value += '</div></div>';
  18702. }*/
  18703. }
  18704. menu_var_or_value += "</div></div>";
  18705. menu_var_or_value = $(menu_var_or_value);
  18706. menu_var_or_value.find('.width-dynamic').on('input', function () {
  18707. var input_field = $(this);
  18708. var inputWidth = input_field.textWidth() + 10;
  18709. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  18710. input_field.css({
  18711. width: inputWidth
  18712. });
  18713. }).trigger('input');
  18714. dom_object.append(menu_var_or_value);
  18715. ref_object.dom_object = menu_var_or_value;
  18716. addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  18717. addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  18718. addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  18719. addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  18720. if (ref_object.content || ref_object.function_called) {
  18721. if (ref_object.content) {
  18722. // Verificar se a variável ainda existe:
  18723. var variable_fun = isVarInProgram(ref_object.content, function_obj);
  18724. if (variable_fun) {
  18725. ref_object.content = variable_fun;
  18726. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  18727. } else {
  18728. if (ref_object.content && ref_object.content.type) {
  18729. ref_object.content = null;
  18730. appendSelectText(ref_object, menu_var_or_value);
  18731. } else {
  18732. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  18733. }
  18734. }
  18735. } else if (ref_object.function_called) {
  18736. // Verificar se a função ainda existe:
  18737. var ret_function = isFunctionInProgram(ref_object.function_called);
  18738. if (ret_function) {
  18739. ref_object.function_called = ret_function;
  18740. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  18741. } else {
  18742. ref_object.content = null;
  18743. ref_object.row = null;
  18744. ref_object.column = null;
  18745. delete ref_object.function_called;
  18746. delete ref_object.parameters_list;
  18747. appendSelectText(ref_object, menu_var_or_value);
  18748. }
  18749. }
  18750. } else {
  18751. appendSelectText(ref_object, menu_var_or_value);
  18752. }
  18753. }
  18754. function appendSelectText(ref_object, menu_var_or_value) {
  18755. switch (ref_object.variable_and_value) {
  18756. case VAR_OR_VALUE_TYPES.only_variable:
  18757. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_var") + "</i>");
  18758. break;
  18759. case VAR_OR_VALUE_TYPES.all:
  18760. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  18761. break;
  18762. case VAR_OR_VALUE_TYPES.variable_and_function:
  18763. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  18764. break;
  18765. case VAR_OR_VALUE_TYPES.only_function:
  18766. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_function") + "</i>");
  18767. break;
  18768. }
  18769. }
  18770. function isFunctionInProgram(function_called_obj) {
  18771. if (function_called_obj.name) {
  18772. if (window.program_obj.functions) {
  18773. for (var i = 0; i < window.program_obj.functions.length; i++) {
  18774. if (window.program_obj.functions[i] == function_called_obj) {
  18775. return window.program_obj.functions[i];
  18776. }
  18777. }
  18778. for (var i = 0; i < window.program_obj.functions.length; i++) {
  18779. if (window.program_obj.functions[i].name == function_called_obj.name) {
  18780. return window.program_obj.functions[i];
  18781. }
  18782. }
  18783. }
  18784. } else if (function_called_obj.identifier) {
  18785. for (var i = 0; i < window.system_functions.length; i++) {
  18786. if (window.system_functions[i].identifier == function_called_obj.identifier) {
  18787. return window.system_functions[i];
  18788. }
  18789. }
  18790. }
  18791. return null;
  18792. }
  18793. function isVarInProgram(var_obj, function_obj) {
  18794. // Verify in locals:
  18795. if (function_obj.variables_list) {
  18796. for (var i = 0; i < function_obj.variables_list.length; i++) {
  18797. if (function_obj.variables_list[i] == var_obj) {
  18798. return function_obj.variables_list[i];
  18799. }
  18800. }
  18801. } // Verify in parameters:
  18802. if (function_obj.parameters_list) {
  18803. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  18804. if (function_obj.parameters_list[i] == var_obj) {
  18805. return function_obj.parameters_list[i];
  18806. }
  18807. }
  18808. } // Verify in globals:
  18809. if (window.program_obj.globals) {
  18810. for (var i = 0; i < window.program_obj.globals.length; i++) {
  18811. if (window.program_obj.globals[i] == var_obj) {
  18812. return window.program_obj.globals[i];
  18813. }
  18814. }
  18815. } // If not found, verify if the reference was lost
  18816. if (var_obj) {
  18817. if (function_obj.variables_list) {
  18818. for (var i = 0; i < function_obj.variables_list.length; i++) {
  18819. if (function_obj.variables_list[i].name == var_obj.name) {
  18820. return function_obj.variables_list[i];
  18821. }
  18822. }
  18823. }
  18824. if (function_obj.parameters_list) {
  18825. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  18826. if (function_obj.parameters_list[i].name == var_obj.name) {
  18827. return function_obj.parameters_list[i];
  18828. }
  18829. }
  18830. }
  18831. if (window.program_obj.globals) {
  18832. for (var i = 0; i < window.program_obj.globals.length; i++) {
  18833. if (window.program_obj.globals[i].name == var_obj.name) {
  18834. return window.program_obj.globals[i];
  18835. }
  18836. }
  18837. }
  18838. }
  18839. return null;
  18840. }
  18841. function renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element) {
  18842. if (ref_object.function_called) {
  18843. menu_var_or_value.remove();
  18844. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  18845. } else if (ref_object.content.type) {
  18846. menu_var_or_value.remove();
  18847. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  18848. } else {
  18849. menu_var_or_value.remove();
  18850. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  18851. }
  18852. }
  18853. function variableValueMenuCode(command, variable_obj, dom_object, function_obj, menu_var_or_value, expression_element) {
  18854. if (variable_obj.content || variable_obj.function_called) {
  18855. // Verificar se a variável ainda existe:
  18856. var var_fun = isVarInProgram(variable_obj.content, function_obj);
  18857. if (var_fun) {
  18858. variable_obj.content = var_fun;
  18859. } else {
  18860. if (variable_obj.content && variable_obj.content.type) {
  18861. variable_obj.content = null;
  18862. appendSelectText(variable_obj, menu_var_or_value);
  18863. }
  18864. }
  18865. } else {
  18866. appendSelectText(variable_obj, menu_var_or_value);
  18867. }
  18868. if (variable_obj.content == null && variable_obj.function_called == null) {
  18869. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18870. return;
  18871. }
  18872. var ret = "";
  18873. if (variable_obj.function_called) {
  18874. if (variable_obj.function_called.parameters_list == null || variable_obj.function_called.length == 0) {
  18875. menu_var_or_value.find(".text").text(" ");
  18876. dom_object.find(".menu_var_or_value_dom").remove();
  18877. var parameters_menu;
  18878. if (variable_obj.function_called.name) {
  18879. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  18880. } else {
  18881. parameters_menu = '<div class="parameters_function_called"> <i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + "</i> <span> ( </span>";
  18882. }
  18883. parameters_menu += "<span> ) </span></div>";
  18884. parameters_menu = $(parameters_menu);
  18885. dom_object.append(parameters_menu);
  18886. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18887. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18888. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18889. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18890. context_menu += '<div class="menu">';
  18891. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18892. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18893. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18894. context_menu += '</div></div>';
  18895. }*/
  18896. context_menu += "</div></div>";
  18897. context_menu = $(context_menu);
  18898. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  18899. context_menu.dropdown({
  18900. onChange: function onChange(value, text, $selectedItem) {
  18901. if ($selectedItem.data("clear")) {
  18902. dom_object.text("");
  18903. variable_obj.content = null;
  18904. variable_obj.row = null;
  18905. variable_obj.column = null;
  18906. delete variable_obj.function_called;
  18907. delete variable_obj.parameters_list;
  18908. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18909. }
  18910. if ($selectedItem.data("exp")) {
  18911. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18912. }
  18913. },
  18914. selectOnKeydown: false
  18915. });
  18916. } else {
  18917. menu_var_or_value.find(".text").text(" ");
  18918. dom_object.find(".menu_var_or_value_dom").remove();
  18919. var parameters_menu;
  18920. if (variable_obj.function_called.name) {
  18921. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  18922. } else {
  18923. parameters_menu = '<div class="parameters_function_called"> <i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + "</i> <span> ( </span>";
  18924. }
  18925. for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
  18926. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  18927. if (j + 1 != variable_obj.function_called.parameters_list.length) {
  18928. parameters_menu += " , ";
  18929. }
  18930. }
  18931. parameters_menu += "<span> ) </span></div>";
  18932. parameters_menu = $(parameters_menu);
  18933. dom_object.append(parameters_menu);
  18934. for (var _j = 0; _j < variable_obj.function_called.parameters_list.length; _j++) {
  18935. renderMenu(command, variable_obj.parameters_list[_j], parameters_menu.find(".parameter_" + _j), function_obj, 2, expression_element);
  18936. }
  18937. var _context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18938. _context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18939. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18940. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18941. context_menu += '<div class="menu">';
  18942. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18943. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18944. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18945. context_menu += '</div></div>';
  18946. }*/
  18947. _context_menu += "</div></div>";
  18948. _context_menu = $(_context_menu);
  18949. _context_menu.insertAfter(parameters_menu);
  18950. _context_menu.dropdown({
  18951. onChange: function onChange(value, text, $selectedItem) {
  18952. if ($selectedItem.data("clear")) {
  18953. dom_object.text("");
  18954. variable_obj.content = null;
  18955. variable_obj.row = null;
  18956. variable_obj.column = null;
  18957. delete variable_obj.function_called;
  18958. delete variable_obj.parameters_list;
  18959. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18960. }
  18961. if ($selectedItem.data("exp")) {
  18962. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18963. }
  18964. },
  18965. selectOnKeydown: false
  18966. });
  18967. }
  18968. } else if (variable_obj.content.type) {
  18969. var variable_render = "";
  18970. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  18971. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  18972. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  18973. variable_render += "</div>";
  18974. variable_render = $(variable_render);
  18975. dom_object.append(variable_render);
  18976. var _context_menu2 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18977. _context_menu2 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18978. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18979. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18980. context_menu += '<div class="menu">';
  18981. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18982. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18983. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18984. context_menu += '</div></div>';
  18985. }*/
  18986. _context_menu2 += "</div></div>";
  18987. _context_menu2 = $(_context_menu2);
  18988. variable_render.append(_context_menu2);
  18989. _context_menu2.dropdown({
  18990. onChange: function onChange(value, text, $selectedItem) {
  18991. if ($selectedItem.data("clear")) {
  18992. dom_object.text("");
  18993. variable_obj.content = null;
  18994. variable_obj.row = null;
  18995. variable_obj.column = null;
  18996. delete variable_obj.function_called;
  18997. delete variable_obj.parameters_list;
  18998. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18999. }
  19000. if ($selectedItem.data("exp")) {
  19001. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19002. }
  19003. },
  19004. selectOnKeydown: false
  19005. });
  19006. if (!variable_obj.column) {
  19007. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19008. }
  19009. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  19010. } else if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  19011. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  19012. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span>';
  19013. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ] </span>';
  19014. variable_render += "</div>";
  19015. variable_render = $(variable_render);
  19016. dom_object.append(variable_render);
  19017. var _context_menu3 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19018. _context_menu3 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19019. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19020. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19021. context_menu += '<div class="menu">';
  19022. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19023. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19024. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19025. context_menu += '</div></div>';
  19026. }*/
  19027. _context_menu3 += "</div></div>";
  19028. _context_menu3 = $(_context_menu3);
  19029. variable_render.append(_context_menu3);
  19030. _context_menu3.dropdown({
  19031. onChange: function onChange(value, text, $selectedItem) {
  19032. if ($selectedItem.data("clear")) {
  19033. dom_object.text("");
  19034. variable_obj.content = null;
  19035. variable_obj.row = null;
  19036. variable_obj.column = null;
  19037. delete variable_obj.function_called;
  19038. delete variable_obj.parameters_list;
  19039. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19040. }
  19041. if ($selectedItem.data("exp")) {
  19042. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19043. }
  19044. },
  19045. selectOnKeydown: false
  19046. });
  19047. if (!variable_obj.column) {
  19048. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19049. }
  19050. if (!variable_obj.row) {
  19051. variable_obj.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19052. }
  19053. variableValueMenuCode(command, variable_obj.row, $(variable_render.find(".row_container")), function_obj, menu_var_or_value, expression_element);
  19054. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  19055. } else {
  19056. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  19057. variable_render += "</div>";
  19058. variable_render = $(variable_render);
  19059. dom_object.append(variable_render);
  19060. var _context_menu4 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19061. _context_menu4 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19062. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  19063. console.log('dom_object6');
  19064. console.log(dom_object);
  19065. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19066. context_menu += '<div class="menu">';
  19067. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19068. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19069. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19070. context_menu += '</div></div>';
  19071. }*/
  19072. _context_menu4 += "</div></div>";
  19073. _context_menu4 = $(_context_menu4);
  19074. variable_render.append(_context_menu4);
  19075. _context_menu4.dropdown({
  19076. onChange: function onChange(value, text, $selectedItem) {
  19077. if ($selectedItem.data("clear")) {
  19078. dom_object.text("");
  19079. variable_obj.content = null;
  19080. variable_obj.row = null;
  19081. variable_obj.column = null;
  19082. delete variable_obj.function_called;
  19083. delete variable_obj.parameters_list;
  19084. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19085. }
  19086. if ($selectedItem.data("exp")) {
  19087. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19088. }
  19089. },
  19090. selectOnKeydown: false
  19091. });
  19092. }
  19093. } else {
  19094. var _variable_render;
  19095. _variable_render = '<div class="variable_rendered"> <span class="var_name">';
  19096. if (isNaN(variable_obj.content)) {
  19097. _variable_render += variable_obj.content.replaceAll(" ", "&nbsp;");
  19098. } else {
  19099. _variable_render += variable_obj.content;
  19100. }
  19101. _variable_render += "</span>";
  19102. _variable_render += "</div>";
  19103. _variable_render = $(_variable_render);
  19104. dom_object.append(_variable_render);
  19105. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19106. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19107. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19108. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19109. context_menu += '<div class="menu">';
  19110. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19111. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19112. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19113. context_menu += '</div></div>';
  19114. }*/
  19115. context_menu += "</div></div>";
  19116. context_menu = $(context_menu);
  19117. if (variable_obj.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19118. context_menu.insertAfter(_variable_render);
  19119. }
  19120. context_menu.dropdown({
  19121. onChange: function onChange(value, text, $selectedItem) {
  19122. if ($selectedItem.data("clear")) {
  19123. dom_object.text("");
  19124. variable_obj.content = null;
  19125. variable_obj.row = null;
  19126. variable_obj.column = null;
  19127. delete variable_obj.function_called;
  19128. delete variable_obj.parameters_list;
  19129. dom_object.find(".value_rendered").remove();
  19130. dom_object.find(".context_menu_clear").remove();
  19131. dom_object.find(".width-dynamic-minus").remove();
  19132. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19133. }
  19134. if ($selectedItem.data("exp")) {
  19135. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19136. }
  19137. },
  19138. selectOnKeydown: false
  19139. });
  19140. _variable_render.on("click", function (e) {
  19141. _variable_render.remove();
  19142. _variable_render.empty();
  19143. _variable_render.remove();
  19144. dom_object.empty();
  19145. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19146. openInputToValue(command, variable_obj, dom_object, menu_var_or_value, function_obj, expression_element);
  19147. });
  19148. }
  19149. }
  19150. function addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19151. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  19152. sub_menu.append('<div class="divider"></div><div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_header_ivprog_functions") + "</div>");
  19153. sub_menu.append('<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_menu_functions_math") + '<div class="menu menu_math_functions"></div></div>');
  19154. sub_menu.append('<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_menu_functions_text") + '<div class="menu menu_text_functions"></div></div>');
  19155. sub_menu.append('<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_menu_functions_array") + '<div class="menu menu_arrangement_functions"></div></div>');
  19156. sub_menu.append('<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_menu_functions_conversion") + '<div class="menu menu_conversion_functions"></div></div>'); // Insert Math functions:
  19157. for (var i = 0; i < window.system_functions.length; i++) {
  19158. var t = $('<div class="item"></div>');
  19159. t.data("function_reference", window.system_functions[i]);
  19160. t.data("option", VAR_OR_VALUE_TYPES.only_function);
  19161. t.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(window.system_functions[i].identifier));
  19162. switch (window.system_functions[i].category) {
  19163. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].math:
  19164. sub_menu.find(".menu_math_functions").append(t);
  19165. break;
  19166. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].text:
  19167. sub_menu.find(".menu_text_functions").append(t);
  19168. break;
  19169. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement:
  19170. sub_menu.find(".menu_arrangement_functions").append(t);
  19171. break;
  19172. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion:
  19173. sub_menu.find(".menu_conversion_functions").append(t);
  19174. break;
  19175. }
  19176. }
  19177. }
  19178. function addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19179. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  19180. sub_menu.text("");
  19181. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19182. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_function + '">' + window.program_obj.functions[i].name + " </div>");
  19183. temp.data("function_reference", window.program_obj.functions[i]);
  19184. sub_menu.append(temp);
  19185. }
  19186. }
  19187. function addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19188. var sub_menu = menu_var_or_value.find(".menu_only_vars");
  19189. sub_menu.text("");
  19190. var is_there = false;
  19191. if (window.program_obj.globals) {
  19192. if (ref_object.include_constant) {
  19193. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19194. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  19195. temp.data("variable_reference", window.program_obj.globals[i]);
  19196. sub_menu.append(temp);
  19197. is_there = true;
  19198. }
  19199. } else {
  19200. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19201. if (!window.program_obj.globals[i].is_constant) {
  19202. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  19203. temp.data("variable_reference", window.program_obj.globals[i]);
  19204. sub_menu.append(temp);
  19205. is_there = true;
  19206. }
  19207. }
  19208. }
  19209. }
  19210. if (function_obj.parameters_list) {
  19211. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  19212. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.parameters_list[i].name + " </div>");
  19213. temp.data("variable_reference", function_obj.parameters_list[i]);
  19214. sub_menu.append(temp);
  19215. is_there = true;
  19216. }
  19217. }
  19218. if (function_obj.variables_list) {
  19219. for (var i = 0; i < function_obj.variables_list.length; i++) {
  19220. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.variables_list[i].name + " </div>");
  19221. temp.data("variable_reference", function_obj.variables_list[i]);
  19222. sub_menu.append(temp);
  19223. is_there = true;
  19224. }
  19225. }
  19226. if (!is_there) {
  19227. sub_menu.append($('<div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable") + "</div>"));
  19228. sub_menu.append($('<div class="item disabled">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable_instruction") + "</div>"));
  19229. }
  19230. }
  19231. function addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  19232. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19233. menu_var_or_value.dropdown({
  19234. onChange: function onChange(value, text, $selectedItem) {
  19235. dom_object.find(".var_name").remove();
  19236. switch ($selectedItem.data("option")) {
  19237. case VAR_OR_VALUE_TYPES.only_function:
  19238. openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("function_reference"), expression_element);
  19239. break;
  19240. case VAR_OR_VALUE_TYPES.only_value:
  19241. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19242. break;
  19243. case VAR_OR_VALUE_TYPES.only_variable:
  19244. openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("variable_reference"), expression_element);
  19245. break;
  19246. }
  19247. if ($selectedItem.data("exp")) {
  19248. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19249. }
  19250. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  19251. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19252. }
  19253. },
  19254. selectOnKeydown: false
  19255. });
  19256. }
  19257. dom_object.find(".width-dynamic").on("input", function () {
  19258. var inputWidth = $(this).textWidth() + 10;
  19259. $(this).focus();
  19260. var tmpStr = $(this).val();
  19261. $(this).val("");
  19262. $(this).val(tmpStr);
  19263. $(this).css({
  19264. width: inputWidth
  19265. });
  19266. }).trigger("input");
  19267. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  19268. dom_object.parent().on("click", function (e) {
  19269. dom_object.find(".value_rendered").remove();
  19270. dom_object.find(".value_rendered").empty();
  19271. dom_object.find(".value_rendered").remove();
  19272. dom_object.empty();
  19273. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19274. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19275. });
  19276. }
  19277. }
  19278. function openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, function_selected, expression_element) {
  19279. ref_object.function_called = function_selected;
  19280. ref_object.parameters_list = [];
  19281. if (function_selected.parameters_list != null && function_selected.parameters_list.length > 0) {
  19282. menu_var_or_value.find(".text").text(" ");
  19283. dom_object.find(".menu_var_or_value_dom").remove();
  19284. var parameters_menu;
  19285. if (function_selected.name) {
  19286. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  19287. } else {
  19288. parameters_menu = '<div class="parameters_function_called"> <i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(function_selected.identifier, function_selected.category) + "</i> <span> ( </span>";
  19289. }
  19290. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  19291. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  19292. if (j + 1 != function_selected.parameters_list.length) {
  19293. parameters_menu += " , ";
  19294. }
  19295. }
  19296. parameters_menu += "<span> ) </span></div>";
  19297. parameters_menu = $(parameters_menu);
  19298. dom_object.append(parameters_menu);
  19299. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  19300. var temp;
  19301. if (function_selected.parameters_list[j].dimensions > 0) {
  19302. temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.variable_and_function, null, null, null, true, function_selected.parameters_list[j].dimensions);
  19303. } else {
  19304. temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19305. }
  19306. ref_object.parameters_list.push(temp);
  19307. renderMenu(command, temp, parameters_menu.find(".parameter_" + j), function_obj, 2, expression_element);
  19308. }
  19309. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19310. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19311. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19312. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19313. context_menu += '<div class="menu">';
  19314. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19315. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19316. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19317. context_menu += '</div></div>';
  19318. }*/
  19319. context_menu += "</div></div>";
  19320. context_menu = $(context_menu);
  19321. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  19322. context_menu.dropdown({
  19323. onChange: function onChange(value, text, $selectedItem) {
  19324. if ($selectedItem.data("clear")) {
  19325. dom_object.text("");
  19326. ref_object.content = null;
  19327. ref_object.row = null;
  19328. ref_object.column = null;
  19329. delete ref_object.function_called;
  19330. delete ref_object.parameters_list;
  19331. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19332. }
  19333. if ($selectedItem.data("exp")) {
  19334. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19335. }
  19336. },
  19337. selectOnKeydown: false
  19338. });
  19339. } else {
  19340. menu_var_or_value.find(".text").text(" ");
  19341. dom_object.find(".menu_var_or_value_dom").remove();
  19342. var parameters_menu;
  19343. if (function_selected.name) {
  19344. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  19345. } else {
  19346. parameters_menu = '<div class="parameters_function_called"> <i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(function_selected.identifier, function_selected.category) + "</i> <span> ( </span>";
  19347. }
  19348. parameters_menu += "<span> ) </span></div>";
  19349. parameters_menu = $(parameters_menu);
  19350. dom_object.append(parameters_menu);
  19351. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19352. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19353. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19354. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19355. context_menu += '<div class="menu">';
  19356. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19357. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19358. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19359. context_menu += '</div></div>';
  19360. }*/
  19361. context_menu += "</div></div>";
  19362. context_menu = $(context_menu);
  19363. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  19364. context_menu.dropdown({
  19365. onChange: function onChange(value, text, $selectedItem) {
  19366. if ($selectedItem.data("clear")) {
  19367. dom_object.text("");
  19368. ref_object.content = null;
  19369. ref_object.row = null;
  19370. ref_object.column = null;
  19371. delete ref_object.function_called;
  19372. delete ref_object.parameters_list;
  19373. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19374. }
  19375. if ($selectedItem.data("exp")) {
  19376. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19377. }
  19378. },
  19379. selectOnKeydown: false
  19380. });
  19381. }
  19382. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19383. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  19384. }*/
  19385. }
  19386. function openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected, expression_element) {
  19387. ref_object.content = variable_selected;
  19388. menu_var_or_value.find(".text").text(" ");
  19389. dom_object.find(".menu_var_or_value_dom").remove();
  19390. var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_selected.name + "</span>";
  19391. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  19392. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  19393. }
  19394. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  19395. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span> ';
  19396. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  19397. }
  19398. variable_render += "</div>";
  19399. variable_render = $(variable_render);
  19400. dom_object.append(variable_render);
  19401. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  19402. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19403. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  19404. }
  19405. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  19406. ref_object.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19407. renderMenu(command, ref_object.row, variable_render.find(".row_container"), function_obj, 2, expression_element);
  19408. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19409. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  19410. }
  19411. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19412. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19413. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  19414. console.log("dom_object 10: ");
  19415. console.log(dom_object);
  19416. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19417. context_menu += '<div class="menu">';
  19418. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19419. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19420. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19421. context_menu += '</div></div>';
  19422. }*/
  19423. context_menu += "</div></div>";
  19424. context_menu = $(context_menu);
  19425. context_menu.insertAfter(dom_object.find(".variable_rendered"));
  19426. context_menu.dropdown({
  19427. onChange: function onChange(value, text, $selectedItem) {
  19428. if ($selectedItem.data("clear")) {
  19429. dom_object.text("");
  19430. ref_object.content = null;
  19431. ref_object.row = null;
  19432. ref_object.column = null;
  19433. delete ref_object.function_called;
  19434. delete ref_object.parameters_list;
  19435. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19436. }
  19437. if ($selectedItem.data("exp")) {
  19438. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19439. }
  19440. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  19441. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageClearExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19442. }
  19443. },
  19444. selectOnKeydown: false
  19445. });
  19446. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19447. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected);
  19448. }*/
  19449. }
  19450. function openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  19451. if (ref_object.content == null) {
  19452. ref_object.content = "";
  19453. }
  19454. menu_var_or_value.find(".text").text(" ");
  19455. var field = $('<input type="text" size="2" class="width-dynamic-minus" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />');
  19456. field.insertBefore(dom_object.find(".menu_var_or_value_dom"));
  19457. field.on('input', function () {
  19458. var input_field = $(this);
  19459. var inputWidth = input_field.textWidth() + 10;
  19460. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  19461. input_field.css({
  19462. width: inputWidth
  19463. });
  19464. }).trigger('input');
  19465. var rendered = $('<div class="value_rendered"></div>');
  19466. rendered.insertBefore(field);
  19467. field.focus();
  19468. field.val(ref_object.content);
  19469. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19470. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19471. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19472. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19473. context_menu += '<div class="menu">';
  19474. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19475. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19476. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19477. context_menu += '</div></div>';
  19478. }*/
  19479. context_menu += "</div></div>";
  19480. context_menu = $(context_menu);
  19481. dom_object.find(".menu_var_or_value_dom").remove();
  19482. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19483. context_menu.insertAfter(field);
  19484. }
  19485. context_menu.dropdown({
  19486. onChange: function onChange(value, text, $selectedItem) {
  19487. if ($selectedItem.data("clear")) {
  19488. dom_object.text("");
  19489. dom_object.find(".value_rendered").remove();
  19490. dom_object.find(".context_menu_clear").remove();
  19491. dom_object.find(".width-dynamic-minus").remove();
  19492. ref_object.content = null;
  19493. ref_object.row = null;
  19494. ref_object.column = null;
  19495. delete ref_object.function_called;
  19496. delete ref_object.parameters_list;
  19497. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19498. }
  19499. if ($selectedItem.data("exp")) {
  19500. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19501. }
  19502. },
  19503. selectOnKeydown: false
  19504. });
  19505. dom_object.find(".width-dynamic-minus").focusout(function () {
  19506. /*if (
  19507. $(this)
  19508. .val()
  19509. .trim()
  19510. ) {
  19511. ref_object.content = $(this)
  19512. .val()
  19513. .trim();
  19514. }*/
  19515. ref_object.content = $(this).val();
  19516. if (isNaN(ref_object.content)) {
  19517. rendered.html(ref_object.content.replaceAll(" ", "&nbsp;"));
  19518. } else {
  19519. rendered.text(ref_object.content);
  19520. }
  19521. $(this).remove();
  19522. });
  19523. dom_object.find(".width-dynamic-minus").on("keydown", function (e) {
  19524. var code = e.keyCode || e.which;
  19525. if (code == 13) {
  19526. /*if (
  19527. $(this)
  19528. .val()
  19529. .trim()
  19530. ) {
  19531. ref_object.content = $(this)
  19532. .val()
  19533. .trim();
  19534. }*/
  19535. ref_object.content = $(this).val();
  19536. if (isNaN(ref_object.content)) {
  19537. rendered.html(ref_object.content.replaceAll(" ", "&nbsp;"));
  19538. } else {
  19539. rendered.text(ref_object.content);
  19540. }
  19541. $(this).remove();
  19542. }
  19543. if (code == 27) {
  19544. if (isNaN(ref_object.content)) {
  19545. rendered.html(ref_object.content.replaceAll(" ", "&nbsp;"));
  19546. } else {
  19547. rendered.text(ref_object.content);
  19548. }
  19549. $(this).remove();
  19550. }
  19551. });
  19552. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  19553. /*rendered.parent().on('click', function(e) {
  19554. rendered.parent().off();
  19555. console.log("TTT14");
  19556. rendered.remove();
  19557. rendered.empty();
  19558. rendered.remove();
  19559. dom_object.empty();
  19560. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19561. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element)
  19562. });*/
  19563. }
  19564. rendered.on("click", function (e) {
  19565. rendered.empty();
  19566. rendered.remove();
  19567. dom_object.empty();
  19568. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19569. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19570. });
  19571. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19572. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  19573. }*/
  19574. }
  19575. $.fn.textWidth = function (text, font) {
  19576. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $("<span>").hide().appendTo(document.body);
  19577. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr("placeholder")).css("font", font || this.css("font"));
  19578. return $.fn.textWidth.fakeEl.width();
  19579. };
  19580. /***/ }),
  19581. /***/ "./js/visualUI/commands/whiletrue.js":
  19582. /*!*******************************************!*\
  19583. !*** ./js/visualUI/commands/whiletrue.js ***!
  19584. \*******************************************/
  19585. /*! exports provided: createFloatingCommand, renderCommand */
  19586. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19587. "use strict";
  19588. __webpack_require__.r(__webpack_exports__);
  19589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19591. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19592. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19593. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  19594. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  19595. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19596. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  19597. function createFloatingCommand() {
  19598. return $('<div class="ui whiletrue created_element"> <i class="ui icon small sync"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_while') + ' ( x < 10 ) <br> </span></div>');
  19599. }
  19600. function renderCommand(command, function_obj) {
  19601. var ret = '';
  19602. ret += '<div class="ui whiletrue command_container"> <i class="ui icon small sync command_drag"></i> <i class="ui icon times red button_remove_command"></i><button class="ui icon button minimize_block_button tiny"><i class="icon window minimize"></i></button> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_while') + ' </span>';
  19603. ret += '<span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="textual_expression"></span> <span class="span_command_spec"> ) </span>';
  19604. ret += ' </span>';
  19605. ret += '<i class="ui icon unlock button_alternate_expression"></i> <div class="ui context_menu"></div>';
  19606. ret += '<div class="ui block_commands">';
  19607. ret += '</div>';
  19608. ret += '<span> </span>';
  19609. ret += '</div>';
  19610. var el = $(ret);
  19611. el.data('command', command);
  19612. el.find('.block_commands').data('command', command);
  19613. addHandlers(command, function_obj, el);
  19614. _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
  19615. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  19616. if (command.commands_block) {
  19617. for (var j = 0; j < command.commands_block.length; j++) {
  19618. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  19619. }
  19620. }
  19621. if (command.lockexpression) {
  19622. if (command.expression) {
  19623. try {
  19624. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  19625. if (text) {
  19626. $(el.find('.conditional_expression')[0]).toggle();
  19627. $(el.find('.textual_expression')[0]).text(text);
  19628. $(el.find('.textual_expression')[0]).toggle();
  19629. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19630. }
  19631. } catch (e) {
  19632. command.lockexpression = false;
  19633. }
  19634. }
  19635. }
  19636. return el;
  19637. }
  19638. function addHandlers(command, function_obj, whiletrue_dom) {
  19639. whiletrue_dom.find('.minimize_block_button').on('click', function (evt) {
  19640. whiletrue_dom.children('.ui.block_commands').toggle();
  19641. command.collapsed = !command.collapsed;
  19642. });
  19643. $(whiletrue_dom.find('.textual_expression')[0]).toggle();
  19644. whiletrue_dom.find('.button_alternate_expression').on('click', function () {
  19645. if (command.expression) {
  19646. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  19647. if (text) {
  19648. $(whiletrue_dom.find('.conditional_expression')[0]).toggle();
  19649. $(whiletrue_dom.find('.textual_expression')[0]).text(text);
  19650. $(whiletrue_dom.find('.textual_expression')[0]).toggle();
  19651. $(this).toggleClass('unlock').toggleClass('lock');
  19652. command.lockexpression = !command.lockexpression;
  19653. }
  19654. }
  19655. });
  19656. whiletrue_dom.find('.button_remove_command').on('click', function () {
  19657. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, whiletrue_dom)) {
  19658. whiletrue_dom.fadeOut(400, function () {
  19659. whiletrue_dom.remove();
  19660. });
  19661. }
  19662. });
  19663. }
  19664. /***/ }),
  19665. /***/ "./js/visualUI/commands/writer.js":
  19666. /*!****************************************!*\
  19667. !*** ./js/visualUI/commands/writer.js ***!
  19668. \****************************************/
  19669. /*! exports provided: createFloatingCommand, renderCommand, addContent */
  19670. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19671. "use strict";
  19672. __webpack_require__.r(__webpack_exports__);
  19673. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19675. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContent", function() { return addContent; });
  19676. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19677. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19678. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19679. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19680. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19681. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  19682. function createFloatingCommand() {
  19683. return $('<div class="ui writer created_element"> <i class="ui icon small upload"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_command_write") + " var </span></div>");
  19684. }
  19685. function renderCommand(command, function_obj) {
  19686. var ret = "<div class=\"ui writer command_container\">\n <i class=\"ui icon small upload command_drag\"></i>\n <i class=\"ui icon times red button_remove_command\"></i>\n <span class=\"span_command_spec\">".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_command_write"), "\n ( </span><div class=\"all_elements_write\"></div> <span class=\"textual_expression\"></span>\n <span class=\"close_parentheses span_command_spec\">)</span>\n <img data-state=\"").concat(command.newline ? "on" : "false", "\" src=\"").concat(command.newline ? "img/new_line.svg" : "img/no_new_line.svg", "\" class=\"ivprog_newline_btn\"/> \n <i class=\"ui icon unlock button_alternate_expression\"></i>\n </div>");
  19687. var el = $(ret);
  19688. el.data("command", command); //renderExpression (command, function_obj, div_to_render, expression_array)
  19689. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find(".all_elements_write"), command.content);
  19690. addHandlers(command, function_obj, el);
  19691. if (command.content && command.lockexpression) {
  19692. try {
  19693. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.content);
  19694. if (text) {
  19695. $(el.find('.all_elements_write')[0]).toggle();
  19696. $(el.find('.textual_expression')[0]).text(text);
  19697. $(el.find('.textual_expression')[0]).toggle();
  19698. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19699. }
  19700. } catch (e) {
  19701. command.lockexpression = false;
  19702. }
  19703. }
  19704. return el;
  19705. }
  19706. function addHandlersManager(command, _function_obj, _writer_dom, item_div, content_element) {
  19707. item_div.find(".times").on("click", function () {
  19708. for (var i = 0; i < command.content.length; i++) {
  19709. if (command.content[i] == content_element) {
  19710. delete command.content[i];
  19711. command.content.splice(i, 1);
  19712. item_div.children().off();
  19713. item_div.off();
  19714. item_div.fadeOut();
  19715. if (command.content.length > 0) {
  19716. item_div.next(".icon_add_item_to_writer").fadeOut();
  19717. }
  19718. break;
  19719. }
  19720. }
  19721. });
  19722. }
  19723. function addHandlers(command, function_obj, writer_dom) {
  19724. $(writer_dom.find('.textual_expression')[0]).toggle();
  19725. writer_dom.find('.button_alternate_expression').on('click', function () {
  19726. if (command.content) {
  19727. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.content);
  19728. if (text) {
  19729. $(writer_dom.find('.all_elements_write')[0]).toggle();
  19730. $(writer_dom.find('.textual_expression')[0]).text(text);
  19731. $(writer_dom.find('.textual_expression')[0]).toggle();
  19732. $(this).toggleClass('unlock').toggleClass('lock');
  19733. command.lockexpression = !command.lockexpression;
  19734. }
  19735. }
  19736. });
  19737. writer_dom.find(".button_remove_command").on("click", function () {
  19738. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, writer_dom)) {
  19739. writer_dom.fadeOut(400, function () {
  19740. writer_dom.remove();
  19741. });
  19742. }
  19743. });
  19744. Sortable.create(writer_dom.find(".all_elements_write")[0], {
  19745. handle: ".ellipsis",
  19746. animation: 100,
  19747. ghostClass: "ghost",
  19748. group: "writer_" + Math.floor(Math.random() * 10000000),
  19749. draggable: ".div_parent_handler",
  19750. onEnd: function onEnd(evt) {
  19751. command.content.splice(evt.newIndex, 0, command.content.splice(evt.oldIndex, 1)[0]);
  19752. writer_dom.empty();
  19753. writer_dom.replaceWith(renderCommand(command, function_obj));
  19754. }
  19755. }); // Attach event handles for the newline button
  19756. var newlineBtn = writer_dom.find(".ivprog_newline_btn");
  19757. newlineBtn.on("click", function () {
  19758. var state = this.dataset.state;
  19759. if (state === "on") {
  19760. this.dataset.state = "off";
  19761. command.newline = false;
  19762. this.setAttribute("src", "img/no_new_line.svg");
  19763. } else {
  19764. this.dataset.state = "on";
  19765. command.newline = true;
  19766. this.setAttribute("src", "img/new_line.svg");
  19767. }
  19768. writer_dom.data("command", command);
  19769. setPopup(newlineBtn, command.newline);
  19770. }); // Attach jquery popup
  19771. setPopup(newlineBtn, command.newline);
  19772. }
  19773. function setPopup(element, state) {
  19774. if (element.popup("exists")) {
  19775. element.popup("destroy");
  19776. }
  19777. var content = state ? _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("write_command_newline_on") : _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("write_command_newline_off");
  19778. element.popup({
  19779. content: content,
  19780. delay: {
  19781. show: 750,
  19782. hide: 0
  19783. }
  19784. });
  19785. }
  19786. function _addHandlerIconAdd(dom_object, command, function_obj) {
  19787. var insert_after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  19788. var after_which = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  19789. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  19790. if (!insert_after) {
  19791. dom_object.append(icon_add_item);
  19792. } else {
  19793. icon_add_item.insertAfter(after_which);
  19794. }
  19795. icon_add_item.on("click", function (_event) {
  19796. var div_parent_with_handler = $('<div class="div_parent_handler" style="display:none;"></div>');
  19797. var new_div_item = $('<div class="var_value_menu_div"></div>');
  19798. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  19799. div_parent_with_handler.append(new_div_item);
  19800. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  19801. div_parent_with_handler.insertAfter(icon_add_item);
  19802. var new_related_menu = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true);
  19803. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  19804. addHandlerIconAdd(dom_object, command, function_obj, true, div_parent_with_handler);
  19805. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  19806. var pos = 1;
  19807. dom_object.find(".icon_add_item_to_writer").each(function () {
  19808. if ($(this).get(0) === icon_add_item.get(0)) {
  19809. command.content.splice(pos, 0, new_related_menu);
  19810. } else {
  19811. pos++;
  19812. }
  19813. });
  19814. if (command.content.length == 1) {
  19815. icon_add_item.remove();
  19816. }
  19817. div_parent_with_handler.fadeIn();
  19818. });
  19819. }
  19820. function addContent(command, _ref_object, dom_object, _menu_var_or_value, function_obj, _ref_object_content) {
  19821. if (dom_object.hasClass("var_value_menu_div")) {
  19822. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  19823. icon_add_item.insertAfter(dom_object);
  19824. icon_add_item.on("click", function (_event) {
  19825. var div_parent_with_handler = $('<div class="div_parent_handler"></div>');
  19826. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  19827. div_parent_with_handler.append(new_div_item);
  19828. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  19829. div_parent_with_handler.insertAfter(icon_add_item);
  19830. var new_related_menu = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true);
  19831. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  19832. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  19833. command.content.push(new_related_menu);
  19834. if (command.content.length == 1) {
  19835. icon_add_item.remove();
  19836. }
  19837. });
  19838. }
  19839. }
  19840. /***/ }),
  19841. /***/ "./js/visualUI/functions.js":
  19842. /*!**********************************!*\
  19843. !*** ./js/visualUI/functions.js ***!
  19844. \**********************************/
  19845. /*! exports provided: renderFunction, initVisualUI, setTestCases, getTestCases, addFunctionChangeListener, addGlobalChangeListener, removeGlobalListener, removeFunctionListener */
  19846. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19847. "use strict";
  19848. __webpack_require__.r(__webpack_exports__);
  19849. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderFunction", function() { return renderFunction; });
  19850. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return initVisualUI; });
  19851. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestCases", function() { return setTestCases; });
  19852. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return getTestCases; });
  19853. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return addFunctionChangeListener; });
  19854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return addGlobalChangeListener; });
  19855. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return removeGlobalListener; });
  19856. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return removeFunctionListener; });
  19857. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  19858. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19859. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19860. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  19861. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variables */ "./js/visualUI/variables.js");
  19862. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands */ "./js/visualUI/commands.js");
  19863. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./code_generator */ "./js/visualUI/code_generator.js");
  19864. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19865. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  19866. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  19867. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  19868. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__);
  19869. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  19870. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  19871. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  19872. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  19873. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  19874. /* harmony import */ var _ima_version_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../.ima_version.json */ "./.ima_version.json");
  19875. var _ima_version_json__WEBPACK_IMPORTED_MODULE_16___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./../../.ima_version.json */ "./.ima_version.json", 1);
  19876. /* harmony import */ var _text_editor__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./text_editor */ "./js/visualUI/text_editor.js");
  19877. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  19878. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../processor/modes */ "./js/processor/modes.ts");
  19879. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_processor_modes__WEBPACK_IMPORTED_MODULE_19__);
  19880. var counter_new_functions = 0;
  19881. var counter_new_parameters = 0;
  19882. var ivprog_version = _ima_version_json__WEBPACK_IMPORTED_MODULE_16__.version;
  19883. var globalChangeListeners = [];
  19884. var functionsChangeListeners = [];
  19885. var proc = null;
  19886. var domConsole = null;
  19887. var _testCases = [];
  19888. var isRunning = false;
  19889. window.studentGrade = null;
  19890. window.LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"];
  19891. var program = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Program"]();
  19892. window.system_functions = []; // Adding math functions:
  19893. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$sin', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19894. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$cos', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19895. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$tan', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19896. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$sqrt', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19897. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$pow', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19898. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$log', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19899. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$abs', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19900. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$negate', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19901. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$invert', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19902. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$max', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19903. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$min', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math));
  19904. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$rand', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].math)); // Adding text functions:
  19905. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$substring', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].text));
  19906. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$length', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].text));
  19907. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$uppercase', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].text));
  19908. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$lowercase', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].text));
  19909. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$charAt', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].text)); // Adding arrangement functions:
  19910. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$numElements', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].variable_and_function, null, null, null, true, 1)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement));
  19911. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$matrixLines', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].variable_and_function, null, null, null, true, 2)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement));
  19912. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$matrixColumns', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].variable_and_function, null, null, null, true, 2)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement)); // Adding conversion functions:
  19913. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$isReal', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion));
  19914. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$isInt', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion));
  19915. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$isBool', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion));
  19916. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$castReal', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion));
  19917. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$castInt', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion));
  19918. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$castBool', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion));
  19919. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$castString', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion));
  19920. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$castChar', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion));
  19921. console.log(' ___ ___ ________ \n / / / / / ____/ \n / / / / / / \n / / / / ______ ___ / /__ \n / / / / / \\ / / / ___/ \n / /______ / / / /\\ \\/ / / / \n / / / / / / \\ / / /____ \n/__________/ /___/ /___/ \\___/ /________/ \n\n Laboratório de Informática na Educação\n http://line.ime.usp.br');
  19922. var mainFunction = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Function"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("start"), _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID, 0, [], true, false);
  19923. mainFunction.function_comment = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Comment"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment_main'));
  19924. program.addFunction(mainFunction);
  19925. window.program_obj = program;
  19926. window.generator = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"];
  19927. window.runCodeAssessment = runCodeAssessment;
  19928. window.renderAlgorithm = _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"];
  19929. window.insertContext = false;
  19930. window.watchW = melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a;
  19931. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.globals, function () {
  19932. if (window.insertContext) {
  19933. setTimeout(function () {
  19934. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19935. globalChangeListeners.forEach(function (x) {
  19936. return x();
  19937. });
  19938. }, 300);
  19939. window.insertContext = false;
  19940. } else {
  19941. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19942. globalChangeListeners.forEach(function (x) {
  19943. return x();
  19944. });
  19945. }
  19946. }, 1);
  19947. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.functions, function () {
  19948. if (window.insertContext) {
  19949. setTimeout(function () {
  19950. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19951. functionsChangeListeners.forEach(function (x) {
  19952. return x();
  19953. });
  19954. }, 300);
  19955. window.insertContext = false;
  19956. } else {
  19957. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19958. functionsChangeListeners.forEach(function (x) {
  19959. return x();
  19960. });
  19961. }
  19962. }, 1);
  19963. function addFunctionHandler() {
  19964. var new_function = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Function"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("new_function") + "_" + counter_new_functions, _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID, 0, [], false, false, [], new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Comment"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment_start')));
  19965. program.addFunction(new_function);
  19966. counter_new_functions++;
  19967. window.insertContext = true;
  19968. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(new_function.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_FUNCTION); // var newe = renderFunction(new_function);
  19969. renderFunction(new_function);
  19970. /*newe.css('display', 'none');
  19971. newe.fadeIn();*/
  19972. }
  19973. function addParameter(function_obj, function_container
  19974. /*, is_from_click = false*/
  19975. ) {
  19976. if (function_obj.parameters_list == null) {
  19977. function_obj.parameters_list = [];
  19978. }
  19979. var new_parameter = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Variable"](_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("new_parameter") + "_" + counter_new_parameters);
  19980. function_obj.parameters_list.push(new_parameter);
  19981. counter_new_parameters++;
  19982. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_FUNCTION_PARAM, new_parameter.name, _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, 0); //var newe = renderParameter(function_obj, new_parameter, function_container);
  19983. renderParameter(function_obj, new_parameter, function_container); // if (is_from_click) {
  19984. // newe.css('display', 'none');
  19985. // newe.fadeIn();
  19986. // }
  19987. }
  19988. function updateReturnType(function_obj, new_type) {
  19989. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  19990. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].CHANGE_FUNCTION_RETURN, new_type, new_dimensions);
  19991. function_obj.return_type = new_type;
  19992. function_obj.return_dimensions = new_dimensions;
  19993. }
  19994. function removeFunction(function_obj) {
  19995. var index = program.functions.indexOf(function_obj);
  19996. if (index > -1) {
  19997. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION);
  19998. program.functions.splice(index, 1);
  19999. }
  20000. }
  20001. function minimizeFunction(function_obj) {
  20002. function_obj.is_hidden = !function_obj.is_hidden;
  20003. }
  20004. function addHandlers(function_obj, function_container) {
  20005. function_container.find('.ui.dropdown.function_return').dropdown({
  20006. onChange: function onChange(value, text, $selectedItem) {
  20007. if ($selectedItem.data('dimensions')) {
  20008. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  20009. } else {
  20010. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  20011. }
  20012. },
  20013. selectOnKeydown: false
  20014. });
  20015. function_container.find(".name_function_updated").on('click', function (e) {
  20016. enableNameFunctionUpdate(function_obj, function_container);
  20017. });
  20018. function_container.find(".add_parameter_button").on('click', function (e) {
  20019. window.insertContext = true;
  20020. addParameter(function_obj, function_container, true);
  20021. });
  20022. function_container.find('.menu_commands').dropdown({
  20023. on: 'hover'
  20024. });
  20025. function_container.find('.menu_commands a').on('click', function (evt) {
  20026. if (function_obj.commands == null || function_obj.commands.length == 0) {
  20027. function_obj.commands = [];
  20028. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_5__["genericCreateCommand"]($(this).data('command'));
  20029. function_obj.commands.push(new_cmd);
  20030. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](new_cmd, function_container.find('.commands_list_div'), 3, function_obj);
  20031. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, $(this).data('command'), '/', 0);
  20032. } else {
  20033. _commands__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"](function_obj, function_container, $(this).data('command'), evt);
  20034. }
  20035. });
  20036. function_container.find('.add_var_button_function').on('click', function (e) {
  20037. window.insertContext = true;
  20038. _variables__WEBPACK_IMPORTED_MODULE_4__["addVariable"](function_obj, function_container, true);
  20039. });
  20040. function_container.find('.remove_function_button').on('click', function (e) {
  20041. removeFunction(function_obj);
  20042. function_container.fadeOut();
  20043. });
  20044. function_container.find('.minimize_function_button').on('click', function (e) {
  20045. minimizeFunction(function_obj);
  20046. if (function_obj.is_hidden) {
  20047. function_container.find(".add_var_button_function").toggle();
  20048. function_container.find(".inline_add_command").toggle();
  20049. function_container.find(".function_area").slideToggle();
  20050. } else {
  20051. function_container.find(".function_area").slideToggle(function () {
  20052. function_container.find(".add_var_button_function").toggle();
  20053. function_container.find(".inline_add_command").toggle();
  20054. });
  20055. }
  20056. });
  20057. } // Essa função imprime o tipo de retorno da função e cria o menu do tipo 'select' para alteração
  20058. function renderFunctionReturn(function_obj, function_element) {
  20059. var ret = '<div class="ui dropdown function_return">';
  20060. if (function_obj.return_dimensions == 1) {
  20061. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("vector") + ': ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase()));
  20062. ret += ' [ ] </div>';
  20063. } else if (function_obj.return_dimensions == 2) {
  20064. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("matrix") + ': ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase()));
  20065. ret += ' [ ] [ ] </div>';
  20066. } else {
  20067. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase())) + '</div>';
  20068. }
  20069. ret += '<div class="menu">';
  20070. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20071. ret += '<div class="item ' + (function_obj.return_type == tm.toLowerCase() && function_obj.return_dimensions < 1 ? ' selected ' : '') + '" data-type="' + tm + '" >' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  20072. }
  20073. ret += '<div class="item ' + (function_obj.return_dimensions == 1 ? ' selected ' : '') + '">' + '<i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + '<div class="menu">';
  20074. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20075. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20076. continue;
  20077. }
  20078. ret += '<div class="item ' + (function_obj.return_type == tm.toLowerCase() && function_obj.return_dimensions == 1 ? ' selected ' : '') + '" data-text="' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + ':' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + ' [ ] " data-type="' + tm + '" data-dimensions="1"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  20079. }
  20080. ret += '</div></div>';
  20081. ret += '<div class="item ' + (function_obj.return_dimensions == 2 ? ' selected ' : '') + '">' + '<i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + '<div class="menu">';
  20082. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20083. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20084. continue;
  20085. }
  20086. ret += '<div class="item ' + (function_obj.return_type == tm.toLowerCase() && function_obj.return_dimensions == 2 ? ' selected ' : '') + '" data-text="' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + ':' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + ' [ ] " data-type="' + tm + '" data-dimensions="2"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  20087. }
  20088. ret += '</div></div>';
  20089. ret += '</div></div>';
  20090. ret = $(ret);
  20091. function_element.find('.function_return').append(ret);
  20092. }
  20093. var cont = 0;
  20094. function renderFunction(function_obj) {
  20095. var appender = '<div class="ui secondary segment function_div list-group-item function_cont_' + cont + '">';
  20096. if (function_obj.function_comment) {//appender += renderComment(function_obj.function_comment, sequence, true, -1);
  20097. }
  20098. appender += '<span class="glyphicon glyphicon-move move_function" aria-hidden="true"><i class="icon sort alternate vertical"></i></span>';
  20099. appender += (function_obj.is_main ? '<div class="div_start_minimize_v"> </div>' : '<button class="ui icon button large remove_function_button"><i class="red icon times"></i></button>') + '<button class="ui icon button tiny minimize_function_button"><i class="icon window minimize"></i></button>';
  20100. appender += '<div class="function_signature_div">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + ' ';
  20101. if (function_obj.is_main) {
  20102. appender += '<div class="function_name_div"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_void') + ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="span_name_function" >' + function_obj.name + '</span> </div> ' + ' <span class="parethesis_function">( </span> <div class="ui large labels parameters_list">';
  20103. } else {
  20104. appender += '<div class="ui function_return"></div>';
  20105. appender += '<div class="function_name_div function_name_div_updated"><span class="span_name_function name_function_updated">' + function_obj.name + '</span> </div> ' + ' <span class="parethesis_function"> ( </span> <i class="ui icon plus square outline add_parameter_button"></i> <div class="ui large labels parameters_list container_parameters_list">';
  20106. }
  20107. appender += '</div> <span class="parethesis_function"> ) </span> </div>' + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ');
  20108. appender += '<div class="ui add_var_context add_var_button_function" style="float: left;"> <div class="ui icon button purple"> ';
  20109. appender += '<i class="icons"><i class="icon superscript" style="margin-top: -2px;margin-bottom: 2px;margin-left: 1px;margin-right: 1px;"></i><i class="corner add icon inverted" style="font-size: 9px;padding-top: 6px;padding-left: 9px;"></i></i>';
  20110. appender += '</div></div>';
  20111. appender += '<div class="ui top attached segment variables_list_div"></div>';
  20112. appender += '<div class="ui bottom attached segment commands_list_div commands_cont_' + cont + '">' + '<div class="ui rail" style="width: 35px; margin-left: -36px;"><div class="ui sticky sticky_cont_' + cont + '" style="top: 50px !important;">';
  20113. appender += '<div class="ui icon button dropdown menu_commands orange" > ' + '<i class="icons"><i class="icon code" style="margin-top: -1px;margin-bottom: 1px;margin-right: 0px;"></i><i class="corner add icon inverted" style="font-size: 9px;padding-top: 6px;padding-left: 9px;"></i></i>' + '<div class="menu"> ';
  20114. appender += '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].reader + '"><i class="download icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_read_var') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer + '"><i class="upload icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_write_var') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].comment + '"><i class="quote left icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution + '"><i class="arrow left icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_attribution') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].functioncall + '"><i class="hand point right icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_functioncall') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].iftrue + '" ><i class="random icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_iftrue') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].repeatNtimes + '"><i class="sync icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_repeatNtimes') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].whiletrue + '"><i class="sync icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_whiletrue') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].dowhiletrue + '"><i class="sync icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_dowhiletrue') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["switch"] + '"><i class="list icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_switch') + '</a>' + '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["return"] + '"><i class="reply icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_btn_return') + '</a>' + '</div></div>';
  20115. appender += '</div></div>' + '</div>';
  20116. appender += '</div></div>';
  20117. appender = $(appender);
  20118. $('.all_functions').append(appender);
  20119. appender.data('fun', function_obj);
  20120. appender.find('.commands_list_div').data('fun', function_obj);
  20121. renderFunctionReturn(function_obj, appender);
  20122. addHandlers(function_obj, appender); // Rendering parameters:
  20123. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  20124. renderParameter(function_obj, function_obj.parameters_list[j], appender);
  20125. } // Rendering variables:
  20126. for (var j = 0; j < function_obj.variables_list.length; j++) {
  20127. _variables__WEBPACK_IMPORTED_MODULE_4__["renderVariable"](appender, function_obj.variables_list[j], function_obj);
  20128. } // Rendering commands:
  20129. for (var j = 0; j < function_obj.commands.length; j++) {
  20130. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](function_obj.commands[j], $(appender.find('.commands_list_div')[0]), 3, function_obj);
  20131. }
  20132. $('.minimize_function_button').popup({
  20133. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_hide_function"),
  20134. delay: {
  20135. show: 750,
  20136. hide: 0
  20137. }
  20138. });
  20139. var function_index = program.functions.indexOf(function_obj);
  20140. Sortable.create(appender.find(".variables_list_div")[0], {
  20141. handle: '.ellipsis',
  20142. animation: 100,
  20143. ghostClass: 'ghost',
  20144. group: 'local_vars_drag_' + function_index,
  20145. onEnd: function onEnd(evt) {
  20146. updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
  20147. }
  20148. });
  20149. addSortableHandler(appender.find(".commands_list_div")[0], function_index);
  20150. if (!function_obj.is_main) {
  20151. Sortable.create(appender.find(".container_parameters_list")[0], {
  20152. handle: '.ellipsis',
  20153. animation: 100,
  20154. ghostClass: 'ghost',
  20155. group: 'parameters_drag_' + program.functions.indexOf(function_obj),
  20156. onEnd: function onEnd(evt) {
  20157. updateSequenceParameters(evt.oldIndex, evt.newIndex, function_obj);
  20158. }
  20159. });
  20160. }
  20161. if (function_obj.commands.length > 0) {
  20162. var teste = '.ui.sticky.sticky_cont_' + cont;
  20163. $(teste).sticky({
  20164. context: '.ui.bottom.attached.segment.commands_list_div.commands_cont_' + cont,
  20165. scrollContext: '.ivprog_visual_panel',
  20166. observeChanges: true,
  20167. offset: 40,
  20168. onStick: function onStick(evt) {
  20169. $(teste).css('top', '20px', 'important');
  20170. },
  20171. onBottom: function onBottom(evt) {
  20172. $(teste).css('top', '20px', 'important');
  20173. },
  20174. onUnstick: function onUnstick(evt) {
  20175. $(teste).css('top', '20px', 'important');
  20176. },
  20177. onReposition: function onReposition(evt) {
  20178. $(teste).css('top', '20px', 'important');
  20179. },
  20180. onScroll: function onScroll(evt) {
  20181. $(teste).css('top', '20px', 'important');
  20182. if (!isVisible($(teste), $(teste).parent())) {
  20183. $(teste).removeClass('fixed');
  20184. }
  20185. },
  20186. onTop: function onTop(evt) {
  20187. $(teste).css('top', '20px', 'important');
  20188. }
  20189. });
  20190. }
  20191. cont++;
  20192. return appender;
  20193. }
  20194. function isVisible(element, container) {
  20195. var elementTop = $(element).offset().top,
  20196. elementHeight = $(element).height(),
  20197. containerTop = $(container).offset().top,
  20198. containerHeight = $(container).height() - 30;
  20199. return elementTop - containerTop + elementHeight > 0 && elementTop - containerTop < containerHeight;
  20200. }
  20201. window.evento_drag;
  20202. function updateProgramObjDrag() {
  20203. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20204. var function_index;
  20205. var start_index;
  20206. var function_obj;
  20207. $(evento_drag.item).parentsUntil(".all_functions").each(function (index) {
  20208. var ref = $(this);
  20209. if (ref.hasClass('function_div')) {
  20210. function_index = nodes.indexOf(this);
  20211. start_index = index;
  20212. function_obj = ref;
  20213. }
  20214. });
  20215. var path_target = [];
  20216. $(evento_drag.item).parentsUntil(".all_functions").each(function () {
  20217. if ($(this).hasClass('command_container')) {
  20218. path_target.push(this);
  20219. }
  20220. });
  20221. if (path_target.length == 0) {//console.log('soltou na raiz, na posição: ' + evento_drag.newIndex + ' mas ainda não sei de onde saiu ');
  20222. } else {//console.log('soltou dentro de algum bloco, sequência vem logo abaixo (de baixo pra cima): ');
  20223. //console.log(path_target);
  20224. }
  20225. var index_each = [];
  20226. var path_relative = [];
  20227. for (var i = path_target.length - 1; i >= 0; i--) {
  20228. if (i == path_target.length - 1) {
  20229. // está na raiz
  20230. var indice_na_raiz = function_obj.find('.command_container').index(path_target[i]);
  20231. } else {
  20232. if ($(path_target[i + 1]).hasClass('iftrue')) {
  20233. if ($(path_target[i]).parent().hasClass('commands_if')) {
  20234. path_relative.push('if');
  20235. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  20236. } else {
  20237. path_relative.push('else');
  20238. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  20239. }
  20240. } else if ($(path_target[i + 1]).hasClass('dowhiletrue')) {
  20241. path_relative.push('dowhiletrue');
  20242. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20243. } else if ($(path_target[i + 1]).hasClass('repeatNtimes')) {
  20244. path_relative.push('repeatNtimes');
  20245. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20246. } else if ($(path_target[i + 1]).hasClass('whiletrue')) {
  20247. path_relative.push('whiletrue');
  20248. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20249. } else if ($(path_target[i + 1]).hasClass('switch')) {
  20250. path_relative.push('switch'); //index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20251. }
  20252. }
  20253. } // var index_in_block = -1;
  20254. var is_in_else = $(evento_drag.item).parent().hasClass('commands_else'); // index_in_block = $(evento_drag.item).parent().find('.command_container').index(evento_drag.item);
  20255. var is_in_case_switch = $(evento_drag.item).parent().hasClass('case_commands_block'); // encontrar o elemento na árvore:
  20256. var command_start_point = window.program_obj.functions[function_index].commands[indice_na_raiz];
  20257. var block_to_insert = command_start_point;
  20258. for (var i = 0; i < index_each.length; i++) {
  20259. if (path_relative[i] == "else") {
  20260. block_to_insert = block_to_insert.commands_else[index_each[i]];
  20261. } else if (path_relative[i] == "switch") {} else {
  20262. block_to_insert = block_to_insert.commands_block[index_each[i]];
  20263. }
  20264. } //console.log('command_start_point', command_start_point);
  20265. //console.log('block_to_insert', block_to_insert);
  20266. // agora tem que alocar o comando na árvore, mas considerar as quatro situações:
  20267. // (1) se está em um else ou (2) se está em switch ou (3) será um caso padrão ou (4) se será na raiz.
  20268. if (path_target.length == 0) {
  20269. // soltou na raiz:
  20270. window.program_obj.functions[function_index].commands.splice(evento_drag.newIndex - 1, 0, command_in_drag);
  20271. } else if (is_in_else) {
  20272. if (block_to_insert.commands_else) {
  20273. block_to_insert.commands_else.splice(evento_drag.newIndex, 0, command_in_drag);
  20274. } else {
  20275. block_to_insert.commands_else = [];
  20276. block_to_insert.commands_else.push(command_in_drag);
  20277. }
  20278. } else if (is_in_case_switch) {} else {
  20279. // verificar se tem alguma coisa no bloco:
  20280. if (block_to_insert.commands_block) {
  20281. block_to_insert.commands_block.splice(evento_drag.newIndex, 0, command_in_drag);
  20282. } else {
  20283. block_to_insert.commands_block = [];
  20284. block_to_insert.commands_block.push(command_in_drag);
  20285. }
  20286. }
  20287. window.draging = false;
  20288. renderAlgorithm();
  20289. }
  20290. function prepareDragHandler(evt) {
  20291. window.draging = true;
  20292. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20293. var function_index;
  20294. var function_obj;
  20295. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  20296. if ($(this).hasClass('function_div')) {
  20297. function_index = nodes.indexOf(this);
  20298. function_obj = window.program_obj.functions[function_index];
  20299. }
  20300. });
  20301. command_in_drag = $(evt.item).data("command"); //console.log('$(evt.item).parent(): ');
  20302. //console.log($(evt.item).parent());
  20303. // descobrir qual das quatro situações:
  20304. if ($(evt.item).parent().hasClass('commands_list_div')) {
  20305. // está na raiz:
  20306. if (function_obj.commands.indexOf(command_in_drag) > -1) {
  20307. function_obj.commands.splice(function_obj.commands.indexOf(command_in_drag), 1);
  20308. }
  20309. } else if ($(evt.item).parent().hasClass('commands_else')) {
  20310. // está no else:
  20311. if ($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag) > -1) {
  20312. $(evt.item).parent().data('command').commands_else.splice($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag), 1);
  20313. }
  20314. } else if ($(evt.item).parent().hasClass('case_commands_block')) {// está em um switch:
  20315. } else {
  20316. // caso padrão:
  20317. if ($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag) > -1) {
  20318. $(evt.item).parent().data('command').commands_block.splice($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag), 1);
  20319. }
  20320. }
  20321. }
  20322. var command_in_drag;
  20323. function addSortableHandler(element, id_function) {
  20324. var n_group = 'commands_drag_' + id_function;
  20325. Sortable.create(element, {
  20326. handle: '.command_drag',
  20327. ghostClass: 'ghost',
  20328. animation: 300,
  20329. group: {
  20330. name: n_group
  20331. },
  20332. onEnd: function onEnd(evt) {
  20333. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20334. var function_index;
  20335. var function_obj;
  20336. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  20337. if ($(this).hasClass('function_div')) {
  20338. function_index = nodes.indexOf(this);
  20339. function_obj = window.program_obj.functions[function_index];
  20340. }
  20341. });
  20342. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].MOVE_COMMAND, $(evt.item).data('command').type, '/', 'from: ' + evt.oldIndex + ' to: ' + evt.newIndex); //updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
  20343. var itemEl = evt.item; // dragged HTMLElement
  20344. evt.to; // target list
  20345. evt.from; // previous list
  20346. evt.oldIndex; // element's old index within old parent
  20347. evt.newIndex; // element's new index within new parent
  20348. //console.log('::EVT::');
  20349. //console.log(evt);
  20350. window.evento_drag = evt;
  20351. try {
  20352. updateProgramObjDrag();
  20353. } catch (e) {
  20354. console.error(e);
  20355. window.draging = false;
  20356. }
  20357. },
  20358. onStart: function onStart(evt) {
  20359. //console.log("START::EVT::");
  20360. //console.log(evt);
  20361. //console.log("\n\ncommand_in_drag");
  20362. try {
  20363. prepareDragHandler(evt);
  20364. } catch (e) {
  20365. window.draging = false;
  20366. }
  20367. }
  20368. });
  20369. element = $(element);
  20370. element.find(".iftrue").each(function (index) {
  20371. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20372. addSortableHandler($(this).find(".block_commands")[1], id_function);
  20373. });
  20374. element.find(".repeatNtimes").each(function (index) {
  20375. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20376. });
  20377. element.find(".dowhiletrue").each(function (index) {
  20378. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20379. });
  20380. element.find(".whiletrue").each(function (index) {
  20381. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20382. });
  20383. element.find(".switch").each(function (index) {
  20384. $(this).find(".case_div").each(function (index) {
  20385. addSortableHandler($(this).find(".case_commands_block")[0], id_function);
  20386. });
  20387. });
  20388. }
  20389. function initVisualUI() {
  20390. // MUST USE CONST, LET, OR VAR !!!!!!
  20391. // const mainDiv = $('#visual-main-div');
  20392. // fill mainDiv with functions and globals...
  20393. // renderAlgorithm()...
  20394. domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_8__["DOMConsole"]("ivprog-term-div");
  20395. domConsole.hide();
  20396. $(document.getElementById("ivprog-term-div")).draggable();
  20397. $('.add_function_button').on('click', function () {
  20398. addFunctionHandler();
  20399. });
  20400. $('.add_global_button').on('click', function () {
  20401. window.insertContext = true;
  20402. _globals__WEBPACK_IMPORTED_MODULE_3__["addGlobal"](program, true);
  20403. });
  20404. $('#run_button').on('click', function () {
  20405. showStopButton();
  20406. runCode();
  20407. });
  20408. $('#stop_button').on('click', function () {
  20409. showRunButton();
  20410. stopExecution();
  20411. });
  20412. $('.visual_coding_button').on('click', function () {
  20413. toggleVisualCoding();
  20414. });
  20415. $('.textual_coding_button').on('click', function () {
  20416. toggleTextualCoding();
  20417. });
  20418. $('.assessment').on('click', function () {
  20419. is_iassign = true;
  20420. runCodeAssessment();
  20421. });
  20422. $('.div_toggle_console').on('click', function () {
  20423. toggleConsole();
  20424. });
  20425. $('.expand_button').on('click', function () {
  20426. full_screen();
  20427. });
  20428. $('.help_button').on('click', function () {
  20429. window.open('https://www.usp.br/line/ivprog/', '_blank');
  20430. });
  20431. $('.main_title h2').prop('title', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_ivprog_description'));
  20432. var time_show = 750;
  20433. $('.visual_coding_button').popup({
  20434. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_visual"),
  20435. delay: {
  20436. show: time_show,
  20437. hide: 0
  20438. }
  20439. });
  20440. $('.textual_coding_button').popup({
  20441. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_textual"),
  20442. delay: {
  20443. show: time_show,
  20444. hide: 0
  20445. }
  20446. });
  20447. $('.upload_file_button').popup({
  20448. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_upload"),
  20449. delay: {
  20450. show: time_show,
  20451. hide: 0
  20452. }
  20453. });
  20454. $('.download_file_button').popup({
  20455. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_download"),
  20456. delay: {
  20457. show: time_show,
  20458. hide: 0
  20459. }
  20460. });
  20461. $('.undo_button').popup({
  20462. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_undo"),
  20463. delay: {
  20464. show: time_show,
  20465. hide: 0
  20466. }
  20467. });
  20468. $('.redo_button').popup({
  20469. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_redo"),
  20470. delay: {
  20471. show: time_show,
  20472. hide: 0
  20473. }
  20474. });
  20475. $('.run_button').popup({
  20476. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_run"),
  20477. delay: {
  20478. show: time_show,
  20479. hide: 0
  20480. }
  20481. });
  20482. $('.assessment_button').popup({
  20483. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_evaluate"),
  20484. delay: {
  20485. show: time_show,
  20486. hide: 0
  20487. }
  20488. });
  20489. $('.help_button').popup({
  20490. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_help") + ' - ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_ivprog_version") + ' ' + ivprog_version,
  20491. delay: {
  20492. show: time_show,
  20493. hide: 0
  20494. }
  20495. });
  20496. $('.add_global_button').popup({
  20497. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_add_global"),
  20498. delay: {
  20499. show: time_show,
  20500. hide: 0
  20501. }
  20502. });
  20503. $('.div_toggle_console').popup({
  20504. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_console"),
  20505. delay: {
  20506. show: time_show,
  20507. hide: 0
  20508. }
  20509. });
  20510. Sortable.create(listWithHandle, {
  20511. handle: '.glyphicon-move',
  20512. animation: 100,
  20513. ghostClass: 'ghost',
  20514. group: 'functions_divs_drag',
  20515. onEnd: function onEnd(evt) {
  20516. updateSequenceFunction(evt.oldIndex, evt.newIndex);
  20517. }
  20518. });
  20519. var listGlobalsHandle = document.getElementById("listGlobalsHandle");
  20520. Sortable.create(listGlobalsHandle, {
  20521. handle: '.ellipsis',
  20522. animation: 100,
  20523. ghostClass: 'ghost',
  20524. group: 'globals_divs_drag',
  20525. onEnd: function onEnd(evt) {
  20526. updateSequenceGlobals(evt.oldIndex, evt.newIndex);
  20527. }
  20528. });
  20529. }
  20530. function setTestCases(testCases) {
  20531. _testCases = testCases;
  20532. }
  20533. function getTestCases() {
  20534. // Deep clone of test cases to avoid unauthorized modification
  20535. // TODO: It may be not possible to use this once custom test are fully implemented
  20536. return JSON.parse(JSON.stringify(_testCases));
  20537. }
  20538. var is_iassign = false;
  20539. function updateSequenceParameters(oldIndex, newIndex, function_obj) {
  20540. function_obj.parameters_list.splice(newIndex, 0, function_obj.parameters_list.splice(oldIndex, 1)[0]);
  20541. }
  20542. function updateSequenceLocals(oldIndex, newIndex, function_obj) {
  20543. function_obj.variables_list.splice(newIndex, 0, function_obj.variables_list.splice(oldIndex, 1)[0]);
  20544. }
  20545. function updateSequenceGlobals(oldIndex, newIndex) {
  20546. program_obj.globals.splice(newIndex, 0, program_obj.globals.splice(oldIndex, 1)[0]);
  20547. }
  20548. function updateSequenceFunction(oldIndex, newIndex) {
  20549. program_obj.functions.splice(newIndex, 0, program_obj.functions.splice(oldIndex, 1)[0]);
  20550. }
  20551. function runCodeAssessment() {
  20552. if (isRunning) {
  20553. // cannot run assessment or it's already running
  20554. return -1;
  20555. }
  20556. var strCode = null;
  20557. is_iassign = false;
  20558. window.studentGrade = null;
  20559. if (settingsProgrammingTypes == "textual") {
  20560. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  20561. } else {
  20562. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20563. }
  20564. if (strCode == null) {
  20565. // No code, so no assessment
  20566. return -1;
  20567. }
  20568. toggleConsole(true);
  20569. try {
  20570. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  20571. isRunning = true;
  20572. var runner = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__["IVProgAssessment"](data, _testCases, domConsole);
  20573. runner.runTest().then(function (grade) {
  20574. if (!is_iassign) {
  20575. parent.getEvaluationCallback(grade);
  20576. } else {
  20577. is_iassign = false;
  20578. }
  20579. isRunning = false;
  20580. })["catch"](function (err) {
  20581. console.log(err);
  20582. isRunning = false;
  20583. });
  20584. } catch (error) {
  20585. isRunning = false;
  20586. domConsole.err(error.message);
  20587. console.log(error);
  20588. if (!is_iassign) {
  20589. parent.getEvaluationCallback(0);
  20590. } else {
  20591. is_iassign = false;
  20592. }
  20593. }
  20594. return 0;
  20595. }
  20596. function runCode() {
  20597. if (isRunning) {
  20598. return;
  20599. }
  20600. var strCode = null;
  20601. if (settingsProgrammingTypes == "textual") {
  20602. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  20603. } else {
  20604. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20605. }
  20606. if (strCode == null) {
  20607. return;
  20608. }
  20609. toggleConsole(true); // if(domConsole == null)
  20610. // domConsole = new DOMConsole("#ivprog-term");
  20611. //$("#ivprog-term").slideDown(500);
  20612. try {
  20613. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  20614. proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__["IVProgProcessor"](data);
  20615. proc.registerInput(domConsole);
  20616. proc.registerOutput(domConsole);
  20617. $("#ivprog-term").addClass('ivprog-term-active');
  20618. isRunning = true;
  20619. proc.interpretAST().then(function (_) {
  20620. scheduleCall(function () {
  20621. if (domConsole.pending_writes.length == 0) {
  20622. if (proc.mode === _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT) {
  20623. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("aborted_execution"));
  20624. } else {
  20625. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("success_execution"));
  20626. }
  20627. $("#ivprog-term").removeClass('ivprog-term-active');
  20628. isRunning = false;
  20629. proc = null;
  20630. showRunButton();
  20631. return true;
  20632. }
  20633. return false;
  20634. }, 100);
  20635. })["catch"](function (err) {
  20636. scheduleCall(function () {
  20637. if (domConsole.pending_writes.length == 0) {
  20638. if (err instanceof Error) {
  20639. domConsole.err(err.message);
  20640. } else {
  20641. domConsole.err(err);
  20642. }
  20643. $("#ivprog-term").removeClass('ivprog-term-active');
  20644. isRunning = false;
  20645. proc = null;
  20646. showRunButton();
  20647. return true;
  20648. }
  20649. return false;
  20650. }, 100);
  20651. });
  20652. } catch (error) {
  20653. scheduleCall(function () {
  20654. if (domConsole.pending_writes.length == 0) {
  20655. isRunning = false;
  20656. proc = null;
  20657. showRunButton();
  20658. domConsole.err(error.message);
  20659. console.log(error);
  20660. return true;
  20661. }
  20662. return false;
  20663. }, 100);
  20664. }
  20665. }
  20666. function toggleConsole(is_running) {
  20667. if (is_running) {
  20668. $('.ivprog-term-div').css('display', 'block');
  20669. $('#ivprog-term').css('min-height', '160px');
  20670. if (domConsole != null) domConsole.focus(); //$('#ivprog-term').css('margin-top', '-170px');
  20671. return;
  20672. } else {
  20673. domConsole.hide();
  20674. return;
  20675. }
  20676. if ($('#ivprog-term').css('min-height') == '160px') {
  20677. // esconder
  20678. $('.ivprog-term-div').css('display', 'none');
  20679. $('#ivprog-term').css('min-height', '0'); //$('#ivprog-term').css('margin-top', '-30px');
  20680. //$('#ivprog-term').css('padding', '5px');
  20681. } else {
  20682. // mostrar
  20683. $('.ivprog-term-div').css('display', 'block');
  20684. $('#ivprog-term').css('min-height', '160px'); //$('#ivprog-term').css('margin-top', '-170px');
  20685. }
  20686. } // function waitToCloseConsole () {
  20687. // domConsole.info("Aperte qualquer tecla para fechar...");
  20688. // const p = new Promise((resolve, _) => {
  20689. // domConsole.requestInput(resolve, true);
  20690. // });
  20691. // p.then( _ => {
  20692. // domConsole.dispose();
  20693. // domConsole = null;
  20694. // $("#ivprog-term").hide();
  20695. // })
  20696. // }
  20697. function toggleTextualCoding() {
  20698. var code = null;
  20699. if (settingsProgrammingTypes != "textual") {
  20700. code = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20701. if (code == null) {
  20702. return;
  20703. }
  20704. }
  20705. $('.ivprog_visual_panel').css('display', 'none');
  20706. $('.ivprog_textual_panel').css('display', 'block');
  20707. $('.ivprog_textual_panel').removeClass('loading');
  20708. _text_editor__WEBPACK_IMPORTED_MODULE_17__["updateEditor"]();
  20709. if (code != null) _text_editor__WEBPACK_IMPORTED_MODULE_17__["setCode"](code); //$('.ivprog_textual_code').text(code);
  20710. $('.visual_coding_button').removeClass('active');
  20711. $('.textual_coding_button').addClass('active');
  20712. }
  20713. function toggleVisualCoding() {
  20714. $('.ivprog_textual_panel').addClass('loading');
  20715. $('.ivprog_textual_panel').css('display', 'none');
  20716. $('.ivprog_visual_panel').css('display', 'block');
  20717. $('.textual_coding_button').removeClass('active');
  20718. $('.visual_coding_button').addClass('active');
  20719. }
  20720. function removeParameter(function_obj, parameter_obj, parameter_container) {
  20721. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(parameter_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION_PARAM, function_obj.name);
  20722. var index = function_obj.parameters_list.indexOf(parameter_obj);
  20723. if (index > -1) {
  20724. window.insertContext = true;
  20725. function_obj.parameters_list.splice(index, 1);
  20726. }
  20727. $(parameter_container).fadeOut();
  20728. }
  20729. function updateParameterType(parameter_obj, new_type, function_name) {
  20730. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  20731. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(parameter_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].CHANGE_PARAM_TYPE, function_name, new_type, new_dimensions);
  20732. parameter_obj.type = new_type;
  20733. parameter_obj.dimensions = new_dimensions;
  20734. if (new_dimensions > 0) {
  20735. parameter_obj.rows = new_dimensions;
  20736. parameter_obj.columns = 2;
  20737. }
  20738. }
  20739. function renderParameter(function_obj, parameter_obj, function_container) {
  20740. var ret = "";
  20741. ret += '<div class="ui label function_name_parameter pink"><i class="ui icon ellipsis vertical inverted"></i>';
  20742. ret += '<div class="ui dropdown parameter_type">';
  20743. if (parameter_obj.dimensions > 0) {
  20744. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + ':' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(parameter_obj.type.toLowerCase()));
  20745. if (parameter_obj.dimensions == 1) {
  20746. ret += ' [ ] ';
  20747. } else {
  20748. ret += ' [ ] [ ] ';
  20749. }
  20750. ret += '</div>';
  20751. } else {
  20752. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(parameter_obj.type.toLowerCase())) + '</div>';
  20753. }
  20754. ret += '<div class="menu">';
  20755. for (var _tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20756. if (_tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20757. continue;
  20758. }
  20759. ret += '<div class="item ' + (parameter_obj.type == _tm.toLowerCase() && parameter_obj.dimensions == 0 ? ' selected ' : '') + '" data-type="' + _tm + '" >' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(_tm.toLowerCase())) + '</div>';
  20760. }
  20761. ret += '<div class="item ' + (parameter_obj.dimensions == 1 ? ' selected ' : '') + '">' + '<i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + '<div class="menu">';
  20762. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20763. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20764. continue;
  20765. }
  20766. ret += '<div class="item ' + (parameter_obj.type == tm.toLowerCase() && parameter_obj.dimensions == 1 ? ' selected ' : '') + '" data-text="' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + ':' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + ' [ ] " data-type="' + tm + '" data-dimensions="1"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  20767. }
  20768. ret += '</div></div>';
  20769. ret += '<div class="item ' + (parameter_obj.dimensions == 2 ? ' selected ' : '') + '">' + '<i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + '<div class="menu">';
  20770. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20771. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20772. continue;
  20773. }
  20774. ret += '<div class="item ' + (parameter_obj.type == tm.toLowerCase() && parameter_obj.dimensions == 2 ? ' selected ' : '') + '" data-text="' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + ':' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + ' [ ] " data-type="' + tm + '" data-dimensions="2"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  20775. }
  20776. ret += '</div></div>';
  20777. ret += '</div></div>';
  20778. ret += '<div class="parameter_div_edit"><span class="span_name_parameter label_enable_name_parameter">' + parameter_obj.name + '</span></div> ';
  20779. ret += ' <i class="yellow inverted icon times remove_parameter"></i></div>';
  20780. ret = $(ret);
  20781. function_container.find('.container_parameters_list').append(ret);
  20782. ret.find('.remove_parameter').on('click', function (e) {
  20783. removeParameter(function_obj, parameter_obj, ret);
  20784. });
  20785. ret.find('.ui.dropdown.parameter_type').dropdown({
  20786. onChange: function onChange(_, __, $selectedItem) {
  20787. if ($selectedItem.data('dimensions')) {
  20788. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  20789. } else {
  20790. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  20791. }
  20792. },
  20793. selectOnKeydown: false
  20794. });
  20795. ret.find('.parameter_div_edit').on('click', function (e) {
  20796. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].ENTER_CHANGE_PARAM_NAME, parameter_obj.name);
  20797. enableNameParameterUpdate(parameter_obj, ret, function_obj);
  20798. });
  20799. return ret;
  20800. }
  20801. function updateParameterName(parameter_var, new_name, parameter_obj_dom, function_obj) {
  20802. if (parameter_var.name == new_name) {
  20803. return;
  20804. }
  20805. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  20806. if (variableNameAlreadyExists(new_name, function_obj)) {
  20807. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](parameter_obj_dom.find('.parameter_div_edit'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_param_duplicated', [new_name, function_obj.name]));
  20808. } else {
  20809. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].RENAME_FUNCTION_PARAM, parameter_var.name, new_name);
  20810. parameter_var.name = new_name;
  20811. }
  20812. } else {
  20813. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](parameter_obj_dom.find('.parameter_div_edit'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  20814. }
  20815. }
  20816. function variableNameAlreadyExists(name_var, function_obj) {
  20817. if (function_obj.parameters_list) {
  20818. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  20819. if (function_obj.parameters_list[i].name == name_var) {
  20820. return true;
  20821. }
  20822. }
  20823. }
  20824. if (function_obj.variables_list) {
  20825. for (var i = 0; i < function_obj.variables_list.length; i++) {
  20826. if (function_obj.variables_list[i].name == name_var) {
  20827. return true;
  20828. }
  20829. }
  20830. }
  20831. return false;
  20832. }
  20833. function updateFunctionName(function_var, new_name, function_obj_dom) {
  20834. if (function_var.name == new_name) {
  20835. return;
  20836. }
  20837. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  20838. if (functionNameAlreadyExists(new_name)) {
  20839. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](function_obj_dom.find('.function_name_div'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_function_duplicated', [new_name]));
  20840. } else {
  20841. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].RENAME_FUNCTION, new_name);
  20842. function_var.name = new_name;
  20843. }
  20844. } else {
  20845. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](function_obj_dom.find('.function_name_div'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  20846. }
  20847. }
  20848. function functionNameAlreadyExists(function_name) {
  20849. for (var i = 0; i < window.program_obj.functions.length; i++) {
  20850. if (window.program_obj.functions[i].name == function_name) {
  20851. return true;
  20852. }
  20853. }
  20854. return false;
  20855. }
  20856. var opened_name_parameter = false;
  20857. var opened_input_parameter = null;
  20858. function enableNameParameterUpdate(parameter_obj, parent_node, function_obj) {
  20859. if (opened_name_parameter) {
  20860. opened_input_parameter.focus();
  20861. return;
  20862. }
  20863. opened_name_parameter = true;
  20864. parent_node = $(parent_node);
  20865. var input_field;
  20866. parent_node.find('.span_name_parameter').text('');
  20867. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + parameter_obj.name + "' />");
  20868. input_field.insertBefore(parent_node.find('.span_name_parameter'));
  20869. input_field.on('input', function () {
  20870. var inputWidth = input_field.textWidth() + 10;
  20871. opened_input_parameter = input_field;
  20872. input_field.focus();
  20873. var tmpStr = input_field.val();
  20874. input_field.val('');
  20875. input_field.val(tmpStr);
  20876. input_field.css({
  20877. width: inputWidth
  20878. });
  20879. }).trigger('input');
  20880. input_field.focusout(function () {
  20881. /// update array:
  20882. if (input_field.val().trim()) {
  20883. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  20884. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  20885. }
  20886. input_field.off();
  20887. input_field.remove(); /// update elements:
  20888. opened_name_parameter = false;
  20889. opened_input_parameter = false;
  20890. });
  20891. input_field.on('keydown', function (e) {
  20892. var code = e.keyCode || e.which;
  20893. if (code == 13) {
  20894. if (input_field.val().trim()) {
  20895. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  20896. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  20897. }
  20898. input_field.off();
  20899. input_field.remove(); /// update elements:
  20900. opened_name_parameter = false;
  20901. opened_input_parameter = false;
  20902. }
  20903. if (code == 27) {
  20904. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  20905. input_field.off();
  20906. input_field.remove(); /// update elements:
  20907. opened_name_parameter = false;
  20908. opened_input_parameter = false;
  20909. }
  20910. });
  20911. input_field.select();
  20912. }
  20913. var opened_name_function = false;
  20914. var opened_input = null;
  20915. var previousPadding = null;
  20916. function enableNameFunctionUpdate(function_obj, parent_node) {
  20917. if (opened_name_function) {
  20918. opened_input.focus();
  20919. return;
  20920. }
  20921. parent_node = $(parent_node);
  20922. parent_node.find('.span_name_function').text('');
  20923. var input_field;
  20924. if (!previousPadding) {
  20925. previousPadding = parent_node.find('.span_name_function').css('padding-left');
  20926. }
  20927. parent_node.find('.span_name_function').css('padding-left', '0');
  20928. parent_node.find('.span_name_function').css('padding-right', '0');
  20929. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + function_obj.name + "' />");
  20930. input_field.insertBefore(parent_node.find('.span_name_function'));
  20931. input_field.on('input', function () {
  20932. var inputWidth = input_field.textWidth() + 10;
  20933. opened_input = input_field;
  20934. input_field.focus();
  20935. var tmpStr = input_field.val();
  20936. input_field.val('');
  20937. input_field.val(tmpStr);
  20938. input_field.css({
  20939. width: inputWidth
  20940. });
  20941. }).trigger('input');
  20942. input_field.focusout(function () {
  20943. /// update array:
  20944. if (input_field.val().trim()) {
  20945. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  20946. }
  20947. input_field.off();
  20948. input_field.remove();
  20949. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  20950. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  20951. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  20952. opened_name_function = false;
  20953. opened_input = false;
  20954. });
  20955. input_field.on('keydown', function (e) {
  20956. var code = e.keyCode || e.which;
  20957. if (code == 13) {
  20958. if (input_field.val().trim()) {
  20959. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  20960. }
  20961. input_field.off();
  20962. input_field.remove();
  20963. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  20964. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  20965. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  20966. opened_name_function = false;
  20967. opened_input = false;
  20968. }
  20969. if (code == 27) {
  20970. input_field.off();
  20971. input_field.remove();
  20972. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  20973. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  20974. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  20975. opened_name_function = false;
  20976. opened_input = false;
  20977. }
  20978. });
  20979. input_field.select();
  20980. }
  20981. function addFunctionChangeListener(callback) {
  20982. functionsChangeListeners.push(callback);
  20983. return functionsChangeListeners.length - 1;
  20984. }
  20985. function addGlobalChangeListener(callback) {
  20986. globalChangeListeners.push(callback);
  20987. return globalChangeListeners.length - 1;
  20988. }
  20989. function removeGlobalListener(index) {
  20990. globalChangeListeners.splice(index, 1);
  20991. }
  20992. function removeFunctionListener(index) {
  20993. functionsChangeListeners.splice(index);
  20994. }
  20995. function scheduleCall(callback, time) {
  20996. var scheduled_call = function scheduled_call() {
  20997. var id = setInterval(function () {
  20998. if (callback()) {
  20999. clearInterval(id);
  21000. }
  21001. }, time);
  21002. };
  21003. scheduled_call();
  21004. }
  21005. function showRunButton() {
  21006. document.getElementById('run_button').style.display = 'inline';
  21007. document.getElementById('stop_button').style.display = 'none';
  21008. }
  21009. function showStopButton() {
  21010. document.getElementById('run_button').style.display = 'none';
  21011. document.getElementById('stop_button').style.display = 'inline';
  21012. }
  21013. function stopExecution() {
  21014. domConsole.clearPendingWrites();
  21015. domConsole.cancelPendingInputRequests();
  21016. if (!isRunning) {
  21017. return;
  21018. }
  21019. proc.mode = _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT;
  21020. }
  21021. /***/ }),
  21022. /***/ "./js/visualUI/globals.js":
  21023. /*!********************************!*\
  21024. !*** ./js/visualUI/globals.js ***!
  21025. \********************************/
  21026. /*! exports provided: addGlobal, renderGlobal */
  21027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21028. "use strict";
  21029. __webpack_require__.r(__webpack_exports__);
  21030. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobal", function() { return addGlobal; });
  21031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderGlobal", function() { return renderGlobal; });
  21032. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  21033. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  21034. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  21035. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  21036. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  21037. var counter_new_globals = 0;
  21038. function addGlobal(program) {
  21039. var is_from_click = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  21040. var new_global = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Variable"](_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('new_global') + '_' + counter_new_globals, 0);
  21041. counter_new_globals++;
  21042. program.addGlobal(new_global);
  21043. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(new_global.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].INSERT_GLOBAL_VAR);
  21044. var newe = renderGlobal(new_global);
  21045. if (is_from_click) {
  21046. newe.css('display', 'none');
  21047. newe.fadeIn();
  21048. }
  21049. }
  21050. function toggleConstant(global_var) {
  21051. global_var.is_constant = !global_var.is_constant;
  21052. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].SET_GLOBAL_CONST);
  21053. }
  21054. function updateName(global_var, new_name, global_obj_dom) {
  21055. if (global_var.name == new_name) {
  21056. return;
  21057. }
  21058. if (isValidIdentifier(new_name)) {
  21059. if (globalNameAlreadyExists(new_name)) {
  21060. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_global_duplicated'));
  21061. } else {
  21062. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].RENAME_GLOBAL_VAR, new_name);
  21063. global_var.name = new_name;
  21064. }
  21065. } else {
  21066. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_name'));
  21067. }
  21068. }
  21069. function globalNameAlreadyExists(global_name) {
  21070. for (var i = 0; i < window.program_obj.globals.length; i++) {
  21071. if (window.program_obj.globals[i].name == global_name) {
  21072. return true;
  21073. }
  21074. }
  21075. return false;
  21076. }
  21077. function isValidIdentifier(identifier_str) {
  21078. return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  21079. }
  21080. function updateType(global_var, new_type) {
  21081. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  21082. global_var.type = new_type;
  21083. global_var.dimensions = new_dimensions;
  21084. if (new_dimensions > 0) {
  21085. global_var.rows = new_dimensions;
  21086. global_var.columns = 2;
  21087. }
  21088. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_TYPE, new_type, new_dimensions, global_var.rows, global_var.columns);
  21089. updateInitialValues(global_var);
  21090. }
  21091. function removeGlobal(global_var, global_container) {
  21092. var index = window.program_obj.globals.indexOf(global_var);
  21093. if (index > -1) {
  21094. window.insertContext = true;
  21095. window.program_obj.globals.splice(index, 1);
  21096. }
  21097. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_GLOBAL_VAR);
  21098. global_container.children().off();
  21099. global_container.off();
  21100. global_container.fadeOut();
  21101. }
  21102. function updateInitialValues(global_var) {
  21103. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21104. if (global_var.dimensions == 0) {
  21105. global_var.value = 0;
  21106. }
  21107. if (global_var.dimensions == 1) {
  21108. global_var.value = [0, 0];
  21109. }
  21110. if (global_var.dimensions == 2) {
  21111. global_var.value = [[0, 0], [0, 0]];
  21112. }
  21113. }
  21114. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21115. if (global_var.dimensions == 0) {
  21116. global_var.value = 0.0;
  21117. }
  21118. if (global_var.dimensions == 1) {
  21119. global_var.value = [0.0, 0.0];
  21120. }
  21121. if (global_var.dimensions == 2) {
  21122. global_var.value = [[0.0, 0.0], [0.0, 0.0]];
  21123. }
  21124. }
  21125. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21126. if (global_var.dimensions == 0) {
  21127. global_var.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  21128. }
  21129. if (global_var.dimensions == 1) {
  21130. global_var.value = [_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value')];
  21131. }
  21132. if (global_var.dimensions == 2) {
  21133. global_var.value = [[_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value')], [_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value')]];
  21134. }
  21135. }
  21136. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21137. if (global_var.dimensions == 0) {
  21138. global_var.value = true;
  21139. }
  21140. if (global_var.dimensions == 1) {
  21141. global_var.value = [true, true];
  21142. }
  21143. if (global_var.dimensions == 2) {
  21144. global_var.value = [[true, true], [true, true]];
  21145. }
  21146. }
  21147. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21148. if (global_var.dimensions == 0) {
  21149. global_var.value = 'A';
  21150. }
  21151. if (global_var.dimensions == 1) {
  21152. global_var.value = ['A', 'A'];
  21153. }
  21154. if (global_var.dimensions == 2) {
  21155. global_var.value = [['A', 'A'], ['A', 'A']];
  21156. }
  21157. }
  21158. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.name, global_var.value);
  21159. }
  21160. function alternateBooleanGlobalValue(global_var, value_container) {
  21161. global_var.value = !global_var.value;
  21162. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value)));
  21163. }
  21164. function alternateBooleanGlobalVectorValue(global_var, index, value_container) {
  21165. global_var.value[index] = !global_var.value[index];
  21166. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[index])));
  21167. }
  21168. function removeGlobalColumnVector(global_var) {
  21169. if (global_var.columns == 0) {
  21170. return;
  21171. }
  21172. global_var.columns--;
  21173. global_var.value.splice(global_var.value.length - 1, 1);
  21174. }
  21175. function addGlobalColumnVector(global_var) {
  21176. global_var.columns++;
  21177. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21178. global_var.value.push(0);
  21179. }
  21180. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21181. global_var.value.push(0.0);
  21182. }
  21183. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21184. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21185. }
  21186. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21187. global_var.value.push(true);
  21188. }
  21189. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21190. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21191. }
  21192. }
  21193. function removeColumnGlobalMatrix(global_var) {
  21194. if (global_var.columns == 0) {
  21195. return;
  21196. }
  21197. global_var.columns--;
  21198. for (var i = 0; i < global_var.rows; i++) {
  21199. global_var.value[i].splice(global_var.value[i].length - 1, 1);
  21200. }
  21201. }
  21202. function addColumnGlobalMatrix(global_var) {
  21203. global_var.columns++;
  21204. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21205. for (var i = 0; i < global_var.rows; i++) {
  21206. global_var.value[i].push(0);
  21207. }
  21208. }
  21209. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21210. for (var i = 0; i < global_var.rows; i++) {
  21211. global_var.value[i].push(0.0);
  21212. }
  21213. }
  21214. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21215. for (var i = 0; i < global_var.rows; i++) {
  21216. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21217. }
  21218. }
  21219. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21220. for (var i = 0; i < global_var.rows; i++) {
  21221. global_var.value[i].push(true);
  21222. }
  21223. }
  21224. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21225. for (var i = 0; i < global_var.rows; i++) {
  21226. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21227. }
  21228. }
  21229. }
  21230. function removeLineGlobalMatrix(global_var) {
  21231. if (global_var.rows == 0) {
  21232. return;
  21233. }
  21234. global_var.rows--;
  21235. global_var.value.splice(global_var.value.length - 1, 1);
  21236. }
  21237. function addLineGlobalMatrix(global_var) {
  21238. global_var.rows++;
  21239. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21240. var n_l = [];
  21241. for (var i = 0; i < global_var.columns; i++) {
  21242. n_l.push(0);
  21243. }
  21244. global_var.value.push(n_l);
  21245. }
  21246. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21247. var n_l = [];
  21248. for (i = 0; i < global_var.columns; i++) {
  21249. n_l.push(0.0);
  21250. }
  21251. global_var.value.push(n_l);
  21252. }
  21253. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21254. var n_l = [];
  21255. for (i = 0; i < global_var.columns; i++) {
  21256. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21257. }
  21258. global_var.value.push(n_l);
  21259. }
  21260. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21261. var n_l = [];
  21262. for (i = 0; i < global_var.columns; i++) {
  21263. n_l.push(true);
  21264. }
  21265. global_var.value.push(n_l);
  21266. }
  21267. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21268. var n_l = [];
  21269. for (i = 0; i < global_var.columns; i++) {
  21270. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21271. }
  21272. global_var.value.push(n_l);
  21273. }
  21274. }
  21275. function alternateBooleanGlobalMatrixValue(global_var, row, index, value_container) {
  21276. global_var.value[row][index] = !global_var.value[row][index];
  21277. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[row][index])));
  21278. }
  21279. function renderValues(global_var, global_container) {
  21280. var ret = "";
  21281. var j = 0;
  21282. if (global_var.dimensions == 0) {
  21283. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21284. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value.toFixed(1) + '</span> </div> ';
  21285. } else {
  21286. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21287. ret += '<div class="created_div_valor_var"><span class="span_value_variable boolean_simple_type">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value)) + '</span> </div> ';
  21288. } else {
  21289. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value + '</span> </div> ';
  21290. }
  21291. }
  21292. } else {
  21293. ret += '<table class="tabela_var">';
  21294. if (global_var.dimensions == 1) {
  21295. ret += '<tr>';
  21296. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21297. for (var k = 0; k < global_var.columns; k++) {
  21298. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k].toFixed(1) + '</span></td>';
  21299. }
  21300. } else {
  21301. for (var k = 0; k < global_var.columns; k++) {
  21302. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21303. ret += '<td><span class="span_value_variable boolean_vector_var" data-index="' + k + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[k])) + '</span></td>';
  21304. } else {
  21305. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k] + '</span>' + '</td>';
  21306. }
  21307. }
  21308. }
  21309. ret += '</tr>';
  21310. ret += '</table>';
  21311. ret += '<div class="buttons_manage_columns"><i class="ui icon minus square outline remove_global_vector_column"></i>' + ' <i class="ui icon plus square outline add_global_vector_column"></i></div>';
  21312. }
  21313. if (global_var.dimensions == 2) {
  21314. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21315. for (var l = 0; l < global_var.rows; l++) {
  21316. ret += '<tr>';
  21317. for (var k = 0; k < global_var.columns; k++) {
  21318. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  21319. }
  21320. ret += '</tr>';
  21321. }
  21322. } else {
  21323. for (var l = 0; l < global_var.rows; l++) {
  21324. ret += '<tr>';
  21325. for (var k = 0; k < global_var.columns; k++) {
  21326. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21327. ret += '<td><span class="span_value_variable boolean_matrix_var" data-index="' + k + '" data-row="' + l + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[l][k])) + '</span></td>';
  21328. } else {
  21329. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k] + '</span></td>';
  21330. }
  21331. }
  21332. ret += '</tr>';
  21333. }
  21334. }
  21335. if (global_var.rows == 0) {
  21336. ret += '<tr><td></td></tr>';
  21337. }
  21338. ret += '<tr><td colspan="' + global_var.columns + '" class="tr_manage_lines"><i class="ui icon minus square outline remove_global_matrix_line"></i>' + ' <i class="ui icon plus square outline add_global_matrix_line"></i></td></tr>';
  21339. ret += '</table>';
  21340. ret += '<div class="buttons_manage_columns"><i class="ui icon minus square outline remove_global_matrix_column"></i>' + ' <i class="ui icon plus square outline add_global_matrix_column"></i></div>';
  21341. }
  21342. }
  21343. global_container.find(".div_valor_var").html('');
  21344. ret = $(ret);
  21345. ret.find('.span_value_variable').data('associatedOject', global_var);
  21346. ret.find(".boolean_simple_type").on('click', function (e) {
  21347. alternateBooleanGlobalValue(global_var, this.parentNode);
  21348. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21349. });
  21350. ret.find(".simple_var").on('click', function (e) {
  21351. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21352. enableGlobalValueUpdate(global_var, this.parentNode);
  21353. });
  21354. ret.find(".boolean_vector_var").on('click', function (e) {
  21355. alternateBooleanGlobalVectorValue(global_var, $(this).data('index'), this.parentNode);
  21356. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21357. });
  21358. ret.find(".vector_var").on('click', function (e) {
  21359. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21360. enableGlobalVectorValueUpdate(global_var, $(this).data('index'), this.parentNode);
  21361. });
  21362. ret.find(".remove_global_vector_column").on('click', function (e) {
  21363. removeGlobalColumnVector(global_var);
  21364. global_container.find(".div_valor_var").html('');
  21365. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_TYPE, global_var.type, global_var.dimensions, global_var.rows, global_var.columns);
  21366. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21367. renderValues(global_var, global_container);
  21368. });
  21369. ret.find(".add_global_vector_column").on('click', function (e) {
  21370. addGlobalColumnVector(global_var);
  21371. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_TYPE, global_var.type, global_var.dimensions, global_var.rows, global_var.columns);
  21372. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21373. global_container.find(".div_valor_var").html('');
  21374. renderValues(global_var, global_container);
  21375. });
  21376. ret.find(".remove_global_matrix_column").on('click', function (e) {
  21377. removeColumnGlobalMatrix(global_var);
  21378. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_TYPE, global_var.type, global_var.dimensions, global_var.rows, global_var.columns);
  21379. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21380. global_container.find(".div_valor_var").html('');
  21381. renderValues(global_var, global_container);
  21382. });
  21383. ret.find(".add_global_matrix_column").on('click', function (e) {
  21384. addColumnGlobalMatrix(global_var);
  21385. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_TYPE, global_var.type, global_var.dimensions, global_var.rows, global_var.columns);
  21386. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21387. global_container.find(".div_valor_var").html('');
  21388. renderValues(global_var, global_container);
  21389. });
  21390. ret.find(".remove_global_matrix_line").on('click', function (e) {
  21391. removeLineGlobalMatrix(global_var);
  21392. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_TYPE, global_var.type, global_var.dimensions, global_var.rows, global_var.columns);
  21393. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21394. global_container.find(".div_valor_var").html('');
  21395. renderValues(global_var, global_container);
  21396. });
  21397. ret.find(".add_global_matrix_line").on('click', function (e) {
  21398. addLineGlobalMatrix(global_var);
  21399. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_TYPE, global_var.type, global_var.dimensions, global_var.rows, global_var.columns);
  21400. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21401. global_container.find(".div_valor_var").html('');
  21402. renderValues(global_var, global_container);
  21403. });
  21404. ret.find(".boolean_matrix_var").on('click', function (e) {
  21405. alternateBooleanGlobalMatrixValue(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  21406. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21407. });
  21408. ret.find(".matrix_var").on('click', function (e) {
  21409. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21410. enableGlobalMatrixValueUpdate(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  21411. });
  21412. global_container.find(".div_valor_var").append(ret);
  21413. updateColumnsAndRowsText(global_container, global_var);
  21414. }
  21415. function addHandlers(global_container) {
  21416. var global_var = global_container.data('associatedOject'); // Manage constant option:
  21417. global_container.find(".alternate_constant").on('click', function (e) {
  21418. toggleConstant(global_var);
  21419. $(this).removeClass("on off");
  21420. if (global_var.is_constant) {
  21421. $(this).addClass("on");
  21422. } else {
  21423. $(this).addClass("off");
  21424. }
  21425. }); // Manage global name:
  21426. global_container.find(".editing_name_var").on('click', function (e) {
  21427. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_NAME);
  21428. enableNameUpdate(global_container);
  21429. }); // Menu to change type:
  21430. global_container.find('.ui.dropdown.global_type').dropdown({
  21431. onChange: function onChange(_, __, $selectedItem) {
  21432. if ($selectedItem.data('dimensions')) {
  21433. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  21434. } else {
  21435. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  21436. }
  21437. renderValues(global_var, global_container);
  21438. },
  21439. selectOnKeydown: false
  21440. }); // Remove global:
  21441. global_container.find(".remove_global").on('click', function (e) {
  21442. removeGlobal(global_var, global_container);
  21443. });
  21444. }
  21445. function updateColumnsAndRowsText(global_container, global_var) {
  21446. var prev = global_container.find('.text').text().split('[');
  21447. if (prev.length == 2) {
  21448. var ff = prev[0] + '[ ' + global_var.columns + ' ] ';
  21449. global_container.find('.text').empty();
  21450. global_container.find('.text').text(ff);
  21451. }
  21452. if (prev.length == 3) {
  21453. var ff = prev[0] + '[ ' + global_var.columns + ' ] [ ' + global_var.rows + ' ] ';
  21454. global_container.find('.text').empty();
  21455. global_container.find('.text').text(ff);
  21456. }
  21457. }
  21458. function renderGlobal(global_var) {
  21459. var element = '<div class="ui label global_container pink"><i class="ui icon ellipsis vertical inverted"></i><div class="global_const">const: ';
  21460. element += '<i class="ui icon toggle ' + (global_var.is_constant ? "on" : "off") + ' alternate_constant"></i></div>';
  21461. element += '<div class="ui dropdown global_type">';
  21462. if (global_var.dimensions == 1) {
  21463. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + ': ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type));
  21464. element += ' [ <span class="dimensions_0"></span> ] ';
  21465. element += '</div>';
  21466. } else if (global_var.dimensions == 2) {
  21467. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + ': ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type));
  21468. element += ' [ <span class="dimensions_0"></span> ] [ <span class="dimensions_1"></span> ] ';
  21469. element += '</div>';
  21470. } else {
  21471. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type.toLowerCase())) + '</div>';
  21472. }
  21473. element += '<div class="menu">';
  21474. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21475. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21476. continue;
  21477. }
  21478. element += '<div class="item ' + (global_var.type == tm.toLowerCase() && global_var.dimensions == 0 ? ' selected ' : '') + '" data-type="' + tm + '" >' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  21479. }
  21480. element += '<div class="item ' + (global_var.dimensions == 1 ? ' selected ' : '') + '">' + '<i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + '<div class="menu">';
  21481. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21482. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21483. continue;
  21484. }
  21485. element += '<div class="item ' + (global_var.type == tm.toLowerCase() && global_var.dimensions == 1 ? ' selected ' : '') + '" data-text="' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + ':' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + ' [ ] " data-type="' + tm + '" data-dimensions="1"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  21486. }
  21487. element += '</div></div>';
  21488. element += '<div class="item ' + (global_var.dimensions == 2 ? ' selected ' : '') + '">' + '<i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + '<div class="menu">';
  21489. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21490. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21491. continue;
  21492. }
  21493. element += '<div class="item ' + (global_var.type == tm.toLowerCase() && global_var.dimensions == 2 ? ' selected ' : '') + '" data-text="' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + ':' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + ' [ ] " data-type="' + tm + '" data-dimensions="2"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  21494. }
  21495. element += '</div></div>';
  21496. element += '</div></div> <div class="editing_name_var"> <span class="span_name_variable enable_edit_name_parameter">' + global_var.name + '</span> </div> <span class="character_equals"> <&#8212; </span> ';
  21497. element += '<div class="ui div_valor_var">' + global_var.value + '</div>';
  21498. element += ' <i class="yellow inverted icon times remove_global"></i></div>';
  21499. var complete_element = $(element);
  21500. complete_element.data('associatedOject', global_var);
  21501. $('.list_globals').append(complete_element);
  21502. addHandlers(complete_element);
  21503. renderValues(global_var, complete_element);
  21504. if (global_var.dimensions == 1) {
  21505. complete_element.find('.dimensions_0').text(global_var.columns);
  21506. }
  21507. if (global_var.dimensions == 2) {
  21508. complete_element.find('.dimensions_0').text(global_var.columns);
  21509. complete_element.find('.dimensions_1').text(global_var.rows);
  21510. }
  21511. return complete_element;
  21512. }
  21513. var opened_name_value_matrix_global_v = false;
  21514. var opened_input_value_matrix_global_v = null;
  21515. function enableGlobalMatrixValueUpdate(global_var, row, index, parent_node) {
  21516. if (opened_name_value_matrix_global_v) {
  21517. opened_input_value_matrix_global_v.focus();
  21518. return;
  21519. }
  21520. parent_node = $(parent_node);
  21521. opened_name_value_matrix_global_v = true;
  21522. parent_node.find('.span_value_variable').text('');
  21523. var input_field;
  21524. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21525. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[row][index].toFixed(1) + "' />");
  21526. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21527. } else {
  21528. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[row][index] + "' />");
  21529. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21530. }
  21531. input_field.on('input', function () {
  21532. var inputWidth = input_field.textWidth() + 10;
  21533. opened_input_value_matrix_global_v = input_field;
  21534. input_field.focus();
  21535. var tmpStr = input_field.val();
  21536. input_field.val('');
  21537. input_field.val(tmpStr);
  21538. input_field.css({
  21539. width: inputWidth
  21540. });
  21541. }).trigger('input');
  21542. input_field.focusout(function () {
  21543. /// update array:
  21544. if (input_field.val().trim()) {
  21545. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21546. global_var.value[row][index] = parseFloat(input_field.val().trim());
  21547. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21548. } else {
  21549. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21550. global_var.value[row][index] = parseInt(input_field.val().trim());
  21551. } else {
  21552. global_var.value[row][index] = input_field.val().trim();
  21553. }
  21554. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21555. }
  21556. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21557. } else {
  21558. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21559. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21560. } else {
  21561. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21562. }
  21563. }
  21564. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21565. global_var.value[row][index] = input_field.val();
  21566. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21567. }
  21568. input_field.off();
  21569. input_field.remove(); /// update elements:
  21570. opened_name_value_matrix_global_v = false;
  21571. opened_input_value_matrix_global_v = false;
  21572. });
  21573. input_field.on('keydown', function (e) {
  21574. var code = e.keyCode || e.which;
  21575. if (code == 13) {
  21576. if (input_field.val().trim()) {
  21577. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21578. global_var.value[row][index] = parseFloat(input_field.val().trim());
  21579. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21580. } else {
  21581. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21582. global_var.value[row][index] = parseInt(input_field.val().trim());
  21583. } else {
  21584. global_var.value[row][index] = input_field.val().trim();
  21585. }
  21586. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21587. }
  21588. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21589. } else {
  21590. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21591. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21592. } else {
  21593. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21594. }
  21595. }
  21596. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21597. global_var.value[row][index] = input_field.val();
  21598. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21599. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21600. }
  21601. input_field.off();
  21602. input_field.remove(); /// update elements:
  21603. opened_name_value_matrix_global_v = false;
  21604. opened_input_value_matrix_global_v = false;
  21605. }
  21606. if (code == 27) {
  21607. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21608. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21609. } else {
  21610. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21611. }
  21612. input_field.off();
  21613. input_field.remove(); /// update elements:
  21614. opened_name_value_matrix_global_v = false;
  21615. opened_input_value_matrix_global_v = false;
  21616. }
  21617. });
  21618. input_field.select();
  21619. }
  21620. var opened_name_value_global_var = false;
  21621. var opened_input_value_global_ar = null;
  21622. function enableGlobalValueUpdate(global_var, parent_node) {
  21623. if (opened_name_value_global_var) {
  21624. opened_input_value_global_ar.focus();
  21625. return;
  21626. }
  21627. parent_node = $(parent_node);
  21628. opened_name_value_global_var = true;
  21629. parent_node.find('.span_value_variable').text('');
  21630. var input_field;
  21631. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21632. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value.toFixed(1) + "' />");
  21633. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21634. } else {
  21635. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value + "' />");
  21636. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21637. }
  21638. input_field.on('input', function () {
  21639. var inputWidth = input_field.textWidth() + 10;
  21640. opened_input_value_global_ar = input_field;
  21641. input_field.focus();
  21642. var tmpStr = input_field.val();
  21643. input_field.val('');
  21644. input_field.val(tmpStr);
  21645. input_field.css({
  21646. width: inputWidth
  21647. });
  21648. }).trigger('input');
  21649. input_field.focusout(function () {
  21650. var changed = false; /// update array:
  21651. if (input_field.val().trim()) {
  21652. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21653. global_var.value = parseFloat(input_field.val().trim());
  21654. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21655. } else {
  21656. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21657. global_var.value = parseInt(input_field.val().trim());
  21658. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21659. global_var.value = input_field.val().charAt(0);
  21660. } else {
  21661. global_var.value = input_field.val().trim();
  21662. }
  21663. parent_node.find('.span_value_variable').text(global_var.value);
  21664. }
  21665. changed = true;
  21666. } else {
  21667. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21668. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21669. } else {
  21670. parent_node.find('.span_value_variable').text(global_var.value);
  21671. }
  21672. }
  21673. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21674. global_var.value = input_field.val();
  21675. changed = true;
  21676. parent_node.find('.span_value_variable').text(global_var.value);
  21677. }
  21678. if (changed) {
  21679. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21680. }
  21681. input_field.off();
  21682. input_field.remove(); /// update elements:
  21683. opened_name_value_global_var = false;
  21684. opened_input_value_global_ar = false;
  21685. });
  21686. input_field.on('keydown', function (e) {
  21687. var code = e.keyCode || e.which;
  21688. var changed = true;
  21689. if (code == 13) {
  21690. if (input_field.val().trim()) {
  21691. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21692. global_var.value = parseFloat(input_field.val().trim());
  21693. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21694. } else {
  21695. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21696. global_var.value = parseInt(input_field.val().trim());
  21697. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21698. global_var.value = input_field.val().charAt(0);
  21699. } else {
  21700. global_var.value = input_field.val().trim();
  21701. }
  21702. parent_node.find('.span_value_variable').text(global_var.value);
  21703. }
  21704. changed = true;
  21705. } else {
  21706. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21707. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21708. } else {
  21709. parent_node.find('.span_value_variable').text(global_var.value);
  21710. }
  21711. }
  21712. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21713. global_var.value = input_field.val();
  21714. changed = true;
  21715. parent_node.find('.span_value_variable').text(global_var.value);
  21716. }
  21717. if (changed) {
  21718. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21719. }
  21720. input_field.off();
  21721. input_field.remove(); /// update elements:
  21722. opened_name_value_global_var = false;
  21723. opened_input_value_global_ar = false;
  21724. }
  21725. if (code == 27) {
  21726. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21727. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21728. } else {
  21729. parent_node.find('.span_value_variable').text(global_var.value);
  21730. }
  21731. input_field.off();
  21732. input_field.remove(); /// update elements:
  21733. opened_name_value_global_var = false;
  21734. opened_input_value_global_ar = false;
  21735. }
  21736. });
  21737. input_field.select();
  21738. }
  21739. var opened_name_global = false;
  21740. var opened_input_global = null;
  21741. function enableNameUpdate(global_container) {
  21742. var global_var = global_container.data('associatedOject');
  21743. if (opened_name_global) {
  21744. opened_input_global.focus();
  21745. return;
  21746. }
  21747. opened_name_global = true;
  21748. global_container.find('.span_name_variable').text('');
  21749. var input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.name + "' />");
  21750. input_name.insertBefore(global_container.find('.span_name_variable'));
  21751. input_name.on('input', function () {
  21752. var inputWidth = input_name.textWidth() + 10;
  21753. opened_input_global = input_name;
  21754. opened_input_global.focus();
  21755. opened_input_global.css({
  21756. width: inputWidth
  21757. });
  21758. }).trigger('input');
  21759. input_name.focusout(function () {
  21760. /// update array:
  21761. if (input_name.val().trim().length > 0) {
  21762. updateName(global_var, input_name.val().trim(), global_container);
  21763. global_container.find('.span_name_variable').text(global_var.name);
  21764. } else {
  21765. global_container.find('.span_name_variable').text(global_var.name);
  21766. }
  21767. input_name.off();
  21768. input_name.remove(); /// update elements:
  21769. opened_name_global = false;
  21770. opened_input_global = false;
  21771. });
  21772. input_name.on('keydown', function (e) {
  21773. var code = e.keyCode || e.which;
  21774. if (code == 13) {
  21775. if (input_name.val().trim()) {
  21776. updateName(global_var, input_name.val().trim(), global_container);
  21777. global_container.find('.span_name_variable').text(global_var.name);
  21778. } else {
  21779. global_container.find('.span_name_variable').text(global_var.name);
  21780. }
  21781. input_name.off();
  21782. input_name.remove(); /// update elements:
  21783. opened_name_global = false;
  21784. opened_input_global = false;
  21785. }
  21786. if (code == 27) {
  21787. global_container.find('.span_name_variable').text(global_var.name);
  21788. input_name.off();
  21789. input_name.remove(); /// update elements:
  21790. opened_name_global = false;
  21791. opened_input_global = false;
  21792. }
  21793. });
  21794. input_name.select();
  21795. }
  21796. var opened_name_value_vector_global_ = false;
  21797. var opened_input_value_vector_global_ = null;
  21798. function enableGlobalVectorValueUpdate(global_var, index, parent_node) {
  21799. if (opened_name_value_vector_global_) {
  21800. opened_input_value_vector_global_.focus();
  21801. return;
  21802. }
  21803. parent_node = $(parent_node);
  21804. opened_name_value_vector_global_ = true;
  21805. parent_node.find('.span_value_variable').text('');
  21806. var input_field;
  21807. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21808. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[index].toFixed(1) + "' />");
  21809. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21810. } else {
  21811. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[index] + "' />");
  21812. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21813. }
  21814. input_field.on('input', function () {
  21815. var inputWidth = input_field.textWidth() + 10;
  21816. opened_input_value_vector_global_ = input_field;
  21817. input_field.focus();
  21818. var tmpStr = input_field.val();
  21819. input_field.val('');
  21820. input_field.val(tmpStr);
  21821. input_field.css({
  21822. width: inputWidth
  21823. });
  21824. }).trigger('input');
  21825. input_field.focusout(function () {
  21826. var changed = false; /// update array:
  21827. if (input_field.val().trim()) {
  21828. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21829. global_var.value[index] = parseFloat(input_field.val().trim());
  21830. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21831. } else {
  21832. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21833. global_var.value[index] = parseInt(input_field.val().trim());
  21834. } else {
  21835. global_var.value[index] = input_field.val().trim();
  21836. }
  21837. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21838. }
  21839. changed = true;
  21840. } else {
  21841. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21842. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21843. } else {
  21844. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21845. }
  21846. }
  21847. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21848. global_var.value[index] = input_field.val();
  21849. changed = true;
  21850. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21851. }
  21852. if (changed) {
  21853. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21854. }
  21855. input_field.off();
  21856. input_field.remove(); /// update elements:
  21857. opened_name_value_vector_global_ = false;
  21858. opened_input_value_vector_global_ = false;
  21859. });
  21860. input_field.on('keydown', function (e) {
  21861. var code = e.keyCode || e.which;
  21862. var changed = false;
  21863. if (code == 13) {
  21864. if (input_field.val().trim()) {
  21865. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21866. global_var.value[index] = parseFloat(input_field.val().trim());
  21867. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21868. } else {
  21869. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21870. global_var.value[index] = parseInt(input_field.val().trim());
  21871. } else {
  21872. global_var.value[index] = input_field.val().trim();
  21873. }
  21874. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21875. }
  21876. changed = true;
  21877. } else {
  21878. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21879. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21880. } else {
  21881. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21882. }
  21883. }
  21884. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21885. global_var.value[index] = input_field.val();
  21886. changed = true;
  21887. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21888. }
  21889. if (changed) {
  21890. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21891. }
  21892. input_field.off();
  21893. input_field.remove(); /// update elements:
  21894. opened_name_value_vector_global_ = false;
  21895. opened_input_value_vector_global_ = false;
  21896. }
  21897. if (code == 27) {
  21898. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21899. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21900. } else {
  21901. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21902. }
  21903. input_field.off();
  21904. input_field.remove(); /// update elements:
  21905. opened_name_value_vector_global_ = false;
  21906. opened_input_value_vector_global_ = false;
  21907. }
  21908. });
  21909. input_field.select();
  21910. }
  21911. $.fn.textWidth = function (text, font) {
  21912. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  21913. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  21914. return $.fn.textWidth.fakeEl.width();
  21915. };
  21916. /***/ }),
  21917. /***/ "./js/visualUI/ivprog_elements.js":
  21918. /*!****************************************!*\
  21919. !*** ./js/visualUI/ivprog_elements.js ***!
  21920. \****************************************/
  21921. /*! exports provided: COMMAND_TYPES, ARITHMETIC_TYPES, EXPRESSION_ELEMENTS, EXPRESSION_TYPES, ARITHMETIC_COMPARISON, LOGIC_COMPARISON, SYSTEM_FUNCTIONS_CATEGORIES, Variable, Function, SystemFunction, Comment, Break, Reader, Writer, Attribution, ExpressionOperator, ExpressionElement, ConditionalExpression, LogicExpression, ArithmeticExpression, IfTrue, RepeatNTimes, WhileTrue, DoWhileTrue, Switch, Return, SwitchCase, FunctionCall, VariableValueMenu, FunctionCallMenu, Program */
  21922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21923. "use strict";
  21924. __webpack_require__.r(__webpack_exports__);
  21925. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_TYPES", function() { return COMMAND_TYPES; });
  21926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_TYPES", function() { return ARITHMETIC_TYPES; });
  21927. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_ELEMENTS", function() { return EXPRESSION_ELEMENTS; });
  21928. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_TYPES", function() { return EXPRESSION_TYPES; });
  21929. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_COMPARISON", function() { return ARITHMETIC_COMPARISON; });
  21930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOGIC_COMPARISON", function() { return LOGIC_COMPARISON; });
  21931. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYSTEM_FUNCTIONS_CATEGORIES", function() { return SYSTEM_FUNCTIONS_CATEGORIES; });
  21932. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; });
  21933. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  21934. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemFunction", function() { return SystemFunction; });
  21935. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });
  21936. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  21937. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reader", function() { return Reader; });
  21938. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Writer", function() { return Writer; });
  21939. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribution", function() { return Attribution; });
  21940. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionOperator", function() { return ExpressionOperator; });
  21941. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionElement", function() { return ExpressionElement; });
  21942. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionalExpression", function() { return ConditionalExpression; });
  21943. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicExpression", function() { return LogicExpression; });
  21944. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArithmeticExpression", function() { return ArithmeticExpression; });
  21945. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfTrue", function() { return IfTrue; });
  21946. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatNTimes", function() { return RepeatNTimes; });
  21947. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WhileTrue", function() { return WhileTrue; });
  21948. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DoWhileTrue", function() { return DoWhileTrue; });
  21949. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  21950. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  21951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwitchCase", function() { return SwitchCase; });
  21952. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  21953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableValueMenu", function() { return VariableValueMenu; });
  21954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCallMenu", function() { return FunctionCallMenu; });
  21955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Program", function() { return Program; });
  21956. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  21957. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__);
  21958. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  21959. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  21960. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  21961. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  21962. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__);
  21963. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  21964. var COMMAND_TYPES = Object.freeze({
  21965. "function": "function",
  21966. comment: "comment",
  21967. reader: "reader",
  21968. writer: "writer",
  21969. attribution: "attribution",
  21970. iftrue: "iftrue",
  21971. repeatNtimes: "repeatNtimes",
  21972. whiletrue: "whiletrue",
  21973. dowhiletrue: "dowhiletrue",
  21974. "switch": "switch",
  21975. switchcase: "switchcase",
  21976. functioncall: "functioncall",
  21977. "break": "break",
  21978. "return": "return"
  21979. });
  21980. var ARITHMETIC_TYPES = Object.freeze({
  21981. plus: "plus",
  21982. minus: "minus",
  21983. multiplication: "multiplication",
  21984. division: "division",
  21985. module: "module",
  21986. none: "none"
  21987. });
  21988. var EXPRESSION_ELEMENTS = Object.freeze({
  21989. exp_op_exp: "exp_op_exp",
  21990. op_exp: "op_exp",
  21991. par_exp_par: "par_exp_par",
  21992. start_point: "start_point"
  21993. });
  21994. var EXPRESSION_TYPES = Object.freeze({
  21995. exp_conditional: "exp_conditional",
  21996. exp_logic: "exp_logic",
  21997. exp_arithmetic: "exp_arithmetic",
  21998. write_sep: "write_separator"
  21999. });
  22000. var ARITHMETIC_COMPARISON = Object.freeze({
  22001. greater_than: "greater_than",
  22002. less_than: "less_than",
  22003. equals_to: "equals_to",
  22004. not_equals_to: "not_equals_to",
  22005. greater_than_or_equals_to: "greater_than_or_equals_to",
  22006. less_than_or_equals_to: "less_than_or_equals_to"
  22007. });
  22008. var LOGIC_COMPARISON = Object.freeze({
  22009. equals_to: "equals_to",
  22010. not_equals_to: "not_equals_to",
  22011. and: "and",
  22012. or: "or",
  22013. not: "not"
  22014. });
  22015. var SYSTEM_FUNCTIONS_CATEGORIES = Object.freeze({
  22016. math: "$mathLib",
  22017. text: "$strLib",
  22018. arrangement: "$arrayLib",
  22019. conversion: "$langLib"
  22020. });
  22021. var Variable = function Variable(type, name, value) {
  22022. var dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  22023. var is_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  22024. var rows = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  22025. var columns = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
  22026. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Variable);
  22027. this.type = type;
  22028. this.name = name;
  22029. this.value = value;
  22030. this.dimensions = dimensions;
  22031. this.is_constant = is_constant;
  22032. this.rows = rows;
  22033. this.columns = columns;
  22034. };
  22035. var Function = function Function(name) {
  22036. var return_type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID;
  22037. var return_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  22038. var parameters_list = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  22039. var is_main = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  22040. var is_hidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
  22041. var variables_list = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
  22042. var function_comment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
  22043. var commands = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];
  22044. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Function);
  22045. this.type = COMMAND_TYPES["function"];
  22046. this.name = name;
  22047. this.return_type = return_type;
  22048. this.return_dimensions = return_dimensions;
  22049. this.parameters_list = parameters_list;
  22050. this.is_main = is_main;
  22051. this.is_hidden = is_hidden;
  22052. this.variables_list = variables_list;
  22053. this.function_comment = function_comment;
  22054. this.commands = commands;
  22055. };
  22056. var SystemFunction = function SystemFunction(identifier, return_type, return_dimensions, parameters_list) {
  22057. var function_comment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  22058. var category = arguments.length > 5 ? arguments[5] : undefined;
  22059. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SystemFunction);
  22060. this.type = COMMAND_TYPES["function"];
  22061. this.identifier = identifier;
  22062. this.return_type = return_type;
  22063. this.return_dimensions = return_dimensions;
  22064. this.parameters_list = parameters_list;
  22065. this.function_comment = function_comment;
  22066. this.category = category;
  22067. };
  22068. var Comment = function Comment(comment_text) {
  22069. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Comment);
  22070. this.type = COMMAND_TYPES.comment;
  22071. this.comment_text = comment_text;
  22072. };
  22073. var Break = function Break() {
  22074. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Break);
  22075. this.type = COMMAND_TYPES["break"];
  22076. };
  22077. var Reader = function Reader() {
  22078. var variable_value_menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new VariableValueMenu();
  22079. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Reader);
  22080. this.type = COMMAND_TYPES.reader;
  22081. this.variable_value_menu = variable_value_menu;
  22082. };
  22083. var Writer = function Writer(content) {
  22084. var newline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  22085. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Writer);
  22086. this.type = COMMAND_TYPES.writer;
  22087. this.content = content;
  22088. this.newline = newline;
  22089. };
  22090. var Attribution = function Attribution(variable) {
  22091. var expression = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22092. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Attribution);
  22093. this.type = COMMAND_TYPES.attribution;
  22094. this.variable = variable;
  22095. this.expression = expression;
  22096. };
  22097. var ExpressionOperator = function ExpressionOperator(type_op, item) {
  22098. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionOperator);
  22099. this.type_op = type_op; // Logic, Arithmetic OR Relational
  22100. this.item = item;
  22101. };
  22102. var ExpressionElement = function ExpressionElement(type_exp) {
  22103. var itens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22104. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionElement);
  22105. this.type_exp = type_exp;
  22106. this.itens = itens;
  22107. };
  22108. var ConditionalExpression = function ConditionalExpression(expression) {
  22109. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ConditionalExpression);
  22110. this.type = EXPRESSION_TYPES.exp_conditional;
  22111. this.expression = expression;
  22112. };
  22113. var LogicExpression = function LogicExpression(has_neg, first_operand, second_operand, operator) {
  22114. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, LogicExpression);
  22115. this.type = EXPRESSION_TYPES.exp_logic;
  22116. this.has_neg = has_neg;
  22117. this.first_operand = first_operand;
  22118. this.second_operand = second_operand;
  22119. this.operator = operator;
  22120. };
  22121. var ArithmeticExpression = function ArithmeticExpression(first_operand, second_operand, operator) {
  22122. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ArithmeticExpression);
  22123. this.type = EXPRESSION_TYPES.exp_arithmetic;
  22124. this.first_operand = first_operand;
  22125. this.second_operand = second_operand;
  22126. this.operator = operator;
  22127. };
  22128. var IfTrue = function IfTrue(expression, commands_block, commands_else) {
  22129. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, IfTrue);
  22130. this.type = COMMAND_TYPES.iftrue;
  22131. this.expression = expression;
  22132. this.commands_block = commands_block;
  22133. this.commands_else = commands_else;
  22134. };
  22135. var RepeatNTimes = function RepeatNTimes(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block) {
  22136. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, RepeatNTimes);
  22137. this.type = COMMAND_TYPES.repeatNtimes;
  22138. this.var_attribution = var_attribution;
  22139. this.var_incrementation = var_incrementation;
  22140. this.expression1 = expression1;
  22141. this.expression2 = expression2;
  22142. this.expression3 = expression3;
  22143. this.commands_block = commands_block;
  22144. };
  22145. var WhileTrue = function WhileTrue(expression, commands_block) {
  22146. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, WhileTrue);
  22147. this.type = COMMAND_TYPES.whiletrue;
  22148. this.expression = expression;
  22149. this.commands_block = commands_block;
  22150. };
  22151. var DoWhileTrue = function DoWhileTrue(expression, commands_block) {
  22152. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, DoWhileTrue);
  22153. this.type = COMMAND_TYPES.dowhiletrue;
  22154. this.expression = expression;
  22155. this.commands_block = commands_block;
  22156. };
  22157. var Switch = function Switch(variable) {
  22158. var cases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22159. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Switch);
  22160. this.type = COMMAND_TYPES["switch"];
  22161. this.variable = variable;
  22162. this.cases = cases;
  22163. };
  22164. var Return = function Return(variable_value_menu) {
  22165. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Return);
  22166. this.type = COMMAND_TYPES["return"];
  22167. this.variable_value_menu = variable_value_menu;
  22168. };
  22169. var SwitchCase = function SwitchCase(variable_value_menu) {
  22170. var commands_block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22171. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SwitchCase);
  22172. this.type = COMMAND_TYPES.switchcase;
  22173. this.variable_value_menu = variable_value_menu;
  22174. this.commands_block = commands_block;
  22175. };
  22176. var FunctionCall = function FunctionCall(function_called, parameters_list) {
  22177. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCall);
  22178. this.type = COMMAND_TYPES.functioncall;
  22179. this.function_called = function_called;
  22180. this.parameters_list = parameters_list;
  22181. };
  22182. var VariableValueMenu = function VariableValueMenu() {
  22183. var variable_and_value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
  22184. var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  22185. var row = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  22186. var column = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  22187. var include_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  22188. var dimensions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  22189. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, VariableValueMenu);
  22190. this.type = "var_value";
  22191. this.variable_and_value = variable_and_value;
  22192. this.content = content;
  22193. this.row = row;
  22194. this.column = column;
  22195. this.include_constant = include_constant;
  22196. this.dimensions = dimensions;
  22197. };
  22198. var FunctionCallMenu = function FunctionCallMenu() {
  22199. var function_called = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  22200. var parameters_list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22201. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCallMenu);
  22202. this.type = "function_call";
  22203. this.function_called = function_called;
  22204. this.parameters_list = parameters_list;
  22205. };
  22206. var Program = /*#__PURE__*/function () {
  22207. function Program() {
  22208. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Program);
  22209. this.functions = [];
  22210. this.globals = [];
  22211. }
  22212. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default()(Program, [{
  22213. key: "addFunction",
  22214. value: function addFunction(function_to_add) {
  22215. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.parameters_list, function () {
  22216. if (window.insertContext) {
  22217. setTimeout(function () {
  22218. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22219. }, 300);
  22220. window.insertContext = false;
  22221. } else {
  22222. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22223. }
  22224. }, 1);
  22225. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.variables_list, function () {
  22226. if (window.insertContext) {
  22227. setTimeout(function () {
  22228. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22229. }, 300);
  22230. window.insertContext = false;
  22231. } else {
  22232. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22233. }
  22234. }, 1);
  22235. this.functions.push(function_to_add);
  22236. }
  22237. }, {
  22238. key: "addVariable",
  22239. value: function addVariable(function_to_receive, variable) {
  22240. if (this.functions[function_to_receive].variable === null) {
  22241. this.functions[function_to_receive].variables_list = [];
  22242. }
  22243. this.functions[function_to_receive].variables_list.push(variable);
  22244. }
  22245. }, {
  22246. key: "addGlobal",
  22247. value: function addGlobal(variable) {
  22248. this.globals.push(variable);
  22249. }
  22250. }]);
  22251. return Program;
  22252. }();
  22253. /***/ }),
  22254. /***/ "./js/visualUI/text_editor.js":
  22255. /*!************************************!*\
  22256. !*** ./js/visualUI/text_editor.js ***!
  22257. \************************************/
  22258. /*! exports provided: initTextEditor, disable, updateEditor, setCode, getCode */
  22259. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22260. "use strict";
  22261. __webpack_require__.r(__webpack_exports__);
  22262. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initTextEditor", function() { return initTextEditor; });
  22263. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disable", function() { return disable; });
  22264. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateEditor", function() { return updateEditor; });
  22265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCode", function() { return setCode; });
  22266. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  22267. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! codemirror */ "./node_modules/codemirror/lib/codemirror.js");
  22268. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  22269. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! codemirror/addon/edit/closebrackets */ "./node_modules/codemirror/addon/edit/closebrackets.js");
  22270. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__);
  22271. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! codemirror/addon/edit/matchbrackets */ "./node_modules/codemirror/addon/edit/matchbrackets.js");
  22272. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__);
  22273. /* harmony import */ var codemirror_addon_selection_active_line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! codemirror/addon/selection/active-line */ "./node_modules/codemirror/addon/selection/active-line.js");
  22274. /* harmony import */ var codemirror_addon_selection_active_line__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_selection_active_line__WEBPACK_IMPORTED_MODULE_3__);
  22275. /* harmony import */ var _util_editorMode2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../util/editorMode2 */ "./js/util/editorMode2.js");
  22276. // import "codemirror/addon/hint/show-hint";
  22277. // import "codemirror/addon/hint/anyword-hint";
  22278. Object(_util_editorMode2__WEBPACK_IMPORTED_MODULE_4__["CodeEditorMode"])(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  22279. var codeEditor = null;
  22280. function initTextEditor(element) {
  22281. var id = element;
  22282. if (element[0] == '#') {
  22283. id = element.substring(1);
  22284. }
  22285. codeEditor = codemirror__WEBPACK_IMPORTED_MODULE_0__["fromTextArea"](document.getElementById(id), {
  22286. theme: "ttcn",
  22287. value: "",
  22288. mode: "text/x-ivprog",
  22289. indentUnit: 4,
  22290. lineNumbers: true,
  22291. matchBrackets: true,
  22292. autoCloseBrackets: true,
  22293. fixedGutter: true,
  22294. styleActiveLine: true,
  22295. readOnly: true
  22296. });
  22297. }
  22298. function disable(flag) {
  22299. codeEditor.setOption("readOnly", flag);
  22300. updateEditor();
  22301. }
  22302. function updateEditor() {
  22303. codeEditor.refresh();
  22304. }
  22305. function setCode(code) {
  22306. codeEditor.setValue(code);
  22307. }
  22308. function getCode() {
  22309. return codeEditor.getValue();
  22310. }
  22311. /***/ }),
  22312. /***/ "./js/visualUI/types.js":
  22313. /*!******************************!*\
  22314. !*** ./js/visualUI/types.js ***!
  22315. \******************************/
  22316. /*! exports provided: Types */
  22317. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22318. "use strict";
  22319. __webpack_require__.r(__webpack_exports__);
  22320. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Types", function() { return Types; });
  22321. var Types = Object.freeze({
  22322. INTEGER: "integer",
  22323. REAL: "real",
  22324. TEXT: "text",
  22325. CHAR: 'char',
  22326. BOOLEAN: "boolean",
  22327. VOID: "void"
  22328. });
  22329. /***/ }),
  22330. /***/ "./js/visualUI/utils.js":
  22331. /*!******************************!*\
  22332. !*** ./js/visualUI/utils.js ***!
  22333. \******************************/
  22334. /*! exports provided: renderErrorMessage */
  22335. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22336. "use strict";
  22337. __webpack_require__.r(__webpack_exports__);
  22338. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderErrorMessage", function() { return renderErrorMessage; });
  22339. function renderErrorMessage(dom_obj_target, message_text) {
  22340. dom_obj_target.popup({
  22341. html: '<i class="ui icon inverted exclamation triangle yellow"></i>' + message_text,
  22342. transition: "fade up",
  22343. on: 'click',
  22344. closable: true,
  22345. movePopup: true,
  22346. boundary: window,
  22347. preserve: false,
  22348. target: false,
  22349. className: {
  22350. popup: 'ui popup invalid-identifier'
  22351. },
  22352. onHidden: function onHidden($module) {
  22353. dom_obj_target.popup('destroy');
  22354. }
  22355. }).popup('toggle');
  22356. }
  22357. /***/ }),
  22358. /***/ "./js/visualUI/variables.js":
  22359. /*!**********************************!*\
  22360. !*** ./js/visualUI/variables.js ***!
  22361. \**********************************/
  22362. /*! exports provided: addVariable, renderVariable */
  22363. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22364. "use strict";
  22365. __webpack_require__.r(__webpack_exports__);
  22366. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVariable", function() { return addVariable; });
  22367. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderVariable", function() { return renderVariable; });
  22368. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  22369. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  22370. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  22371. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  22372. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  22373. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  22374. var counter_new_variables = 0;
  22375. function addVariable(function_obj, function_container) {
  22376. var is_in_click = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  22377. var new_var = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Variable"](_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('new_variable') + '_' + counter_new_variables, 0);
  22378. if (function_obj.variables_list == null) {
  22379. function_obj.variables_list = [];
  22380. }
  22381. function_obj.variables_list.push(new_var);
  22382. counter_new_variables++;
  22383. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].INSERT_FUNCTION_VAR, new_var.name, _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, 0);
  22384. var newe = renderVariable(function_container, new_var, function_obj);
  22385. if (is_in_click) {
  22386. newe.css('display', 'none');
  22387. newe.fadeIn();
  22388. }
  22389. }
  22390. function updateName(variable_obj, new_name, variable_obj_dom, function_obj) {
  22391. if (variable_obj.name == new_name) {
  22392. return;
  22393. }
  22394. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_5__["isValidIdentifier"])(new_name)) {
  22395. if (variableNameAlreadyExists(new_name, function_obj)) {
  22396. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_variable_duplicated', [new_name, function_obj.name]));
  22397. } else {
  22398. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].RENAME_FUNCTION_VAR, variable_obj.name, new_name);
  22399. variable_obj.name = new_name;
  22400. }
  22401. } else {
  22402. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  22403. }
  22404. }
  22405. function variableNameAlreadyExists(name_var, function_obj) {
  22406. if (function_obj.parameters_list) {
  22407. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  22408. if (function_obj.parameters_list[i].name == name_var) {
  22409. return true;
  22410. }
  22411. }
  22412. }
  22413. if (function_obj.variables_list) {
  22414. for (var i = 0; i < function_obj.variables_list.length; i++) {
  22415. if (function_obj.variables_list[i].name == name_var) {
  22416. return true;
  22417. }
  22418. }
  22419. }
  22420. return false;
  22421. }
  22422. function removeVariable(variable_obj, variable_container, function_name) {
  22423. var function_associated = variable_container.data('associatedFunction');
  22424. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_FUNCTION_VAR, variable_obj.name);
  22425. var index = function_associated.variables_list.indexOf(variable_obj);
  22426. if (index > -1) {
  22427. window.insertContext = true;
  22428. delete function_associated.variables_list[index];
  22429. function_associated.variables_list.splice(index, 1);
  22430. }
  22431. variable_container.children().off();
  22432. variable_container.off();
  22433. variable_container.fadeOut();
  22434. }
  22435. function updateType(variable_obj, new_type, function_name) {
  22436. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  22437. variable_obj.type = new_type;
  22438. variable_obj.dimensions = new_dimensions;
  22439. if (new_dimensions > 0) {
  22440. variable_obj.rows = new_dimensions;
  22441. variable_obj.columns = 2;
  22442. }
  22443. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_TYPE, variable_obj.name, new_type, new_dimensions, variable_obj.rows, variable_obj.columns);
  22444. updateInitialValues(variable_obj, function_name);
  22445. }
  22446. function addHandlers(variable_obj, variable_container, function_obj) {
  22447. // Manage variable name:
  22448. variable_container.find(".editing_name_var").on('click', function (e) {
  22449. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_NAME, variable_obj.name);
  22450. enableNameUpdate(variable_obj, variable_container, function_obj);
  22451. }); // Menu to change type:
  22452. variable_container.find('.ui.dropdown.variable_type').dropdown({
  22453. onChange: function onChange(_, __, $selectedItem) {
  22454. if ($selectedItem.data('dimensions')) {
  22455. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  22456. } else {
  22457. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  22458. }
  22459. renderValues(variable_obj, variable_container, function_obj.name);
  22460. },
  22461. selectOnKeydown: false
  22462. }); // Remove variable:
  22463. variable_container.find(".remove_variable").on('click', function (e) {
  22464. removeVariable(variable_obj, variable_container, function_obj.name);
  22465. });
  22466. }
  22467. function renderVariable(function_container, new_var, function_obj) {
  22468. var element = '<div class="ui label variable_container pink"><i class="ui icon ellipsis vertical inverted"></i>';
  22469. element += '<div class="ui dropdown variable_type">';
  22470. if (new_var.dimensions == 1) {
  22471. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + ': ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase()));
  22472. element += ' [ ] </div>';
  22473. } else if (new_var.dimensions == 2) {
  22474. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + ': ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase()));
  22475. element += ' [ ] [ ] </div>';
  22476. } else {
  22477. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase())) + '</div>';
  22478. }
  22479. element += '<div class="menu">';
  22480. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22481. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22482. continue;
  22483. }
  22484. element += '<div class="item ' + (new_var.type == tm.toLowerCase() && new_var.dimensions == 0 ? ' selected ' : '') + '" data-type="' + tm + '" >' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  22485. }
  22486. element += '<div class="item ' + (new_var.dimensions == 1 ? ' selected ' : '') + '">' + '<i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + '<div class="menu">';
  22487. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22488. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22489. continue;
  22490. }
  22491. element += '<div class="item ' + (new_var.type == tm.toLowerCase() && new_var.dimensions == 1 ? ' selected ' : '') + '" data-text="' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('vector') + ':' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + ' [ ] " data-type="' + tm + '" data-dimensions="1"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  22492. }
  22493. element += '</div></div>';
  22494. element += '<div class="item ' + (new_var.dimensions == 2 ? ' selected ' : '') + '">' + '<i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + '<div class="menu">';
  22495. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22496. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22497. continue;
  22498. }
  22499. element += '<div class="item ' + (new_var.type == tm.toLowerCase() && new_var.dimensions == 2 ? ' selected ' : '') + '" data-text="' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('matrix') + ':' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + ' [ ] " data-type="' + tm + '" data-dimensions="2"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(tm.toLowerCase())) + '</div>';
  22500. }
  22501. element += '</div></div>';
  22502. element += '</div></div> ';
  22503. element += '<div class="editing_name_var"><span class="span_name_variable enable_edit_name_variable">' + new_var.name + '</span> </div>';
  22504. element += ' <span class="character_equals"> <&#8212; </span> <div class="ui div_valor_var">' + new_var.value + '</div>';
  22505. element += ' <i class="yellow inverted icon times remove_variable"></i></div>';
  22506. element = $(element);
  22507. element.data('associatedFunction', function_obj);
  22508. function_container.find('.variables_list_div').append(element);
  22509. addHandlers(new_var, element, function_obj);
  22510. renderValues(new_var, element, function_obj.name);
  22511. return element;
  22512. }
  22513. function updateColumnsAndRowsText(variable_container, variable_var) {
  22514. var prev = variable_container.find('.text').text().split('[');
  22515. if (prev.length == 2) {
  22516. var ff = prev[0] + '[ ' + variable_var.columns + ' ] ';
  22517. variable_container.find('.text').empty();
  22518. variable_container.find('.text').text(ff);
  22519. }
  22520. if (prev.length == 3) {
  22521. var ff = prev[0] + '[ ' + variable_var.columns + ' ] [ ' + variable_var.rows + ' ] ';
  22522. variable_container.find('.text').empty();
  22523. variable_container.find('.text').text(ff);
  22524. }
  22525. }
  22526. function renderValues(new_var, variable_container, function_name) {
  22527. var ret = "";
  22528. var j = 0;
  22529. if (new_var.dimensions == 0) {
  22530. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22531. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value.toFixed(1) + '</span> </div> ';
  22532. } else {
  22533. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22534. ret += '<div class="created_div_valor_var"><span class="span_value_variable boolean_simple_type">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(new_var.value)) + '</span> </div> ';
  22535. } else {
  22536. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value + '</span> </div> ';
  22537. }
  22538. }
  22539. } else {
  22540. ret += '<table class="tabela_var">';
  22541. if (new_var.dimensions == 1) {
  22542. ret += '<tr>';
  22543. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22544. for (var k = 0; k < new_var.columns; k++) {
  22545. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k].toFixed(1) + '</span></td>';
  22546. }
  22547. } else {
  22548. for (var k = 0; k < new_var.columns; k++) {
  22549. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22550. ret += '<td><span class="span_value_variable boolean_vector_var" data-index="' + k + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(new_var.value[k])) + '</span></td>';
  22551. } else {
  22552. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k] + '</span>' + '</td>';
  22553. }
  22554. }
  22555. }
  22556. ret += '</tr>';
  22557. ret += '</table>';
  22558. ret += '<div class="buttons_manage_columns"><i class="ui icon minus square outline remove_global_vector_column"></i>' + ' <i class="ui icon plus square outline add_global_vector_column"></i></div>';
  22559. }
  22560. if (new_var.dimensions == 2) {
  22561. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22562. for (var l = 0; l < new_var.rows; l++) {
  22563. ret += '<tr>';
  22564. for (var k = 0; k < new_var.columns; k++) {
  22565. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  22566. }
  22567. ret += '</tr>';
  22568. }
  22569. } else {
  22570. for (var l = 0; l < new_var.rows; l++) {
  22571. ret += '<tr>';
  22572. for (var k = 0; k < new_var.columns; k++) {
  22573. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22574. ret += '<td><span class="span_value_variable boolean_matrix_var" data-index="' + k + '" data-row="' + l + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(new_var.value[l][k])) + '</span></td>';
  22575. } else {
  22576. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k] + '</span></td>';
  22577. }
  22578. }
  22579. ret += '</tr>';
  22580. }
  22581. }
  22582. if (new_var.rows == 0) {
  22583. ret += '<tr><td></td></tr>';
  22584. }
  22585. ret += '<tr><td colspan="' + new_var.columns + '" class="tr_manage_lines"><i class="ui icon minus square outline remove_global_matrix_line"></i>' + ' <i class="ui icon plus square outline add_global_matrix_line"></i></td></tr>';
  22586. ret += '</table>';
  22587. ret += '<div class="buttons_manage_columns"><i class="ui icon minus square outline remove_global_matrix_column"></i>' + ' <i class="ui icon plus square outline add_global_matrix_column"></i></div>';
  22588. }
  22589. }
  22590. $(variable_container).find(".div_valor_var").html('');
  22591. ret = $(ret);
  22592. $(ret).find('.span_value_variable').data('associatedOject', new_var);
  22593. $(ret).find(".boolean_simple_type").on('click', function (e) {
  22594. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, new_var.name, new_var.value);
  22595. alternateBooleanValue(new_var, this.parentNode);
  22596. });
  22597. $(ret).find(".simple_var").on('click', function (e) {
  22598. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  22599. enableValueUpdate(new_var, this.parentNode, function_name);
  22600. });
  22601. $(ret).find(".boolean_vector_var").on('click', function (e) {
  22602. alternateBooleanVectorValue(new_var, $(this).data('index'), this.parentNode);
  22603. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, new_var.name, new_var.value);
  22604. });
  22605. $(ret).find(".vector_var").on('click', function (e) {
  22606. enableVectorValueUpdate(new_var, $(this).data('index'), this.parentNode, function_name);
  22607. });
  22608. $(ret).find(".remove_global_vector_column").on('click', function (e) {
  22609. removeColumnVector(new_var);
  22610. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_TYPE, new_var.name, new_var.type, new_var.dimensions, new_var.rows, new_var.columns);
  22611. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, new_var.name, new_var.value);
  22612. $(variable_container).find(".div_valor_var").html('');
  22613. renderValues(new_var, variable_container, function_name);
  22614. });
  22615. $(ret).find(".add_global_vector_column").on('click', function (e) {
  22616. addColumnVector(new_var);
  22617. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_TYPE, new_var.name, new_var.type, new_var.dimensions, new_var.rows, new_var.columns);
  22618. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, new_var.name, new_var.value);
  22619. $(variable_container).find(".div_valor_var").html('');
  22620. renderValues(new_var, variable_container, function_name);
  22621. });
  22622. $(ret).find(".remove_global_matrix_column").on('click', function (e) {
  22623. removeColumnMatrix(new_var);
  22624. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_TYPE, new_var.name, new_var.type, new_var.dimensions, new_var.rows, new_var.columns);
  22625. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, new_var.name, new_var.value);
  22626. $(variable_container).find(".div_valor_var").html('');
  22627. renderValues(new_var, variable_container, function_name);
  22628. });
  22629. $(ret).find(".add_global_matrix_column").on('click', function (e) {
  22630. addColumnMatrix(new_var);
  22631. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_TYPE, new_var.name, new_var.type, new_var.dimensions, new_var.rows, new_var.columns);
  22632. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, new_var.name, new_var.value);
  22633. $(variable_container).find(".div_valor_var").html('');
  22634. renderValues(new_var, variable_container, function_name);
  22635. });
  22636. $(ret).find(".remove_global_matrix_line").on('click', function (e) {
  22637. removeLineMatrix(new_var);
  22638. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_TYPE, new_var.name, new_var.type, new_var.dimensions, new_var.rows, new_var.columns);
  22639. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, new_var.name, new_var.value);
  22640. $(variable_container).find(".div_valor_var").html('');
  22641. renderValues(new_var, variable_container, function_name);
  22642. });
  22643. $(ret).find(".add_global_matrix_line").on('click', function (e) {
  22644. addLineMatrix(new_var);
  22645. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_TYPE, new_var.name, new_var.type, new_var.dimensions, new_var.rows, new_var.columns);
  22646. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, new_var.name, new_var.value);
  22647. $(variable_container).find(".div_valor_var").html('');
  22648. renderValues(new_var, variable_container, function_name);
  22649. });
  22650. $(ret).find(".boolean_matrix_var").on('click', function (e) {
  22651. alternateBooleanMatrixValue(new_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  22652. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, new_var.name, new_var.value);
  22653. });
  22654. $(ret).find(".matrix_var").on('click', function (e) {
  22655. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  22656. enableMatrixValueUpdate(new_var, $(this).data('row'), $(this).data('index'), this.parentNode, function_name);
  22657. });
  22658. $(variable_container).find(".div_valor_var").append(ret);
  22659. updateColumnsAndRowsText(variable_container, new_var);
  22660. }
  22661. function alternateBooleanMatrixValue(var_obj, row, index, value_container) {
  22662. var_obj.value[row][index] = !var_obj.value[row][index];
  22663. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[row][index])));
  22664. }
  22665. function addLineMatrix(var_obj) {
  22666. var_obj.rows++;
  22667. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22668. var n_l = [];
  22669. for (var i = 0; i < var_obj.columns; i++) {
  22670. n_l.push(0);
  22671. }
  22672. var_obj.value.push(n_l);
  22673. }
  22674. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22675. var n_l = [];
  22676. for (i = 0; i < var_obj.columns; i++) {
  22677. n_l.push(0.0);
  22678. }
  22679. var_obj.value.push(n_l);
  22680. }
  22681. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22682. var n_l = [];
  22683. for (i = 0; i < var_obj.columns; i++) {
  22684. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22685. }
  22686. var_obj.value.push(n_l);
  22687. }
  22688. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22689. var n_l = [];
  22690. for (i = 0; i < var_obj.columns; i++) {
  22691. n_l.push(true);
  22692. }
  22693. var_obj.value.push(n_l);
  22694. }
  22695. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22696. var n_l = [];
  22697. for (i = 0; i < var_obj.columns; i++) {
  22698. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22699. }
  22700. var_obj.value.push(n_l);
  22701. }
  22702. }
  22703. function removeLineMatrix(var_obj) {
  22704. if (var_obj.rows == 0) {
  22705. return;
  22706. }
  22707. var_obj.rows--;
  22708. var_obj.value.splice(var_obj.value.length - 1, 1);
  22709. }
  22710. function addColumnMatrix(var_obj) {
  22711. var_obj.columns++;
  22712. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22713. for (var i = 0; i < var_obj.rows; i++) {
  22714. var_obj.value[i].push(0);
  22715. }
  22716. }
  22717. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22718. for (var i = 0; i < var_obj.rows; i++) {
  22719. var_obj.value[i].push(0.0);
  22720. }
  22721. }
  22722. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22723. for (var i = 0; i < var_obj.rows; i++) {
  22724. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22725. }
  22726. }
  22727. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22728. for (var i = 0; i < var_obj.rows; i++) {
  22729. var_obj.value[i].push(true);
  22730. }
  22731. }
  22732. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22733. for (var i = 0; i < var_obj.rows; i++) {
  22734. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22735. }
  22736. }
  22737. }
  22738. function removeColumnMatrix(var_obj) {
  22739. if (var_obj.columns == 0) {
  22740. return;
  22741. }
  22742. var_obj.columns--;
  22743. for (var i = 0; i < var_obj.rows; i++) {
  22744. var_obj.value[i].splice(var_obj.value[i].length - 1, 1);
  22745. }
  22746. }
  22747. function addColumnVector(var_obj) {
  22748. var_obj.columns++;
  22749. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22750. var_obj.value.push(0);
  22751. }
  22752. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22753. var_obj.value.push(0.0);
  22754. }
  22755. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22756. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22757. }
  22758. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22759. var_obj.value.push(true);
  22760. }
  22761. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22762. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22763. }
  22764. }
  22765. function removeColumnVector(var_obj) {
  22766. if (var_obj.columns == 0) {
  22767. return;
  22768. }
  22769. var_obj.columns--;
  22770. var_obj.value.splice(var_obj.value.length - 1, 1);
  22771. }
  22772. function alternateBooleanValue(var_obj, value_container) {
  22773. var_obj.value = !var_obj.value;
  22774. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value)));
  22775. }
  22776. function alternateBooleanVectorValue(var_obj, index, value_container) {
  22777. var_obj.value[index] = !var_obj.value[index];
  22778. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[index])));
  22779. }
  22780. function updateInitialValues(variable_obj, function_name) {
  22781. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22782. if (variable_obj.dimensions == 0) {
  22783. variable_obj.value = 0;
  22784. }
  22785. if (variable_obj.dimensions == 1) {
  22786. variable_obj.value = [0, 0];
  22787. }
  22788. if (variable_obj.dimensions == 2) {
  22789. variable_obj.value = [[0, 0], [0, 0]];
  22790. }
  22791. }
  22792. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22793. if (variable_obj.dimensions == 0) {
  22794. variable_obj.value = 0.0;
  22795. }
  22796. if (variable_obj.dimensions == 1) {
  22797. variable_obj.value = [0.0, 0.0];
  22798. }
  22799. if (variable_obj.dimensions == 2) {
  22800. variable_obj.value = [[0.0, 0.0], [0.0, 0.0]];
  22801. }
  22802. }
  22803. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22804. if (variable_obj.dimensions == 0) {
  22805. variable_obj.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  22806. }
  22807. if (variable_obj.dimensions == 1) {
  22808. variable_obj.value = [_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value')];
  22809. }
  22810. if (variable_obj.dimensions == 2) {
  22811. variable_obj.value = [[_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value')], [_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value')]];
  22812. }
  22813. }
  22814. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22815. if (variable_obj.dimensions == 0) {
  22816. variable_obj.value = true;
  22817. }
  22818. if (variable_obj.dimensions == 1) {
  22819. variable_obj.value = [true, true];
  22820. }
  22821. if (variable_obj.dimensions == 2) {
  22822. variable_obj.value = [[true, true], [true, true]];
  22823. }
  22824. }
  22825. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22826. if (variable_obj.dimensions == 0) {
  22827. variable_obj.value = 'A';
  22828. }
  22829. if (variable_obj.dimensions == 1) {
  22830. variable_obj.value = ['A', 'A'];
  22831. }
  22832. if (variable_obj.dimensions == 2) {
  22833. variable_obj.value = [['A', 'A'], ['A', 'A']];
  22834. }
  22835. }
  22836. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, variable_obj.name, variable_obj.value);
  22837. }
  22838. var opened_name_value_vector_global_ = false;
  22839. var opened_input_value_vector_global_ = null;
  22840. function enableVectorValueUpdate(var_obj, index, parent_node, function_name) {
  22841. if (opened_name_value_vector_global_) {
  22842. opened_input_value_vector_global_.focus();
  22843. return;
  22844. }
  22845. parent_node = $(parent_node);
  22846. opened_name_value_vector_global_ = true;
  22847. parent_node.find('.span_value_variable').text('');
  22848. var input_field;
  22849. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22850. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[index].toFixed(1) + "' />");
  22851. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22852. } else {
  22853. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[index] + "' />");
  22854. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22855. }
  22856. input_field.on('input', function () {
  22857. var inputWidth = input_field.textWidth() + 10;
  22858. opened_input_value_vector_global_ = input_field;
  22859. input_field.focus();
  22860. var tmpStr = input_field.val();
  22861. input_field.val('');
  22862. input_field.val(tmpStr);
  22863. input_field.css({
  22864. width: inputWidth
  22865. });
  22866. }).trigger('input');
  22867. input_field.focusout(function () {
  22868. var changed = false; /// update array:
  22869. if (input_field.val().trim()) {
  22870. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22871. var_obj.value[index] = parseFloat(input_field.val().trim());
  22872. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22873. } else {
  22874. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22875. var_obj.value[index] = parseInt(input_field.val().trim());
  22876. } else {
  22877. var_obj.value[index] = input_field.val().trim();
  22878. }
  22879. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22880. }
  22881. changed = true;
  22882. } else {
  22883. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22884. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22885. } else {
  22886. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22887. }
  22888. }
  22889. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22890. var_obj.value[index] = input_field.val();
  22891. changed = true;
  22892. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22893. }
  22894. if (changed) {
  22895. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, var_obj.name, var_obj.value);
  22896. }
  22897. input_field.off();
  22898. input_field.remove(); /// update elements:
  22899. opened_name_value_vector_global_ = false;
  22900. opened_input_value_vector_global_ = false;
  22901. });
  22902. input_field.on('keydown', function (e) {
  22903. var code = e.keyCode || e.which;
  22904. var changed = false;
  22905. if (code == 13) {
  22906. if (input_field.val().trim()) {
  22907. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22908. var_obj.value[index] = parseFloat(input_field.val().trim());
  22909. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22910. } else {
  22911. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22912. var_obj.value[index] = parseInt(input_field.val().trim());
  22913. } else {
  22914. var_obj.value[index] = input_field.val().trim();
  22915. }
  22916. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22917. }
  22918. changed = true;
  22919. } else {
  22920. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22921. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22922. } else {
  22923. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22924. }
  22925. }
  22926. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22927. var_obj.value[index] = input_field.val();
  22928. changed = true;
  22929. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22930. }
  22931. if (changed) {
  22932. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, var_obj.name, var_obj.value);
  22933. }
  22934. input_field.off();
  22935. input_field.remove(); /// update elements:
  22936. opened_name_value_vector_global_ = false;
  22937. opened_input_value_vector_global_ = false;
  22938. }
  22939. if (code == 27) {
  22940. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22941. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22942. } else {
  22943. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22944. }
  22945. input_field.off();
  22946. input_field.remove(); /// update elements:
  22947. opened_name_value_vector_global_ = false;
  22948. opened_input_value_vector_global_ = false;
  22949. }
  22950. });
  22951. input_field.select();
  22952. }
  22953. var opened_name_value_global_var = false;
  22954. var opened_input_value_global_ar = null;
  22955. function enableValueUpdate(var_obj, parent_node, function_name) {
  22956. if (opened_name_value_global_var) {
  22957. opened_input_value_global_ar.focus();
  22958. return;
  22959. }
  22960. parent_node = $(parent_node);
  22961. opened_name_value_global_var = true;
  22962. var input_field;
  22963. parent_node.find('.span_value_variable').text('');
  22964. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22965. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value.toFixed(1) + "' />");
  22966. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22967. } else {
  22968. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value + "' />");
  22969. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22970. }
  22971. input_field.on('input', function () {
  22972. var inputWidth = input_field.textWidth() + 10;
  22973. opened_input_value_global_ar = input_field;
  22974. input_field.focus();
  22975. var tmpStr = input_field.val();
  22976. input_field.val('');
  22977. input_field.val(tmpStr);
  22978. input_field.css({
  22979. width: inputWidth
  22980. });
  22981. }).trigger('input');
  22982. input_field.focusout(function () {
  22983. /// update array:
  22984. var changed = false;
  22985. if (input_field.val().trim()) {
  22986. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22987. var_obj.value = parseFloat(input_field.val().trim());
  22988. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22989. } else {
  22990. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22991. var_obj.value = parseInt(input_field.val().trim());
  22992. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22993. var_obj.value = input_field.val().charAt(0);
  22994. } else {
  22995. var_obj.value = input_field.val().trim();
  22996. }
  22997. parent_node.find('.span_value_variable').text(var_obj.value);
  22998. }
  22999. changed = true;
  23000. } else {
  23001. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23002. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  23003. } else {
  23004. parent_node.find('.span_value_variable').text(var_obj.value);
  23005. }
  23006. }
  23007. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23008. var_obj.value = input_field.val();
  23009. changed = true;
  23010. parent_node.find('.span_value_variable').text(var_obj.value);
  23011. }
  23012. if (changed) {
  23013. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, var_obj.name, var_obj.value);
  23014. }
  23015. input_field.off();
  23016. input_field.remove(); /// update elements:
  23017. opened_name_value_global_var = false;
  23018. opened_input_value_global_ar = false;
  23019. });
  23020. input_field.on('keydown', function (e) {
  23021. var code = e.keyCode || e.which;
  23022. var changed = false;
  23023. if (code == 13) {
  23024. if (input_field.val().trim()) {
  23025. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23026. var_obj.value = parseFloat(input_field.val().trim());
  23027. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  23028. } else {
  23029. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23030. var_obj.value = parseInt(input_field.val().trim());
  23031. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23032. var_obj.value = input_field.val().charAt(0);
  23033. } else {
  23034. var_obj.value = input_field.val().trim();
  23035. }
  23036. parent_node.find('.span_value_variable').text(var_obj.value);
  23037. }
  23038. changed = true;
  23039. } else {
  23040. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23041. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  23042. } else {
  23043. parent_node.find('.span_value_variable').text(var_obj.value);
  23044. }
  23045. }
  23046. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23047. var_obj.value = input_field.val();
  23048. changed = true;
  23049. parent_node.find('.span_value_variable').text(var_obj.value);
  23050. }
  23051. if (changed) {
  23052. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, var_obj.name, var_obj.value);
  23053. }
  23054. input_field.off();
  23055. input_field.remove(); /// update elements:
  23056. opened_name_value_global_var = false;
  23057. opened_input_value_global_ar = false;
  23058. }
  23059. if (code == 27) {
  23060. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23061. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  23062. } else {
  23063. parent_node.find('.span_value_variable').text(var_obj.value);
  23064. }
  23065. input_field.off();
  23066. input_field.remove(); /// update elements:
  23067. opened_name_value_global_var = false;
  23068. opened_input_value_global_ar = false;
  23069. }
  23070. });
  23071. input_field.select();
  23072. }
  23073. var opened_name_global = false;
  23074. var opened_input_global = null;
  23075. function enableNameUpdate(variable_obj, variable_container, function_obj) {
  23076. if (opened_name_global) {
  23077. opened_input_global.focus();
  23078. return;
  23079. }
  23080. opened_name_global = true;
  23081. variable_container.find('.span_name_variable').text('');
  23082. var input_name;
  23083. input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + variable_obj.name + "' />");
  23084. input_name.insertBefore(variable_container.find('.span_name_variable'));
  23085. input_name.on('input', function () {
  23086. var inputWidth = input_name.textWidth() + 10;
  23087. opened_input_global = input_name;
  23088. input_name.focus();
  23089. var tmpStr = input_name.val();
  23090. input_name.val('');
  23091. input_name.val(tmpStr);
  23092. input_name.css({
  23093. width: inputWidth
  23094. });
  23095. }).trigger('input');
  23096. input_name.focusout(function () {
  23097. /// update array:
  23098. if (input_name.val().trim().length > 0) {
  23099. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  23100. variable_container.find('.span_name_variable').text(variable_obj.name);
  23101. } else {
  23102. variable_container.find('.span_name_variable').text(variable_obj.name);
  23103. }
  23104. input_name.off();
  23105. input_name.remove(); /// update elements:
  23106. opened_name_global = false;
  23107. opened_input_global = false;
  23108. });
  23109. input_name.on('keydown', function (e) {
  23110. var code = e.keyCode || e.which;
  23111. if (code == 13) {
  23112. if (input_name.val().trim().length > 0) {
  23113. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  23114. variable_container.find('.span_name_variable').text(variable_obj.name);
  23115. } else {
  23116. variable_container.find('.span_name_variable').text(variable_obj.name);
  23117. }
  23118. input_name.off();
  23119. input_name.remove(); /// update elements:
  23120. opened_name_global = false;
  23121. opened_input_global = false;
  23122. }
  23123. if (code == 27) {
  23124. variable_container.find('.span_name_variable').text(variable_obj.name);
  23125. input_name.off();
  23126. input_name.remove(); /// update elements:
  23127. opened_name_global = false;
  23128. opened_input_global = false;
  23129. }
  23130. });
  23131. input_name.select();
  23132. }
  23133. var opened_name_value_matrix_global_v = false;
  23134. var opened_input_value_matrix_global_v = null;
  23135. function enableMatrixValueUpdate(var_obj, row, index, parent_node, function_name) {
  23136. if (opened_name_value_matrix_global_v) {
  23137. opened_input_value_matrix_global_v.focus();
  23138. return;
  23139. }
  23140. parent_node = $(parent_node);
  23141. opened_name_value_matrix_global_v = true;
  23142. parent_node.find('.span_value_variable').text('');
  23143. var input_field;
  23144. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23145. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[row][index].toFixed(1) + "' />");
  23146. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23147. } else {
  23148. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[row][index] + "' />");
  23149. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23150. }
  23151. input_field.on('input', function () {
  23152. var inputWidth = input_field.textWidth() + 10;
  23153. opened_input_value_matrix_global_v = input_field;
  23154. input_field.focus();
  23155. var tmpStr = input_field.val();
  23156. input_field.val('');
  23157. input_field.val(tmpStr);
  23158. input_field.css({
  23159. width: inputWidth
  23160. });
  23161. }).trigger('input');
  23162. input_field.focusout(function () {
  23163. var changed = false; /// update array:
  23164. if (input_field.val().trim()) {
  23165. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23166. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  23167. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23168. } else {
  23169. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23170. var_obj.value[row][index] = parseInt(input_field.val().trim());
  23171. } else {
  23172. var_obj.value[row][index] = input_field.val().trim();
  23173. }
  23174. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23175. }
  23176. changed = true;
  23177. } else {
  23178. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23179. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23180. } else {
  23181. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23182. }
  23183. }
  23184. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23185. var_obj.value[row][index] = input_field.val();
  23186. changed = true;
  23187. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23188. }
  23189. if (changed) {
  23190. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, var_obj.name, var_obj.value);
  23191. }
  23192. input_field.off();
  23193. input_field.remove(); /// update elements:
  23194. opened_name_value_matrix_global_v = false;
  23195. opened_input_value_matrix_global_v = false;
  23196. });
  23197. input_field.on('keydown', function (e) {
  23198. var code = e.keyCode || e.which;
  23199. var changed = false;
  23200. if (code == 13) {
  23201. if (input_field.val().trim()) {
  23202. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23203. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  23204. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23205. } else {
  23206. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23207. var_obj.value[row][index] = parseInt(input_field.val().trim());
  23208. } else {
  23209. var_obj.value[row][index] = input_field.val().trim();
  23210. }
  23211. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23212. }
  23213. changed = true;
  23214. } else {
  23215. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23216. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23217. } else {
  23218. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23219. }
  23220. }
  23221. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23222. var_obj.value[row][index] = input_field.val();
  23223. changed = true;
  23224. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23225. }
  23226. if (changed) {
  23227. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_VAR_VALUE, var_obj.name, var_obj.value);
  23228. }
  23229. input_field.off();
  23230. input_field.remove(); /// update elements:
  23231. opened_name_value_matrix_global_v = false;
  23232. opened_input_value_matrix_global_v = false;
  23233. }
  23234. if (code == 27) {
  23235. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23236. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23237. } else {
  23238. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23239. }
  23240. input_field.off();
  23241. input_field.remove(); /// update elements:
  23242. opened_name_value_matrix_global_v = false;
  23243. opened_input_value_matrix_global_v = false;
  23244. }
  23245. });
  23246. input_field.select();
  23247. }
  23248. /***/ })
  23249. /******/ });
  23250. });
  23251. //# sourceMappingURL=main.e0ee3563388774042d6b.js.map