main.308b4036355a0af3793b.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651
  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_07 16_08\"}");
  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-13225VQiALyR4rfD5/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-13225XlC5iUO3QI0B/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. this.pos++;
  4712. this.checkEOS();
  4713. this.pos++;
  4714. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Break"]();
  4715. }
  4716. }, {
  4717. key: "parseReturn",
  4718. value: function parseReturn() {
  4719. this.pos++;
  4720. var exp = null;
  4721. if (!this.checkEOS(true)) {
  4722. exp = this.parseExpressionOR();
  4723. this.checkEOS();
  4724. }
  4725. this.pos++;
  4726. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Return"](exp);
  4727. }
  4728. }, {
  4729. key: "parseIDCommand",
  4730. value: function parseIDCommand() {
  4731. var refToken = this.getToken();
  4732. var isID = refToken.type === this.lexerClass.ID;
  4733. var id = this.parseMaybeLibID();
  4734. if (this.checkOpenBrace(true)) {
  4735. this.pos++;
  4736. var lineExpression = null;
  4737. var columnExpression = null;
  4738. this.consumeNewLines();
  4739. lineExpression = this.parseExpression();
  4740. this.consumeNewLines();
  4741. this.checkCloseBrace();
  4742. this.pos++;
  4743. if (this.checkOpenBrace(true)) {
  4744. this.pos++;
  4745. this.consumeNewLines();
  4746. columnExpression = this.parseExpression();
  4747. this.consumeNewLines();
  4748. this.checkCloseBrace();
  4749. this.pos++;
  4750. }
  4751. var equalToken = this.getToken();
  4752. if (equalToken.type !== this.lexerClass.EQUAL) {
  4753. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('=', equalToken);
  4754. }
  4755. this.pos++;
  4756. var exp = this.parseExpressionOR();
  4757. this.checkEOS();
  4758. this.pos++;
  4759. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["ArrayIndexAssign"](id, lineExpression, columnExpression, exp);
  4760. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalToken);
  4761. return cmd;
  4762. }
  4763. var equalOrParenthesis = this.getToken();
  4764. if (isID && equalOrParenthesis.type === this.lexerClass.EQUAL) {
  4765. this.pos++;
  4766. var _exp = this.parseExpressionOR();
  4767. this.checkEOS();
  4768. this.pos++;
  4769. var _cmd2 = new _commands__WEBPACK_IMPORTED_MODULE_4__["Assign"](id, _exp);
  4770. _cmd2.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalOrParenthesis);
  4771. return _cmd2;
  4772. } else if (equalOrParenthesis.type === this.lexerClass.OPEN_PARENTHESIS) {
  4773. var funcCall = this.parseFunctionCallCommand(id);
  4774. this.checkEOS();
  4775. this.pos++;
  4776. return funcCall;
  4777. } else if (isID) {
  4778. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list(['=', '('], equalOrParenthesis);
  4779. } else {
  4780. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(refToken);
  4781. }
  4782. }
  4783. }, {
  4784. key: "parseForParameters",
  4785. value: function parseForParameters(keyword_code) {
  4786. if (keyword_code === this.lexerClass.RK_FOR_PASS) {
  4787. if (this.checkOpenCurly(true)) {
  4788. return null;
  4789. }
  4790. }
  4791. var from_token = this.getToken();
  4792. if (from_token.type !== keyword_code) {
  4793. // TODO better error message
  4794. var keyword = this.lexer.literalNames[keyword_code];
  4795. throw new Error("Error de sintaxe no comando repita_para: esperava-se " + keyword + " mas encontrou " + from_token.text);
  4796. }
  4797. this.pos += 1;
  4798. var int_or_id = this.getToken();
  4799. var is_unary_op = false;
  4800. var op = null;
  4801. if (int_or_id.type === this.lexerClass.SUM_OP) {
  4802. is_unary_op = true;
  4803. op = int_or_id.text;
  4804. this.pos += 1;
  4805. int_or_id = this.getToken();
  4806. }
  4807. var for_from = null;
  4808. if (int_or_id.type === this.lexerClass.ID) {
  4809. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](this.parseID());
  4810. for_from.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(int_or_id);
  4811. } else if (int_or_id.type === this.lexerClass.INTEGER) {
  4812. this.pos += 1;
  4813. for_from = this.getIntLiteral(int_or_id);
  4814. }
  4815. if (for_from == null) {
  4816. // TODO better error message
  4817. var _keyword = this.lexer.literalNames[keyword_code];
  4818. 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.");
  4819. }
  4820. if (is_unary_op) {
  4821. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(op), for_from);
  4822. }
  4823. return for_from;
  4824. }
  4825. }, {
  4826. key: "parseCases",
  4827. value: function parseCases() {
  4828. var token = this.getToken();
  4829. if (token.type !== this.lexerClass.RK_CASE) {
  4830. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_CASE], token);
  4831. }
  4832. this.pos++;
  4833. var nextToken = this.getToken();
  4834. if (nextToken.type === this.lexerClass.RK_DEFAULT) {
  4835. this.pos++;
  4836. var colonToken = this.getToken();
  4837. if (colonToken.type !== this.lexerClass.COLON) {
  4838. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(':', colonToken);
  4839. }
  4840. this.pos++;
  4841. this.consumeNewLines();
  4842. var block = this.parseCommandBlock(true);
  4843. var defaultCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](null);
  4844. defaultCase.setCommands(block.commands);
  4845. return [defaultCase];
  4846. } else {
  4847. var exp = this.parseExpressionOR();
  4848. var _colonToken = this.getToken();
  4849. if (_colonToken.type !== this.lexerClass.COLON) {
  4850. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(':', _colonToken);
  4851. }
  4852. this.pos++;
  4853. this.consumeNewLines();
  4854. var _block = this.parseCommandBlock(true);
  4855. var aCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](exp);
  4856. aCase.setCommands(_block.commands);
  4857. var caseToken = this.getToken();
  4858. if (caseToken.type === this.lexerClass.RK_CASE) {
  4859. return [aCase].concat(this.parseCases());
  4860. } else {
  4861. return [aCase];
  4862. }
  4863. }
  4864. }
  4865. /*
  4866. * Parses an Expression following the structure:
  4867. *
  4868. * EOR => EAnd ( 'or' EOR)? #expression and
  4869. *
  4870. * EOR => ENot ('and' EOR)? #expression or
  4871. *
  4872. * ENot => 'not'? ER #expression not
  4873. *
  4874. * ER => E ((>=, <=, ==, >, <) E)? #expression relational
  4875. *
  4876. * E => factor ((+, -) E)? #expression
  4877. *
  4878. * factor=> term ((*, /, %) factor)?
  4879. *
  4880. * term => literal || arrayAccess || FuncCall || ID || '('EAnd')'
  4881. **/
  4882. }, {
  4883. key: "parseExpressionOR",
  4884. value: function parseExpressionOR() {
  4885. var exp1 = this.parseExpressionAND();
  4886. while (this.getToken().type === this.lexerClass.OR_OPERATOR) {
  4887. var opToken = this.getToken();
  4888. this.pos++;
  4889. var or = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])('or');
  4890. this.consumeNewLines();
  4891. var exp2 = this.parseExpressionAND();
  4892. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](or, exp1, exp2);
  4893. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  4894. exp1 = finalExp;
  4895. }
  4896. return exp1;
  4897. }
  4898. }, {
  4899. key: "parseExpressionAND",
  4900. value: function parseExpressionAND() {
  4901. var exp1 = this.parseExpressionNot();
  4902. while (this.getToken().type === this.lexerClass.AND_OPERATOR) {
  4903. var opToken = this.getToken();
  4904. this.pos++;
  4905. var and = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])('and');
  4906. this.consumeNewLines();
  4907. var exp2 = this.parseExpressionNot();
  4908. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](and, exp1, exp2);
  4909. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  4910. exp1 = finalExp;
  4911. }
  4912. return exp1;
  4913. }
  4914. }, {
  4915. key: "parseExpressionNot",
  4916. value: function parseExpressionNot() {
  4917. var maybeNotToken = this.getToken();
  4918. if (maybeNotToken.type === this.lexerClass.NOT_OPERATOR) {
  4919. var opToken = this.getToken();
  4920. this.pos++;
  4921. var not = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])('not');
  4922. var exp1 = this.parseExpressionRel();
  4923. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](not, exp1);
  4924. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  4925. return finalExp;
  4926. } else {
  4927. return this.parseExpressionRel();
  4928. }
  4929. }
  4930. }, {
  4931. key: "parseExpressionRel",
  4932. value: function parseExpressionRel() {
  4933. var exp1 = this.parseExpression();
  4934. while (this.getToken().type === this.lexerClass.RELATIONAL_OPERATOR) {
  4935. var relToken = this.getToken();
  4936. this.pos++;
  4937. var rel = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(relToken.text);
  4938. var exp2 = this.parseExpression();
  4939. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](rel, exp1, exp2);
  4940. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(relToken);
  4941. exp1 = finalExp;
  4942. }
  4943. return exp1;
  4944. }
  4945. }, {
  4946. key: "parseExpression",
  4947. value: function parseExpression() {
  4948. var factor = this.parseFactor();
  4949. while (this.getToken().type === this.lexerClass.SUM_OP) {
  4950. var sumOpToken = this.getToken();
  4951. this.pos++;
  4952. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(sumOpToken.text);
  4953. var factor2 = this.parseFactor();
  4954. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, factor, factor2);
  4955. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(sumOpToken);
  4956. factor = finalExp;
  4957. }
  4958. return factor;
  4959. }
  4960. }, {
  4961. key: "parseFactor",
  4962. value: function parseFactor() {
  4963. var term = this.parseTerm();
  4964. while (this.getToken().type === this.lexerClass.MULTI_OP) {
  4965. var multOpToken = this.getToken();
  4966. this.pos++;
  4967. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(multOpToken.text);
  4968. var term2 = this.parseTerm();
  4969. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, term, term2);
  4970. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(multOpToken);
  4971. term = finalExp;
  4972. }
  4973. return term;
  4974. }
  4975. }, {
  4976. key: "parseTerm",
  4977. value: function parseTerm() {
  4978. var token = this.getToken();
  4979. var sourceInfo = null;
  4980. var exp = null;
  4981. switch (token.type) {
  4982. case this.lexerClass.SUM_OP:
  4983. this.pos++;
  4984. sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4985. exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(token.text), this.parseTerm());
  4986. exp.sourceInfo = sourceInfo;
  4987. return exp;
  4988. case this.lexerClass.INTEGER:
  4989. this.pos++;
  4990. return this.getIntLiteral(token);
  4991. case this.lexerClass.REAL:
  4992. this.pos++;
  4993. return this.getRealLiteral(token);
  4994. case this.lexerClass.STRING:
  4995. this.pos++;
  4996. return this.getStringLiteral(token);
  4997. case this.lexerClass.CHARACTER:
  4998. this.pos++;
  4999. return this.getCharLiteral(token);
  5000. case this.lexerClass.RK_TRUE:
  5001. case this.lexerClass.RK_FALSE:
  5002. this.pos++;
  5003. return this.getBoolLiteral(token);
  5004. case this.lexerClass.OPEN_CURLY:
  5005. // No more annonymous array
  5006. // return this.parseArrayLiteral();
  5007. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].annonymous_array_literal(token);
  5008. case this.lexerClass.ID:
  5009. case this.lexerClass.LIB_ID:
  5010. return this.parseIDTerm();
  5011. case this.lexerClass.OPEN_PARENTHESIS:
  5012. return this.parseParenthesisExp();
  5013. default:
  5014. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_terminal(token);
  5015. }
  5016. }
  5017. }, {
  5018. key: "parseIDTerm",
  5019. value: function parseIDTerm() {
  5020. var tokenA = this.getToken();
  5021. var id = this.parseMaybeLibID();
  5022. var isID = tokenA.type === this.lexerClass.ID;
  5023. if (isID && this.checkOpenBrace(true)) {
  5024. var tokenB = null;
  5025. this.pos++;
  5026. var firstIndex = this.parseExpression();
  5027. var secondIndex = null;
  5028. this.consumeNewLines();
  5029. this.checkCloseBrace();
  5030. tokenB = this.getToken();
  5031. this.pos++;
  5032. if (this.checkOpenBrace(true)) {
  5033. this.pos++;
  5034. secondIndex = this.parseExpression();
  5035. this.consumeNewLines();
  5036. this.checkCloseBrace();
  5037. tokenB = this.getToken();
  5038. this.pos++;
  5039. }
  5040. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5041. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayAccess"](id, firstIndex, secondIndex);
  5042. exp.sourceInfo = sourceInfo;
  5043. return exp;
  5044. } else if (this.checkOpenParenthesis(true)) {
  5045. return this.parseFunctionCallExpression(id);
  5046. } else if (isID) {
  5047. var _sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(tokenA);
  5048. var _exp2 = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
  5049. _exp2.sourceInfo = _sourceInfo;
  5050. return _exp2;
  5051. } else {
  5052. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(tokenA);
  5053. }
  5054. }
  5055. }, {
  5056. key: "getFunctionName",
  5057. value: function getFunctionName(id) {
  5058. var name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getInternalName(id);
  5059. if (name === null) {
  5060. if (id === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
  5061. return null;
  5062. }
  5063. return id;
  5064. } else {
  5065. return name;
  5066. }
  5067. }
  5068. }, {
  5069. key: "parseFunctionCallExpression",
  5070. value: function parseFunctionCallExpression(id) {
  5071. var tokenA = this.getToken(this.pos - 1);
  5072. var actualParameters = this.parseActualParameters();
  5073. var tokenB = this.getToken(this.pos - 1);
  5074. var funcName = this.getFunctionName(id);
  5075. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5076. var cmd = new _expressions__WEBPACK_IMPORTED_MODULE_3__["FunctionCall"](funcName, actualParameters);
  5077. cmd.sourceInfo = sourceInfo;
  5078. return cmd;
  5079. }
  5080. }, {
  5081. key: "parseFunctionCallCommand",
  5082. value: function parseFunctionCallCommand(id) {
  5083. return this.parseFunctionCallExpression(id);
  5084. }
  5085. }, {
  5086. key: "parseParenthesisExp",
  5087. value: function parseParenthesisExp() {
  5088. this.checkOpenParenthesis();
  5089. var tokenA = this.getToken();
  5090. this.pos += 1;
  5091. this.consumeNewLines();
  5092. var exp = this.parseExpressionOR();
  5093. this.consumeNewLines();
  5094. this.checkCloseParenthesis();
  5095. var tokenB = this.getToken();
  5096. this.pos += 1;
  5097. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5098. exp.parenthesis = true;
  5099. return exp;
  5100. }
  5101. }, {
  5102. key: "parseActualParameters",
  5103. value: function parseActualParameters() {
  5104. this.checkOpenParenthesis();
  5105. this.pos++;
  5106. if (this.checkCloseParenthesis(true)) {
  5107. this.pos++;
  5108. return [];
  5109. }
  5110. this.consumeNewLines();
  5111. var list = this.parseExpressionList();
  5112. this.consumeNewLines();
  5113. this.checkCloseParenthesis();
  5114. this.pos++;
  5115. return list;
  5116. }
  5117. }, {
  5118. key: "parseExpressionList",
  5119. value: function parseExpressionList() {
  5120. var list = [];
  5121. for (;;) {
  5122. var exp = this.parseExpressionOR();
  5123. list.push(exp);
  5124. var maybeToken = this.getToken();
  5125. if (maybeToken.type !== this.lexerClass.COMMA) {
  5126. break;
  5127. } else {
  5128. this.pos++;
  5129. this.consumeNewLines();
  5130. }
  5131. }
  5132. return list;
  5133. }
  5134. }, {
  5135. key: "getTypeArray",
  5136. value: function getTypeArray() {
  5137. var _this = this;
  5138. var types = this.insideScope(IVProgParser.FUNCTION) ? this.functionTypes : this.variableTypes;
  5139. return types.map(function (x) {
  5140. return _this.lexer.literalNames[x];
  5141. });
  5142. }
  5143. }]);
  5144. return IVProgParser;
  5145. }();
  5146. /***/ }),
  5147. /***/ "./js/ast/operators.ts":
  5148. /*!*****************************!*\
  5149. !*** ./js/ast/operators.ts ***!
  5150. \*****************************/
  5151. /*! no static exports found */
  5152. /***/ (function(module, exports, __webpack_require__) {
  5153. "use strict";
  5154. Object.defineProperty(exports, "__esModule", { value: true });
  5155. exports.convertFromString = exports.Operators = void 0;
  5156. exports.Operators = Object.freeze({
  5157. ADD: { ord: 0, value: "+" },
  5158. SUB: { ord: 1, value: "-" },
  5159. MULT: { ord: 2, value: '*' },
  5160. DIV: { ord: 3, value: '/' },
  5161. MOD: { ord: 4, value: '%' },
  5162. GT: { ord: 5, value: '>' },
  5163. GE: { ord: 6, value: '>=' },
  5164. LT: { ord: 7, value: '<' },
  5165. LE: { ord: 8, value: '<=' },
  5166. EQ: { ord: 9, value: '==' },
  5167. NEQ: { ord: 10, value: '!=' },
  5168. AND: { ord: 11, value: 'and' },
  5169. OR: { ord: 12, value: 'or' },
  5170. NOT: { ord: 13, value: 'not' }
  5171. });
  5172. function convertFromString(op) {
  5173. switch (op) {
  5174. case '+': return exports.Operators.ADD;
  5175. case '-': return exports.Operators.SUB;
  5176. case '*': return exports.Operators.MULT;
  5177. case '/': return exports.Operators.DIV;
  5178. case '%': return exports.Operators.MOD;
  5179. case '>': return exports.Operators.GT;
  5180. case '>=': return exports.Operators.GE;
  5181. case '<': return exports.Operators.LT;
  5182. case '<=': return exports.Operators.LE;
  5183. case '==': return exports.Operators.EQ;
  5184. case '!=': return exports.Operators.NEQ;
  5185. case 'and': return exports.Operators.AND;
  5186. case 'or': return exports.Operators.OR;
  5187. case 'not': return exports.Operators.NOT;
  5188. }
  5189. return null;
  5190. }
  5191. exports.convertFromString = convertFromString;
  5192. /***/ }),
  5193. /***/ "./js/ast/sourceInfo.js":
  5194. /*!******************************!*\
  5195. !*** ./js/ast/sourceInfo.js ***!
  5196. \******************************/
  5197. /*! exports provided: SourceInfo */
  5198. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5199. "use strict";
  5200. __webpack_require__.r(__webpack_exports__);
  5201. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SourceInfo", function() { return SourceInfo; });
  5202. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5203. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5204. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5205. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5206. var SourceInfo = /*#__PURE__*/function () {
  5207. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SourceInfo, null, [{
  5208. key: "createSourceInfo",
  5209. value: function createSourceInfo(token) {
  5210. return new SourceInfo(token.line, token.column, token.text, token.text.length);
  5211. }
  5212. }, {
  5213. key: "createSourceInfoFromList",
  5214. value: function createSourceInfoFromList(tokenA, tokenB) {
  5215. var line = tokenA.line;
  5216. 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
  5217. // No idea why...
  5218. var size = tokenB.tokenIndex + 1 - tokenA.tokenIndex;
  5219. return new SourceInfo(line, column, "", size);
  5220. }
  5221. }]);
  5222. function SourceInfo(line, column, text, size) {
  5223. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SourceInfo);
  5224. this.line = line;
  5225. this.column = column;
  5226. this.text = text;
  5227. this.size = size;
  5228. }
  5229. return SourceInfo;
  5230. }();
  5231. /***/ }),
  5232. /***/ "./js/io/domConsole.js":
  5233. /*!*****************************!*\
  5234. !*** ./js/io/domConsole.js ***!
  5235. \*****************************/
  5236. /*! exports provided: DOMConsole */
  5237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5238. "use strict";
  5239. __webpack_require__.r(__webpack_exports__);
  5240. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMConsole", function() { return DOMConsole; });
  5241. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  5242. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  5243. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  5244. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  5245. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5246. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
  5247. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5248. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
  5249. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  5250. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  5251. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  5252. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_6__);
  5253. var DOMConsole = /*#__PURE__*/function () {
  5254. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, null, [{
  5255. key: "BASH_TEMPLATE",
  5256. get: function get() {
  5257. 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>";
  5258. }
  5259. }, {
  5260. key: "INPUT_CARET_TEMPLATE",
  5261. get: function get() {
  5262. return "\n <div id=\"cmd\">\n <span></span>\n <div id=\"cursor\"></div>\n </div>";
  5263. }
  5264. }, {
  5265. key: "USER",
  5266. get: function get() {
  5267. return 0;
  5268. }
  5269. }, {
  5270. key: "INFO",
  5271. get: function get() {
  5272. return 1;
  5273. }
  5274. }, {
  5275. key: "ERR",
  5276. get: function get() {
  5277. return 2;
  5278. }
  5279. }, {
  5280. key: "INPUT",
  5281. get: function get() {
  5282. return 3;
  5283. }
  5284. }]);
  5285. function DOMConsole(elementID) {
  5286. var disableMarginTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5287. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, DOMConsole);
  5288. this.disableMarginTop = disableMarginTop;
  5289. this.input = null;
  5290. this.cursorInterval = null;
  5291. this.idleInterval = null;
  5292. this.inputDiv = null;
  5293. this.inputCMD = null;
  5294. this.inputSpan = null;
  5295. this.cursorRef = null;
  5296. this.needInput = false;
  5297. this.clearBtn = null;
  5298. this.hideBtn = null;
  5299. this.showBtn = null;
  5300. this.termDiv = null;
  5301. this.anyKey = false;
  5302. var actualID = elementID;
  5303. if (elementID[0] === "#") {
  5304. actualID = elementID.substring(1);
  5305. }
  5306. this.parent = document.getElementById(actualID);
  5307. this.setup();
  5308. this.inputListeners = [];
  5309. this.hideInput();
  5310. this.pending_writes = [];
  5311. this.last_clear = -1;
  5312. }
  5313. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, [{
  5314. key: "setup",
  5315. value: function setup() {
  5316. this._setupDom();
  5317. this._setupEvents();
  5318. }
  5319. }, {
  5320. key: "_setupEvents",
  5321. value: function _setupEvents() {
  5322. this.input.addEventListener("keydown", this.registerInput.bind(this));
  5323. this.clearBtn.addEventListener("click", this.clearBtnClick.bind(this));
  5324. this.hideBtn.addEventListener("click", this.hideBtnClick.bind(this));
  5325. this.showBtn.addEventListener("click", this.showBtnClick.bind(this));
  5326. }
  5327. }, {
  5328. key: "registerInput",
  5329. value: function registerInput(event) {
  5330. if (!this.needInput) {
  5331. return;
  5332. }
  5333. var keyCode = event.which;
  5334. if (keyCode === 13 || this.anyKey) {
  5335. if (this.idleInterval != null) {
  5336. clearInterval(this.idleInterval);
  5337. this.idleInterval = null;
  5338. }
  5339. var text = this.input.value;
  5340. text = text.replace("[\n\r]+", "");
  5341. this.notifyListeners(text);
  5342. this._appendUserInput(text);
  5343. this.input.value = "";
  5344. this.inputSpan.innerHTML = "";
  5345. this.currentLine = null;
  5346. }
  5347. }
  5348. }, {
  5349. key: "_setupDom",
  5350. value: function _setupDom() {
  5351. var bashNode = document.createElement("div");
  5352. bashNode.classList.add("bash");
  5353. bashNode.innerHTML = DOMConsole.BASH_TEMPLATE;
  5354. this.termDiv = bashNode.querySelector("#ivprog-term");
  5355. this.termDiv.classList.add("ivprog-term-div");
  5356. this.inputDiv = document.createElement("div");
  5357. this.inputDiv.id = "ivprog-terminal-inputdiv";
  5358. this.inputDiv.innerHTML = DOMConsole.INPUT_CARET_TEMPLATE;
  5359. this.input = document.createElement("input");
  5360. this.input.setAttribute("name", "command");
  5361. this.input.setAttribute("value", "");
  5362. this.input.setAttribute("type", "text");
  5363. this.inputDiv.append(this.input);
  5364. this.termDiv.append(this.inputDiv);
  5365. bashNode.append(this.termDiv);
  5366. this.parent.append(bashNode);
  5367. this.inputCMD = this.inputDiv.querySelector("#cmd");
  5368. this.cursorRef = this.inputCMD.querySelector("#cursor");
  5369. this.inputSpan = this.inputCMD.querySelector("span");
  5370. this.clearBtn = bashNode.querySelector("#ivprog-console-clearbtn");
  5371. this.hideBtn = bashNode.querySelector("#ivprog-console-hidebtn");
  5372. this.showBtn = bashNode.querySelector("#ivprog-console-showbtn");
  5373. this._setupCursor(); //Jquery tooltips....
  5374. window.$(this.clearBtn).popup({
  5375. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_clear")
  5376. });
  5377. window.$(this.showBtn).popup({
  5378. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_show")
  5379. });
  5380. window.$(this.hideBtn).popup({
  5381. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_hide")
  5382. });
  5383. }
  5384. }, {
  5385. key: "_setupCursor",
  5386. value: function _setupCursor() {
  5387. this.inputCMD.addEventListener("click", this.blinkCaretAndFocus.bind(this)); //this.inputCMD.click();
  5388. this.input.addEventListener("keyup", this.updateSpanText.bind(this));
  5389. this.input.addEventListener("blur", this.stopBlinkCaret.bind(this));
  5390. }
  5391. }, {
  5392. key: "blinkCaretAndFocus",
  5393. value: function blinkCaretAndFocus() {
  5394. var _this = this;
  5395. if (this.cursorInterval != null) {
  5396. return;
  5397. }
  5398. this.input.focus();
  5399. this.cursorInterval = window.setInterval(function () {
  5400. if (_this.cursorRef.style.visibility === "visible") {
  5401. _this.cursorRef.style.visibility = "hidden";
  5402. } else {
  5403. _this.cursorRef.style.visibility = "visible";
  5404. }
  5405. }, 500);
  5406. }
  5407. }, {
  5408. key: "updateSpanText",
  5409. value: function updateSpanText() {
  5410. this.inputSpan.innerHTML = this.input.value;
  5411. if (this.idleInterval != null) window.clearInterval(this.idleInterval);
  5412. this.scheduleNotify();
  5413. }
  5414. }, {
  5415. key: "stopBlinkCaret",
  5416. value: function stopBlinkCaret() {
  5417. clearInterval(this.cursorInterval);
  5418. this.cursorInterval = null;
  5419. this.cursorRef.style.visibility = "visible";
  5420. }
  5421. }, {
  5422. key: "notifyListeners",
  5423. value: function notifyListeners(text) {
  5424. this.inputListeners.forEach(function (resolve) {
  5425. return resolve(text);
  5426. });
  5427. this.inputListeners.splice(0, this.inputListeners.length);
  5428. this.hideInput();
  5429. this.anyKey = false;
  5430. }
  5431. }, {
  5432. key: "writeRawHTML",
  5433. value: function writeRawHTML(text, channel) {
  5434. this._appendTextLn(text, channel, false);
  5435. }
  5436. }, {
  5437. key: "write",
  5438. value: function write(text) {
  5439. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5440. this._appendText(text, DOMConsole.USER, newLine);
  5441. }
  5442. }, {
  5443. key: "info",
  5444. value: function info(text) {
  5445. this._appendTextLn(text, DOMConsole.INFO);
  5446. }
  5447. }, {
  5448. key: "err",
  5449. value: function err(text) {
  5450. this._appendTextLn(text, DOMConsole.ERR);
  5451. }
  5452. }, {
  5453. key: "_appendText",
  5454. value: function () {
  5455. 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) {
  5456. var newLine,
  5457. write_time,
  5458. divClass,
  5459. textDiv,
  5460. _args = arguments;
  5461. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  5462. while (1) {
  5463. switch (_context.prev = _context.next) {
  5464. case 0:
  5465. newLine = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
  5466. // console.debug("Caling appendText");
  5467. write_time = Date.now();
  5468. this.pending_writes.push(0);
  5469. _context.next = 5;
  5470. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  5471. case 5:
  5472. this.pending_writes.pop();
  5473. if (!(this.last_clear >= write_time)) {
  5474. _context.next = 8;
  5475. break;
  5476. }
  5477. return _context.abrupt("return");
  5478. case 8:
  5479. if (this.currentLine == null) {
  5480. divClass = this.getClassForType(type);
  5481. textDiv = document.createElement("div");
  5482. textDiv.classList.add(divClass);
  5483. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5484. this.currentLine = textDiv;
  5485. }
  5486. this.currentLine.innerHTML += this.getOutputText(text);
  5487. if (newLine) {
  5488. // console.debug("append newline");
  5489. this.currentLine = null;
  5490. }
  5491. this.scrollTerm();
  5492. case 12:
  5493. case "end":
  5494. return _context.stop();
  5495. }
  5496. }
  5497. }, _callee, this);
  5498. }));
  5499. function _appendText(_x, _x2) {
  5500. return _appendText2.apply(this, arguments);
  5501. }
  5502. return _appendText;
  5503. }()
  5504. }, {
  5505. key: "_appendTextLn",
  5506. value: function () {
  5507. 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) {
  5508. var filter,
  5509. write_time,
  5510. divClass,
  5511. textDiv,
  5512. _args2 = arguments;
  5513. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  5514. while (1) {
  5515. switch (_context2.prev = _context2.next) {
  5516. case 0:
  5517. filter = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : true;
  5518. write_time = Date.now();
  5519. this.pending_writes.push(0);
  5520. _context2.next = 5;
  5521. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  5522. case 5:
  5523. this.pending_writes.pop();
  5524. if (!(this.last_clear >= write_time)) {
  5525. _context2.next = 8;
  5526. break;
  5527. }
  5528. return _context2.abrupt("return");
  5529. case 8:
  5530. divClass = this.getClassForType(type);
  5531. textDiv = document.createElement("div");
  5532. textDiv.classList.add(divClass);
  5533. if (filter) textDiv.innerHTML = this.getOutputText(text);else textDiv.innerHTML = "<span>".concat(text, "</span>");
  5534. if (this.currentLine != null && this.currentLine.innerHTML.length === 0) {
  5535. this.termDiv.removeChild(this.currentLine);
  5536. }
  5537. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5538. this.currentLine = null;
  5539. this.scrollTerm();
  5540. case 16:
  5541. case "end":
  5542. return _context2.stop();
  5543. }
  5544. }
  5545. }, _callee2, this);
  5546. }));
  5547. function _appendTextLn(_x3, _x4) {
  5548. return _appendTextLn2.apply(this, arguments);
  5549. }
  5550. return _appendTextLn;
  5551. }()
  5552. }, {
  5553. key: "_appendUserInput",
  5554. value: function () {
  5555. 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) {
  5556. var write_time, divClass, textDiv;
  5557. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  5558. while (1) {
  5559. switch (_context3.prev = _context3.next) {
  5560. case 0:
  5561. write_time = Date.now();
  5562. this.pending_writes.push(0);
  5563. _context3.next = 4;
  5564. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  5565. case 4:
  5566. this.pending_writes.pop();
  5567. if (!(this.last_clear >= write_time)) {
  5568. _context3.next = 7;
  5569. break;
  5570. }
  5571. return _context3.abrupt("return");
  5572. case 7:
  5573. divClass = this.getClassForType(DOMConsole.INPUT);
  5574. textDiv = document.createElement("div");
  5575. textDiv.innerHTML = this.getUserInputText(text);
  5576. textDiv.classList.add(divClass);
  5577. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5578. this.currentLine = null;
  5579. this.scrollTerm();
  5580. case 14:
  5581. case "end":
  5582. return _context3.stop();
  5583. }
  5584. }
  5585. }, _callee3, this);
  5586. }));
  5587. function _appendUserInput(_x5) {
  5588. return _appendUserInput2.apply(this, arguments);
  5589. }
  5590. return _appendUserInput;
  5591. }()
  5592. }, {
  5593. key: "getOutputText",
  5594. value: function getOutputText(text) {
  5595. text = text.replace(/\s/g, "&#160;");
  5596. return "<span>".concat(text, "</span>");
  5597. }
  5598. }, {
  5599. key: "getUserInputText",
  5600. value: function getUserInputText(text) {
  5601. if (text.trim().length == 0) {
  5602. text = "&nbsp;";
  5603. }
  5604. return "<i class=\"icon keyboard outline\" style=\"float:left\"></i><span>".concat(text, "</span>");
  5605. }
  5606. }, {
  5607. key: "scrollTerm",
  5608. value: function scrollTerm() {
  5609. //scrollIt(this.inputDiv.previousSibling,200);
  5610. this.termDiv.scrollTop = this.termDiv.scrollHeight;
  5611. }
  5612. }, {
  5613. key: "focus",
  5614. value: function focus() {
  5615. this.termDiv.style.display = "block"; // Is in draggable mode?
  5616. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  5617. this.parent.style.marginTop = "-160px";
  5618. }
  5619. if (this.needInput) {
  5620. this.showInput();
  5621. this.scheduleNotify();
  5622. }
  5623. if (!_util_utils__WEBPACK_IMPORTED_MODULE_5__["isElementInViewport"](this.termDiv)) this.termDiv.scrollIntoView(false);
  5624. this.scrollTerm();
  5625. }
  5626. }, {
  5627. key: "hide",
  5628. value: function hide() {
  5629. if (this.needInput) {
  5630. clearInterval(this.idleInterval);
  5631. this.hideInput();
  5632. this.needInput = true;
  5633. } // Is in draggable mode?
  5634. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  5635. this.parent.style.marginTop = "0";
  5636. }
  5637. this.termDiv.style.display = "none";
  5638. }
  5639. }, {
  5640. key: "getClassForType",
  5641. value: function getClassForType(type) {
  5642. switch (type) {
  5643. case DOMConsole.INPUT:
  5644. return "ivprog-term-userInput";
  5645. case DOMConsole.USER:
  5646. return "ivprog-term-userText";
  5647. case DOMConsole.INFO:
  5648. return "ivprog-term-info";
  5649. case DOMConsole.ERR:
  5650. return "ivprog-term-error";
  5651. }
  5652. }
  5653. }, {
  5654. key: "dispose",
  5655. value: function dispose() {
  5656. this.input.removeEventListener("keyup", this.updateSpanText.bind(this));
  5657. this.input.removeEventListener("blur", this.stopBlinkCaret.bind(this));
  5658. this.input.removeEventListener("keydown", this.registerInput.bind(this));
  5659. this.inputCMD.removeEventListener("click", this.blinkCaretAndFocus.bind(this));
  5660. this.clearBtn.removeEventListener("click", this.clearBtnClick.bind(this));
  5661. this.hideBtn.removeEventListener("click", this.hideBtnClick.bind(this));
  5662. this.showBtn.removeEventListener("click", this.showBtnClick.bind(this));
  5663. this.input = null;
  5664. this.inputCMD = null;
  5665. this.inputDiv = null;
  5666. this.termDiv = null;
  5667. this.inputSpan = null;
  5668. this.cursorRef = null;
  5669. this.clearBtn = null;
  5670. this.hideBtn = null;
  5671. this.showBtn = null;
  5672. this.currentLine = null;
  5673. var cNode = this.parent.cloneNode(false);
  5674. this.parent.parentNode.replaceChild(cNode, this.parent);
  5675. if (this.cursorInterval != null) {
  5676. clearInterval(this.cursorInterval);
  5677. }
  5678. if (this.idleInterval != null) {
  5679. clearInterval(this.idleInterval);
  5680. }
  5681. }
  5682. }, {
  5683. key: "showInput",
  5684. value: function showInput() {
  5685. this.needInput = true;
  5686. this.inputDiv.style.display = "block";
  5687. this.inputCMD.click(); //this.inputCMD.scrollIntoView();
  5688. this.scrollTerm();
  5689. }
  5690. }, {
  5691. key: "hideInput",
  5692. value: function hideInput() {
  5693. this.needInput = false;
  5694. this.inputDiv.style.display = " none";
  5695. clearInterval(this.cursorInterval);
  5696. this.cursorInterval = null;
  5697. }
  5698. }, {
  5699. key: "requestInput",
  5700. value: function requestInput() {
  5701. var _this2 = this;
  5702. var anyKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  5703. var promise = new Promise(function (resolve, _) {
  5704. _this2.inputListeners.push(resolve);
  5705. _this2.anyKey = anyKey;
  5706. if (_this2.idleInterval == null) _this2.scheduleNotify();
  5707. _this2.showInput();
  5708. });
  5709. return promise;
  5710. }
  5711. }, {
  5712. key: "sendOutput",
  5713. value: function sendOutput(text) {
  5714. //console.debug(text);
  5715. var output = "" + text;
  5716. if (output.indexOf("\n") !== -1) {
  5717. //console.debug("newline");
  5718. var outputList = output.split("\n");
  5719. var i = 0;
  5720. for (; i < outputList.length - 1; i += 1) {
  5721. //console.debug("newline write");
  5722. var _t = outputList[i];
  5723. _t = _t.replace(/\t/g, "&#x0020;&#x0020;");
  5724. _t = _t.replace(/\s/g, "&#x0020;");
  5725. if (_t.length !== 0) {
  5726. this.write(_t);
  5727. }
  5728. this.write("", true);
  5729. }
  5730. var t = outputList[i];
  5731. t = t.replace(/\t/g, "&#x0020;&#x0020;");
  5732. t = t.replace(/\s/g, "&#x0020;");
  5733. if (t.length != 0) this.write(t);
  5734. } else {
  5735. // console.debug("no newline");
  5736. output = output.replace(/\t/g, "&#x0020;&#x0020;");
  5737. output = output.replace(/\s/g, "&#x0020;");
  5738. if (output.length != 0) this.write(output);
  5739. }
  5740. }
  5741. }, {
  5742. key: "clearPendingWrites",
  5743. value: function clearPendingWrites() {
  5744. this.last_clear = Date.now();
  5745. }
  5746. }, {
  5747. key: "clear",
  5748. value: function clear() {
  5749. this.clearPendingWrites();
  5750. while (this.inputDiv.parentElement.childNodes.length > 1) {
  5751. this.inputDiv.parentElement.removeChild(this.inputDiv.parentElement.firstChild);
  5752. }
  5753. this.input.value = "";
  5754. this.inputSpan.innerHTML = "";
  5755. this.currentLine = null;
  5756. }
  5757. }, {
  5758. key: "clearBtnClick",
  5759. value: function clearBtnClick() {
  5760. this.clear();
  5761. }
  5762. }, {
  5763. key: "showBtnClick",
  5764. value: function showBtnClick() {
  5765. this.focus();
  5766. }
  5767. }, {
  5768. key: "hideBtnClick",
  5769. value: function hideBtnClick() {
  5770. this.hide();
  5771. }
  5772. }, {
  5773. key: "notifyIdle",
  5774. value: function notifyIdle() {
  5775. this.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("awaiting_input_message"));
  5776. this.inputCMD.click();
  5777. }
  5778. }, {
  5779. key: "scheduleNotify",
  5780. value: function scheduleNotify() {
  5781. this.idleInterval = window.setInterval(this.notifyIdle.bind(this), _util_config__WEBPACK_IMPORTED_MODULE_6__["Config"].idle_input_interval);
  5782. }
  5783. }, {
  5784. key: "cancelPendingInputRequests",
  5785. value: function cancelPendingInputRequests() {
  5786. this.inputListeners.forEach(function (resolve) {
  5787. return resolve("");
  5788. });
  5789. this.inputListeners.splice(0, this.inputListeners.length);
  5790. if (this.idleInterval != null) {
  5791. clearInterval(this.idleInterval);
  5792. this.idleInterval = null;
  5793. }
  5794. this.input.value = "";
  5795. this.inputSpan.innerHTML = "";
  5796. this.currentLine = null;
  5797. this.hideInput();
  5798. this.anyKey = false;
  5799. }
  5800. }]);
  5801. return DOMConsole;
  5802. }();
  5803. /***/ }),
  5804. /***/ "./js/io/input.js":
  5805. /*!************************!*\
  5806. !*** ./js/io/input.js ***!
  5807. \************************/
  5808. /*! exports provided: Input */
  5809. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5810. "use strict";
  5811. __webpack_require__.r(__webpack_exports__);
  5812. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
  5813. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5814. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5815. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5816. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5817. var Input = /*#__PURE__*/function () {
  5818. function Input() {
  5819. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Input);
  5820. }
  5821. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Input, [{
  5822. key: "requestInput",
  5823. value: function requestInput() {
  5824. throw new Error("Must be implemented");
  5825. }
  5826. }, {
  5827. key: "cancelPendingInputRequests",
  5828. value: function cancelPendingInputRequests() {
  5829. throw new Error("Must be implemented");
  5830. }
  5831. }]);
  5832. return Input;
  5833. }();
  5834. /***/ }),
  5835. /***/ "./js/io/output.js":
  5836. /*!*************************!*\
  5837. !*** ./js/io/output.js ***!
  5838. \*************************/
  5839. /*! exports provided: Output */
  5840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5841. "use strict";
  5842. __webpack_require__.r(__webpack_exports__);
  5843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; });
  5844. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5845. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5846. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5847. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5848. var Output = /*#__PURE__*/function () {
  5849. function Output() {
  5850. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Output);
  5851. }
  5852. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Output, [{
  5853. key: "sendOutput",
  5854. value: function sendOutput(text) {
  5855. throw new Error("Must be implemented");
  5856. }
  5857. }]);
  5858. return Output;
  5859. }();
  5860. /***/ }),
  5861. /***/ "./js/main.js":
  5862. /*!********************!*\
  5863. !*** ./js/main.js ***!
  5864. \********************/
  5865. /*! exports provided: runner, initVisualUI, addFunctionChangeListener, addGlobalChangeListener, removeFunctionListener, removeGlobalListener, getTestCases, autoEval, prepareActivityToStudentHelper, LocalizedStrings, i18n, getLogs, getLogsAsString, registerClick, registerUserEvent, parseLogs, ActionTypes, CodeEditor, openAssessmentDetail, autoGenerateTestCaseOutput, Config */
  5866. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5867. "use strict";
  5868. __webpack_require__.r(__webpack_exports__);
  5869. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  5870. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18n", function() { return i18n; });
  5871. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditor", function() { return CodeEditor; });
  5872. /* harmony import */ var _runner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runner */ "./js/runner.js");
  5873. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return _runner__WEBPACK_IMPORTED_MODULE_0__["runner"]; });
  5874. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualUI/functions */ "./js/visualUI/functions.js");
  5875. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["initVisualUI"]; });
  5876. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addFunctionChangeListener"]; });
  5877. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addGlobalChangeListener"]; });
  5878. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeFunctionListener"]; });
  5879. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeGlobalListener"]; });
  5880. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["getTestCases"]; });
  5881. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/localizedStringsService */ "./js/services/localizedStringsService.js");
  5882. /* harmony import */ var _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/i18nHelper */ "./js/services/i18nHelper.js");
  5883. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/userLog */ "./js/services/userLog.js");
  5884. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogs"]; });
  5885. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogsAsString"]; });
  5886. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerClick"]; });
  5887. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"]; });
  5888. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"]; });
  5889. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"]; });
  5890. /* harmony import */ var _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/iassignHelpers */ "./js/util/iassignHelpers.js");
  5891. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["autoEval"]; });
  5892. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["prepareActivityToStudentHelper"]; });
  5893. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/utils */ "./js/util/utils.js");
  5894. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return _util_utils__WEBPACK_IMPORTED_MODULE_6__["openAssessmentDetail"]; });
  5895. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/config */ "./js/util/config.ts");
  5896. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  5897. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Config", function() { return _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]; });
  5898. /* harmony import */ var _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./visualUI/text_editor */ "./js/visualUI/text_editor.js");
  5899. /* harmony import */ var _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util/auto_gen_output */ "./js/util/auto_gen_output.js");
  5900. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_9__["autoGenerateTestCaseOutput"]; });
  5901. var CodeEditor = {
  5902. initTextEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["initTextEditor"],
  5903. setCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["setCode"],
  5904. getCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["getCode"],
  5905. updateEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["updateEditor"],
  5906. disable: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["disable"]
  5907. };
  5908. var i18n = _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__["i18nHelper"].i18n;
  5909. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  5910. /***/ }),
  5911. /***/ "./js/memory/address.ts":
  5912. /*!******************************!*\
  5913. !*** ./js/memory/address.ts ***!
  5914. \******************************/
  5915. /*! no static exports found */
  5916. /***/ (function(module, exports, __webpack_require__) {
  5917. "use strict";
  5918. Object.defineProperty(exports, "__esModule", { value: true });
  5919. exports.Address = void 0;
  5920. class Address {
  5921. /**
  5922. *
  5923. * @param {Number} id the address id
  5924. * @param {never} value the value stored at this address
  5925. */
  5926. constructor(id, value) {
  5927. this.id = id;
  5928. this.value = value;
  5929. }
  5930. }
  5931. exports.Address = Address;
  5932. /***/ }),
  5933. /***/ "./js/memory/location.ts":
  5934. /*!*******************************!*\
  5935. !*** ./js/memory/location.ts ***!
  5936. \*******************************/
  5937. /*! no static exports found */
  5938. /***/ (function(module, exports, __webpack_require__) {
  5939. "use strict";
  5940. Object.defineProperty(exports, "__esModule", { value: true });
  5941. exports.Location = void 0;
  5942. const address_1 = __webpack_require__(/*! ./address */ "./js/memory/address.ts");
  5943. class LocationHolder {
  5944. constructor() {
  5945. this.data = [];
  5946. this.address_id = 0;
  5947. }
  5948. /**
  5949. *
  5950. * @param {never} value the value to be allocated
  5951. * @returns {number} - the address id
  5952. */
  5953. allocate(value) {
  5954. const id = this.address_id;
  5955. // console.log("Allocation address "+ id);
  5956. const address = new address_1.Address(id, value);
  5957. this.data.push(address);
  5958. this.address_id += 1;
  5959. return id;
  5960. }
  5961. /**
  5962. *
  5963. * @param {number} id
  5964. */
  5965. deallocate(id) {
  5966. const index = this.findIndex(id);
  5967. // console.log("Deallocation address "+ id);
  5968. if (index !== -1) {
  5969. this.data.splice(index, 1);
  5970. return true;
  5971. }
  5972. return false;
  5973. }
  5974. /**
  5975. *
  5976. * @param {number} id
  5977. * @returns {Address} the address identified by id
  5978. */
  5979. find(id) {
  5980. let beg = 0;
  5981. let end = this.data.length;
  5982. // console.log("Finding address "+id);
  5983. while (beg < end) {
  5984. const med = Math.floor((beg + end) / 2);
  5985. const address = this.getAddressAt(med);
  5986. if (address.id === id) {
  5987. return address;
  5988. }
  5989. else if (id > address.id) {
  5990. beg = med;
  5991. }
  5992. else {
  5993. end = med;
  5994. }
  5995. }
  5996. return undefined;
  5997. }
  5998. getAddressAt(pos) {
  5999. return this.data[pos];
  6000. }
  6001. /**
  6002. *
  6003. * @param {number} id address id
  6004. * @returns {number} the index of the address identified by id
  6005. */
  6006. findIndex(id) {
  6007. let beg = 0;
  6008. let end = this.data.length;
  6009. while (beg < end) {
  6010. const med = Math.floor((beg + end) / 2);
  6011. const address = this.getAddressAt(med);
  6012. if (address.id === id) {
  6013. return med;
  6014. }
  6015. else if (id > address.id) {
  6016. beg = med;
  6017. }
  6018. else {
  6019. end = med;
  6020. }
  6021. }
  6022. return -1;
  6023. }
  6024. updateAddress(id, value) {
  6025. const index = this.findIndex(id);
  6026. if (index === -1) {
  6027. throw new Error("Invalid address..." + id);
  6028. }
  6029. this.data[index].value = value;
  6030. }
  6031. clear() {
  6032. for (let i = 0; i < this.data.length; i += 1) {
  6033. delete this.data[i];
  6034. }
  6035. this.data = [];
  6036. this.address_id = 0;
  6037. }
  6038. }
  6039. const inner_ref = new LocationHolder();
  6040. exports.Location = Object.freeze({
  6041. allocate: inner_ref.allocate.bind(inner_ref),
  6042. deallocate: inner_ref.deallocate.bind(inner_ref),
  6043. find: inner_ref.find.bind(inner_ref),
  6044. updateAddress: inner_ref.updateAddress.bind(inner_ref),
  6045. clear: inner_ref.clear.bind(inner_ref),
  6046. size: () => inner_ref.data.length
  6047. });
  6048. /***/ }),
  6049. /***/ "./js/processor/compatibilityTable.ts":
  6050. /*!********************************************!*\
  6051. !*** ./js/processor/compatibilityTable.ts ***!
  6052. \********************************************/
  6053. /*! no static exports found */
  6054. /***/ (function(module, exports, __webpack_require__) {
  6055. "use strict";
  6056. Object.defineProperty(exports, "__esModule", { value: true });
  6057. exports.resultTypeAfterUnaryOp = exports.resultTypeAfterInfixOp = void 0;
  6058. const types_1 = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  6059. const operators_1 = __webpack_require__(/*! ../ast/operators */ "./js/ast/operators.ts");
  6060. const multiType_1 = __webpack_require__(/*! ../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  6061. const config_1 = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  6062. function buildInfixAddTable() {
  6063. const table = [[], [], [], [], []];
  6064. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6065. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6066. table[types_1.Types.INTEGER.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6067. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6068. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6069. table[types_1.Types.REAL.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6070. table[types_1.Types.STRING.ord][types_1.Types.INTEGER.ord] = types_1.Types.STRING;
  6071. table[types_1.Types.STRING.ord][types_1.Types.REAL.ord] = types_1.Types.STRING;
  6072. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6073. table[types_1.Types.STRING.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.STRING;
  6074. table[types_1.Types.STRING.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6075. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6076. table[types_1.Types.CHAR.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6077. return table;
  6078. }
  6079. function buildInfixMultiDivSubTable() {
  6080. const table = [[], []];
  6081. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6082. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6083. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6084. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6085. return table;
  6086. }
  6087. function buildInfixEqualityInequalityTable() {
  6088. const table = [[], [], [], [], []];
  6089. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6090. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6091. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6092. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6093. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6094. return table;
  6095. }
  6096. function buildInfixRelationalTable() {
  6097. const table = [[], [], [], [], []];
  6098. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6099. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6100. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6101. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6102. return table;
  6103. }
  6104. function buildInfixAndOrTable() {
  6105. const table = [[], [], [], []];
  6106. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6107. return table;
  6108. }
  6109. function buildInfixModTable() {
  6110. const table = [[]];
  6111. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6112. return table;
  6113. }
  6114. function buildUnarySumSubList() {
  6115. const list = [];
  6116. list[types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6117. list[types_1.Types.REAL.ord] = types_1.Types.REAL;
  6118. return list;
  6119. }
  6120. function buildUnaryNegList() {
  6121. const list = [];
  6122. list[types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6123. return list;
  6124. }
  6125. function buildInfixCompatibilityTable() {
  6126. const compatibilityMap = new WeakMap();
  6127. compatibilityMap.set(operators_1.Operators.ADD, buildInfixAddTable());
  6128. compatibilityMap.set(operators_1.Operators.SUB, buildInfixMultiDivSubTable());
  6129. compatibilityMap.set(operators_1.Operators.MULT, buildInfixMultiDivSubTable());
  6130. compatibilityMap.set(operators_1.Operators.DIV, buildInfixMultiDivSubTable());
  6131. compatibilityMap.set(operators_1.Operators.EQ, buildInfixEqualityInequalityTable());
  6132. compatibilityMap.set(operators_1.Operators.NEQ, buildInfixEqualityInequalityTable());
  6133. compatibilityMap.set(operators_1.Operators.GE, buildInfixRelationalTable());
  6134. compatibilityMap.set(operators_1.Operators.GT, buildInfixRelationalTable());
  6135. compatibilityMap.set(operators_1.Operators.LE, buildInfixRelationalTable());
  6136. compatibilityMap.set(operators_1.Operators.LT, buildInfixRelationalTable());
  6137. compatibilityMap.set(operators_1.Operators.OR, buildInfixAndOrTable());
  6138. compatibilityMap.set(operators_1.Operators.AND, buildInfixAndOrTable());
  6139. compatibilityMap.set(operators_1.Operators.MOD, buildInfixModTable());
  6140. return compatibilityMap;
  6141. }
  6142. function buildUnaryCompatibilityTable() {
  6143. const compatibilityMap = new WeakMap();
  6144. compatibilityMap.set(operators_1.Operators.ADD, buildUnarySumSubList());
  6145. compatibilityMap.set(operators_1.Operators.SUB, buildUnarySumSubList());
  6146. compatibilityMap.set(operators_1.Operators.NOT, buildUnaryNegList());
  6147. return compatibilityMap;
  6148. }
  6149. const infixMap = buildInfixCompatibilityTable();
  6150. const unaryMap = buildUnaryCompatibilityTable();
  6151. function resultTypeAfterInfixOp(operator, leftExpressionType, rightExpressionType) {
  6152. try {
  6153. if (leftExpressionType instanceof multiType_1.MultiType && rightExpressionType instanceof multiType_1.MultiType) {
  6154. let newMulti = [];
  6155. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6156. const typeA = leftExpressionType.types[i];
  6157. for (let j = 0; j < rightExpressionType.types.length; ++i) {
  6158. const typeB = rightExpressionType.types[j];
  6159. newMulti.push(resultTypeAfterInfixOp(operator, typeA, typeB));
  6160. }
  6161. }
  6162. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6163. if (newMulti.length <= 0) {
  6164. if (config_1.Config.enable_type_casting) {
  6165. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6166. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6167. return new multiType_1.MultiType([types_1.Types.INTEGER, types_1.Types.REAL]);
  6168. }
  6169. }
  6170. }
  6171. return types_1.Types.UNDEFINED;
  6172. }
  6173. else {
  6174. return new multiType_1.MultiType(newMulti);
  6175. }
  6176. }
  6177. else if (leftExpressionType instanceof multiType_1.MultiType) {
  6178. if (leftExpressionType.isCompatible(rightExpressionType)) {
  6179. return resultTypeAfterInfixOp(operator, rightExpressionType, rightExpressionType);
  6180. }
  6181. else {
  6182. if (config_1.Config.enable_type_casting) {
  6183. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6184. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6185. return rightExpressionType;
  6186. }
  6187. }
  6188. }
  6189. return types_1.Types.UNDEFINED;
  6190. }
  6191. }
  6192. else if (rightExpressionType instanceof multiType_1.MultiType) {
  6193. if (rightExpressionType.isCompatible(leftExpressionType)) {
  6194. return resultTypeAfterInfixOp(operator, leftExpressionType, leftExpressionType);
  6195. }
  6196. else {
  6197. if (config_1.Config.enable_type_casting) {
  6198. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6199. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6200. return leftExpressionType;
  6201. }
  6202. }
  6203. }
  6204. return types_1.Types.UNDEFINED;
  6205. }
  6206. }
  6207. const resultTable = infixMap.get(operator) || [];
  6208. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6209. const resultType = resultTable[leftExpressionType.ord][rightExpressionType.ord];
  6210. if (resultType === null || resultType === undefined) {
  6211. if (config_1.Config.enable_type_casting) {
  6212. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6213. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6214. if (operator === operators_1.Operators.MOD) {
  6215. return types_1.Types.INTEGER;
  6216. }
  6217. else if (operator.ord >= 5 && operator.ord <= 10) {
  6218. return types_1.Types.BOOLEAN;
  6219. }
  6220. }
  6221. }
  6222. }
  6223. return types_1.Types.UNDEFINED;
  6224. }
  6225. return resultType;
  6226. }
  6227. catch (e) {
  6228. if (e instanceof TypeError) {
  6229. return types_1.Types.UNDEFINED;
  6230. }
  6231. else {
  6232. throw e;
  6233. }
  6234. }
  6235. }
  6236. exports.resultTypeAfterInfixOp = resultTypeAfterInfixOp;
  6237. function resultTypeAfterUnaryOp(operator, leftExpressionType) {
  6238. try {
  6239. if (leftExpressionType instanceof multiType_1.MultiType) {
  6240. let newMulti = [];
  6241. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6242. const type = leftExpressionType.types[i];
  6243. newMulti.push(resultTypeAfterUnaryOp(operator, type));
  6244. }
  6245. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6246. if (newMulti.length <= 0) {
  6247. return types_1.Types.UNDEFINED;
  6248. }
  6249. return new multiType_1.MultiType(newMulti);
  6250. }
  6251. const resultTable = unaryMap.get(operator) || [];
  6252. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6253. const resultType = resultTable[leftExpressionType.ord];
  6254. if (resultType == null) {
  6255. return types_1.Types.UNDEFINED;
  6256. }
  6257. return resultType;
  6258. }
  6259. catch (e) {
  6260. if (e instanceof TypeError) {
  6261. return types_1.Types.UNDEFINED;
  6262. }
  6263. else {
  6264. throw e;
  6265. }
  6266. }
  6267. }
  6268. exports.resultTypeAfterUnaryOp = resultTypeAfterUnaryOp;
  6269. /***/ }),
  6270. /***/ "./js/processor/context.ts":
  6271. /*!*********************************!*\
  6272. !*** ./js/processor/context.ts ***!
  6273. \*********************************/
  6274. /*! no static exports found */
  6275. /***/ (function(module, exports, __webpack_require__) {
  6276. "use strict";
  6277. Object.defineProperty(exports, "__esModule", { value: true });
  6278. exports.Context = void 0;
  6279. exports.Context = Object.freeze({
  6280. BASE: Symbol('context:base'),
  6281. BREAKABLE: Symbol('context:breakable'),
  6282. FUNCTION: Symbol('context:function')
  6283. });
  6284. /***/ }),
  6285. /***/ "./js/processor/definedFunctions.js":
  6286. /*!******************************************!*\
  6287. !*** ./js/processor/definedFunctions.js ***!
  6288. \******************************************/
  6289. /*! exports provided: LanguageDefinedFunction */
  6290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6291. "use strict";
  6292. __webpack_require__.r(__webpack_exports__);
  6293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageDefinedFunction", function() { return LanguageDefinedFunction; });
  6294. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  6295. /* harmony import */ var _lib_io__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/io */ "./js/processor/lib/io.js");
  6296. /* harmony import */ var _lib_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/strings */ "./js/processor/lib/strings.js");
  6297. /* harmony import */ var _lib_arrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/arrays */ "./js/processor/lib/arrays.js");
  6298. /* harmony import */ var _lib_lang__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/lang */ "./js/processor/lib/lang.js");
  6299. /* harmony import */ var _lib_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/math */ "./js/processor/lib/math.js");
  6300. function valueToKey(value, object) {
  6301. for (var key in object) {
  6302. if (Object.prototype.hasOwnProperty.call(object, key)) {
  6303. if (object[key] === value) {
  6304. return key;
  6305. }
  6306. }
  6307. }
  6308. return null;
  6309. }
  6310. function concatObjects() {
  6311. var result = {};
  6312. for (var i = 0; i < arguments.length; i++) {
  6313. var obj = i < 0 || arguments.length <= i ? undefined : arguments[i];
  6314. for (var key in obj) {
  6315. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  6316. result[key] = obj[key];
  6317. }
  6318. }
  6319. }
  6320. return result;
  6321. }
  6322. var libsObject = {
  6323. $mathLib: {
  6324. $sin: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSinFun"])(),
  6325. $cos: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createCosFun"])(),
  6326. $tan: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createTanFun"])(),
  6327. $sqrt: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSqrtFun"])(),
  6328. $pow: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createPowFun"])(),
  6329. $log: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createLogFun"])(),
  6330. $abs: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createAbsFun"])(),
  6331. $negate: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createNegateFun"])(),
  6332. $invert: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createInvertFun"])(),
  6333. $max: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMaxFun"])(),
  6334. $min: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMinFun"])(),
  6335. $rand: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createRandFun"])()
  6336. },
  6337. $ioLib: {
  6338. $read: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createInputFun"])(),
  6339. $write: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createOutputFun"])()
  6340. },
  6341. $strLib: {
  6342. $substring: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createSubstringFun"])(),
  6343. $length: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLengthFun"])(),
  6344. $uppercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createUppercaseFun"])(),
  6345. $lowercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLowercaseFun"])(),
  6346. $charAt: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createrCharAtFun"])()
  6347. },
  6348. $arrayLib: {
  6349. $numElements: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createNumElementsFun"])(),
  6350. $matrixLines: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixLinesFun"])(),
  6351. $matrixColumns: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixColumnsFun"])()
  6352. },
  6353. $langLib: {
  6354. $isReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsRealFun"])(),
  6355. $isInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsIntFun"])(),
  6356. $isBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsBoolFun"])(),
  6357. $castReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastRealFun"])(),
  6358. $castInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastIntFun"])(),
  6359. $castBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastBoolFun"])(),
  6360. $castString: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastStringFun"])(),
  6361. $castChar: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastCharFun"])()
  6362. }
  6363. };
  6364. var funcsObject = concatObjects(libsObject.$ioLib, libsObject.$langLib, libsObject.$strLib, libsObject.$arrayLib);
  6365. var LanguageDefinedFunction = Object.freeze({
  6366. getMainFunctionName: function getMainFunctionName() {
  6367. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs().main_function;
  6368. },
  6369. getInternalName: function getInternalName(localName) {
  6370. if (localName.indexOf(".") !== -1) {
  6371. var names = localName.split(".");
  6372. var lib = valueToKey(names[0], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs());
  6373. var internalName = valueToKey(names[1], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6374. if (lib === null || internalName === null) {
  6375. return null;
  6376. }
  6377. return lib + "." + internalName;
  6378. }
  6379. var funcName = valueToKey(localName, _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6380. if (funcName !== null) {
  6381. if (funcsObject[funcName]) {
  6382. return funcName;
  6383. }
  6384. }
  6385. return null;
  6386. },
  6387. getFunction: function getFunction(internalName) {
  6388. if (internalName.indexOf(".") !== -1) {
  6389. var names = internalName.split(".");
  6390. var libName = names[0];
  6391. var funName = names[1];
  6392. return libsObject[libName][funName];
  6393. }
  6394. return funcsObject[internalName];
  6395. },
  6396. getLocalName: function getLocalName(internalName) {
  6397. if (internalName.indexOf(".") !== -1) {
  6398. var names = internalName.split(".");
  6399. var libName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs()[names[0]];
  6400. var funName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[names[1]];
  6401. return "".concat(libName, ".").concat(funName);
  6402. } else if (_services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName]) {
  6403. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName];
  6404. } else {
  6405. return internalName;
  6406. }
  6407. }
  6408. });
  6409. /***/ }),
  6410. /***/ "./js/processor/error/processorErrorFactory.js":
  6411. /*!*****************************************************!*\
  6412. !*** ./js/processor/error/processorErrorFactory.js ***!
  6413. \*****************************************************/
  6414. /*! exports provided: ProcessorErrorFactory */
  6415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6416. "use strict";
  6417. __webpack_require__.r(__webpack_exports__);
  6418. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProcessorErrorFactory", function() { return ProcessorErrorFactory; });
  6419. /* harmony import */ var _runtimeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runtimeError */ "./js/processor/error/runtimeError.js");
  6420. /* harmony import */ var _semanticError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./semanticError */ "./js/processor/error/semanticError.js");
  6421. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6422. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../definedFunctions */ "./js/processor/definedFunctions.js");
  6423. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6424. function createRuntimeError(i18n_id) {
  6425. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6426. return new _runtimeError__WEBPACK_IMPORTED_MODULE_0__["RuntimeError"](LocalizedStrings.getError(i18n_id, context));
  6427. }
  6428. function createSemanticError(i18n_id) {
  6429. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6430. return new _semanticError__WEBPACK_IMPORTED_MODULE_1__["SemanticError"](LocalizedStrings.getError(i18n_id, context));
  6431. }
  6432. var ProcessorErrorFactory = Object.freeze({
  6433. symbol_not_found_full: function symbol_not_found_full(id, sourceInfo) {
  6434. if (sourceInfo) {
  6435. var context = [id, sourceInfo.line, sourceInfo.column];
  6436. return createSemanticError("symbol_not_found_full", context);
  6437. } else {
  6438. return ProcessorErrorFactory.symbol_not_found(id);
  6439. }
  6440. },
  6441. symbol_not_found: function symbol_not_found(id) {
  6442. var context = [id];
  6443. return createSemanticError("symbol_not_found", context);
  6444. },
  6445. function_missing_full: function function_missing_full(id, sourceInfo) {
  6446. if (sourceInfo) {
  6447. var context = [id, sourceInfo.line, sourceInfo.column];
  6448. return createSemanticError("function_missing_full", context);
  6449. } else {
  6450. return ProcessorErrorFactory.function_missing(id);
  6451. }
  6452. },
  6453. function_missing: function function_missing(id) {
  6454. var context = [id];
  6455. return createSemanticError("function_missing", context);
  6456. },
  6457. main_missing: function main_missing() {
  6458. return createSemanticError("main_missing");
  6459. },
  6460. array_dimension_not_int_full: function array_dimension_not_int_full(sourceInfo) {
  6461. if (sourceInfo) {
  6462. var context = [sourceInfo.line];
  6463. return createSemanticError("array_dimension_not_int_full", context);
  6464. } else {
  6465. return ProcessorErrorFactory.array_dimension_not_int();
  6466. }
  6467. },
  6468. array_dimension_not_int: function array_dimension_not_int() {
  6469. return createSemanticError("array_dimension_not_int");
  6470. },
  6471. unknown_command_full: function unknown_command_full(sourceInfo) {
  6472. if (sourceInfo) {
  6473. var context = [sourceInfo.line];
  6474. return createRuntimeError("unknown_command_full", context);
  6475. } else {
  6476. return ProcessorErrorFactory.unknown_command();
  6477. }
  6478. },
  6479. unknown_command: function unknown_command() {
  6480. return createRuntimeError("unknown_command");
  6481. },
  6482. incompatible_types_full: function incompatible_types_full(left_type, left_dim, right_type, right_dim, exp, source_info) {
  6483. if (source_info) {
  6484. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, source_info.line, LocalizedStrings.translateType(right_type, right_dim)];
  6485. return createSemanticError("incompatible_types_full", context);
  6486. } else {
  6487. return ProcessorErrorFactory.incompatible_types(left_type, left_dim, right_type, right_dim, exp);
  6488. }
  6489. },
  6490. incompatible_types: function incompatible_types(left_type, left_dim, right_type, right_dim, exp) {
  6491. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, LocalizedStrings.translateType(right_type, right_dim)];
  6492. return createSemanticError("incompatible_types", context);
  6493. },
  6494. incompatible_types_array_full: function incompatible_types_array_full(exp, type, dim, sourceInfo) {
  6495. if (sourceInfo) {
  6496. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6497. return createSemanticError("incompatible_types_array_full", context);
  6498. } else {
  6499. return ProcessorErrorFactory.incompatible_types_array(exp, type, dim);
  6500. }
  6501. },
  6502. incompatible_types_array: function incompatible_types_array(exp, type, dim) {
  6503. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6504. return createSemanticError("incompatible_types_array", context);
  6505. },
  6506. loop_condition_type_full: function loop_condition_type_full(exp, sourceInfo) {
  6507. if (sourceInfo) {
  6508. var context = [sourceInfo.line, sourceInfo.column, exp];
  6509. return createSemanticError("loop_condition_type_full", context);
  6510. } else {
  6511. return ProcessorErrorFactory.loop_condition_type(exp);
  6512. }
  6513. },
  6514. loop_condition_type: function loop_condition_type(exp) {
  6515. var context = [exp];
  6516. return createSemanticError("loop_condition_type", context);
  6517. },
  6518. /**
  6519. * @deprecated 01/10/2019
  6520. */
  6521. endless_loop_full: function endless_loop_full(sourceInfo) {
  6522. if (sourceInfo) {
  6523. var context = [sourceInfo.line];
  6524. return createSemanticError("endless_loop_full", context);
  6525. } else {
  6526. return ProcessorErrorFactory.endless_loop();
  6527. }
  6528. },
  6529. endless_loop: function endless_loop() {
  6530. return createSemanticError("endless_loop");
  6531. },
  6532. if_condition_type_full: function if_condition_type_full(exp, sourceInfo) {
  6533. if (sourceInfo) {
  6534. var context = [sourceInfo.line, sourceInfo.column, exp];
  6535. return createSemanticError("if_condition_type_full", context);
  6536. } else {
  6537. return ProcessorErrorFactory.if_condition_type(exp);
  6538. }
  6539. },
  6540. if_condition_type: function if_condition_type(exp) {
  6541. var context = [exp];
  6542. return createSemanticError("if_condition_type", context);
  6543. },
  6544. invalid_global_var: function invalid_global_var() {
  6545. return createRuntimeError("invalid_global_var");
  6546. },
  6547. not_implemented: function not_implemented(id) {
  6548. var context = [id];
  6549. return createRuntimeError("not_implemented", context);
  6550. },
  6551. invalid_case_type_full: function invalid_case_type_full(exp, type, dim, sourceInfo) {
  6552. if (sourceInfo) {
  6553. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6554. return createSemanticError("invalid_case_type_full", context);
  6555. } else {
  6556. return ProcessorErrorFactory.invalid_case_type(exp, type, dim);
  6557. }
  6558. },
  6559. invalid_case_type: function invalid_case_type(exp, type, dim) {
  6560. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6561. return createSemanticError("invalid_case_type", context);
  6562. },
  6563. void_in_expression_full: function void_in_expression_full(id, sourceInfo) {
  6564. if (sourceInfo) {
  6565. var context = [sourceInfo.line, sourceInfo.column, id];
  6566. return createSemanticError("void_in_expression_full", context);
  6567. } else {
  6568. return ProcessorErrorFactory.void_in_expression(id);
  6569. }
  6570. },
  6571. void_in_expression: function void_in_expression(id) {
  6572. var context = [id];
  6573. return createSemanticError("void_in_expression", context);
  6574. },
  6575. invalid_array_access_full: function invalid_array_access_full(id, sourceInfo) {
  6576. if (sourceInfo) {
  6577. var context = [id, sourceInfo.line, sourceInfo.column];
  6578. return createSemanticError("invalid_array_access_full", context);
  6579. } else {
  6580. return ProcessorErrorFactory.invalid_array_access(id);
  6581. }
  6582. },
  6583. invalid_array_access: function invalid_array_access(id) {
  6584. var context = [id];
  6585. return createSemanticError("invalid_array_access", context);
  6586. },
  6587. invalid_matrix_access_full: function invalid_matrix_access_full(id, sourceInfo) {
  6588. if (sourceInfo) {
  6589. var context = [id, sourceInfo.line, sourceInfo.column];
  6590. return createSemanticError("invalid_matrix_access_full", context);
  6591. } else {
  6592. return ProcessorErrorFactory.invalid_matrix_access(id);
  6593. }
  6594. },
  6595. invalid_matrix_access: function invalid_matrix_access(id) {
  6596. var context = [id];
  6597. return createSemanticError("invalid_matrix_access", context);
  6598. },
  6599. matrix_column_outbounds_full: function matrix_column_outbounds_full(id, value, columns, sourceInfo) {
  6600. if (sourceInfo) {
  6601. var context = [sourceInfo.line, value, id, columns];
  6602. return createRuntimeError("matrix_column_outbounds_full", context);
  6603. } else {
  6604. return ProcessorErrorFactory.matrix_column_outbounds(id, value, columns);
  6605. }
  6606. },
  6607. matrix_column_outbounds: function matrix_column_outbounds(id, value, columns) {
  6608. var context = [value, id, columns];
  6609. return createRuntimeError("matrix_column_outbounds", context);
  6610. },
  6611. matrix_line_outbounds_full: function matrix_line_outbounds_full(id, value, lines, sourceInfo) {
  6612. if (sourceInfo) {
  6613. var context = [sourceInfo.line, value, id, lines];
  6614. return createRuntimeError("matrix_line_outbounds_full", context);
  6615. } else {
  6616. return ProcessorErrorFactory.matrix_line_outbounds(id, value, lines);
  6617. }
  6618. },
  6619. matrix_line_outbounds: function matrix_line_outbounds(id, value, lines) {
  6620. var context = [value, id, lines];
  6621. return createRuntimeError("matrix_line_outbounds", context);
  6622. },
  6623. vector_line_outbounds_full: function vector_line_outbounds_full(id, value, lines, sourceInfo) {
  6624. if (sourceInfo) {
  6625. var context = [sourceInfo.line, value, id, lines];
  6626. return createRuntimeError("vector_line_outbounds_full", context);
  6627. } else {
  6628. return ProcessorErrorFactory.vector_line_outbounds(id, value, lines);
  6629. }
  6630. },
  6631. vector_line_outbounds: function vector_line_outbounds(id, value, lines) {
  6632. var context = [value, id, lines];
  6633. return createRuntimeError("vector_line_outbounds", context);
  6634. },
  6635. vector_not_matrix_full: function vector_not_matrix_full(id, sourceInfo) {
  6636. if (sourceInfo) {
  6637. var context = [sourceInfo.line, id];
  6638. return createRuntimeError("vector_not_matrix_full", context);
  6639. } else {
  6640. return ProcessorErrorFactory.vector_not_matrix(id);
  6641. }
  6642. },
  6643. vector_not_matrix: function vector_not_matrix(id) {
  6644. var context = [id];
  6645. return createRuntimeError("vector_not_matrix", context);
  6646. },
  6647. function_no_return: function function_no_return(id) {
  6648. var context = [id];
  6649. return createSemanticError("function_no_return", context);
  6650. },
  6651. invalid_void_return_full: function invalid_void_return_full(id, type, dim, sourceInfo) {
  6652. if (sourceInfo) {
  6653. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6654. return createSemanticError("invalid_void_return_full", context);
  6655. } else {
  6656. return ProcessorErrorFactory.invalid_void_return(id, type, dim);
  6657. }
  6658. },
  6659. invalid_void_return: function invalid_void_return(id, type, dim) {
  6660. var context = [id, LocalizedStrings.translateType(type, dim)];
  6661. return createSemanticError("invalid_void_return_full", context);
  6662. },
  6663. invalid_return_type_full: function invalid_return_type_full(id, type, dim, sourceInfo) {
  6664. if (sourceInfo) {
  6665. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6666. return createSemanticError("invalid_return_type_full", context);
  6667. } else {
  6668. return ProcessorErrorFactory.invalid_return_type(id, type, dim);
  6669. }
  6670. },
  6671. invalid_return_type: function invalid_return_type(id, type, dim) {
  6672. var context = [id, LocalizedStrings.translateType(type, dim)];
  6673. return createSemanticError("invalid_return_type", context);
  6674. },
  6675. invalid_parameters_size_full: function invalid_parameters_size_full(id, expected, actual, sourceInfo) {
  6676. if (sourceInfo) {
  6677. var context = [sourceInfo.line, id, expected, actual];
  6678. return createSemanticError("invalid_parameters_size_full", context);
  6679. } else {
  6680. return ProcessorErrorFactory.invalid_parameters_size(id, expected, actual);
  6681. }
  6682. },
  6683. invalid_parameters_size: function invalid_parameters_size(id, expected, actual) {
  6684. var context = [id, expected, actual];
  6685. return createSemanticError("invalid_parameters_size", context);
  6686. },
  6687. invalid_parameter_type_full: function invalid_parameter_type_full(fun_name, exp, sourceInfo) {
  6688. if (sourceInfo) {
  6689. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  6690. return createSemanticError("invalid_parameter_type_full", context);
  6691. } else {
  6692. return ProcessorErrorFactory.invalid_parameter_type(fun_name, exp);
  6693. }
  6694. },
  6695. invalid_parameter_type: function invalid_parameter_type(fun_name, exp) {
  6696. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  6697. return createSemanticError("invalid_parameter_type_full", context);
  6698. },
  6699. invalid_ref_full: function invalid_ref_full(id, exp, sourceInfo) {
  6700. if (sourceInfo) {
  6701. var context = [exp, id, sourceInfo.line];
  6702. return createSemanticError("invalid_ref_full", context);
  6703. } else {
  6704. return ProcessorErrorFactory.invalid_ref(id, exp);
  6705. }
  6706. },
  6707. invalid_ref: function invalid_ref(id, exp) {
  6708. var context = [exp, id];
  6709. return createSemanticError("invalid_ref", context);
  6710. },
  6711. unexpected_break_command_full: function unexpected_break_command_full(sourceInfo) {
  6712. if (sourceInfo) {
  6713. var context = [sourceInfo.line];
  6714. return createRuntimeError("unexpected_break_command_full", context);
  6715. } else {
  6716. return ProcessorErrorFactory.unexpected_break_command();
  6717. }
  6718. },
  6719. unexpected_break_command: function unexpected_break_command() {
  6720. return createRuntimeError("unexpected_break_command");
  6721. },
  6722. invalid_array_literal_type_full: function invalid_array_literal_type_full(exp, sourceInfo) {
  6723. if (sourceInfo) {
  6724. var context = [sourceInfo.line, exp];
  6725. return createRuntimeError("invalid_array_literal_type_full", context);
  6726. } else {
  6727. return ProcessorErrorFactory.invalid_array_literal_type(exp);
  6728. }
  6729. },
  6730. invalid_array_literal_type: function invalid_array_literal_type(exp) {
  6731. var context = [exp];
  6732. return createRuntimeError("invalid_array_literal_type", context);
  6733. },
  6734. invalid_array_literal_line_full: function invalid_array_literal_line_full(expected, actual, sourceInfo) {
  6735. if (sourceInfo) {
  6736. var context = [sourceInfo.line, expected, actual];
  6737. return createRuntimeError("invalid_array_literal_line_full", context);
  6738. } else {
  6739. return ProcessorErrorFactory.invalid_array_literal_type(expected, actual);
  6740. }
  6741. },
  6742. invalid_array_literal_line: function invalid_array_literal_line(expected, actual) {
  6743. var context = [expected, actual];
  6744. return createRuntimeError("invalid_array_literal_line", context);
  6745. },
  6746. invalid_array_literal_column_full: function invalid_array_literal_column_full(expected, actual, sourceInfo) {
  6747. if (sourceInfo) {
  6748. var context = [sourceInfo.line, expected, actual];
  6749. return createRuntimeError("invalid_array_literal_column_full", context);
  6750. } else {
  6751. return ProcessorErrorFactory.invalid_array_literal_column(expected, actual);
  6752. }
  6753. },
  6754. invalid_array_literal_column: function invalid_array_literal_column(expected, actual) {
  6755. var context = [expected, actual];
  6756. return createRuntimeError("invalid_array_literal_column", context);
  6757. },
  6758. invalid_unary_op_full: function invalid_unary_op_full(expString, opName, type, dim, sourceInfo) {
  6759. if (sourceInfo) {
  6760. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  6761. return createRuntimeError("invalid_unary_op_full", context);
  6762. } else {
  6763. return ProcessorErrorFactory.invalid_unary_op(opName, type, dim);
  6764. }
  6765. },
  6766. invalid_unary_op: function invalid_unary_op(expString, opName, type, dim) {
  6767. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  6768. return createRuntimeError("invalid_unary_op", context);
  6769. },
  6770. invalid_infix_op_full: function invalid_infix_op_full(expString, opName, typeLeft, dimLeft, typeRight, dimRight, sourceInfo) {
  6771. if (sourceInfo) {
  6772. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  6773. return createRuntimeError("invalid_infix_op_full", context);
  6774. } else {
  6775. return ProcessorErrorFactory.invalid_infix_op(opName, typeLeft, dimLeft, typeRight, dimRight);
  6776. }
  6777. },
  6778. invalid_infix_op: function invalid_infix_op(expString, opName, typeLeft, dimLeft, typeRight, dimRight) {
  6779. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  6780. return createRuntimeError("invalid_infix_op", context);
  6781. },
  6782. array_dimension_not_positive_full: function array_dimension_not_positive_full(sourceInfo) {
  6783. if (sourceInfo) {
  6784. var context = [sourceInfo.line];
  6785. return createSemanticError("array_dimension_not_positive_full", context);
  6786. } else {
  6787. return ProcessorErrorFactory.array_dimension_not_positive();
  6788. }
  6789. },
  6790. array_dimension_not_positive: function array_dimension_not_positive() {
  6791. return createSemanticError("array_dimension_not_positive");
  6792. },
  6793. invalid_type_conversion: function invalid_type_conversion(value, type, dim) {
  6794. var context = [value, LocalizedStrings.translateType(type, dim)];
  6795. return createRuntimeError("invalid_type_conversion", context);
  6796. },
  6797. invalid_read_type: function invalid_read_type(exp, type, dim, name, source_info) {
  6798. var context = [source_info.line, exp, LocalizedStrings.translateType(type, dim), name];
  6799. return createRuntimeError("invalid_read_type", context);
  6800. },
  6801. invalid_read_type_array: function invalid_read_type_array(exp, typePos, dimPos, name, typeArray, dimArray, sourceInfo) {
  6802. var context = [sourceInfo.line, exp, LocalizedStrings.translateType(typePos, dimPos), name, LocalizedStrings.translateType(typeArray, dimArray)];
  6803. return createRuntimeError("invalid_read_type_array", context);
  6804. },
  6805. invalid_const_ref_full: function invalid_const_ref_full(fun_name, exp, sourceInfo) {
  6806. if (sourceInfo) {
  6807. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  6808. return createSemanticError("invalid_const_ref_full", context);
  6809. } else {
  6810. return ProcessorErrorFactory.invalid_const_ref(fun_name, exp);
  6811. }
  6812. },
  6813. invalid_const_ref: function invalid_const_ref(fun_name, exp) {
  6814. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  6815. return createSemanticError("invalid_const_ref", context);
  6816. },
  6817. invalid_const_assignment_full: function invalid_const_assignment_full(var_id, source_info) {
  6818. if (source_info) {
  6819. var context = [source_info.line, var_id];
  6820. return createSemanticError("invalid_const_assignment_full", context);
  6821. } else {
  6822. return ProcessorErrorFactory.invalid_const_assignment(var_id);
  6823. }
  6824. },
  6825. invalid_const_assignment: function invalid_const_assignment(var_id) {
  6826. var context = [var_id];
  6827. return createSemanticError("invalid_const_assignment", context);
  6828. },
  6829. invalid_vector_assignment_full: function invalid_vector_assignment_full(left_id, left_size, right_id, right_size, source_info) {
  6830. if (source_info) {
  6831. var context = [source_info.line, left_id, left_size, right_id, right_size];
  6832. return createRuntimeError("invalid_vector_assignment_full", context);
  6833. } else {
  6834. return ProcessorErrorFactory.invalid_vector_assignment(left_id, left_size, right_id, right_size);
  6835. }
  6836. },
  6837. invalid_vector_assignment: function invalid_vector_assignment(left_id, left_size, right_id, right_size) {
  6838. var context = [left_id, left_size, right_id, right_size];
  6839. return createRuntimeError("invalid_vector_assignment", context);
  6840. },
  6841. invalid_matrix_assignment_full: function invalid_matrix_assignment_full(left_id, left_line, left_column, right_id, right_line, right_column, source_info) {
  6842. if (source_info) {
  6843. var context = [source_info.line, left_id, left_line, left_column, right_id, right_line, right_column];
  6844. return createRuntimeError("invalid_matrix_assignment_full", context);
  6845. } else {
  6846. return ProcessorErrorFactory.invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column);
  6847. }
  6848. },
  6849. invalid_matrix_assignment: function invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column) {
  6850. var context = [left_id, left_line, left_column, right_id, right_line, right_column];
  6851. return createRuntimeError("invalid_matrix_assignment", context);
  6852. },
  6853. matrix_to_vector_attr: function matrix_to_vector_attr(left_id, right_id, source_info) {
  6854. // SourceInfo have to be valid...
  6855. var context = [source_info.line, right_id, left_id];
  6856. return createSemanticError("matrix_to_vector_attr", context);
  6857. },
  6858. vector_to_matrix_attr: function vector_to_matrix_attr(left_id, right_id, source_info) {
  6859. // SourceInfo have to be valid...
  6860. var context = [source_info.line, right_id, left_id];
  6861. return createSemanticError("vector_to_matrix_attr", context);
  6862. },
  6863. invalid_matrix_index_assign_full: function invalid_matrix_index_assign_full(mat_id, mat_line, mat_size, exp, exp_size, source_info) {
  6864. if (source_info) {
  6865. var context = [source_info.line, mat_line, mat_id, mat_size, exp, exp_size];
  6866. return createRuntimeError("invalid_matrix_index_assign_full", context);
  6867. } else {
  6868. return ProcessorErrorFactory.invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size);
  6869. }
  6870. },
  6871. invalid_matrix_index_assign: function invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size) {
  6872. var context = [mat_line, mat_id, mat_size, exp, exp_size];
  6873. return createRuntimeError("invalid_matrix_index_assign", context);
  6874. },
  6875. invalid_number_elements_vector: function invalid_number_elements_vector(expected_num, exp, actual_num, source_info) {
  6876. // SourceInfo have to be valid...
  6877. var context = [expected_num, source_info.line, exp, actual_num];
  6878. return createRuntimeError("invalid_number_elements_vector", context);
  6879. },
  6880. invalid_number_lines_matrix: function invalid_number_lines_matrix(expected_num, exp, actual_num, source_info) {
  6881. // SourceInfo have to be valid...
  6882. var context = [expected_num, source_info.line, exp, actual_num];
  6883. return createRuntimeError("invalid_number_lines_matrix", context);
  6884. },
  6885. divsion_by_zero_full: function divsion_by_zero_full(exp, source_info) {
  6886. if (source_info) {
  6887. var context = [source_info.line, exp];
  6888. return createRuntimeError("divsion_by_zero_full", context);
  6889. } else {
  6890. return ProcessorErrorFactory.divsion_by_zero(exp);
  6891. }
  6892. },
  6893. divsion_by_zero: function divsion_by_zero(exp) {
  6894. var context = [exp];
  6895. return createRuntimeError("divsion_by_zero", context);
  6896. },
  6897. undefined_tanget_value: function undefined_tanget_value(value, source_info) {
  6898. var context = [source_info.line, value];
  6899. return createRuntimeError("undefined_tanget_value", context);
  6900. },
  6901. negative_log_value: function negative_log_value(source_info) {
  6902. return createRuntimeError("negative_log_value", [source_info.line]);
  6903. },
  6904. invalid_string_index: function invalid_string_index(index, str, source_info) {
  6905. var local_fun_name = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName("$charAt");
  6906. var context = [source_info.line, local_fun_name, index, str, str.length - 1];
  6907. return createRuntimeError("invalid_string_index", context);
  6908. },
  6909. negative_sqrt_value: function negative_sqrt_value(source_info) {
  6910. return createRuntimeError("negative_sqrt_value", [source_info.line]);
  6911. },
  6912. /**
  6913. * @deprecated 01/10/2019
  6914. */
  6915. exceeded_recursive_calls: function exceeded_recursive_calls(source_info) {
  6916. var context = [source_info.line];
  6917. return createRuntimeError("exceeded_recursive_calls", context);
  6918. },
  6919. invalid_for_variable: function invalid_for_variable(id, source_info) {
  6920. var context = [source_info.line, id];
  6921. return createSemanticError("invalid_for_variable", context);
  6922. },
  6923. invalid_for_from: function invalid_for_from(exp, source_info) {
  6924. var context = [source_info.line, exp];
  6925. return createSemanticError("invalid_for_from", context);
  6926. },
  6927. invalid_for_to: function invalid_for_to(exp, source_info) {
  6928. var context = [source_info.line, exp];
  6929. return createSemanticError("invalid_for_to", context);
  6930. },
  6931. invalid_for_pass: function invalid_for_pass(exp, source_info) {
  6932. var context = [source_info.line, exp];
  6933. return createSemanticError("invalid_for_pass", context);
  6934. },
  6935. exceed_max_instructions: function exceed_max_instructions() {
  6936. return createRuntimeError('exceed_max_instructions');
  6937. }
  6938. });
  6939. /***/ }),
  6940. /***/ "./js/processor/error/runtimeError.js":
  6941. /*!********************************************!*\
  6942. !*** ./js/processor/error/runtimeError.js ***!
  6943. \********************************************/
  6944. /*! exports provided: RuntimeError */
  6945. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6946. "use strict";
  6947. __webpack_require__.r(__webpack_exports__);
  6948. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuntimeError", function() { return RuntimeError; });
  6949. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  6950. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  6951. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  6952. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
  6953. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  6954. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  6955. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  6956. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  6957. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  6958. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  6959. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  6960. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
  6961. 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); }; }
  6962. 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; } }
  6963. var RuntimeError = /*#__PURE__*/function (_Error) {
  6964. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RuntimeError, _Error);
  6965. var _super = _createSuper(RuntimeError);
  6966. function RuntimeError() {
  6967. var _this;
  6968. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RuntimeError);
  6969. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  6970. msg[_key] = arguments[_key];
  6971. }
  6972. _this = _super.call.apply(_super, [this].concat(msg));
  6973. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), RuntimeError);
  6974. return _this;
  6975. }
  6976. return RuntimeError;
  6977. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
  6978. /***/ }),
  6979. /***/ "./js/processor/error/semanticError.js":
  6980. /*!*********************************************!*\
  6981. !*** ./js/processor/error/semanticError.js ***!
  6982. \*********************************************/
  6983. /*! exports provided: SemanticError */
  6984. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6985. "use strict";
  6986. __webpack_require__.r(__webpack_exports__);
  6987. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticError", function() { return SemanticError; });
  6988. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  6989. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  6990. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  6991. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
  6992. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  6993. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  6994. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  6995. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  6996. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  6997. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  6998. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  6999. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
  7000. 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); }; }
  7001. 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; } }
  7002. var SemanticError = /*#__PURE__*/function (_Error) {
  7003. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(SemanticError, _Error);
  7004. var _super = _createSuper(SemanticError);
  7005. function SemanticError() {
  7006. var _this;
  7007. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticError);
  7008. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  7009. msg[_key] = arguments[_key];
  7010. }
  7011. _this = _super.call.apply(_super, [this].concat(msg));
  7012. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), SemanticError);
  7013. return _this;
  7014. }
  7015. return SemanticError;
  7016. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
  7017. /***/ }),
  7018. /***/ "./js/processor/ivprogProcessor.js":
  7019. /*!*****************************************!*\
  7020. !*** ./js/processor/ivprogProcessor.js ***!
  7021. \*****************************************/
  7022. /*! exports provided: IVProgProcessor */
  7023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7024. "use strict";
  7025. __webpack_require__.r(__webpack_exports__);
  7026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgProcessor", function() { return IVProgProcessor; });
  7027. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
  7028. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
  7029. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  7030. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  7031. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  7032. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  7033. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7034. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);
  7035. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  7036. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);
  7037. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./store/store */ "./js/processor/store/store.ts");
  7038. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_5__);
  7039. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modes */ "./js/processor/modes.ts");
  7040. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  7041. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./context */ "./js/processor/context.ts");
  7042. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_context__WEBPACK_IMPORTED_MODULE_7__);
  7043. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../typeSystem/types */ "./js/typeSystem/types.ts");
  7044. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__);
  7045. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  7046. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  7047. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./definedFunctions */ "./js/processor/definedFunctions.js");
  7048. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./compatibilityTable */ "./js/processor/compatibilityTable.ts");
  7049. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__);
  7050. /* harmony import */ var _ast_commands___WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../ast/commands/ */ "./js/ast/commands/index.js");
  7051. /* harmony import */ var _ast_commands_command__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../ast/commands/command */ "./js/ast/commands/command.js");
  7052. /* harmony import */ var _ast_expressions___WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../ast/expressions/ */ "./js/ast/expressions/index.js");
  7053. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  7054. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  7055. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  7056. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__);
  7057. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  7058. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  7059. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_19__);
  7060. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  7061. /* harmony import */ var _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./error/runtimeError */ "./js/processor/error/runtimeError.js");
  7062. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../memory/location */ "./js/memory/location.ts");
  7063. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_22__);
  7064. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./store/value/store_value */ "./js/processor/store/value/store_value.ts");
  7065. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_23__);
  7066. /* 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");
  7067. /* 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__);
  7068. /* 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");
  7069. /* 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__);
  7070. /* 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");
  7071. /* 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__);
  7072. /* 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");
  7073. /* 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__);
  7074. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  7075. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7076. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7077. var IVProgProcessor = /*#__PURE__*/function () {
  7078. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, null, [{
  7079. key: "MAIN_INTERNAL_ID",
  7080. get: function get() {
  7081. return "$main";
  7082. }
  7083. }]);
  7084. function IVProgProcessor(ast) {
  7085. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, IVProgProcessor);
  7086. this.ast = ast;
  7087. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7088. this.stores = [this.globalStore];
  7089. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7090. this.input = null;
  7091. this.forceKill = false;
  7092. this.output = null;
  7093. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7094. /**
  7095. * Stores the sourceInfo of every function call, command or expression
  7096. */
  7097. this.function_call_stack = [];
  7098. this.instruction_count = 0;
  7099. this.function_call_count = 0;
  7100. }
  7101. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, [{
  7102. key: "registerInput",
  7103. value: function registerInput(input) {
  7104. if (this.input !== null) this.input = null;
  7105. this.input = input;
  7106. }
  7107. }, {
  7108. key: "registerOutput",
  7109. value: function registerOutput(output) {
  7110. if (this.output !== null) this.output = null;
  7111. this.output = output;
  7112. }
  7113. }, {
  7114. key: "checkContext",
  7115. value: function checkContext(context) {
  7116. return this.context[this.context.length - 1] === context;
  7117. }
  7118. }, {
  7119. key: "ignoreSwitchCases",
  7120. value: function ignoreSwitchCases(store) {
  7121. if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN) {
  7122. return true;
  7123. } else if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  7124. return true;
  7125. } else {
  7126. return false;
  7127. }
  7128. }
  7129. }, {
  7130. key: "prepareState",
  7131. value: function prepareState() {
  7132. if (this.stores !== null) {
  7133. for (var i = 0; i < this.stores.length; i++) {
  7134. delete this.stores[i];
  7135. }
  7136. this.stores = null;
  7137. }
  7138. if (this.globalStore !== null) this.globalStore = null;
  7139. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7140. this.stores = [this.globalStore];
  7141. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7142. this.instruction_count = 0;
  7143. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7144. }
  7145. }, {
  7146. key: "interpretAST",
  7147. value: function () {
  7148. var _interpretAST = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee() {
  7149. var mainFunc;
  7150. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  7151. while (1) {
  7152. switch (_context.prev = _context.next) {
  7153. case 0:
  7154. this.prepareState();
  7155. _memory_location__WEBPACK_IMPORTED_MODULE_22__["Location"].clear();
  7156. _context.next = 4;
  7157. return this.initGlobal();
  7158. case 4:
  7159. mainFunc = this.findMainFunction();
  7160. if (!(mainFunc === null)) {
  7161. _context.next = 7;
  7162. break;
  7163. }
  7164. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].main_missing();
  7165. case 7:
  7166. return _context.abrupt("return", this.runFunction(mainFunc, [], this.globalStore));
  7167. case 8:
  7168. case "end":
  7169. return _context.stop();
  7170. }
  7171. }
  7172. }, _callee, this);
  7173. }));
  7174. function interpretAST() {
  7175. return _interpretAST.apply(this, arguments);
  7176. }
  7177. return interpretAST;
  7178. }()
  7179. }, {
  7180. key: "initGlobal",
  7181. value: function () {
  7182. var _initGlobal = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2() {
  7183. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  7184. while (1) {
  7185. switch (_context2.prev = _context2.next) {
  7186. case 0:
  7187. if (this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE)) {
  7188. _context2.next = 2;
  7189. break;
  7190. }
  7191. return _context2.abrupt("return", _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_global_var());
  7192. case 2:
  7193. return _context2.abrupt("return", this.executeCommands(this.globalStore, this.ast.global));
  7194. case 3:
  7195. case "end":
  7196. return _context2.stop();
  7197. }
  7198. }
  7199. }, _callee2, this);
  7200. }));
  7201. function initGlobal() {
  7202. return _initGlobal.apply(this, arguments);
  7203. }
  7204. return initGlobal;
  7205. }()
  7206. }, {
  7207. key: "findMainFunction",
  7208. value: function findMainFunction() {
  7209. return this.ast.functions.find(function (v) {
  7210. return v.isMain;
  7211. });
  7212. }
  7213. }, {
  7214. key: "findFunction",
  7215. value: function findFunction(name) {
  7216. if (name.match(/^\$.+$/)) {
  7217. if (name === IVProgProcessor.MAIN_INTERNAL_ID) {
  7218. return this.findMainFunction();
  7219. }
  7220. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getFunction(name);
  7221. if (!fun) {
  7222. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].not_implemented(name);
  7223. }
  7224. return fun;
  7225. } else {
  7226. var val = this.ast.functions.find(function (v) {
  7227. return v.name === name;
  7228. });
  7229. if (!val) {
  7230. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_missing(name);
  7231. }
  7232. return val;
  7233. }
  7234. }
  7235. }, {
  7236. key: "runFunction",
  7237. value: function () {
  7238. 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) {
  7239. var funcName, funcStore, stoWithVars, finalSto;
  7240. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  7241. while (1) {
  7242. switch (_context3.prev = _context3.next) {
  7243. case 0:
  7244. funcName = func.isMain ? IVProgProcessor.MAIN_INTERNAL_ID : func.name;
  7245. funcStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"](funcName);
  7246. funcStore.extendStore(this.globalStore);
  7247. _context3.next = 5;
  7248. return this.associateParameters(func.formalParameters, actualParameters, store, funcStore);
  7249. case 5:
  7250. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].FUNCTION);
  7251. this.stores.push(funcStore);
  7252. _context3.next = 9;
  7253. return this.executeCommands(funcStore, func.variablesDeclarations);
  7254. case 9:
  7255. stoWithVars = _context3.sent;
  7256. finalSto = this.executeCommands(stoWithVars, func.commands);
  7257. this.stores.pop();
  7258. this.context.pop();
  7259. return _context3.abrupt("return", finalSto);
  7260. case 14:
  7261. case "end":
  7262. return _context3.stop();
  7263. }
  7264. }
  7265. }, _callee3, this);
  7266. }));
  7267. function runFunction(_x, _x2, _x3) {
  7268. return _runFunction.apply(this, arguments);
  7269. }
  7270. return runFunction;
  7271. }()
  7272. /**
  7273. *
  7274. * @param {import('./../ast/commands/formalParameter').FormalParameter[]} formal_params
  7275. * @param {Expression[]} effective_params
  7276. * @param {Store} caller_store
  7277. * @param {Store} callee_store
  7278. */
  7279. }, {
  7280. key: "associateParameters",
  7281. value: function () {
  7282. 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) {
  7283. var funcName, hasVariadic, i, j, formalParameter, _yield$this$associate, _yield$this$associate2, actualParam;
  7284. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  7285. while (1) {
  7286. switch (_context4.prev = _context4.next) {
  7287. case 0:
  7288. funcName = callee_store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : callee_store.name;
  7289. hasVariadic = formal_params.some(function (p) {
  7290. return p.variadic;
  7291. });
  7292. if (!(formal_params.length != effective_params.length && !hasVariadic || formal_params.length > effective_params.length)) {
  7293. _context4.next = 4;
  7294. break;
  7295. }
  7296. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameters_size(funcName, formal_params.length, effective_params.length);
  7297. case 4:
  7298. i = 0, j = 0;
  7299. case 5:
  7300. if (!(i < formal_params.length && j < effective_params.length)) {
  7301. _context4.next = 23;
  7302. break;
  7303. }
  7304. formalParameter = formal_params[i];
  7305. if (!formalParameter.variadic) {
  7306. _context4.next = 16;
  7307. break;
  7308. }
  7309. _context4.next = 10;
  7310. return this.associateVariadicParameter(funcName, formalParameter, j, effective_params, caller_store, callee_store);
  7311. case 10:
  7312. _yield$this$associate = _context4.sent;
  7313. _yield$this$associate2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_yield$this$associate, 2);
  7314. j = _yield$this$associate2[0];
  7315. callee_store = _yield$this$associate2[1];
  7316. _context4.next = 20;
  7317. break;
  7318. case 16:
  7319. actualParam = effective_params[i];
  7320. _context4.next = 19;
  7321. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store);
  7322. case 19:
  7323. callee_store = _context4.sent;
  7324. case 20:
  7325. i += 1, j += 1;
  7326. _context4.next = 5;
  7327. break;
  7328. case 23:
  7329. return _context4.abrupt("return", callee_store);
  7330. case 24:
  7331. case "end":
  7332. return _context4.stop();
  7333. }
  7334. }
  7335. }, _callee4, this);
  7336. }));
  7337. function associateParameters(_x4, _x5, _x6, _x7) {
  7338. return _associateParameters.apply(this, arguments);
  7339. }
  7340. return associateParameters;
  7341. }()
  7342. /**
  7343. *
  7344. * @param {string} funcName
  7345. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7346. * @param {number} index
  7347. * @param {Expression[]} effective_params
  7348. * @param {Store} caller_store
  7349. * @param {Store} callee_store
  7350. */
  7351. }, {
  7352. key: "associateVariadicParameter",
  7353. value: function () {
  7354. 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) {
  7355. var i, count, actualParam, variadicCount;
  7356. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  7357. while (1) {
  7358. switch (_context5.prev = _context5.next) {
  7359. case 0:
  7360. count = 1;
  7361. i = index;
  7362. case 2:
  7363. if (!(i < effective_params.length)) {
  7364. _context5.next = 11;
  7365. break;
  7366. }
  7367. actualParam = effective_params[i];
  7368. _context5.next = 6;
  7369. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store, count);
  7370. case 6:
  7371. callee_store = _context5.sent;
  7372. count += 1;
  7373. case 8:
  7374. i += 1;
  7375. _context5.next = 2;
  7376. break;
  7377. case 11:
  7378. variadicCount = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER, count, undefined, true);
  7379. callee_store.insertStore("".concat(formalParameter.id, ".0"), variadicCount);
  7380. return _context5.abrupt("return", [i - 1, callee_store]);
  7381. case 14:
  7382. case "end":
  7383. return _context5.stop();
  7384. }
  7385. }
  7386. }, _callee5, this);
  7387. }));
  7388. function associateVariadicParameter(_x8, _x9, _x10, _x11, _x12, _x13) {
  7389. return _associateVariadicParameter.apply(this, arguments);
  7390. }
  7391. return associateVariadicParameter;
  7392. }()
  7393. /**
  7394. *
  7395. * @param {string} funcName
  7396. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7397. * @param {Expression} actualParameter
  7398. * @param {Store} callerStore
  7399. * @param {Store} calleeStore
  7400. * @param {number} variadicCount The number of the current value being assigned to the variadic parameter, default 0
  7401. */
  7402. }, {
  7403. key: "associateParameter",
  7404. value: function () {
  7405. 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) {
  7406. var variadicCount,
  7407. actualValue,
  7408. shouldTypeCast,
  7409. realObj,
  7410. ref,
  7411. values,
  7412. array_type,
  7413. addresses,
  7414. columns,
  7415. line,
  7416. column,
  7417. varID,
  7418. realValue,
  7419. _varID,
  7420. _args6 = arguments;
  7421. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  7422. while (1) {
  7423. switch (_context6.prev = _context6.next) {
  7424. case 0:
  7425. variadicCount = _args6.length > 5 && _args6[5] !== undefined ? _args6[5] : 0;
  7426. _context6.next = 3;
  7427. return this.evaluateExpression(callerStore, actualParameter);
  7428. case 3:
  7429. actualValue = _context6.sent;
  7430. shouldTypeCast = false;
  7431. if (formalParameter.type.isCompatible(actualValue.type)) {
  7432. _context6.next = 11;
  7433. break;
  7434. }
  7435. 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))) {
  7436. _context6.next = 10;
  7437. break;
  7438. }
  7439. shouldTypeCast = true;
  7440. _context6.next = 11;
  7441. break;
  7442. case 10:
  7443. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameter_type(funcName, actualParameter.toString());
  7444. case 11:
  7445. if (!(formalParameter.byRef && !actualValue.inStore())) {
  7446. _context6.next = 13;
  7447. break;
  7448. }
  7449. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_ref(funcName, actualParameter.toString());
  7450. case 13:
  7451. if (formalParameter.byRef) {
  7452. realObj = callerStore.getStoreObject(actualValue.id);
  7453. ref = null;
  7454. if (actualValue instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"]) {
  7455. // it's a vector or matrix...
  7456. values = actualValue.get();
  7457. array_type = actualValue.type;
  7458. addresses = values.map(function (v) {
  7459. return realObj.getLocAddressOf(v.line, v.column);
  7460. });
  7461. columns = actualValue.isVector() ? 0 : actualValue.columns;
  7462. ref = new _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__["ArrayStoreValueRef"](array_type, values, addresses, actualValue.lines, columns, realObj.id);
  7463. } else {
  7464. if (actualValue instanceof _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"]) {
  7465. line = actualValue.line;
  7466. column = actualValue.column;
  7467. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.getLocAddressOf(line, column), realObj.id);
  7468. ref.setReferenceDimension(realObj.type.dimensions);
  7469. } else {
  7470. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.locAddress, realObj.id);
  7471. }
  7472. }
  7473. varID = formalParameter.id;
  7474. if (formalParameter.variadic) varID = "".concat(varID, ".").concat(variadicCount);
  7475. calleeStore.insertStore(varID, ref);
  7476. } else {
  7477. realValue = actualValue;
  7478. if (shouldTypeCast) {
  7479. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(formalParameter.type, realValue);
  7480. }
  7481. _varID = formalParameter.id;
  7482. if (formalParameter.variadic) _varID = "".concat(_varID, ".").concat(variadicCount);
  7483. calleeStore.insertStore(_varID, realValue);
  7484. }
  7485. return _context6.abrupt("return", calleeStore);
  7486. case 15:
  7487. case "end":
  7488. return _context6.stop();
  7489. }
  7490. }
  7491. }, _callee6, this);
  7492. }));
  7493. function associateParameter(_x14, _x15, _x16, _x17, _x18) {
  7494. return _associateParameter.apply(this, arguments);
  7495. }
  7496. return associateParameter;
  7497. }()
  7498. /**
  7499. *
  7500. * @param {Store} store
  7501. * @param {Command[]} cmds
  7502. *
  7503. * @returns {Promise<Store>}
  7504. */
  7505. }, {
  7506. key: "executeCommands",
  7507. value: function () {
  7508. 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) {
  7509. var sto, i;
  7510. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  7511. while (1) {
  7512. switch (_context7.prev = _context7.next) {
  7513. case 0:
  7514. // helper to partially apply a function, in this case executeCommand
  7515. sto = store;
  7516. i = 0;
  7517. case 2:
  7518. if (!(i < cmds.length)) {
  7519. _context7.next = 9;
  7520. break;
  7521. }
  7522. _context7.next = 5;
  7523. return this.executeCommand(sto, cmds[i]);
  7524. case 5:
  7525. sto = _context7.sent;
  7526. case 6:
  7527. i += 1;
  7528. _context7.next = 2;
  7529. break;
  7530. case 9:
  7531. return _context7.abrupt("return", sto);
  7532. case 10:
  7533. case "end":
  7534. return _context7.stop();
  7535. }
  7536. }
  7537. }, _callee7, this);
  7538. }));
  7539. function executeCommands(_x19, _x20) {
  7540. return _executeCommands.apply(this, arguments);
  7541. }
  7542. return executeCommands;
  7543. }()
  7544. /**
  7545. *
  7546. * @param {Store} store
  7547. * @param {Command} cmd
  7548. *
  7549. * @returns {Promise<Store>}
  7550. */
  7551. }, {
  7552. key: "executeCommand",
  7553. value: function () {
  7554. 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) {
  7555. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  7556. while (1) {
  7557. switch (_context8.prev = _context8.next) {
  7558. case 0:
  7559. this.instruction_count += 1;
  7560. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  7561. _context8.next = 4;
  7562. break;
  7563. }
  7564. _context8.next = 4;
  7565. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
  7566. case 4:
  7567. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  7568. _context8.next = 8;
  7569. break;
  7570. }
  7571. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceed_max_instructions();
  7572. case 8:
  7573. if (!this.forceKill) {
  7574. _context8.next = 12;
  7575. break;
  7576. }
  7577. throw "FORCED_KILL!";
  7578. case 12:
  7579. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].PAUSE)) {
  7580. _context8.next = 16;
  7581. break;
  7582. }
  7583. return _context8.abrupt("return", this.executeCommand(store, cmd));
  7584. case 16:
  7585. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  7586. _context8.next = 20;
  7587. break;
  7588. }
  7589. return _context8.abrupt("return", store);
  7590. case 20:
  7591. if (!(this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE) && store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  7592. _context8.next = 24;
  7593. break;
  7594. }
  7595. return _context8.abrupt("return", store);
  7596. case 24:
  7597. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  7598. _context8.next = 26;
  7599. break;
  7600. }
  7601. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  7602. case 26:
  7603. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Declaration"])) {
  7604. _context8.next = 30;
  7605. break;
  7606. }
  7607. return _context8.abrupt("return", this.executeDeclaration(store, cmd));
  7608. case 30:
  7609. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayIndexAssign"])) {
  7610. _context8.next = 34;
  7611. break;
  7612. }
  7613. return _context8.abrupt("return", this.executeArrayIndexAssign(store, cmd));
  7614. case 34:
  7615. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"])) {
  7616. _context8.next = 38;
  7617. break;
  7618. }
  7619. return _context8.abrupt("return", this.executeAssign(store, cmd));
  7620. case 38:
  7621. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Break"])) {
  7622. _context8.next = 42;
  7623. break;
  7624. }
  7625. return _context8.abrupt("return", this.executeBreak(store, cmd));
  7626. case 42:
  7627. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Return"])) {
  7628. _context8.next = 46;
  7629. break;
  7630. }
  7631. return _context8.abrupt("return", this.executeReturn(store, cmd));
  7632. case 46:
  7633. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  7634. _context8.next = 50;
  7635. break;
  7636. }
  7637. return _context8.abrupt("return", this.executeIfThenElse(store, cmd));
  7638. case 50:
  7639. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["RepeatUntil"])) {
  7640. _context8.next = 54;
  7641. break;
  7642. }
  7643. return _context8.abrupt("return", this.executeRepeatUntil(store, cmd));
  7644. case 54:
  7645. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"])) {
  7646. _context8.next = 58;
  7647. break;
  7648. }
  7649. return _context8.abrupt("return", this.executeWhile(store, cmd));
  7650. case 58:
  7651. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["For"])) {
  7652. _context8.next = 62;
  7653. break;
  7654. }
  7655. return _context8.abrupt("return", this.executeFor(store, cmd));
  7656. case 62:
  7657. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Switch"])) {
  7658. _context8.next = 66;
  7659. break;
  7660. }
  7661. return _context8.abrupt("return", this.executeSwitch(store, cmd));
  7662. case 66:
  7663. if (!(cmd instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  7664. _context8.next = 70;
  7665. break;
  7666. }
  7667. return _context8.abrupt("return", this.executeFunctionCall(store, cmd));
  7668. case 70:
  7669. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["SysCall"])) {
  7670. _context8.next = 74;
  7671. break;
  7672. }
  7673. return _context8.abrupt("return", this.executeSysCall(store, cmd));
  7674. case 74:
  7675. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unknown_command(cmd.sourceInfo);
  7676. case 75:
  7677. case "end":
  7678. return _context8.stop();
  7679. }
  7680. }
  7681. }, _callee8, this);
  7682. }));
  7683. function executeCommand(_x21, _x22) {
  7684. return _executeCommand.apply(this, arguments);
  7685. }
  7686. return executeCommand;
  7687. }()
  7688. /**
  7689. *
  7690. * @param {Store} store
  7691. * @param {Commands.SysCall} cmd
  7692. *
  7693. * @returns {Promise<Store>}
  7694. */
  7695. }, {
  7696. key: "executeSysCall",
  7697. value: function () {
  7698. 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) {
  7699. var func;
  7700. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  7701. while (1) {
  7702. switch (_context9.prev = _context9.next) {
  7703. case 0:
  7704. func = cmd.langFunc.bind(this);
  7705. return _context9.abrupt("return", func(store, cmd));
  7706. case 2:
  7707. case "end":
  7708. return _context9.stop();
  7709. }
  7710. }
  7711. }, _callee9, this);
  7712. }));
  7713. function executeSysCall(_x23, _x24) {
  7714. return _executeSysCall.apply(this, arguments);
  7715. }
  7716. return executeSysCall;
  7717. }()
  7718. /**
  7719. *
  7720. * @param {Store} store
  7721. * @param {Commands.FunctionCall} cmd
  7722. *
  7723. * @returns {Promise<Store>}
  7724. */
  7725. }, {
  7726. key: "executeFunctionCall",
  7727. value: function () {
  7728. 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) {
  7729. var func, sto, funcName;
  7730. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  7731. while (1) {
  7732. switch (_context10.prev = _context10.next) {
  7733. case 0:
  7734. func = null;
  7735. if (cmd.isMainCall) {
  7736. func = this.findMainFunction();
  7737. } else {
  7738. func = this.findFunction(cmd.id);
  7739. }
  7740. this.function_call_stack.push(cmd.sourceInfo);
  7741. _context10.next = 5;
  7742. return this.runFunction(func, cmd.actualParameters, store);
  7743. case 5:
  7744. sto = _context10.sent;
  7745. sto.destroy();
  7746. if (!(!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType) && sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  7747. _context10.next = 12;
  7748. break;
  7749. }
  7750. funcName = func.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : func.name;
  7751. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_no_return(funcName);
  7752. case 12:
  7753. this.function_call_stack.pop();
  7754. return _context10.abrupt("return", store);
  7755. case 14:
  7756. case "end":
  7757. return _context10.stop();
  7758. }
  7759. }
  7760. }, _callee10, this);
  7761. }));
  7762. function executeFunctionCall(_x25, _x26) {
  7763. return _executeFunctionCall.apply(this, arguments);
  7764. }
  7765. return executeFunctionCall;
  7766. }()
  7767. /**
  7768. *
  7769. * @param {Store} store
  7770. * @param {Commands.Switch} cmd
  7771. *
  7772. * @returns {Promise<Store>}
  7773. */
  7774. }, {
  7775. key: "executeSwitch",
  7776. value: function () {
  7777. 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) {
  7778. var switchCases, lastStore, lastCaseCheckResult, i, switchCase, equalityInfixApp, result;
  7779. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  7780. while (1) {
  7781. switch (_context11.prev = _context11.next) {
  7782. case 0:
  7783. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  7784. switchCases = cmd.cases;
  7785. lastStore = store;
  7786. lastCaseCheckResult = false;
  7787. i = 0;
  7788. case 5:
  7789. if (!(i < switchCases.length && !this.ignoreSwitchCases(lastStore))) {
  7790. _context11.next = 26;
  7791. break;
  7792. }
  7793. switchCase = switchCases[i];
  7794. if (!(lastCaseCheckResult || switchCase.isDefault)) {
  7795. _context11.next = 13;
  7796. break;
  7797. }
  7798. _context11.next = 10;
  7799. return this.executeCommands(lastStore, switchCase.commands);
  7800. case 10:
  7801. lastStore = _context11.sent;
  7802. _context11.next = 23;
  7803. break;
  7804. case 13:
  7805. equalityInfixApp = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].EQ, cmd.expression, switchCase.expression);
  7806. equalityInfixApp.sourceInfo = switchCase.sourceInfo;
  7807. _context11.next = 17;
  7808. return this.evaluateExpression(lastStore, equalityInfixApp);
  7809. case 17:
  7810. result = _context11.sent;
  7811. if (!result.get()) {
  7812. _context11.next = 22;
  7813. break;
  7814. }
  7815. _context11.next = 21;
  7816. return this.executeCommands(lastStore, switchCase.commands);
  7817. case 21:
  7818. lastStore = _context11.sent;
  7819. case 22:
  7820. lastCaseCheckResult = result.get();
  7821. case 23:
  7822. i += 1;
  7823. _context11.next = 5;
  7824. break;
  7825. case 26:
  7826. this.context.pop();
  7827. if (lastStore.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  7828. lastStore.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7829. }
  7830. return _context11.abrupt("return", lastStore);
  7831. case 29:
  7832. case "end":
  7833. return _context11.stop();
  7834. }
  7835. }
  7836. }, _callee11, this);
  7837. }));
  7838. function executeSwitch(_x27, _x28) {
  7839. return _executeSwitch.apply(this, arguments);
  7840. }
  7841. return executeSwitch;
  7842. }()
  7843. /**
  7844. *
  7845. * @param {Store} store
  7846. * @param {Commands.For} cmd
  7847. *
  7848. * @returns {Promise<Store>}
  7849. */
  7850. }, {
  7851. key: "executeFor",
  7852. value: function () {
  7853. 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) {
  7854. var initCmd, passValue, condition, checkEndGTBegin, isForward, increment, whileBlock, forAsWhile, newCmdList;
  7855. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  7856. while (1) {
  7857. switch (_context12.prev = _context12.next) {
  7858. case 0:
  7859. //BEGIN for -> while rewrite
  7860. initCmd = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"](cmd.for_id.id, cmd.for_from);
  7861. initCmd.sourceInfo = cmd.sourceInfo; // Assume for is iterating forward and that pass is not missing
  7862. passValue = cmd.for_pass;
  7863. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LT, cmd.for_id, cmd.for_to);
  7864. if (!(cmd.for_pass == null)) {
  7865. _context12.next = 12;
  7866. break;
  7867. }
  7868. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(1));
  7869. _context12.next = 8;
  7870. 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));
  7871. case 8:
  7872. checkEndGTBegin = _context12.sent;
  7873. if (!checkEndGTBegin.get()) {
  7874. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(-1));
  7875. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  7876. }
  7877. _context12.next = 16;
  7878. break;
  7879. case 12:
  7880. _context12.next = 14;
  7881. 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))));
  7882. case 14:
  7883. isForward = _context12.sent;
  7884. if (!isForward.get()) {
  7885. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  7886. }
  7887. case 16:
  7888. condition.sourceInfo = cmd.sourceInfo;
  7889. 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));
  7890. increment.sourceInfo = cmd.sourceInfo;
  7891. whileBlock = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["CommandBlock"]([], cmd.commands.concat(increment));
  7892. forAsWhile = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"](condition, whileBlock);
  7893. forAsWhile.sourceInfo = cmd.sourceInfo; //END for -> while rewrite
  7894. newCmdList = [initCmd, forAsWhile];
  7895. return _context12.abrupt("return", this.executeCommands(store, newCmdList));
  7896. case 24:
  7897. case "end":
  7898. return _context12.stop();
  7899. }
  7900. }
  7901. }, _callee12, this);
  7902. }));
  7903. function executeFor(_x29, _x30) {
  7904. return _executeFor.apply(this, arguments);
  7905. }
  7906. return executeFor;
  7907. }()
  7908. /**
  7909. *
  7910. * @param {Store} store
  7911. * @param {Commands.RepeatUntil} cmd
  7912. *
  7913. * @returns {Promise<Store>}
  7914. */
  7915. }, {
  7916. key: "executeRepeatUntil",
  7917. value: function () {
  7918. 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) {
  7919. var sto, checkCondition;
  7920. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  7921. while (1) {
  7922. switch (_context13.prev = _context13.next) {
  7923. case 0:
  7924. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  7925. _context13.next = 3;
  7926. return this.executeCommands(store, cmd.commands);
  7927. case 3:
  7928. sto = _context13.sent;
  7929. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  7930. _context13.next = 8;
  7931. break;
  7932. }
  7933. this.context.pop();
  7934. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7935. return _context13.abrupt("return", sto);
  7936. case 8:
  7937. _context13.next = 10;
  7938. return this.evaluateExpression(sto, cmd.expression);
  7939. case 10:
  7940. checkCondition = _context13.sent;
  7941. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  7942. _context13.next = 13;
  7943. break;
  7944. }
  7945. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.sourceInfo);
  7946. case 13:
  7947. this.context.pop();
  7948. if (!checkCondition.get()) {
  7949. _context13.next = 18;
  7950. break;
  7951. }
  7952. return _context13.abrupt("return", sto);
  7953. case 18:
  7954. return _context13.abrupt("return", this.executeCommand(sto, cmd));
  7955. case 19:
  7956. case "end":
  7957. return _context13.stop();
  7958. }
  7959. }
  7960. }, _callee13, this);
  7961. }));
  7962. function executeRepeatUntil(_x31, _x32) {
  7963. return _executeRepeatUntil.apply(this, arguments);
  7964. }
  7965. return executeRepeatUntil;
  7966. }()
  7967. /**
  7968. *
  7969. * @param {Store} store
  7970. * @param {Commands.While} cmd
  7971. *
  7972. * @returns {Promise<Store>}
  7973. */
  7974. }, {
  7975. key: "executeWhile",
  7976. value: function () {
  7977. 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) {
  7978. var checkCondition, sto;
  7979. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee14$(_context14) {
  7980. while (1) {
  7981. switch (_context14.prev = _context14.next) {
  7982. case 0:
  7983. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  7984. _context14.next = 3;
  7985. return this.evaluateExpression(store, cmd.expression);
  7986. case 3:
  7987. checkCondition = _context14.sent;
  7988. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  7989. _context14.next = 6;
  7990. break;
  7991. }
  7992. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  7993. case 6:
  7994. if (!checkCondition.get()) {
  7995. _context14.next = 17;
  7996. break;
  7997. }
  7998. _context14.next = 9;
  7999. return this.executeCommands(store, cmd.commands);
  8000. case 9:
  8001. sto = _context14.sent;
  8002. this.context.pop();
  8003. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8004. _context14.next = 14;
  8005. break;
  8006. }
  8007. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8008. return _context14.abrupt("return", sto);
  8009. case 14:
  8010. return _context14.abrupt("return", this.executeCommand(sto, cmd));
  8011. case 17:
  8012. this.context.pop();
  8013. return _context14.abrupt("return", store);
  8014. case 19:
  8015. case "end":
  8016. return _context14.stop();
  8017. }
  8018. }
  8019. }, _callee14, this);
  8020. }));
  8021. function executeWhile(_x33, _x34) {
  8022. return _executeWhile.apply(this, arguments);
  8023. }
  8024. return executeWhile;
  8025. }()
  8026. /**
  8027. *
  8028. * @param {Store} store
  8029. * @param {Commands.IfThenElse} cmd
  8030. *
  8031. * @returns {Promise<Store>}
  8032. */
  8033. }, {
  8034. key: "executeIfThenElse",
  8035. value: function () {
  8036. 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) {
  8037. var isTrue;
  8038. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee15$(_context15) {
  8039. while (1) {
  8040. switch (_context15.prev = _context15.next) {
  8041. case 0:
  8042. _context15.next = 2;
  8043. return this.evaluateExpression(store, cmd.condition);
  8044. case 2:
  8045. isTrue = _context15.sent;
  8046. if (isTrue.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8047. _context15.next = 5;
  8048. break;
  8049. }
  8050. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  8051. case 5:
  8052. if (!isTrue.get()) {
  8053. _context15.next = 9;
  8054. break;
  8055. }
  8056. return _context15.abrupt("return", this.executeCommands(store, cmd.ifTrue.commands));
  8057. case 9:
  8058. if (!(cmd.ifFalse !== null)) {
  8059. _context15.next = 17;
  8060. break;
  8061. }
  8062. if (!(cmd.ifFalse instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  8063. _context15.next = 14;
  8064. break;
  8065. }
  8066. return _context15.abrupt("return", this.executeCommand(store, cmd.ifFalse));
  8067. case 14:
  8068. return _context15.abrupt("return", this.executeCommands(store, cmd.ifFalse.commands));
  8069. case 15:
  8070. _context15.next = 18;
  8071. break;
  8072. case 17:
  8073. return _context15.abrupt("return", store);
  8074. case 18:
  8075. case "end":
  8076. return _context15.stop();
  8077. }
  8078. }
  8079. }, _callee15, this);
  8080. }));
  8081. function executeIfThenElse(_x35, _x36) {
  8082. return _executeIfThenElse.apply(this, arguments);
  8083. }
  8084. return executeIfThenElse;
  8085. }()
  8086. /**
  8087. *
  8088. * @param {Store} store
  8089. * @param {Commands.Return} cmd
  8090. *
  8091. * @returns {Promise<Store>}
  8092. */
  8093. }, {
  8094. key: "executeReturn",
  8095. value: function () {
  8096. 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) {
  8097. var funcName, func, funcType, value, real_value, stringInfo, info;
  8098. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee16$(_context16) {
  8099. while (1) {
  8100. switch (_context16.prev = _context16.next) {
  8101. case 0:
  8102. 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);
  8103. func = this.findFunction(store.name);
  8104. funcType = func.returnType;
  8105. _context16.next = 5;
  8106. return this.evaluateExpression(store, cmd.expression);
  8107. case 5:
  8108. value = _context16.sent;
  8109. if (!(value === null && funcType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID))) {
  8110. _context16.next = 9;
  8111. break;
  8112. }
  8113. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8114. return _context16.abrupt("return", store);
  8115. case 9:
  8116. real_value = value;
  8117. if (!(value === null || !funcType.isCompatible(value.type))) {
  8118. _context16.next = 16;
  8119. break;
  8120. }
  8121. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(funcType, value.type))) {
  8122. _context16.next = 15;
  8123. break;
  8124. }
  8125. stringInfo = funcType.stringInfo();
  8126. info = stringInfo[0];
  8127. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_return_type_full(funcName, info.type, info.dim, cmd.sourceInfo);
  8128. case 15:
  8129. real_value = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(funcType, value);
  8130. case 16:
  8131. store.insertStore("$", real_value);
  8132. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8133. return _context16.abrupt("return", store);
  8134. case 19:
  8135. case "end":
  8136. return _context16.stop();
  8137. }
  8138. }
  8139. }, _callee16, this);
  8140. }));
  8141. function executeReturn(_x37, _x38) {
  8142. return _executeReturn.apply(this, arguments);
  8143. }
  8144. return executeReturn;
  8145. }()
  8146. /**
  8147. *
  8148. * @param {Store} store
  8149. * @param {Commands.Break} cmd
  8150. *
  8151. * @returns {Promise<Store>}
  8152. */
  8153. }, {
  8154. key: "executeBreak",
  8155. value: function () {
  8156. 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) {
  8157. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee17$(_context17) {
  8158. while (1) {
  8159. switch (_context17.prev = _context17.next) {
  8160. case 0:
  8161. if (!this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE)) {
  8162. _context17.next = 5;
  8163. break;
  8164. }
  8165. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK;
  8166. return _context17.abrupt("return", store);
  8167. case 5:
  8168. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unexpected_break_command_full(cmd.sourceInfo);
  8169. case 6:
  8170. case "end":
  8171. return _context17.stop();
  8172. }
  8173. }
  8174. }, _callee17, this);
  8175. }));
  8176. function executeBreak(_x39, _x40) {
  8177. return _executeBreak.apply(this, arguments);
  8178. }
  8179. return executeBreak;
  8180. }()
  8181. /**
  8182. *
  8183. * @param {Store} store
  8184. * @param {Commands.Assign} cmd
  8185. *
  8186. * @returns {Promise<Store>}
  8187. */
  8188. }, {
  8189. key: "executeAssign",
  8190. value: function () {
  8191. 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) {
  8192. var inStore, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp, columns, _exp;
  8193. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee18$(_context18) {
  8194. while (1) {
  8195. switch (_context18.prev = _context18.next) {
  8196. case 0:
  8197. inStore = store.applyStore(cmd.id);
  8198. if (!inStore.isConst) {
  8199. _context18.next = 3;
  8200. break;
  8201. }
  8202. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8203. case 3:
  8204. _context18.next = 5;
  8205. return this.evaluateExpression(store, cmd.expression);
  8206. case 5:
  8207. value = _context18.sent;
  8208. realValue = value;
  8209. if (inStore.type.isCompatible(realValue.type)) {
  8210. _context18.next = 18;
  8211. break;
  8212. }
  8213. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(inStore.type, value.type))) {
  8214. _context18.next = 12;
  8215. break;
  8216. }
  8217. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(inStore.type, realValue);
  8218. _context18.next = 18;
  8219. break;
  8220. case 12:
  8221. stringInfo = inStore.type.stringInfo();
  8222. info = stringInfo[0];
  8223. exp_type_string_info = value.type.stringInfo();
  8224. exp_type_info = exp_type_string_info[0];
  8225. exp = cmd.expression.toString();
  8226. 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);
  8227. case 18:
  8228. if (!(inStore instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8229. _context18.next = 27;
  8230. break;
  8231. }
  8232. columns = realValue.columns == null ? 0 : realValue.columns;
  8233. if (!(inStore.lines !== realValue.lines || inStore.columns !== columns)) {
  8234. _context18.next = 27;
  8235. break;
  8236. }
  8237. _exp = cmd.expression.toString();
  8238. if (!inStore.isVector()) {
  8239. _context18.next = 26;
  8240. break;
  8241. }
  8242. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_vector_assignment_full(cmd.id, inStore.lines, _exp, realValue.lines, cmd.sourceInfo);
  8243. case 26:
  8244. 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);
  8245. case 27:
  8246. store.updateStore(cmd.id, realValue);
  8247. return _context18.abrupt("return", store);
  8248. case 29:
  8249. case "end":
  8250. return _context18.stop();
  8251. }
  8252. }
  8253. }, _callee18, this);
  8254. }));
  8255. function executeAssign(_x41, _x42) {
  8256. return _executeAssign.apply(this, arguments);
  8257. }
  8258. return executeAssign;
  8259. }()
  8260. /**
  8261. *
  8262. * @param {Store} store
  8263. * @param {Commands.ArrayIndexAssign} cmd
  8264. *
  8265. * @returns {Promise<Store>}
  8266. */
  8267. }, {
  8268. key: "executeArrayIndexAssign",
  8269. value: function () {
  8270. 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) {
  8271. var mustBeArray, used_dims, lineSV, line, columnSV, column, value, actualValue, type, stringInfo, info, exp_type_string_info, exp_type_info, exp, current_value, _exp2;
  8272. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee19$(_context19) {
  8273. while (1) {
  8274. switch (_context19.prev = _context19.next) {
  8275. case 0:
  8276. mustBeArray = store.applyStore(cmd.id);
  8277. used_dims = 0;
  8278. if (!mustBeArray.isConst) {
  8279. _context19.next = 4;
  8280. break;
  8281. }
  8282. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8283. case 4:
  8284. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  8285. _context19.next = 6;
  8286. break;
  8287. }
  8288. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  8289. case 6:
  8290. _context19.next = 8;
  8291. return this.evaluateExpression(store, cmd.line);
  8292. case 8:
  8293. lineSV = _context19.sent;
  8294. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  8295. _context19.next = 11;
  8296. break;
  8297. }
  8298. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8299. case 11:
  8300. used_dims += 1;
  8301. line = lineSV.get().toNumber();
  8302. _context19.next = 15;
  8303. return this.evaluateExpression(store, cmd.column);
  8304. case 15:
  8305. columnSV = _context19.sent;
  8306. column = null;
  8307. if (!(columnSV != null)) {
  8308. _context19.next = 22;
  8309. break;
  8310. }
  8311. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  8312. _context19.next = 20;
  8313. break;
  8314. }
  8315. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8316. case 20:
  8317. column = columnSV.get().toNumber();
  8318. used_dims += 1;
  8319. case 22:
  8320. _context19.next = 24;
  8321. return this.evaluateExpression(store, cmd.expression);
  8322. case 24:
  8323. value = _context19.sent;
  8324. actualValue = value;
  8325. if (!(line >= mustBeArray.lines)) {
  8326. _context19.next = 34;
  8327. break;
  8328. }
  8329. if (!mustBeArray.isVector) {
  8330. _context19.next = 31;
  8331. break;
  8332. }
  8333. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8334. case 31:
  8335. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8336. case 32:
  8337. _context19.next = 36;
  8338. break;
  8339. case 34:
  8340. if (!(line < 0)) {
  8341. _context19.next = 36;
  8342. break;
  8343. }
  8344. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8345. case 36:
  8346. if (!(column != null && mustBeArray.columns === 0)) {
  8347. _context19.next = 38;
  8348. break;
  8349. }
  8350. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(cmd.id, cmd.sourceInfo);
  8351. case 38:
  8352. if (!(column != null)) {
  8353. _context19.next = 45;
  8354. break;
  8355. }
  8356. if (!(column >= mustBeArray.columns)) {
  8357. _context19.next = 43;
  8358. break;
  8359. }
  8360. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(cmd.id, column, mustBeArray.columns, cmd.sourceInfo);
  8361. case 43:
  8362. if (!(column < 0)) {
  8363. _context19.next = 45;
  8364. break;
  8365. }
  8366. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8367. case 45:
  8368. if (mustBeArray.type.canAccept(value.type, used_dims)) {
  8369. _context19.next = 55;
  8370. break;
  8371. }
  8372. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(mustBeArray.type.innerType, value.type))) {
  8373. _context19.next = 54;
  8374. break;
  8375. }
  8376. type = mustBeArray.type.innerType;
  8377. stringInfo = type.stringInfo();
  8378. info = stringInfo[0];
  8379. exp_type_string_info = value.type.stringInfo();
  8380. exp_type_info = exp_type_string_info[0];
  8381. exp = cmd.expression.toString();
  8382. 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);
  8383. case 54:
  8384. actualValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(mustBeArray.type.innerType, value);
  8385. case 55:
  8386. current_value = mustBeArray.getAt(line, column);
  8387. if (!(current_value instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8388. _context19.next = 60;
  8389. break;
  8390. }
  8391. if (!(current_value.lines !== actualValue.lines || current_value.columns !== actualValue.columns)) {
  8392. _context19.next = 60;
  8393. break;
  8394. }
  8395. _exp2 = cmd.expression.toString();
  8396. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_matrix_index_assign_full(cmd.id, line, current_value.lines, _exp2, actualValue.lines, cmd.sourceInfo);
  8397. case 60:
  8398. return _context19.abrupt("return", store.updateStoreArray(cmd.id, actualValue, line, column));
  8399. case 61:
  8400. case "end":
  8401. return _context19.stop();
  8402. }
  8403. }
  8404. }, _callee19, this);
  8405. }));
  8406. function executeArrayIndexAssign(_x43, _x44) {
  8407. return _executeArrayIndexAssign.apply(this, arguments);
  8408. }
  8409. return executeArrayIndexAssign;
  8410. }()
  8411. /**
  8412. *
  8413. * @param {Store} store
  8414. * @param {Commands.Declaration} cmd
  8415. *
  8416. * @returns {Promise<Store>}
  8417. */
  8418. }, {
  8419. key: "executeDeclaration",
  8420. value: function () {
  8421. 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) {
  8422. var temp, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp;
  8423. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee20$(_context20) {
  8424. while (1) {
  8425. switch (_context20.prev = _context20.next) {
  8426. case 0:
  8427. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayDeclaration"])) {
  8428. _context20.next = 4;
  8429. break;
  8430. }
  8431. return _context20.abrupt("return", this.executeArrayDeclaration(store, cmd));
  8432. case 4:
  8433. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, null, null, cmd.isConst);
  8434. if (!(cmd.initial !== null)) {
  8435. _context20.next = 22;
  8436. break;
  8437. }
  8438. _context20.next = 8;
  8439. return this.evaluateExpression(store, cmd.initial);
  8440. case 8:
  8441. value = _context20.sent;
  8442. realValue = value;
  8443. if (value.type.isCompatible(cmd.type)) {
  8444. _context20.next = 21;
  8445. break;
  8446. }
  8447. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(cmd.type, value.type))) {
  8448. _context20.next = 15;
  8449. break;
  8450. }
  8451. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(cmd.type, realValue);
  8452. _context20.next = 21;
  8453. break;
  8454. case 15:
  8455. stringInfo = value.type.stringInfo();
  8456. info = stringInfo[0];
  8457. exp_type_string_info = value.type.stringInfo();
  8458. exp_type_info = exp_type_string_info[0];
  8459. exp = cmd.expression.toString();
  8460. 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);
  8461. case 21:
  8462. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, realValue.get(), null, cmd.isConst);
  8463. case 22:
  8464. store.insertStore(cmd.id, temp);
  8465. return _context20.abrupt("return", store);
  8466. case 24:
  8467. case "end":
  8468. return _context20.stop();
  8469. }
  8470. }
  8471. }, _callee20, this);
  8472. }));
  8473. function executeDeclaration(_x45, _x46) {
  8474. return _executeDeclaration.apply(this, arguments);
  8475. }
  8476. return executeDeclaration;
  8477. }()
  8478. /**
  8479. *
  8480. * @param {Store} store
  8481. * @param {Commands.ArrayDeclaration} cmd
  8482. *
  8483. * @returns {Promise<Store>}
  8484. */
  8485. }, {
  8486. key: "executeArrayDeclaration",
  8487. value: function () {
  8488. 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) {
  8489. var linesSV, line, columnsSV, column, temp, valueList;
  8490. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee21$(_context21) {
  8491. while (1) {
  8492. switch (_context21.prev = _context21.next) {
  8493. case 0:
  8494. _context21.next = 2;
  8495. return this.evaluateExpression(store, cmd.lines);
  8496. case 2:
  8497. linesSV = _context21.sent;
  8498. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(linesSV.type)) {
  8499. _context21.next = 5;
  8500. break;
  8501. }
  8502. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8503. case 5:
  8504. line = linesSV.get().toNumber();
  8505. _context21.next = 8;
  8506. return this.evaluateExpression(store, cmd.columns);
  8507. case 8:
  8508. columnsSV = _context21.sent;
  8509. column = null;
  8510. if (!(columnsSV !== null)) {
  8511. _context21.next = 16;
  8512. break;
  8513. }
  8514. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnsSV.type)) {
  8515. _context21.next = 13;
  8516. break;
  8517. }
  8518. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8519. case 13:
  8520. column = columnsSV.get().toNumber();
  8521. if (!(column < 0)) {
  8522. _context21.next = 16;
  8523. break;
  8524. }
  8525. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8526. case 16:
  8527. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, [], line, column, null, cmd.isConst);
  8528. if (!(cmd.initial !== null)) {
  8529. _context21.next = 22;
  8530. break;
  8531. }
  8532. _context21.next = 20;
  8533. return this.evaluateArrayLiteral(store, cmd.initial, cmd.type, line, column);
  8534. case 20:
  8535. valueList = _context21.sent;
  8536. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, valueList, line, column, null, cmd.isConst);
  8537. case 22:
  8538. store.insertStore(cmd.id, temp);
  8539. return _context21.abrupt("return", store);
  8540. case 24:
  8541. case "end":
  8542. return _context21.stop();
  8543. }
  8544. }
  8545. }, _callee21, this);
  8546. }));
  8547. function executeArrayDeclaration(_x47, _x48) {
  8548. return _executeArrayDeclaration.apply(this, arguments);
  8549. }
  8550. return executeArrayDeclaration;
  8551. }()
  8552. /**
  8553. *
  8554. * @param {Store} store
  8555. * @param {Expression} exp
  8556. *
  8557. * @returns {Promise<import('./store/value/istore_value').IStoreValue>}
  8558. */
  8559. }, {
  8560. key: "evaluateExpression",
  8561. value: function () {
  8562. 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) {
  8563. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee22$(_context22) {
  8564. while (1) {
  8565. switch (_context22.prev = _context22.next) {
  8566. case 0:
  8567. this.instruction_count += 1;
  8568. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  8569. _context22.next = 4;
  8570. break;
  8571. }
  8572. _context22.next = 4;
  8573. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
  8574. case 4:
  8575. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  8576. _context22.next = 6;
  8577. break;
  8578. }
  8579. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  8580. case 6:
  8581. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  8582. _context22.next = 8;
  8583. break;
  8584. }
  8585. 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.");
  8586. case 8:
  8587. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["UnaryApp"])) {
  8588. _context22.next = 12;
  8589. break;
  8590. }
  8591. return _context22.abrupt("return", this.evaluateUnaryApp(store, exp));
  8592. case 12:
  8593. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"])) {
  8594. _context22.next = 16;
  8595. break;
  8596. }
  8597. return _context22.abrupt("return", this.evaluateInfixApp(store, exp));
  8598. case 16:
  8599. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayAccess"])) {
  8600. _context22.next = 20;
  8601. break;
  8602. }
  8603. return _context22.abrupt("return", this.evaluateArrayAccess(store, exp));
  8604. case 20:
  8605. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["VariableLiteral"])) {
  8606. _context22.next = 24;
  8607. break;
  8608. }
  8609. return _context22.abrupt("return", this.evaluateVariableLiteral(store, exp));
  8610. case 24:
  8611. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"])) {
  8612. _context22.next = 28;
  8613. break;
  8614. }
  8615. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8616. case 28:
  8617. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["RealLiteral"])) {
  8618. _context22.next = 32;
  8619. break;
  8620. }
  8621. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8622. case 32:
  8623. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["BoolLiteral"])) {
  8624. _context22.next = 36;
  8625. break;
  8626. }
  8627. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8628. case 36:
  8629. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["StringLiteral"])) {
  8630. _context22.next = 40;
  8631. break;
  8632. }
  8633. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8634. case 40:
  8635. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["CharLiteral"])) {
  8636. _context22.next = 44;
  8637. break;
  8638. }
  8639. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  8640. case 44:
  8641. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayLiteral"])) {
  8642. _context22.next = 48;
  8643. break;
  8644. }
  8645. throw new Error("Internal Error: The system should not eval an array literal.");
  8646. case 48:
  8647. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  8648. _context22.next = 50;
  8649. break;
  8650. }
  8651. return _context22.abrupt("return", this.evaluateFunctionCall(store, exp));
  8652. case 50:
  8653. return _context22.abrupt("return", null);
  8654. case 51:
  8655. case "end":
  8656. return _context22.stop();
  8657. }
  8658. }
  8659. }, _callee22, this);
  8660. }));
  8661. function evaluateExpression(_x49, _x50) {
  8662. return _evaluateExpression.apply(this, arguments);
  8663. }
  8664. return evaluateExpression;
  8665. }()
  8666. }, {
  8667. key: "evaluateFunctionCall",
  8668. value: function () {
  8669. 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) {
  8670. var func, sto, val;
  8671. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee23$(_context23) {
  8672. while (1) {
  8673. switch (_context23.prev = _context23.next) {
  8674. case 0:
  8675. if (!exp.isMainCall) {
  8676. _context23.next = 2;
  8677. break;
  8678. }
  8679. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName(), exp.sourceInfo);
  8680. case 2:
  8681. func = this.findFunction(exp.id);
  8682. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType)) {
  8683. _context23.next = 5;
  8684. break;
  8685. }
  8686. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(exp.id, exp.sourceInfo);
  8687. case 5:
  8688. if (!(this.function_call_stack.length >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_call_stack)) {
  8689. _context23.next = 7;
  8690. break;
  8691. }
  8692. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceeded_recursive_calls(exp.sourceInfo);
  8693. case 7:
  8694. this.function_call_stack.push(exp.sourceInfo);
  8695. _context23.next = 10;
  8696. return this.runFunction(func, exp.actualParameters, store);
  8697. case 10:
  8698. sto = _context23.sent;
  8699. if (!(sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  8700. _context23.next = 13;
  8701. break;
  8702. }
  8703. 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);
  8704. case 13:
  8705. val = sto.applyStore("$");
  8706. sto.destroy();
  8707. this.function_call_stack.pop();
  8708. return _context23.abrupt("return", val);
  8709. case 17:
  8710. case "end":
  8711. return _context23.stop();
  8712. }
  8713. }
  8714. }, _callee23, this);
  8715. }));
  8716. function evaluateFunctionCall(_x51, _x52) {
  8717. return _evaluateFunctionCall.apply(this, arguments);
  8718. }
  8719. return evaluateFunctionCall;
  8720. }()
  8721. /**
  8722. *
  8723. * @param {Store} store
  8724. * @param {Expressions.ArrayLiteral} exp
  8725. * @param {ArrayType} type
  8726. *
  8727. * @returns {Promise<StoreValue[]>}
  8728. */
  8729. }, {
  8730. key: "evaluateArrayLiteral",
  8731. value: function () {
  8732. 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) {
  8733. var storeValueMatrix;
  8734. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee24$(_context24) {
  8735. while (1) {
  8736. switch (_context24.prev = _context24.next) {
  8737. case 0:
  8738. if (exp.isVector) {
  8739. _context24.next = 9;
  8740. break;
  8741. }
  8742. if (!(columns == null)) {
  8743. _context24.next = 3;
  8744. break;
  8745. }
  8746. throw new Error("This should never happen: Vector cannot be initialized by a matrix");
  8747. case 3:
  8748. _context24.next = 5;
  8749. return this.evaluateMatrix(store, exp, type, lines, columns);
  8750. case 5:
  8751. storeValueMatrix = _context24.sent;
  8752. return _context24.abrupt("return", storeValueMatrix.reduce(function (prev, next) {
  8753. return prev.concat(next);
  8754. }, []));
  8755. case 9:
  8756. if (!(columns != null)) {
  8757. _context24.next = 11;
  8758. break;
  8759. }
  8760. throw new Error("This should never happen: Matrix cannot be initialized by a vector");
  8761. case 11:
  8762. return _context24.abrupt("return", this.evaluateVector(store, exp, type, lines));
  8763. case 12:
  8764. case "end":
  8765. return _context24.stop();
  8766. }
  8767. }
  8768. }, _callee24, this);
  8769. }));
  8770. function evaluateArrayLiteral(_x53, _x54, _x55, _x56, _x57) {
  8771. return _evaluateArrayLiteral.apply(this, arguments);
  8772. }
  8773. return evaluateArrayLiteral;
  8774. }()
  8775. /**
  8776. * Evalautes a list of literals and expression composing the vector
  8777. * @param {Store} store
  8778. * @param {Expressions.ArrayLiteral} exps
  8779. * @param {ArrayType} type
  8780. * @param {number} n_elements
  8781. *
  8782. * @returns {Promise<StoreValue[]>} store object list
  8783. */
  8784. }, {
  8785. key: "evaluateVector",
  8786. value: function () {
  8787. 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) {
  8788. var _this = this;
  8789. var values, actualValues;
  8790. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee25$(_context25) {
  8791. while (1) {
  8792. switch (_context25.prev = _context25.next) {
  8793. case 0:
  8794. values = exps.value;
  8795. if (!(n_elements !== values.length)) {
  8796. _context25.next = 3;
  8797. break;
  8798. }
  8799. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_elements_vector(n_elements, exps.toString(), values.length, exps.sourceInfo);
  8800. case 3:
  8801. _context25.next = 5;
  8802. return Promise.all(values.map(function (exp) {
  8803. return _this.evaluateExpression(store, exp);
  8804. }));
  8805. case 5:
  8806. actualValues = _context25.sent;
  8807. return _context25.abrupt("return", actualValues.map(function (v, index) {
  8808. if (!type.canAccept(v.type, 1)) {
  8809. if (!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(type.innerType, v.type)) {
  8810. // const stringInfo = v.type.stringInfo();
  8811. // const info = stringInfo[0];
  8812. var exp_str = values[index].toString(); // TODO - fix error message
  8813. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_literal_type_full(exp_str, values[index].sourceInfo);
  8814. }
  8815. var newValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(type.innerType, v);
  8816. return newValue;
  8817. }
  8818. return v;
  8819. }));
  8820. case 7:
  8821. case "end":
  8822. return _context25.stop();
  8823. }
  8824. }
  8825. }, _callee25);
  8826. }));
  8827. function evaluateVector(_x58, _x59, _x60, _x61) {
  8828. return _evaluateVector.apply(this, arguments);
  8829. }
  8830. return evaluateVector;
  8831. }()
  8832. /**
  8833. * Evaluates a list of array literals composing the matrix
  8834. * @param {Store} store
  8835. * @param {Expressions.ArrayLiteral} exps
  8836. * @param {ArrayType} type
  8837. *
  8838. * @returns {Promise<StoreValue[][]>}
  8839. */
  8840. }, {
  8841. key: "evaluateMatrix",
  8842. value: function () {
  8843. 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) {
  8844. var _this2 = this;
  8845. var values, vectors;
  8846. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee26$(_context26) {
  8847. while (1) {
  8848. switch (_context26.prev = _context26.next) {
  8849. case 0:
  8850. values = exps.value;
  8851. if (!(values.length !== lines)) {
  8852. _context26.next = 3;
  8853. break;
  8854. }
  8855. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_lines_matrix(lines, exps.toString(), values.length, exps.sourceInfo);
  8856. case 3:
  8857. vectors = values.map(function (vector) {
  8858. var vec_type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"](type.innerType, 1);
  8859. return _this2.evaluateVector(store, vector, vec_type, columns);
  8860. });
  8861. _context26.next = 6;
  8862. return Promise.all(vectors);
  8863. case 6:
  8864. return _context26.abrupt("return", _context26.sent);
  8865. case 7:
  8866. case "end":
  8867. return _context26.stop();
  8868. }
  8869. }
  8870. }, _callee26);
  8871. }));
  8872. function evaluateMatrix(_x62, _x63, _x64, _x65, _x66) {
  8873. return _evaluateMatrix.apply(this, arguments);
  8874. }
  8875. return evaluateMatrix;
  8876. }()
  8877. /**
  8878. *
  8879. * @param {Store} _
  8880. * @param {import('../ast/expressions/literal').Literal} exp
  8881. *
  8882. * @returns {import('./store/value/istore_value').IStoreValue}
  8883. */
  8884. }, {
  8885. key: "evaluateLiteral",
  8886. value: function () {
  8887. 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) {
  8888. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee27$(_context27) {
  8889. while (1) {
  8890. switch (_context27.prev = _context27.next) {
  8891. case 0:
  8892. return _context27.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](exp.type, exp.value));
  8893. case 1:
  8894. case "end":
  8895. return _context27.stop();
  8896. }
  8897. }
  8898. }, _callee27);
  8899. }));
  8900. function evaluateLiteral(_x67, _x68) {
  8901. return _evaluateLiteral.apply(this, arguments);
  8902. }
  8903. return evaluateLiteral;
  8904. }()
  8905. /**
  8906. *
  8907. * @param {Store} store
  8908. * @param {Expressions.VariableLiteral} exp
  8909. *
  8910. * @returns {import('./store/value/istore_value').IStoreValue}
  8911. */
  8912. }, {
  8913. key: "evaluateVariableLiteral",
  8914. value: function () {
  8915. 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) {
  8916. var val;
  8917. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee28$(_context28) {
  8918. while (1) {
  8919. switch (_context28.prev = _context28.next) {
  8920. case 0:
  8921. val = store.applyStore(exp.id);
  8922. return _context28.abrupt("return", val);
  8923. case 2:
  8924. case "end":
  8925. return _context28.stop();
  8926. }
  8927. }
  8928. }, _callee28);
  8929. }));
  8930. function evaluateVariableLiteral(_x69, _x70) {
  8931. return _evaluateVariableLiteral.apply(this, arguments);
  8932. }
  8933. return evaluateVariableLiteral;
  8934. }()
  8935. /**
  8936. *
  8937. * @param {Store} store
  8938. * @param {Expressions.ArrayAccess} exp
  8939. *
  8940. * @returns {import('./store/value/istore_value').IStoreValue}
  8941. */
  8942. }, {
  8943. key: "evaluateArrayAccess",
  8944. value: function () {
  8945. 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) {
  8946. var mustBeArray, lineSV, line, columnSV, column, result, type, values;
  8947. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee29$(_context29) {
  8948. while (1) {
  8949. switch (_context29.prev = _context29.next) {
  8950. case 0:
  8951. mustBeArray = store.getStoreObject(exp.id);
  8952. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  8953. _context29.next = 3;
  8954. break;
  8955. }
  8956. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(exp.id, exp.sourceInfo);
  8957. case 3:
  8958. _context29.next = 5;
  8959. return this.evaluateExpression(store, exp.line);
  8960. case 5:
  8961. lineSV = _context29.sent;
  8962. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  8963. _context29.next = 8;
  8964. break;
  8965. }
  8966. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  8967. case 8:
  8968. line = lineSV.get().toNumber();
  8969. _context29.next = 11;
  8970. return this.evaluateExpression(store, exp.column);
  8971. case 11:
  8972. columnSV = _context29.sent;
  8973. column = null;
  8974. if (!(columnSV !== null)) {
  8975. _context29.next = 17;
  8976. break;
  8977. }
  8978. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  8979. _context29.next = 16;
  8980. break;
  8981. }
  8982. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  8983. case 16:
  8984. column = columnSV.get().toNumber();
  8985. case 17:
  8986. if (!(line >= mustBeArray.lines)) {
  8987. _context29.next = 25;
  8988. break;
  8989. }
  8990. if (!mustBeArray.isVector) {
  8991. _context29.next = 22;
  8992. break;
  8993. }
  8994. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  8995. case 22:
  8996. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  8997. case 23:
  8998. _context29.next = 27;
  8999. break;
  9000. case 25:
  9001. if (!(line < 0)) {
  9002. _context29.next = 27;
  9003. break;
  9004. }
  9005. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9006. case 27:
  9007. if (!(column !== null && mustBeArray.columns === 0)) {
  9008. _context29.next = 29;
  9009. break;
  9010. }
  9011. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(exp.id, exp.sourceInfo);
  9012. case 29:
  9013. if (!(column !== null)) {
  9014. _context29.next = 36;
  9015. break;
  9016. }
  9017. if (!(column >= mustBeArray.columns)) {
  9018. _context29.next = 34;
  9019. break;
  9020. }
  9021. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(exp.id, column, mustBeArray.columns, exp.sourceInfo);
  9022. case 34:
  9023. if (!(column < 0)) {
  9024. _context29.next = 36;
  9025. break;
  9026. }
  9027. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9028. case 36:
  9029. result = mustBeArray.getAt(line, column);
  9030. type = mustBeArray.type.innerType;
  9031. if (!Array.isArray(result)) {
  9032. _context29.next = 43;
  9033. break;
  9034. }
  9035. values = result.map(function (val, col) {
  9036. return new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, val, line, col, mustBeArray.id, mustBeArray.readOnly);
  9037. });
  9038. 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));
  9039. case 43:
  9040. return _context29.abrupt("return", new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, result, line, column, mustBeArray.id, mustBeArray.readOnly));
  9041. case 44:
  9042. case "end":
  9043. return _context29.stop();
  9044. }
  9045. }
  9046. }, _callee29, this);
  9047. }));
  9048. function evaluateArrayAccess(_x71, _x72) {
  9049. return _evaluateArrayAccess.apply(this, arguments);
  9050. }
  9051. return evaluateArrayAccess;
  9052. }()
  9053. /**
  9054. *
  9055. * @param {Store} store
  9056. * @param {Expressions.UnaryApp} unaryApp
  9057. *
  9058. * @returns {import('./store/value/istore_value').IStoreValue}
  9059. */
  9060. }, {
  9061. key: "evaluateUnaryApp",
  9062. value: function () {
  9063. 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) {
  9064. var left, resultType, stringInfo, info;
  9065. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee30$(_context30) {
  9066. while (1) {
  9067. switch (_context30.prev = _context30.next) {
  9068. case 0:
  9069. _context30.next = 2;
  9070. return this.evaluateExpression(store, unaryApp.left);
  9071. case 2:
  9072. left = _context30.sent;
  9073. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterUnaryOp"])(unaryApp.op, left.type);
  9074. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9075. _context30.next = 8;
  9076. break;
  9077. }
  9078. stringInfo = left.type.stringInfo();
  9079. info = stringInfo[0];
  9080. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_unary_op_full(unaryApp.op, info.type, info.dim, unaryApp.sourceInfo);
  9081. case 8:
  9082. _context30.t0 = unaryApp.op.ord;
  9083. _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;
  9084. break;
  9085. case 11:
  9086. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get()));
  9087. case 12:
  9088. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().negated()));
  9089. case 13:
  9090. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, !left.get()));
  9091. case 14:
  9092. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid UnaryApp " + unaryApp.op);
  9093. case 15:
  9094. case "end":
  9095. return _context30.stop();
  9096. }
  9097. }
  9098. }, _callee30, this);
  9099. }));
  9100. function evaluateUnaryApp(_x73, _x74) {
  9101. return _evaluateUnaryApp.apply(this, arguments);
  9102. }
  9103. return evaluateUnaryApp;
  9104. }()
  9105. /**
  9106. *
  9107. * @param {Store} store
  9108. * @param {Expressions.InfixApp} infixApp
  9109. *
  9110. * @returns {import('./store/value/istore_value').IStoreValue}
  9111. */
  9112. }, {
  9113. key: "evaluateInfixApp",
  9114. value: function () {
  9115. 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) {
  9116. 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;
  9117. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee31$(_context31) {
  9118. while (1) {
  9119. switch (_context31.prev = _context31.next) {
  9120. case 0:
  9121. _context31.next = 2;
  9122. return this.evaluateExpression(store, infixApp.left);
  9123. case 2:
  9124. left = _context31.sent;
  9125. _context31.next = 5;
  9126. return this.evaluateExpression(store, infixApp.right);
  9127. case 5:
  9128. right = _context31.sent;
  9129. shouldImplicitCast = false;
  9130. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterInfixOp"])(infixApp.op, left.type, right.type);
  9131. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9132. _context31.next = 18;
  9133. break;
  9134. }
  9135. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(left.type, right.type))) {
  9136. _context31.next = 13;
  9137. break;
  9138. }
  9139. shouldImplicitCast = true;
  9140. _context31.next = 18;
  9141. break;
  9142. case 13:
  9143. stringInfoLeft = left.type.stringInfo();
  9144. infoLeft = stringInfoLeft[0];
  9145. stringInfoRight = right.type.stringInfo();
  9146. infoRight = stringInfoRight[0];
  9147. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_infix_op_full(infixApp.op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, infixApp.sourceInfo);
  9148. case 18:
  9149. result = null;
  9150. _context31.t0 = infixApp.op.ord;
  9151. _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;
  9152. break;
  9153. case 22:
  9154. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9155. _context31.next = 27;
  9156. break;
  9157. }
  9158. rightStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9159. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() + rightStr));
  9160. case 27:
  9161. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(right.type)) {
  9162. _context31.next = 32;
  9163. break;
  9164. }
  9165. leftStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9166. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, leftStr + right.get()));
  9167. case 32:
  9168. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9169. _context31.next = 38;
  9170. break;
  9171. }
  9172. strLeft = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9173. strRight = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9174. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, strLeft + strRight));
  9175. case 38:
  9176. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().plus(right.get())));
  9177. case 39:
  9178. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().minus(right.get())));
  9179. case 40:
  9180. result = left.get().times(right.get());
  9181. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9182. case 42:
  9183. if (!(right.get() == 0)) {
  9184. _context31.next = 44;
  9185. break;
  9186. }
  9187. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].divsion_by_zero_full(infixApp.toString(), infixApp.sourceInfo);
  9188. case 44:
  9189. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(resultType)) result = left.get().divToInt(right.get());else result = left.get().div(right.get());
  9190. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9191. case 46:
  9192. leftValue = left.get();
  9193. rightValue = right.get();
  9194. if (shouldImplicitCast) {
  9195. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER;
  9196. leftValue = leftValue.trunc();
  9197. rightValue = rightValue.trunc();
  9198. }
  9199. result = leftValue.modulo(rightValue);
  9200. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9201. case 51:
  9202. _leftValue = left.get();
  9203. _rightValue = right.get();
  9204. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9205. result = _leftValue.length > _rightValue.length;
  9206. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9207. result = _leftValue.charCodeAt(0) > _rightValue.charCodeAt(0);
  9208. } else {
  9209. if (shouldImplicitCast) {
  9210. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9211. _leftValue = _leftValue.trunc();
  9212. _rightValue = _rightValue.trunc();
  9213. }
  9214. result = _leftValue.gt(_rightValue);
  9215. }
  9216. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9217. case 55:
  9218. _leftValue2 = left.get();
  9219. _rightValue2 = right.get();
  9220. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9221. result = _leftValue2.length >= _rightValue2.length;
  9222. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9223. result = _leftValue2.charCodeAt(0) >= _rightValue2.charCodeAt(0);
  9224. } else {
  9225. if (shouldImplicitCast) {
  9226. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9227. _leftValue2 = _leftValue2.trunc();
  9228. _rightValue2 = _rightValue2.trunc();
  9229. }
  9230. result = _leftValue2.gte(_rightValue2);
  9231. }
  9232. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9233. case 59:
  9234. _leftValue3 = left.get();
  9235. _rightValue3 = right.get();
  9236. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9237. result = _leftValue3.length < _rightValue3.length;
  9238. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9239. result = _leftValue3.charCodeAt(0) < _rightValue3.charCodeAt(0);
  9240. } else {
  9241. if (shouldImplicitCast) {
  9242. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9243. _leftValue3 = _leftValue3.trunc();
  9244. _rightValue3 = _rightValue3.trunc();
  9245. }
  9246. result = _leftValue3.lt(_rightValue3);
  9247. }
  9248. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9249. case 63:
  9250. _leftValue4 = left.get();
  9251. _rightValue4 = right.get();
  9252. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9253. result = _leftValue4.length <= _rightValue4.length;
  9254. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9255. result = _leftValue4.charCodeAt(0) <= _rightValue4.charCodeAt(0);
  9256. } else {
  9257. if (shouldImplicitCast) {
  9258. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9259. _leftValue4 = _leftValue4.trunc();
  9260. _rightValue4 = _rightValue4.trunc();
  9261. }
  9262. result = _leftValue4.lte(_rightValue4);
  9263. }
  9264. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9265. case 67:
  9266. _leftValue5 = left.get();
  9267. _rightValue5 = right.get();
  9268. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9269. if (shouldImplicitCast) {
  9270. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9271. _leftValue5 = _leftValue5.trunc();
  9272. _rightValue5 = _rightValue5.trunc();
  9273. }
  9274. result = _leftValue5.eq(_rightValue5);
  9275. } else {
  9276. result = _leftValue5 === _rightValue5;
  9277. }
  9278. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9279. case 71:
  9280. _leftValue6 = left.get();
  9281. _rightValue6 = right.get();
  9282. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9283. if (shouldImplicitCast) {
  9284. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9285. _leftValue6 = _leftValue6.trunc();
  9286. _rightValue6 = _rightValue6.trunc();
  9287. }
  9288. result = !_leftValue6.eq(_rightValue6);
  9289. } else {
  9290. result = _leftValue6 !== _rightValue6;
  9291. }
  9292. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9293. case 75:
  9294. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() && right.get()));
  9295. case 76:
  9296. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() || right.get()));
  9297. case 77:
  9298. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid InfixApp " + infixApp.op);
  9299. case 78:
  9300. case "end":
  9301. return _context31.stop();
  9302. }
  9303. }
  9304. }, _callee31, this);
  9305. }));
  9306. function evaluateInfixApp(_x75, _x76) {
  9307. return _evaluateInfixApp.apply(this, arguments);
  9308. }
  9309. return evaluateInfixApp;
  9310. }()
  9311. }]);
  9312. return IVProgProcessor;
  9313. }();
  9314. /***/ }),
  9315. /***/ "./js/processor/lib/arrays.js":
  9316. /*!************************************!*\
  9317. !*** ./js/processor/lib/arrays.js ***!
  9318. \************************************/
  9319. /*! exports provided: createNumElementsFun, createMatrixLinesFun, createMatrixColumnsFun */
  9320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9321. "use strict";
  9322. __webpack_require__.r(__webpack_exports__);
  9323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumElementsFun", function() { return createNumElementsFun; });
  9324. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixLinesFun", function() { return createMatrixLinesFun; });
  9325. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixColumnsFun", function() { return createMatrixColumnsFun; });
  9326. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9327. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9328. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9329. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9330. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9331. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9332. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  9333. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9334. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  9335. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__);
  9336. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9337. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  9338. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9339. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  9340. /**
  9341. * num_elements
  9342. * matrix_lines
  9343. * matrix_columns
  9344. */
  9345. function createNumElementsFun() {
  9346. var numElementsFun = /*#__PURE__*/function () {
  9347. 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, _) {
  9348. var vector, temp;
  9349. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9350. while (1) {
  9351. switch (_context.prev = _context.next) {
  9352. case 0:
  9353. vector = sto.applyStore("vector");
  9354. 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));
  9355. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9356. sto.insertStore("$", temp);
  9357. return _context.abrupt("return", sto);
  9358. case 5:
  9359. case "end":
  9360. return _context.stop();
  9361. }
  9362. }
  9363. }, _callee);
  9364. }));
  9365. return function numElementsFun(_x, _x2) {
  9366. return _ref.apply(this, arguments);
  9367. };
  9368. }();
  9369. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](numElementsFun)]);
  9370. 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);
  9371. return func;
  9372. }
  9373. function createMatrixLinesFun() {
  9374. var matrixLinesFun = /*#__PURE__*/function () {
  9375. 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, _) {
  9376. var matrix, temp;
  9377. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9378. while (1) {
  9379. switch (_context2.prev = _context2.next) {
  9380. case 0:
  9381. matrix = sto.applyStore("matrix");
  9382. 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));
  9383. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9384. sto.insertStore("$", temp);
  9385. return _context2.abrupt("return", sto);
  9386. case 5:
  9387. case "end":
  9388. return _context2.stop();
  9389. }
  9390. }
  9391. }, _callee2);
  9392. }));
  9393. return function matrixLinesFun(_x3, _x4) {
  9394. return _ref2.apply(this, arguments);
  9395. };
  9396. }();
  9397. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixLinesFun)]);
  9398. 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);
  9399. return func;
  9400. }
  9401. function createMatrixColumnsFun() {
  9402. var matrixColumnsFun = /*#__PURE__*/function () {
  9403. 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, _) {
  9404. var matrix, temp;
  9405. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  9406. while (1) {
  9407. switch (_context3.prev = _context3.next) {
  9408. case 0:
  9409. matrix = sto.applyStore("matrix");
  9410. 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));
  9411. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9412. sto.insertStore("$", temp);
  9413. return _context3.abrupt("return", sto);
  9414. case 5:
  9415. case "end":
  9416. return _context3.stop();
  9417. }
  9418. }
  9419. }, _callee3);
  9420. }));
  9421. return function matrixColumnsFun(_x5, _x6) {
  9422. return _ref3.apply(this, arguments);
  9423. };
  9424. }();
  9425. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixColumnsFun)]);
  9426. 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);
  9427. return func;
  9428. }
  9429. /***/ }),
  9430. /***/ "./js/processor/lib/io.js":
  9431. /*!********************************!*\
  9432. !*** ./js/processor/lib/io.js ***!
  9433. \********************************/
  9434. /*! exports provided: createOutputFun, createInputFun */
  9435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9436. "use strict";
  9437. __webpack_require__.r(__webpack_exports__);
  9438. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createOutputFun", function() { return createOutputFun; });
  9439. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInputFun", function() { return createInputFun; });
  9440. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9441. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9442. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9443. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9444. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9445. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9446. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_3__);
  9447. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9448. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9449. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__);
  9450. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9451. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9452. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  9453. function createOutputFun() {
  9454. var writeFunction = /*#__PURE__*/function () {
  9455. 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, _) {
  9456. var totalSV, total, i, val;
  9457. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9458. while (1) {
  9459. switch (_context.prev = _context.next) {
  9460. case 0:
  9461. totalSV = store.applyStore("p1.0");
  9462. total = totalSV.get();
  9463. for (i = 1; i < total; i += 1) {
  9464. val = store.applyStore("p1.".concat(i));
  9465. this.output.sendOutput(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type));
  9466. }
  9467. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9468. return _context.abrupt("return", store);
  9469. case 5:
  9470. case "end":
  9471. return _context.stop();
  9472. }
  9473. }
  9474. }, _callee, this);
  9475. }));
  9476. return function writeFunction(_x, _x2) {
  9477. return _ref.apply(this, arguments);
  9478. };
  9479. }();
  9480. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](writeFunction)]);
  9481. 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);
  9482. return func;
  9483. }
  9484. function createInputFun() {
  9485. var readFunction = /*#__PURE__*/function () {
  9486. 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, _) {
  9487. var text, typeToConvert, type, result, stringInfo, realObject, arrayInfo, dim, stoValue;
  9488. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9489. while (1) {
  9490. switch (_context2.prev = _context2.next) {
  9491. case 0:
  9492. _context2.next = 2;
  9493. return this.input.requestInput();
  9494. case 2:
  9495. text = _context2.sent;
  9496. typeToConvert = store.applyStore("p1").type;
  9497. type = null;
  9498. result = null;
  9499. _context2.prev = 6;
  9500. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER)) {
  9501. _context2.next = 12;
  9502. break;
  9503. }
  9504. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"](text.trim()).trunc();
  9505. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER;
  9506. _context2.next = 33;
  9507. break;
  9508. case 12:
  9509. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL)) {
  9510. _context2.next = 17;
  9511. break;
  9512. }
  9513. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toReal"](text.trim());
  9514. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL;
  9515. _context2.next = 33;
  9516. break;
  9517. case 17:
  9518. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN)) {
  9519. _context2.next = 22;
  9520. break;
  9521. }
  9522. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toBool"](text.trim());
  9523. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN;
  9524. _context2.next = 33;
  9525. break;
  9526. case 22:
  9527. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING)) {
  9528. _context2.next = 27;
  9529. break;
  9530. }
  9531. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toString"](text);
  9532. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING;
  9533. _context2.next = 33;
  9534. break;
  9535. case 27:
  9536. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR)) {
  9537. _context2.next = 32;
  9538. break;
  9539. }
  9540. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toChar"](text);
  9541. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR;
  9542. _context2.next = 33;
  9543. break;
  9544. case 32:
  9545. throw new Error("!!!!Critical error: Unknown type in readFunction!!!!");
  9546. case 33:
  9547. _context2.next = 47;
  9548. break;
  9549. case 35:
  9550. _context2.prev = 35;
  9551. _context2.t0 = _context2["catch"](6);
  9552. if (!(this.mode == _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].ABORT)) {
  9553. _context2.next = 40;
  9554. break;
  9555. }
  9556. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9557. return _context2.abrupt("return", store);
  9558. case 40:
  9559. stringInfo = typeToConvert.stringInfo()[0];
  9560. realObject = store.getStoreObject("p1");
  9561. if (!(realObject.getReferenceDimension() > 0)) {
  9562. _context2.next = 46;
  9563. break;
  9564. }
  9565. arrayInfo = realObject.type.stringInfo()[0];
  9566. dim = realObject.getReferenceDimension();
  9567. 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());
  9568. case 46:
  9569. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__["ProcessorErrorFactory"].invalid_read_type(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), this.function_call_stack.pop());
  9570. case 47:
  9571. stoValue = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](type, result);
  9572. store.updateStore("p1", stoValue);
  9573. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9574. return _context2.abrupt("return", store);
  9575. case 51:
  9576. case "end":
  9577. return _context2.stop();
  9578. }
  9579. }
  9580. }, _callee2, this, [[6, 35]]);
  9581. }));
  9582. return function readFunction(_x3, _x4) {
  9583. return _ref2.apply(this, arguments);
  9584. };
  9585. }();
  9586. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](readFunction)]);
  9587. 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);
  9588. return func;
  9589. }
  9590. /***/ }),
  9591. /***/ "./js/processor/lib/lang.js":
  9592. /*!**********************************!*\
  9593. !*** ./js/processor/lib/lang.js ***!
  9594. \**********************************/
  9595. /*! exports provided: createIsRealFun, createIsIntFun, createIsBoolFun, createCastRealFun, createCastIntFun, createCastBoolFun, createCastStringFun, createCastCharFun */
  9596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9597. "use strict";
  9598. __webpack_require__.r(__webpack_exports__);
  9599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsRealFun", function() { return createIsRealFun; });
  9600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsIntFun", function() { return createIsIntFun; });
  9601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsBoolFun", function() { return createIsBoolFun; });
  9602. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastRealFun", function() { return createCastRealFun; });
  9603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastIntFun", function() { return createCastIntFun; });
  9604. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastBoolFun", function() { return createCastBoolFun; });
  9605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastStringFun", function() { return createCastStringFun; });
  9606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastCharFun", function() { return createCastCharFun; });
  9607. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9608. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9609. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9610. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9611. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9612. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9613. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  9614. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9615. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  9616. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  9617. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9618. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_7__);
  9619. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  9620. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__);
  9621. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9622. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9623. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  9624. /**
  9625. *
  9626. * is_real
  9627. * is_int
  9628. * is_bool
  9629. * cast_real
  9630. * cast_int
  9631. * cast_bool
  9632. * cast_string
  9633. * cast_char
  9634. */
  9635. function createIsRealFun() {
  9636. var isRealFun = /*#__PURE__*/function () {
  9637. 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, _) {
  9638. var str, parser, result, val, temp;
  9639. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9640. while (1) {
  9641. switch (_context.prev = _context.next) {
  9642. case 0:
  9643. str = sto.applyStore("str");
  9644. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  9645. result = false;
  9646. try {
  9647. val = parser.parseTerm();
  9648. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"]) {
  9649. result = true;
  9650. }
  9651. } catch (error) {// ignore
  9652. }
  9653. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  9654. sto.insertStore("$", temp);
  9655. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9656. return _context.abrupt("return", sto);
  9657. case 8:
  9658. case "end":
  9659. return _context.stop();
  9660. }
  9661. }
  9662. }, _callee);
  9663. }));
  9664. return function isRealFun(_x, _x2) {
  9665. return _ref.apply(this, arguments);
  9666. };
  9667. }();
  9668. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isRealFun)]);
  9669. 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);
  9670. return func;
  9671. }
  9672. function createIsIntFun() {
  9673. var isIntFun = /*#__PURE__*/function () {
  9674. 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, _) {
  9675. var str, parser, result, val, temp;
  9676. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9677. while (1) {
  9678. switch (_context2.prev = _context2.next) {
  9679. case 0:
  9680. str = sto.applyStore("str");
  9681. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  9682. result = false;
  9683. try {
  9684. val = parser.parseTerm();
  9685. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"]) {
  9686. result = true;
  9687. }
  9688. } catch (_unused) {// ignore
  9689. }
  9690. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  9691. sto.insertStore("$", temp);
  9692. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9693. return _context2.abrupt("return", sto);
  9694. case 8:
  9695. case "end":
  9696. return _context2.stop();
  9697. }
  9698. }
  9699. }, _callee2);
  9700. }));
  9701. return function isIntFun(_x3, _x4) {
  9702. return _ref2.apply(this, arguments);
  9703. };
  9704. }();
  9705. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isIntFun)]);
  9706. 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);
  9707. return func;
  9708. }
  9709. function createIsBoolFun() {
  9710. var isBoolFun = function isBoolFun(sto, _) {
  9711. var str = sto.applyStore("str");
  9712. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  9713. var result = false;
  9714. try {
  9715. var val = parser.parseTerm();
  9716. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"]) {
  9717. result = true;
  9718. }
  9719. } catch (error) {// ignore
  9720. }
  9721. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  9722. sto.insertStore("$", temp);
  9723. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9724. return sto;
  9725. };
  9726. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isBoolFun)]);
  9727. 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);
  9728. return func;
  9729. }
  9730. function createCastRealFun() {
  9731. var castRealFun = /*#__PURE__*/function () {
  9732. 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, _) {
  9733. var val, value, temp, parser, result, _temp, typeStringInfoArray, typeInfo;
  9734. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  9735. while (1) {
  9736. switch (_context3.prev = _context3.next) {
  9737. case 0:
  9738. val = sto.applyStore("val");
  9739. value = val.get();
  9740. _context3.t0 = val.type.ord;
  9741. _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;
  9742. break;
  9743. case 5:
  9744. value = value.toNumber();
  9745. 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));
  9746. sto.insertStore("$", temp);
  9747. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9748. return _context3.abrupt("return", sto);
  9749. case 10:
  9750. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  9751. _context3.prev = 11;
  9752. result = parser.parseTerm();
  9753. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"])) {
  9754. _context3.next = 18;
  9755. break;
  9756. }
  9757. _temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, result.value);
  9758. sto.insertStore("$", _temp);
  9759. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9760. return _context3.abrupt("return", sto);
  9761. case 18:
  9762. _context3.next = 22;
  9763. break;
  9764. case 20:
  9765. _context3.prev = 20;
  9766. _context3.t1 = _context3["catch"](11);
  9767. case 22:
  9768. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.stringInfo();
  9769. typeInfo = typeStringInfoArray[0];
  9770. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  9771. case 25:
  9772. case "end":
  9773. return _context3.stop();
  9774. }
  9775. }
  9776. }, _callee3, null, [[11, 20]]);
  9777. }));
  9778. return function castRealFun(_x5, _x6) {
  9779. return _ref3.apply(this, arguments);
  9780. };
  9781. }();
  9782. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castRealFun)]);
  9783. 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);
  9784. return func;
  9785. }
  9786. function createCastIntFun() {
  9787. var castIntFun = /*#__PURE__*/function () {
  9788. 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, _) {
  9789. var val, value, temp, _temp2, parser, result, _temp3, typeStringInfoArray, typeInfo;
  9790. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  9791. while (1) {
  9792. switch (_context4.prev = _context4.next) {
  9793. case 0:
  9794. val = sto.applyStore("val");
  9795. value = val.get();
  9796. _context4.t0 = val.type.ord;
  9797. _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;
  9798. break;
  9799. case 5:
  9800. value = value.toNumber();
  9801. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Math.floor(value));
  9802. sto.insertStore("$", temp);
  9803. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9804. return _context4.abrupt("return", sto);
  9805. case 10:
  9806. _temp2 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, value.charCodeAt(0));
  9807. sto.insertStore("$", _temp2);
  9808. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9809. return _context4.abrupt("return", sto);
  9810. case 14:
  9811. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  9812. _context4.prev = 15;
  9813. result = parser.parseTerm();
  9814. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"])) {
  9815. _context4.next = 22;
  9816. break;
  9817. }
  9818. _temp3 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, result.value);
  9819. sto.insertStore("$", _temp3);
  9820. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9821. return _context4.abrupt("return", sto);
  9822. case 22:
  9823. _context4.next = 26;
  9824. break;
  9825. case 24:
  9826. _context4.prev = 24;
  9827. _context4.t1 = _context4["catch"](15);
  9828. case 26:
  9829. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.stringInfo();
  9830. typeInfo = typeStringInfoArray[0];
  9831. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  9832. case 29:
  9833. case "end":
  9834. return _context4.stop();
  9835. }
  9836. }
  9837. }, _callee4, null, [[15, 24]]);
  9838. }));
  9839. return function castIntFun(_x7, _x8) {
  9840. return _ref4.apply(this, arguments);
  9841. };
  9842. }();
  9843. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castIntFun)]);
  9844. 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);
  9845. return func;
  9846. }
  9847. function createCastBoolFun() {
  9848. var castBoolFun = /*#__PURE__*/function () {
  9849. 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, _) {
  9850. var str, value, parser, val, temp, typeStringInfoArray, typeInfo;
  9851. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  9852. while (1) {
  9853. switch (_context5.prev = _context5.next) {
  9854. case 0:
  9855. str = sto.applyStore("str");
  9856. value = str.get();
  9857. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  9858. _context5.prev = 3;
  9859. val = parser.parseTerm();
  9860. if (!(val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"])) {
  9861. _context5.next = 10;
  9862. break;
  9863. }
  9864. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, val.value);
  9865. sto.insertStore("$", temp);
  9866. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9867. return _context5.abrupt("return", sto);
  9868. case 10:
  9869. _context5.next = 14;
  9870. break;
  9871. case 12:
  9872. _context5.prev = 12;
  9873. _context5.t0 = _context5["catch"](3);
  9874. case 14:
  9875. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN.stringInfo();
  9876. typeInfo = typeStringInfoArray[0];
  9877. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  9878. case 17:
  9879. case "end":
  9880. return _context5.stop();
  9881. }
  9882. }
  9883. }, _callee5, null, [[3, 12]]);
  9884. }));
  9885. return function castBoolFun(_x9, _x10) {
  9886. return _ref5.apply(this, arguments);
  9887. };
  9888. }();
  9889. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castBoolFun)]);
  9890. 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);
  9891. return func;
  9892. }
  9893. function createCastStringFun() {
  9894. var castStringFun = /*#__PURE__*/function () {
  9895. 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, _) {
  9896. var val, result, temp;
  9897. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee6$(_context6) {
  9898. while (1) {
  9899. switch (_context6.prev = _context6.next) {
  9900. case 0:
  9901. val = store.applyStore('str');
  9902. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type);
  9903. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  9904. store.insertStore("$", temp);
  9905. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9906. return _context6.abrupt("return", store);
  9907. case 6:
  9908. case "end":
  9909. return _context6.stop();
  9910. }
  9911. }
  9912. }, _callee6);
  9913. }));
  9914. return function castStringFun(_x11, _x12) {
  9915. return _ref6.apply(this, arguments);
  9916. };
  9917. }();
  9918. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castStringFun)]);
  9919. 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);
  9920. return func;
  9921. }
  9922. function createCastCharFun() {
  9923. var castCharFun = function castCharFun(store, _) {
  9924. var valSV = store.applyStore('charCode'); // Force the int value to the range [0, 255]
  9925. var value = valSV.get().toNumber() & 0xFF;
  9926. var result = String.fromCharCode(value);
  9927. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, result);
  9928. store.insertStore("$", temp);
  9929. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  9930. return store;
  9931. };
  9932. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castCharFun)]);
  9933. 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);
  9934. return func;
  9935. }
  9936. /***/ }),
  9937. /***/ "./js/processor/lib/math.js":
  9938. /*!**********************************!*\
  9939. !*** ./js/processor/lib/math.js ***!
  9940. \**********************************/
  9941. /*! exports provided: createSinFun, createCosFun, createTanFun, createSqrtFun, createPowFun, createLogFun, createAbsFun, createNegateFun, createInvertFun, createMaxFun, createMinFun, createRandFun, createSetSeedFun */
  9942. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9943. "use strict";
  9944. __webpack_require__.r(__webpack_exports__);
  9945. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSinFun", function() { return createSinFun; });
  9946. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCosFun", function() { return createCosFun; });
  9947. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTanFun", function() { return createTanFun; });
  9948. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSqrtFun", function() { return createSqrtFun; });
  9949. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPowFun", function() { return createPowFun; });
  9950. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLogFun", function() { return createLogFun; });
  9951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAbsFun", function() { return createAbsFun; });
  9952. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNegateFun", function() { return createNegateFun; });
  9953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInvertFun", function() { return createInvertFun; });
  9954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMaxFun", function() { return createMaxFun; });
  9955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMinFun", function() { return createMinFun; });
  9956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRandFun", function() { return createRandFun; });
  9957. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSetSeedFun", function() { return createSetSeedFun; });
  9958. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  9959. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  9960. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9961. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  9962. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9963. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  9964. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9965. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9966. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__);
  9967. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9968. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  9969. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_6__);
  9970. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  9971. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__);
  9972. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  9973. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  9974. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9975. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_9__);
  9976. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9977. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  9978. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9979. /**
  9980. * sin
  9981. * cos
  9982. * tan
  9983. * sqrt
  9984. * pow
  9985. * log
  9986. * abs
  9987. * negate
  9988. * invert
  9989. * max
  9990. * min
  9991. */
  9992. function convertToRadians(degrees) {
  9993. return degrees.times(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].acos(-1)).div(180);
  9994. }
  9995. function createSinFun() {
  9996. var sinFun = /*#__PURE__*/function () {
  9997. 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, _) {
  9998. var x, angle, result, temp;
  9999. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  10000. while (1) {
  10001. switch (_context.prev = _context.next) {
  10002. case 0:
  10003. x = sto.applyStore('x');
  10004. angle = x.get().mod(360);
  10005. result = null;
  10006. if (angle.eq(90)) {
  10007. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](1);
  10008. } else if (angle.eq(180)) {
  10009. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10010. } else if (angle.eq(270)) {
  10011. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10012. } else {
  10013. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].sin(convertToRadians(angle));
  10014. }
  10015. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10016. sto.insertStore("$", temp);
  10017. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10018. return _context.abrupt("return", sto);
  10019. case 8:
  10020. case "end":
  10021. return _context.stop();
  10022. }
  10023. }
  10024. }, _callee);
  10025. }));
  10026. return function sinFun(_x, _x2) {
  10027. return _ref.apply(this, arguments);
  10028. };
  10029. }();
  10030. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sinFun)]);
  10031. 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);
  10032. return func;
  10033. }
  10034. function createCosFun() {
  10035. var cosFun = /*#__PURE__*/function () {
  10036. 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, _) {
  10037. var x, angle, result, temp;
  10038. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  10039. while (1) {
  10040. switch (_context2.prev = _context2.next) {
  10041. case 0:
  10042. x = sto.applyStore('x');
  10043. angle = x.get().mod(360);
  10044. result = null;
  10045. if (angle.eq(90)) {
  10046. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10047. } else if (angle.eq(180)) {
  10048. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10049. } else if (angle.eq(270)) {
  10050. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10051. }
  10052. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].cos(convertToRadians(angle));
  10053. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10054. sto.insertStore("$", temp);
  10055. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10056. return _context2.abrupt("return", sto);
  10057. case 9:
  10058. case "end":
  10059. return _context2.stop();
  10060. }
  10061. }
  10062. }, _callee2);
  10063. }));
  10064. return function cosFun(_x3, _x4) {
  10065. return _ref2.apply(this, arguments);
  10066. };
  10067. }();
  10068. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](cosFun)]);
  10069. 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);
  10070. return func;
  10071. }
  10072. function createTanFun() {
  10073. var tanFun = /*#__PURE__*/function () {
  10074. 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, _) {
  10075. var x, angle, result, temp;
  10076. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  10077. while (1) {
  10078. switch (_context3.prev = _context3.next) {
  10079. case 0:
  10080. x = sto.applyStore('x');
  10081. angle = x.get().mod(360);
  10082. if (!(angle.eq(90) || angle.eq(270))) {
  10083. _context3.next = 4;
  10084. break;
  10085. }
  10086. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].undefined_tanget_value(x.get().toNumber(), this.function_call_stack.pop());
  10087. case 4:
  10088. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].tan(convertToRadians(angle));
  10089. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10090. sto.insertStore("$", temp);
  10091. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10092. return _context3.abrupt("return", sto);
  10093. case 9:
  10094. case "end":
  10095. return _context3.stop();
  10096. }
  10097. }
  10098. }, _callee3, this);
  10099. }));
  10100. return function tanFun(_x5, _x6) {
  10101. return _ref3.apply(this, arguments);
  10102. };
  10103. }();
  10104. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](tanFun)]);
  10105. 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);
  10106. return func;
  10107. }
  10108. function createSqrtFun() {
  10109. var sqrtFun = /*#__PURE__*/function () {
  10110. 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, _) {
  10111. var x, result, temp;
  10112. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  10113. while (1) {
  10114. switch (_context4.prev = _context4.next) {
  10115. case 0:
  10116. x = sto.applyStore('x');
  10117. if (!x.get().isNeg()) {
  10118. _context4.next = 3;
  10119. break;
  10120. }
  10121. return _context4.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_sqrt_value(this.function_call_stack.pop())));
  10122. case 3:
  10123. result = x.get().sqrt();
  10124. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10125. sto.insertStore("$", temp);
  10126. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10127. return _context4.abrupt("return", sto);
  10128. case 8:
  10129. case "end":
  10130. return _context4.stop();
  10131. }
  10132. }
  10133. }, _callee4, this);
  10134. }));
  10135. return function sqrtFun(_x7, _x8) {
  10136. return _ref4.apply(this, arguments);
  10137. };
  10138. }();
  10139. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sqrtFun)]);
  10140. 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);
  10141. return func;
  10142. }
  10143. function createPowFun() {
  10144. var powFun = /*#__PURE__*/function () {
  10145. 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, _) {
  10146. var x, y, result, temp;
  10147. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  10148. while (1) {
  10149. switch (_context5.prev = _context5.next) {
  10150. case 0:
  10151. x = sto.applyStore('x');
  10152. y = sto.applyStore('y');
  10153. result = x.get().pow(y.get());
  10154. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10155. sto.insertStore("$", temp);
  10156. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10157. return _context5.abrupt("return", sto);
  10158. case 7:
  10159. case "end":
  10160. return _context5.stop();
  10161. }
  10162. }
  10163. }, _callee5);
  10164. }));
  10165. return function powFun(_x9, _x10) {
  10166. return _ref5.apply(this, arguments);
  10167. };
  10168. }();
  10169. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](powFun)]);
  10170. 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);
  10171. return func;
  10172. }
  10173. function createLogFun() {
  10174. var logFun = /*#__PURE__*/function () {
  10175. 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, _) {
  10176. var x, result, temp;
  10177. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  10178. while (1) {
  10179. switch (_context6.prev = _context6.next) {
  10180. case 0:
  10181. x = sto.applyStore('x');
  10182. if (!x.get().isNegative()) {
  10183. _context6.next = 3;
  10184. break;
  10185. }
  10186. return _context6.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_log_value(this.function_call_stack.pop())));
  10187. case 3:
  10188. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].log10(x.get());
  10189. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10190. sto.insertStore("$", temp);
  10191. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10192. return _context6.abrupt("return", sto);
  10193. case 8:
  10194. case "end":
  10195. return _context6.stop();
  10196. }
  10197. }
  10198. }, _callee6, this);
  10199. }));
  10200. return function logFun(_x11, _x12) {
  10201. return _ref6.apply(this, arguments);
  10202. };
  10203. }();
  10204. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](logFun)]);
  10205. 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);
  10206. return func;
  10207. }
  10208. function createAbsFun() {
  10209. var absFun = /*#__PURE__*/function () {
  10210. 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, _) {
  10211. var x, result, temp;
  10212. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  10213. while (1) {
  10214. switch (_context7.prev = _context7.next) {
  10215. case 0:
  10216. x = sto.applyStore('x');
  10217. result = x.get().abs();
  10218. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10219. sto.insertStore("$", temp);
  10220. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10221. return _context7.abrupt("return", sto);
  10222. case 6:
  10223. case "end":
  10224. return _context7.stop();
  10225. }
  10226. }
  10227. }, _callee7);
  10228. }));
  10229. return function absFun(_x13, _x14) {
  10230. return _ref7.apply(this, arguments);
  10231. };
  10232. }();
  10233. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](absFun)]);
  10234. 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);
  10235. return func;
  10236. }
  10237. function createNegateFun() {
  10238. var negateFun = /*#__PURE__*/function () {
  10239. 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, _) {
  10240. var x, result, temp;
  10241. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  10242. while (1) {
  10243. switch (_context8.prev = _context8.next) {
  10244. case 0:
  10245. x = sto.applyStore('x');
  10246. result = x.get().negated();
  10247. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10248. sto.insertStore("$", temp);
  10249. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10250. return _context8.abrupt("return", sto);
  10251. case 6:
  10252. case "end":
  10253. return _context8.stop();
  10254. }
  10255. }
  10256. }, _callee8);
  10257. }));
  10258. return function negateFun(_x15, _x16) {
  10259. return _ref8.apply(this, arguments);
  10260. };
  10261. }();
  10262. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](negateFun)]);
  10263. 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);
  10264. return func;
  10265. }
  10266. function createInvertFun() {
  10267. var invertFun = /*#__PURE__*/function () {
  10268. 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, _) {
  10269. var x, result, temp;
  10270. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  10271. while (1) {
  10272. switch (_context9.prev = _context9.next) {
  10273. case 0:
  10274. x = sto.applyStore('x');
  10275. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__["toReal"](1).dividedBy(x.get());
  10276. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10277. sto.insertStore("$", temp);
  10278. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10279. return _context9.abrupt("return", sto);
  10280. case 6:
  10281. case "end":
  10282. return _context9.stop();
  10283. }
  10284. }
  10285. }, _callee9);
  10286. }));
  10287. return function invertFun(_x17, _x18) {
  10288. return _ref9.apply(this, arguments);
  10289. };
  10290. }();
  10291. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](invertFun)]);
  10292. 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);
  10293. return func;
  10294. }
  10295. function createMaxFun() {
  10296. var maxFun = /*#__PURE__*/function () {
  10297. 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, _) {
  10298. var x, numbers, result, temp;
  10299. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  10300. while (1) {
  10301. switch (_context10.prev = _context10.next) {
  10302. case 0:
  10303. x = sto.applyStore('x');
  10304. numbers = x.get().map(function (sto_addrs) {
  10305. return sto_addrs.get();
  10306. });
  10307. 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));
  10308. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10309. sto.insertStore("$", temp);
  10310. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10311. return _context10.abrupt("return", sto);
  10312. case 7:
  10313. case "end":
  10314. return _context10.stop();
  10315. }
  10316. }
  10317. }, _callee10);
  10318. }));
  10319. return function maxFun(_x19, _x20) {
  10320. return _ref10.apply(this, arguments);
  10321. };
  10322. }();
  10323. 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);
  10324. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](maxFun)]);
  10325. 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);
  10326. return func;
  10327. }
  10328. function createMinFun() {
  10329. var minFun = /*#__PURE__*/function () {
  10330. 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, _) {
  10331. var x, numbers, result, temp;
  10332. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  10333. while (1) {
  10334. switch (_context11.prev = _context11.next) {
  10335. case 0:
  10336. x = sto.applyStore('x');
  10337. numbers = x.get().map(function (sto_addrs) {
  10338. return sto_addrs.get();
  10339. });
  10340. 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));
  10341. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10342. sto.insertStore("$", temp);
  10343. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10344. return _context11.abrupt("return", sto);
  10345. case 7:
  10346. case "end":
  10347. return _context11.stop();
  10348. }
  10349. }
  10350. }, _callee11);
  10351. }));
  10352. return function minFun(_x21, _x22) {
  10353. return _ref11.apply(this, arguments);
  10354. };
  10355. }();
  10356. 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);
  10357. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](minFun)]);
  10358. 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);
  10359. return func;
  10360. }
  10361. var seed = Date.now();
  10362. function createRandFun() {
  10363. var a = 16807;
  10364. var m = 2147483647;
  10365. var c = 12345;
  10366. var randFun = /*#__PURE__*/function () {
  10367. 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, _) {
  10368. var val, temp;
  10369. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  10370. while (1) {
  10371. switch (_context12.prev = _context12.next) {
  10372. case 0:
  10373. seed = (a * seed + c) % m;
  10374. val = seed / (m - 1);
  10375. 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));
  10376. sto.insertStore("$", temp);
  10377. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10378. return _context12.abrupt("return", sto);
  10379. case 6:
  10380. case "end":
  10381. return _context12.stop();
  10382. }
  10383. }
  10384. }, _callee12);
  10385. }));
  10386. return function randFun(_x23, _x24) {
  10387. return _ref12.apply(this, arguments);
  10388. };
  10389. }();
  10390. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](randFun)]);
  10391. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$rand", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [], block);
  10392. return func;
  10393. }
  10394. function createSetSeedFun() {
  10395. var setSeedFun = /*#__PURE__*/function () {
  10396. 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, _) {
  10397. var value;
  10398. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  10399. while (1) {
  10400. switch (_context13.prev = _context13.next) {
  10401. case 0:
  10402. value = sto.applyStore("x");
  10403. seed = value.get().toNumber();
  10404. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10405. return _context13.abrupt("return", sto);
  10406. case 4:
  10407. case "end":
  10408. return _context13.stop();
  10409. }
  10410. }
  10411. }, _callee13);
  10412. }));
  10413. return function setSeedFun(_x25, _x26) {
  10414. return _ref13.apply(this, arguments);
  10415. };
  10416. }();
  10417. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](setSeedFun)]);
  10418. 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);
  10419. return func;
  10420. }
  10421. /***/ }),
  10422. /***/ "./js/processor/lib/strings.js":
  10423. /*!*************************************!*\
  10424. !*** ./js/processor/lib/strings.js ***!
  10425. \*************************************/
  10426. /*! exports provided: createSubstringFun, createLengthFun, createUppercaseFun, createLowercaseFun, createrCharAtFun */
  10427. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10428. "use strict";
  10429. __webpack_require__.r(__webpack_exports__);
  10430. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSubstringFun", function() { return createSubstringFun; });
  10431. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLengthFun", function() { return createLengthFun; });
  10432. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUppercaseFun", function() { return createUppercaseFun; });
  10433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLowercaseFun", function() { return createLowercaseFun; });
  10434. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createrCharAtFun", function() { return createrCharAtFun; });
  10435. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10436. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  10437. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10438. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  10439. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10440. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10441. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  10442. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10443. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10444. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_5__);
  10445. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10446. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_6__);
  10447. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10448. /*
  10449. * substring
  10450. * length
  10451. * uppercase
  10452. * lowercase
  10453. * charAt
  10454. **/
  10455. function createSubstringFun() {
  10456. var substringFun = /*#__PURE__*/function () {
  10457. 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, _) {
  10458. var str, start, end, result, temp;
  10459. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  10460. while (1) {
  10461. switch (_context.prev = _context.next) {
  10462. case 0:
  10463. str = sto.applyStore("str");
  10464. start = sto.applyStore("start");
  10465. end = sto.applyStore("end");
  10466. result = str.get().substring(start.get(), end.get());
  10467. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  10468. sto.insertStore("$", temp);
  10469. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10470. return _context.abrupt("return", sto);
  10471. case 8:
  10472. case "end":
  10473. return _context.stop();
  10474. }
  10475. }
  10476. }, _callee);
  10477. }));
  10478. return function substringFun(_x, _x2) {
  10479. return _ref.apply(this, arguments);
  10480. };
  10481. }();
  10482. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](substringFun)]);
  10483. 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);
  10484. return func;
  10485. }
  10486. function createLengthFun() {
  10487. var lengthFun = /*#__PURE__*/function () {
  10488. 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, _) {
  10489. var str, temp;
  10490. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  10491. while (1) {
  10492. switch (_context2.prev = _context2.next) {
  10493. case 0:
  10494. str = sto.applyStore("str");
  10495. 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));
  10496. sto.insertStore("$", temp);
  10497. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10498. return _context2.abrupt("return", sto);
  10499. case 5:
  10500. case "end":
  10501. return _context2.stop();
  10502. }
  10503. }
  10504. }, _callee2);
  10505. }));
  10506. return function lengthFun(_x3, _x4) {
  10507. return _ref2.apply(this, arguments);
  10508. };
  10509. }();
  10510. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lengthFun)]);
  10511. 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);
  10512. return func;
  10513. }
  10514. function createUppercaseFun() {
  10515. var uppercaseFun = /*#__PURE__*/function () {
  10516. 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, _) {
  10517. var str, temp;
  10518. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  10519. while (1) {
  10520. switch (_context3.prev = _context3.next) {
  10521. case 0:
  10522. str = sto.applyStore("str");
  10523. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toUpperCase());
  10524. sto.insertStore("$", temp);
  10525. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10526. return _context3.abrupt("return", sto);
  10527. case 5:
  10528. case "end":
  10529. return _context3.stop();
  10530. }
  10531. }
  10532. }, _callee3);
  10533. }));
  10534. return function uppercaseFun(_x5, _x6) {
  10535. return _ref3.apply(this, arguments);
  10536. };
  10537. }();
  10538. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](uppercaseFun)]);
  10539. 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);
  10540. return func;
  10541. }
  10542. function createLowercaseFun() {
  10543. var lowercaseFun = /*#__PURE__*/function () {
  10544. 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, _) {
  10545. var str, temp;
  10546. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  10547. while (1) {
  10548. switch (_context4.prev = _context4.next) {
  10549. case 0:
  10550. str = sto.applyStore("str");
  10551. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toLowerCase());
  10552. sto.insertStore("$", temp);
  10553. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10554. return _context4.abrupt("return", sto);
  10555. case 5:
  10556. case "end":
  10557. return _context4.stop();
  10558. }
  10559. }
  10560. }, _callee4);
  10561. }));
  10562. return function lowercaseFun(_x7, _x8) {
  10563. return _ref4.apply(this, arguments);
  10564. };
  10565. }();
  10566. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lowercaseFun)]);
  10567. 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);
  10568. return func;
  10569. }
  10570. function createrCharAtFun() {
  10571. var charAtFun = /*#__PURE__*/function () {
  10572. 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, _) {
  10573. var str, idx, temp;
  10574. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  10575. while (1) {
  10576. switch (_context5.prev = _context5.next) {
  10577. case 0:
  10578. str = sto.applyStore("str");
  10579. idx = sto.applyStore("index");
  10580. if (!(idx.get().toNumber() < 0 || idx.get().toNumber() >= str.get().length)) {
  10581. _context5.next = 4;
  10582. break;
  10583. }
  10584. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__["ProcessorErrorFactory"].invalid_string_index(idx.get().toNumber(), str.get(), this.function_call_stack.pop());
  10585. case 4:
  10586. 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()));
  10587. sto.insertStore("$", temp);
  10588. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10589. return _context5.abrupt("return", sto);
  10590. case 8:
  10591. case "end":
  10592. return _context5.stop();
  10593. }
  10594. }
  10595. }, _callee5, this);
  10596. }));
  10597. return function charAtFun(_x9, _x10) {
  10598. return _ref5.apply(this, arguments);
  10599. };
  10600. }();
  10601. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](charAtFun)]);
  10602. 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);
  10603. return func;
  10604. }
  10605. /***/ }),
  10606. /***/ "./js/processor/modes.ts":
  10607. /*!*******************************!*\
  10608. !*** ./js/processor/modes.ts ***!
  10609. \*******************************/
  10610. /*! no static exports found */
  10611. /***/ (function(module, exports, __webpack_require__) {
  10612. "use strict";
  10613. Object.defineProperty(exports, "__esModule", { value: true });
  10614. exports.Modes = void 0;
  10615. exports.Modes = Object.freeze({
  10616. RETURN: Symbol('mode:return'),
  10617. BREAK: Symbol('mode:break'),
  10618. PAUSE: Symbol('mode:pause'),
  10619. RUN: Symbol('mode:run'),
  10620. ABORT: Symbol('mode:abort')
  10621. });
  10622. /***/ }),
  10623. /***/ "./js/processor/semantic/semanticAnalyser.js":
  10624. /*!***************************************************!*\
  10625. !*** ./js/processor/semantic/semanticAnalyser.js ***!
  10626. \***************************************************/
  10627. /*! exports provided: SemanticAnalyser */
  10628. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10629. "use strict";
  10630. __webpack_require__.r(__webpack_exports__);
  10631. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticAnalyser", function() { return SemanticAnalyser; });
  10632. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  10633. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  10634. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  10635. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  10636. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10637. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../definedFunctions */ "./js/processor/definedFunctions.js");
  10638. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../services/languageService */ "./js/services/languageService.js");
  10639. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/commands */ "./js/ast/commands/index.js");
  10640. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  10641. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  10642. /* harmony import */ var _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ast/expressions/literal */ "./js/ast/expressions/literal.js");
  10643. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../compatibilityTable */ "./js/processor/compatibilityTable.ts");
  10644. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__);
  10645. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  10646. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__);
  10647. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  10648. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__);
  10649. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  10650. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__);
  10651. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
  10652. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_13__);
  10653. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../store/store */ "./js/processor/store/store.ts");
  10654. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_14__);
  10655. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  10656. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  10657. var SemanticAnalyser = /*#__PURE__*/function () {
  10658. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, null, [{
  10659. key: "analyseFromSource",
  10660. value: function analyseFromSource(stringCode) {
  10661. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__["IVProgParser"].createParser(stringCode);
  10662. var semantic = new SemanticAnalyser(parser.parseTree());
  10663. return semantic.analyseTree();
  10664. }
  10665. }]);
  10666. function SemanticAnalyser(ast) {
  10667. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticAnalyser);
  10668. this.ast = ast;
  10669. this.lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_4__["LanguageService"].getCurrentLexer();
  10670. var lexer = new this.lexerClass(null);
  10671. this.literalNames = lexer.literalNames;
  10672. this.symbolMap = null;
  10673. this.currentFunction = null;
  10674. }
  10675. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, [{
  10676. key: "pushMap",
  10677. value: function pushMap() {
  10678. if (this.symbolMap === null) {
  10679. this.symbolMap = {
  10680. map: {},
  10681. next: null
  10682. };
  10683. } else {
  10684. var n = {
  10685. map: {},
  10686. next: this.symbolMap
  10687. };
  10688. this.symbolMap = n;
  10689. }
  10690. }
  10691. }, {
  10692. key: "popMap",
  10693. value: function popMap() {
  10694. if (this.symbolMap !== null) {
  10695. this.symbolMap = this.symbolMap.next;
  10696. }
  10697. }
  10698. }, {
  10699. key: "insertSymbol",
  10700. value: function insertSymbol(id, typeInfo) {
  10701. this.symbolMap.map[id] = typeInfo;
  10702. }
  10703. }, {
  10704. key: "findSymbol",
  10705. value: function findSymbol(id, symbol_map) {
  10706. if (!symbol_map.map[id]) {
  10707. if (symbol_map.next) {
  10708. return this.findSymbol(id, symbol_map.next);
  10709. }
  10710. return null;
  10711. } else {
  10712. return symbol_map.map[id];
  10713. }
  10714. }
  10715. }, {
  10716. key: "getMainFunction",
  10717. value: function getMainFunction() {
  10718. return this.ast.functions.find(function (v) {
  10719. return v.isMain;
  10720. });
  10721. }
  10722. }, {
  10723. key: "findFunction",
  10724. value: function findFunction(name) {
  10725. if (name.match(/^\$.+$/)) {
  10726. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getFunction(name);
  10727. if (!fun) {
  10728. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].not_implemented(name);
  10729. }
  10730. return fun;
  10731. } else {
  10732. var val = this.ast.functions.find(function (v) {
  10733. return v.name === name;
  10734. });
  10735. if (!val) {
  10736. return null;
  10737. }
  10738. return val;
  10739. }
  10740. }
  10741. }, {
  10742. key: "analyseTree",
  10743. value: function analyseTree() {
  10744. var globalVars = this.ast.global;
  10745. this.pushMap();
  10746. this.assertDeclarations(globalVars);
  10747. var functions = this.ast.functions;
  10748. var mainFunc = functions.filter(function (f) {
  10749. return f.name === null;
  10750. });
  10751. if (mainFunc.length <= 0) {
  10752. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].main_missing();
  10753. }
  10754. for (var i = 0; i < functions.length; i++) {
  10755. var fun = functions[i];
  10756. this.assertFunction(fun);
  10757. }
  10758. return this.ast;
  10759. }
  10760. }, {
  10761. key: "assertDeclarations",
  10762. value: function assertDeclarations(list) {
  10763. for (var i = 0; i < list.length; i++) {
  10764. this.assertDeclaration(list[i]);
  10765. }
  10766. }
  10767. }, {
  10768. key: "assertDeclaration",
  10769. value: function assertDeclaration(declaration) {
  10770. if (declaration instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]) {
  10771. this.assertArrayDeclaration(declaration);
  10772. this.insertSymbol(declaration.id, {
  10773. id: declaration.id,
  10774. lines: declaration.lines,
  10775. columns: declaration.columns,
  10776. type: declaration.type,
  10777. isConst: declaration.isConst
  10778. });
  10779. } else {
  10780. if (declaration.initial === null) {
  10781. this.insertSymbol(declaration.id, {
  10782. id: declaration.id,
  10783. type: declaration.type,
  10784. isConst: declaration.isConst
  10785. });
  10786. return;
  10787. }
  10788. var resultType = this.evaluateExpressionType(declaration.initial);
  10789. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  10790. if (!resultType.isCompatible(declaration.type)) {
  10791. var stringInfo = declaration.type.stringInfo();
  10792. var info = stringInfo[0];
  10793. var result_string_info = resultType.stringInfo();
  10794. var result_info = result_string_info[0];
  10795. var exp = declaration.initial;
  10796. 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);
  10797. }
  10798. this.insertSymbol(declaration.id, {
  10799. id: declaration.id,
  10800. type: declaration.type,
  10801. isConst: declaration.isConst
  10802. });
  10803. } 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)) {
  10804. var _stringInfo = declaration.type.stringInfo();
  10805. var _info = _stringInfo[0];
  10806. var _result_string_info = resultType.stringInfo();
  10807. var _result_info = _result_string_info[0];
  10808. var _exp = declaration.initial;
  10809. 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);
  10810. } else {
  10811. this.insertSymbol(declaration.id, {
  10812. id: declaration.id,
  10813. type: declaration.type,
  10814. isConst: declaration.isConst
  10815. });
  10816. }
  10817. }
  10818. }
  10819. }, {
  10820. key: "assertArrayDeclaration",
  10821. value: function assertArrayDeclaration(declaration) {
  10822. if (declaration.initial === null) {
  10823. var lineType = this.evaluateExpressionType(declaration.lines);
  10824. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  10825. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  10826. }
  10827. if (declaration.columns !== null) {
  10828. var columnType = this.evaluateExpressionType(declaration.columns);
  10829. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  10830. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  10831. }
  10832. }
  10833. } else {
  10834. this.evaluateArrayLiteral(declaration);
  10835. }
  10836. this.insertSymbol(declaration.id, {
  10837. id: declaration.id,
  10838. lines: declaration.lines,
  10839. columns: declaration.columns,
  10840. type: declaration.type
  10841. });
  10842. return;
  10843. }
  10844. }, {
  10845. key: "evaluateExpressionType",
  10846. value: function evaluateExpressionType(expression) {
  10847. // TODO: Throw operator error in case type == UNDEFINED
  10848. if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["UnaryApp"]) {
  10849. var op = expression.op;
  10850. var resultType = this.evaluateExpressionType(expression.left);
  10851. var finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterUnaryOp"])(op, resultType);
  10852. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(finalResult)) {
  10853. var stringInfo = resultType.stringInfo();
  10854. var info = stringInfo[0];
  10855. var expString = expression.toString();
  10856. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_unary_op_full(expString, op, info.type, info.dim, expression.sourceInfo);
  10857. }
  10858. return finalResult;
  10859. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["InfixApp"]) {
  10860. var _op = expression.op;
  10861. var resultTypeLeft = this.evaluateExpressionType(expression.left);
  10862. var resultTypeRight = this.evaluateExpressionType(expression.right);
  10863. var _finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterInfixOp"])(_op, resultTypeLeft, resultTypeRight);
  10864. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(_finalResult)) {
  10865. var stringInfoLeft = resultTypeLeft.stringInfo();
  10866. var infoLeft = stringInfoLeft[0];
  10867. var stringInfoRight = resultTypeRight.stringInfo();
  10868. var infoRight = stringInfoRight[0];
  10869. var _expString = expression.toString();
  10870. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_infix_op_full(_expString, _op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, expression.sourceInfo);
  10871. }
  10872. return _finalResult;
  10873. } else if (expression instanceof _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__["Literal"]) {
  10874. return this.evaluateLiteralType(expression);
  10875. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  10876. if (expression.isMainCall) {
  10877. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName(), expression.sourceInfo);
  10878. }
  10879. var fun = this.findFunction(expression.id);
  10880. if (fun === null) {
  10881. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(expression.id, expression.sourceInfo);
  10882. }
  10883. if (fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  10884. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(expression.id, expression.sourceInfo);
  10885. }
  10886. this.assertParameters(fun, expression.actualParameters);
  10887. return fun.returnType;
  10888. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"]) {
  10889. var arrayTypeInfo = this.findSymbol(expression.id, this.symbolMap);
  10890. if (arrayTypeInfo === null) {
  10891. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(expression.id, expression.sourceInfo);
  10892. }
  10893. if (!(arrayTypeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  10894. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(expression.id, expression.sourceInfo);
  10895. }
  10896. var lineType = this.evaluateExpressionType(expression.line);
  10897. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  10898. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  10899. }
  10900. if (expression.column !== null) {
  10901. if (arrayTypeInfo.columns === null) {
  10902. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(expression.id, expression.sourceInfo);
  10903. }
  10904. var columnType = this.evaluateExpressionType(expression.column);
  10905. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  10906. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  10907. }
  10908. }
  10909. var arrType = arrayTypeInfo.type;
  10910. if (expression.column !== null) {
  10911. // indexing matrix
  10912. return arrType.innerType;
  10913. } else {
  10914. if (arrayTypeInfo.columns === null) {
  10915. return arrType.innerType;
  10916. }
  10917. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](arrType.innerType, 1);
  10918. }
  10919. }
  10920. }
  10921. }, {
  10922. key: "evaluateLiteralType",
  10923. value: function evaluateLiteralType(literal) {
  10924. if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["IntLiteral"]) {
  10925. return literal.type;
  10926. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["RealLiteral"]) {
  10927. return literal.type;
  10928. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["StringLiteral"]) {
  10929. return literal.type;
  10930. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["BoolLiteral"]) {
  10931. return literal.type;
  10932. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["CharLiteral"]) {
  10933. return literal.type;
  10934. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  10935. var typeInfo = this.findSymbol(literal.id, this.symbolMap);
  10936. if (typeInfo === null) {
  10937. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(literal.id, literal.sourceInfo);
  10938. }
  10939. if (typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  10940. return typeInfo.type;
  10941. }
  10942. return typeInfo.type;
  10943. } else {
  10944. // console.warn("Evaluating type only for an array literal...");
  10945. var last = null;
  10946. if (literal.value.length === 1) {
  10947. last = this.evaluateExpressionType(literal.value[0]);
  10948. } else {
  10949. for (var i = 0; i < literal.value.length; i++) {
  10950. var e = this.evaluateExpressionType(literal.value[i]);
  10951. if (last === null) {
  10952. last = e;
  10953. } else if (!last.isCompatible(e)) {
  10954. var strInfo = last.stringInfo();
  10955. var info = strInfo[0];
  10956. var strExp = literal.toString();
  10957. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_array_full(strExp, info.type, info.dim, literal.sourceInfo);
  10958. }
  10959. }
  10960. }
  10961. if (last instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  10962. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last.innerType, last.dimensions + 1);
  10963. }
  10964. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last, 1);
  10965. }
  10966. }
  10967. }, {
  10968. key: "evaluateArrayLiteral",
  10969. value: function evaluateArrayLiteral(arrayDeclaration) {
  10970. var type = arrayDeclaration.type;
  10971. var literal = arrayDeclaration.initial; // console.log(arrayDeclaration);
  10972. if (arrayDeclaration.isVector) {
  10973. this.evaluateVectorLiteralType(literal, type);
  10974. } else {
  10975. // TODO matrix type check
  10976. for (var i = 0; i < literal.lines; ++i) {
  10977. var line_literal = literal.value[i];
  10978. this.evaluateVectorLiteralType(line_literal, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](type.innerType, 1));
  10979. }
  10980. }
  10981. return true;
  10982. }
  10983. }, {
  10984. key: "assertFunction",
  10985. value: function assertFunction(fun) {
  10986. var _this = this;
  10987. this.pushMap();
  10988. this.currentFunction = fun;
  10989. fun.formalParameters.forEach(function (formalParam) {
  10990. if (formalParam.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  10991. if (formalParam.type.dimensions > 1) {
  10992. _this.insertSymbol(formalParam.id, {
  10993. id: formalParam.id,
  10994. lines: -1,
  10995. columns: -1,
  10996. type: formalParam.type
  10997. });
  10998. } else {
  10999. _this.insertSymbol(formalParam.id, {
  11000. id: formalParam.id,
  11001. lines: -1,
  11002. columns: null,
  11003. type: formalParam.type
  11004. });
  11005. }
  11006. } else {
  11007. _this.insertSymbol(formalParam.id, {
  11008. id: formalParam.id,
  11009. type: formalParam.type
  11010. });
  11011. }
  11012. });
  11013. this.assertDeclarations(fun.variablesDeclarations);
  11014. var optional = fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID);
  11015. var valid = this.assertReturn(fun, optional);
  11016. if (!valid) {
  11017. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_no_return(fun.name);
  11018. }
  11019. this.popMap();
  11020. }
  11021. }, {
  11022. key: "assertReturn",
  11023. value: function assertReturn(fun, optional) {
  11024. var _this2 = this;
  11025. return fun.commands.reduce(function (last, next) {
  11026. return _this2.checkCommand(fun.returnType, next, optional) || last;
  11027. }, optional);
  11028. }
  11029. }, {
  11030. key: "checkCommand",
  11031. value: function checkCommand(type, cmd, optional) {
  11032. if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["While"]) {
  11033. var resultType = this.evaluateExpressionType(cmd.expression);
  11034. if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11035. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  11036. }
  11037. this.checkCommands(type, cmd.commands, optional);
  11038. return false;
  11039. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["For"]) {
  11040. var var_type = this.evaluateExpressionType(cmd.for_id);
  11041. if (!var_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11042. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_variable(cmd.for_id, cmd.sourceInfo);
  11043. }
  11044. var from_type = this.evaluateExpressionType(cmd.for_from);
  11045. if (!from_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11046. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_from(cmd.for_from, cmd.sourceInfo);
  11047. }
  11048. var to_type = this.evaluateExpressionType(cmd.for_to);
  11049. if (!to_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11050. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_to(cmd.for_to, cmd.sourceInfo);
  11051. }
  11052. if (cmd.for_pass != null) {
  11053. var pass_type = this.evaluateExpressionType(cmd.for_pass);
  11054. if (!pass_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11055. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_pass(cmd.for_pass, cmd.sourceInfo);
  11056. }
  11057. }
  11058. this.checkCommands(type, cmd.commands, optional);
  11059. return false;
  11060. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Switch"]) {
  11061. var sType = this.evaluateExpressionType(cmd.expression);
  11062. var result = optional;
  11063. var hasDefault = false;
  11064. for (var i = 0; i < cmd.cases.length; i++) {
  11065. var aCase = cmd.cases[i];
  11066. if (aCase.expression !== null) {
  11067. var caseType = this.evaluateExpressionType(aCase.expression);
  11068. if (!sType.isCompatible(caseType)) {
  11069. var strInfo = sType.stringInfo();
  11070. var info = strInfo[0];
  11071. var strExp = aCase.expression.toString();
  11072. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_case_type_full(strExp, info.type, info.dim, aCase.sourceInfo);
  11073. }
  11074. } else {
  11075. hasDefault = true;
  11076. }
  11077. result = result && this.checkCommands(type, aCase.commands, result);
  11078. }
  11079. return result && hasDefault;
  11080. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayIndexAssign"]) {
  11081. // TODO - rework!!!!!
  11082. var used_dims = 0;
  11083. var typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11084. if (typeInfo === null) {
  11085. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11086. }
  11087. if (typeInfo.isConst) {
  11088. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11089. }
  11090. if (!(typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11091. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  11092. }
  11093. var exp = cmd.expression;
  11094. var lineExp = cmd.line;
  11095. var lineType = this.evaluateExpressionType(lineExp);
  11096. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11097. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11098. }
  11099. used_dims += 1;
  11100. var columnExp = cmd.column;
  11101. if (typeInfo.columns === null && columnExp !== null) {
  11102. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(cmd.id, cmd.sourceInfo);
  11103. } else if (columnExp !== null) {
  11104. var columnType = this.evaluateExpressionType(columnExp);
  11105. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11106. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11107. }
  11108. used_dims += 1;
  11109. } // exp a single value exp or an array access
  11110. var exp_type = this.evaluateExpressionType(exp);
  11111. var access_type = typeInfo.type;
  11112. var compatible = false;
  11113. if (exp_type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11114. var _type = access_type;
  11115. if (access_type.dimensions - used_dims == 0) {
  11116. _type = access_type.innerType;
  11117. } else {
  11118. _type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](access_type.innerType, Math.max(0, access_type.dimensions - used_dims));
  11119. }
  11120. compatible = exp_type.isCompatible(_type);
  11121. } else {
  11122. compatible = access_type.canAccept(exp_type, used_dims);
  11123. }
  11124. if (!compatible) {
  11125. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(access_type, exp_type)) {
  11126. var access_type_string_info = access_type.stringInfo();
  11127. var access_type_info = access_type_string_info[0];
  11128. var exp_type_string_info = exp_type.stringInfo();
  11129. var exp_type_info = exp_type_string_info[0];
  11130. 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);
  11131. }
  11132. }
  11133. return optional;
  11134. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Assign"]) {
  11135. // TODO - rework since there is no literal array assignment
  11136. var _typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11137. if (_typeInfo === null) {
  11138. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11139. }
  11140. if (_typeInfo.isConst) {
  11141. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11142. }
  11143. var _exp2 = cmd.expression;
  11144. var _exp_type = this.evaluateExpressionType(_exp2);
  11145. if (_exp_type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11146. if (!(_typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11147. // TODO better error message
  11148. throw new Error("Cannot assign an array to a non-array variable ");
  11149. } // Both are arrays...
  11150. // if both don't have same dimensions and type, cannot perform assignment
  11151. if (!_exp_type.isCompatible(_typeInfo.type)) {
  11152. if (_exp_type.dimensions === _typeInfo.type.dimensions && !_exp_type.innerType.isCompatible(_typeInfo.type.innerType)) {
  11153. 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)) {
  11154. var stringInfo = _typeInfo.type.stringInfo();
  11155. var _info2 = stringInfo[0];
  11156. var _exp_type_string_info = _exp_type.stringInfo();
  11157. var _exp_type_info = _exp_type_string_info[0];
  11158. 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);
  11159. }
  11160. } else {
  11161. switch (_exp_type.dimensions) {
  11162. case 1:
  11163. {
  11164. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].vector_to_matrix_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11165. }
  11166. case 2:
  11167. {
  11168. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].matrix_to_vector_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11169. }
  11170. }
  11171. }
  11172. }
  11173. } else if (!_exp_type.isCompatible(_typeInfo.type)) {
  11174. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(_typeInfo.type, _exp_type)) {
  11175. var _stringInfo2 = _typeInfo.type.stringInfo();
  11176. var _info3 = _stringInfo2[0];
  11177. var _exp_type_string_info2 = _exp_type.stringInfo();
  11178. var _exp_type_info2 = _exp_type_string_info2[0];
  11179. 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);
  11180. }
  11181. }
  11182. return optional;
  11183. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Break"]) {
  11184. return optional;
  11185. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11186. var _resultType = this.evaluateExpressionType(cmd.condition);
  11187. if (!_resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11188. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  11189. }
  11190. if (cmd.ifFalse instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11191. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommand(type, cmd.ifFalse, optional);
  11192. } else if (cmd.ifFalse != null) {
  11193. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommands(type, cmd.ifFalse.commands, optional);
  11194. } else {
  11195. return this.checkCommands(type, cmd.ifTrue.commands, optional);
  11196. }
  11197. } else if (cmd instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  11198. var fun = null;
  11199. if (cmd.isMainCall) {
  11200. fun = this.getMainFunction();
  11201. } else {
  11202. fun = this.findFunction(cmd.id);
  11203. }
  11204. if (fun === null) {
  11205. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(cmd.id, cmd.sourceInfo);
  11206. }
  11207. this.assertParameters(fun, cmd.actualParameters);
  11208. return optional;
  11209. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Return"]) {
  11210. var funcName = this.currentFunction.isMain ? _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName() : this.currentFunction.name;
  11211. if (cmd.expression === null && !type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  11212. var _stringInfo3 = type.stringInfo();
  11213. var _info4 = _stringInfo3[0];
  11214. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_void_return_full(funcName, _info4.type, _info4.dim, cmd.sourceInfo);
  11215. } else if (cmd.expression !== null) {
  11216. var _resultType2 = this.evaluateExpressionType(cmd.expression);
  11217. if (!type.isCompatible(_resultType2)) {
  11218. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type, _resultType2)) {
  11219. var _stringInfo4 = type.stringInfo();
  11220. var _info5 = _stringInfo4[0];
  11221. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_return_type_full(funcName, _info5.type, _info5.dim, cmd.sourceInfo);
  11222. }
  11223. }
  11224. return true;
  11225. } else {
  11226. return true;
  11227. }
  11228. }
  11229. }
  11230. }, {
  11231. key: "checkCommands",
  11232. value: function checkCommands(type, cmds, optional) {
  11233. var _this3 = this;
  11234. return cmds.reduce(function (last, next) {
  11235. return _this3.checkCommand(type, next, optional) || last;
  11236. }, optional);
  11237. }
  11238. /**
  11239. *
  11240. * @param {import('./../../ast/commands/function').Function} fun
  11241. * @param {Expression[]} actualParametersList
  11242. */
  11243. }, {
  11244. key: "assertParameters",
  11245. value: function assertParameters(fun, actualParametersList) {
  11246. var parameterList = fun.formalParameters;
  11247. if (parameterList.length > actualParametersList.length || parameterList.length !== actualParametersList.length && !fun.hasVariadic()) {
  11248. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameters_size_full(fun.name, actualParametersList.length, fun.formalParameters.length, null);
  11249. }
  11250. for (var i = 0, j = 0; i < parameterList.length && j < actualParametersList.length; i += 1, j += 1) {
  11251. var formalParam = parameterList[i];
  11252. if (formalParam.variadic && i + 1 !== parameterList.length) {
  11253. throw "A function variadic parameter must be its last parameter!";
  11254. }
  11255. if (formalParam.variadic) {
  11256. j = this.assertVariadicParameter(fun, formalParam, j, actualParametersList);
  11257. } else {
  11258. var param = actualParametersList[j];
  11259. this.assertParameter(fun, formalParam, param);
  11260. }
  11261. }
  11262. }
  11263. }, {
  11264. key: "evaluateVectorLiteralType",
  11265. value: function evaluateVectorLiteralType(literal, type) {
  11266. // console.log(literal);
  11267. for (var i = 0; i < literal.value.length; i += 1) {
  11268. var exp = literal.value[i];
  11269. var expType = this.evaluateExpressionType(exp);
  11270. var compatible = false;
  11271. if (expType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11272. compatible = expType.isCompatible(type.innerType);
  11273. } else {
  11274. compatible = type.canAccept(expType, 1);
  11275. }
  11276. if (!compatible) {
  11277. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type.innerType, expType)) {
  11278. var stringInfo = type.stringInfo();
  11279. var info = stringInfo[0];
  11280. var result_string_info = expType.stringInfo();
  11281. var result_info = result_string_info[0];
  11282. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(info.type, 0, result_info.type, result_info.dim, exp.toString(), literal.sourceInfo);
  11283. }
  11284. }
  11285. }
  11286. return type;
  11287. }
  11288. /**
  11289. *
  11290. * @param {import('./../../ast/commands/function').Function} fun
  11291. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11292. * @param {number} index
  11293. * @param {Expression[]} actualParametersList
  11294. */
  11295. }, {
  11296. key: "assertVariadicParameter",
  11297. value: function assertVariadicParameter(fun, formalParam, index, actualParametersList) {
  11298. var i;
  11299. for (i = index; i < actualParametersList.length; i += 1) {
  11300. this.assertParameter(fun, formalParam, actualParametersList[i]);
  11301. }
  11302. return i - 1;
  11303. }
  11304. /**
  11305. *
  11306. * @param {import('./../../ast/commands/function').Function} fun
  11307. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11308. * @param {Expression} actualParameter
  11309. */
  11310. }, {
  11311. key: "assertParameter",
  11312. value: function assertParameter(fun, formalParam, actualParameter) {
  11313. // const id = formalParam.id;
  11314. if (formalParam.byRef) {
  11315. if (actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  11316. var variable = this.findSymbol(actualParameter.id, this.symbolMap);
  11317. if (variable.isConst) {
  11318. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_ref_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11319. }
  11320. } else if (!(actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"] || actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"])) {
  11321. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11322. }
  11323. }
  11324. var resultType = this.evaluateExpressionType(actualParameter);
  11325. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"] && formalParam.type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11326. var shared = 0;
  11327. for (var j = 0; j < resultType.types.length; ++j) {
  11328. var element = resultType.types[j];
  11329. if (formalParam.type.types.indexOf(element) !== -1) {
  11330. shared += 1;
  11331. }
  11332. }
  11333. if (shared <= 0) {
  11334. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11335. 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)) {
  11336. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11337. }
  11338. }
  11339. }
  11340. } else if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11341. if (!resultType.isCompatible(formalParam.type)) {
  11342. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11343. 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)) {
  11344. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11345. }
  11346. }
  11347. }
  11348. } else if (!formalParam.type.isCompatible(resultType)) {
  11349. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11350. if (!_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(formalParam.type, resultType)) {
  11351. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11352. }
  11353. }
  11354. }
  11355. }
  11356. }]);
  11357. return SemanticAnalyser;
  11358. }();
  11359. /***/ }),
  11360. /***/ "./js/processor/store/store.ts":
  11361. /*!*************************************!*\
  11362. !*** ./js/processor/store/store.ts ***!
  11363. \*************************************/
  11364. /*! no static exports found */
  11365. /***/ (function(module, exports, __webpack_require__) {
  11366. "use strict";
  11367. Object.defineProperty(exports, "__esModule", { value: true });
  11368. exports.Store = void 0;
  11369. /* eslint-disable @typescript-eslint/no-non-null-assertion */
  11370. const modes_1 = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  11371. const types_1 = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  11372. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  11373. const storeObjectRef_1 = __webpack_require__(/*! ./storeObjectRef */ "./js/processor/store/storeObjectRef.ts");
  11374. const array_type_1 = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11375. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  11376. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  11377. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  11378. const store_value_1 = __webpack_require__(/*! ./value/store_value */ "./js/processor/store/value/store_value.ts");
  11379. const store_value_address_1 = __webpack_require__(/*! ./value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
  11380. const store_value_ref_1 = __webpack_require__(/*! ./value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
  11381. const array_store_value_ref_1 = __webpack_require__(/*! ./value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
  11382. const store_object_array_ref_1 = __webpack_require__(/*! ./store_object_array_ref */ "./js/processor/store/store_object_array_ref.ts");
  11383. class Store {
  11384. constructor(name) {
  11385. this.name = name;
  11386. this.store = new Map();
  11387. this.mode = modes_1.Modes.RUN;
  11388. }
  11389. static canImplicitTypeCast(castType, sourceType) {
  11390. if (castType.isCompatible(types_1.Types.INTEGER) || castType.isCompatible(types_1.Types.REAL)) {
  11391. if (sourceType.isCompatible(types_1.Types.INTEGER) || sourceType.isCompatible(types_1.Types.REAL)) {
  11392. return true;
  11393. }
  11394. }
  11395. return false;
  11396. }
  11397. static doImplicitCasting(castType, stoObj) {
  11398. if (!Store.canImplicitTypeCast(castType, stoObj.type)) {
  11399. throw new Error("!!!Critical error: attempted to type cast invalid types");
  11400. }
  11401. if (castType.isCompatible(types_1.Types.INTEGER)) {
  11402. return new store_value_1.StoreValue(types_1.Types.INTEGER, stoObj.get().trunc());
  11403. }
  11404. else {
  11405. return new store_value_1.StoreValue(types_1.Types.REAL, stoObj.get());
  11406. }
  11407. }
  11408. extendStore(nextStore) {
  11409. this.nextStore = nextStore;
  11410. }
  11411. applyStore(id) {
  11412. if (!this.store.has(id)) {
  11413. if (this.nextStore != null) {
  11414. return this.nextStore.applyStore(id);
  11415. }
  11416. else {
  11417. throw new Error(`Variable ${id} not found.`);
  11418. }
  11419. }
  11420. const val = this.store.get(id);
  11421. let result = null;
  11422. if (val.type instanceof array_type_1.ArrayType) {
  11423. const array = val;
  11424. const array_type = array.type;
  11425. let l = 0, c = 0;
  11426. const values = array.value.map(v => {
  11427. if (array.isVector) {
  11428. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l++, undefined, array.id, array.readOnly);
  11429. }
  11430. else {
  11431. if (c >= array.columns) {
  11432. c = 0;
  11433. l += 1;
  11434. }
  11435. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l, c++, array.id, array.readOnly);
  11436. }
  11437. });
  11438. result = new array_store_value_1.ArrayStoreValue(array_type, values, array.lines, array.columns, val.id, val.readOnly);
  11439. }
  11440. else {
  11441. result = new store_value_1.StoreValue(val.type, val.value, val.id, val.readOnly);
  11442. }
  11443. return result;
  11444. }
  11445. updateStore(id, stoValue) {
  11446. if (!this.store.has(id)) {
  11447. if (this.nextStore != null) {
  11448. this.nextStore.updateStore(id, stoValue);
  11449. return this;
  11450. }
  11451. else {
  11452. // TODO: better error message
  11453. throw new Error(`Variable ${id} not found.`);
  11454. }
  11455. }
  11456. else {
  11457. const oldObj = this.store.get(id);
  11458. if (oldObj.readOnly) {
  11459. // TODO: better error message
  11460. throw new Error("Cannot change value of a read only variable: " + id);
  11461. }
  11462. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  11463. const array_value = stoValue;
  11464. if (oldObj.isCompatible(array_value)) {
  11465. if (oldObj.isVector) {
  11466. array_value.get().forEach((val, index) => {
  11467. oldObj.setAt(val, index, undefined);
  11468. });
  11469. }
  11470. else {
  11471. let line = 0;
  11472. let column = 0;
  11473. array_value.get().forEach((val) => {
  11474. oldObj.setAt(val, line, column);
  11475. column += 1;
  11476. if (column >= oldObj.columns) {
  11477. line += 1;
  11478. column = 0;
  11479. }
  11480. });
  11481. }
  11482. return this;
  11483. }
  11484. }
  11485. else if (oldObj.isCompatible(stoValue)) {
  11486. const loc_address = oldObj.locAddress;
  11487. location_1.Location.updateAddress(loc_address, stoValue.get());
  11488. return this;
  11489. }
  11490. const oldType = oldObj.type;
  11491. const stoType = stoValue.type;
  11492. // TODO: better error message
  11493. throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  11494. }
  11495. }
  11496. /**
  11497. * Method used to update regions of an array (vector or matrix). The should only be used when update an specific
  11498. * possition since it will only update the required addresses.
  11499. * @param {string} id the variable id to be updated
  11500. * @param {IStoreValue} sto_value the value to be used in the update process
  11501. * @param {number} line the line address of the vector/matrix
  11502. * @param {number} column the matrix column, which can be undefined
  11503. */
  11504. updateStoreArray(id, sto_value, line, column) {
  11505. if (!this.store.has(id)) {
  11506. if (this.nextStore != null) {
  11507. this.nextStore.updateStoreArray(id, sto_value, line, column);
  11508. return this;
  11509. }
  11510. else {
  11511. // TODO: better error message
  11512. throw new Error(`Variable ${id} not found.`);
  11513. }
  11514. }
  11515. else {
  11516. const oldObj = this.store.get(id);
  11517. if (oldObj.readOnly) {
  11518. // TODO: better error message
  11519. throw new Error("Cannot change value of a read only variable: " + id);
  11520. }
  11521. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  11522. if (sto_value instanceof array_store_value_1.ArrayStoreValue) {
  11523. // this must be a vector or matrix line update
  11524. const actual_values = sto_value.get();
  11525. if (oldObj.isVector && sto_value.isVector()) {
  11526. for (let i = 0; i < sto_value.lines; i += 1) {
  11527. const val = actual_values[i];
  11528. oldObj.setAt(val, i, undefined);
  11529. }
  11530. }
  11531. else if (!oldObj.isVector && column == null && sto_value.isVector()) {
  11532. for (let i = 0; i < oldObj.columns; i += 1) {
  11533. const val = actual_values[i];
  11534. oldObj.setAt(val, line, i);
  11535. }
  11536. }
  11537. else {
  11538. // TODO: better error message
  11539. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  11540. }
  11541. }
  11542. else {
  11543. if (!oldObj.isVector && column == null) {
  11544. // TODO: better error message
  11545. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  11546. }
  11547. oldObj.setAt(sto_value, line, column);
  11548. }
  11549. }
  11550. else {
  11551. throw new Error("Cannot update a non-array variable using updateStoreArray");
  11552. }
  11553. // const oldType = oldObj.type;
  11554. // const stoType = sto_value.type;
  11555. // // TODO: better error message
  11556. // throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  11557. return this;
  11558. }
  11559. }
  11560. /**
  11561. * Inserts a new variable into the Store. This method should be used when declaring a new variable,
  11562. * including the special return variable $.
  11563. * @param id variable id
  11564. * @param stoValue the value to be used as the initial value of id
  11565. */
  11566. insertStore(id, stoValue) {
  11567. if (this.store.has(id)) {
  11568. // TODO: better error message
  11569. throw new Error(`${id} is already defined`);
  11570. }
  11571. // TODO check for array....
  11572. let newObj;
  11573. if (stoValue instanceof store_value_ref_1.StoreValueRef) {
  11574. newObj = new storeObjectRef_1.StoreObjectRef(stoValue);
  11575. }
  11576. else if (stoValue instanceof array_store_value_ref_1.ArrayStoreValueRef) {
  11577. newObj = new store_object_array_ref_1.StoreObjectArrayRef(stoValue, stoValue.lines, stoValue.columns);
  11578. }
  11579. else if (stoValue instanceof array_store_value_1.ArrayStoreValue) {
  11580. const columns = stoValue.isVector() ? 0 : stoValue.columns;
  11581. const addresses = [];
  11582. const all_values = stoValue.get();
  11583. if (all_values.length > 0) {
  11584. for (let i = 0; i < stoValue.get().length; i += 1) {
  11585. const val = all_values[i].get();
  11586. addresses.push(location_1.Location.allocate(val));
  11587. }
  11588. }
  11589. else {
  11590. let total = stoValue.lines;
  11591. total = stoValue.isVector() ? total : total * columns;
  11592. for (let i = 0; i < total; i += 1) {
  11593. addresses.push(location_1.Location.allocate(null));
  11594. }
  11595. }
  11596. newObj = new storeObjectArray_1.StoreObjectArray(stoValue.type, stoValue.lines, columns, addresses, stoValue.isConst);
  11597. }
  11598. else {
  11599. const loc_address = location_1.Location.allocate(stoValue.get());
  11600. newObj = new storeObject_1.StoreObject(stoValue.type, loc_address, stoValue.isConst);
  11601. }
  11602. newObj.setID(id);
  11603. this.store.set(id, newObj);
  11604. return this;
  11605. }
  11606. /**
  11607. * Helper function similar to applyStore. But it returns the actual object in the store be it ref or not
  11608. * applyStore will return the refferenced object if the object in the store is a ref
  11609. */
  11610. getStoreObject(id) {
  11611. if (!this.store.has(id)) {
  11612. if (this.nextStore != null) {
  11613. return this.nextStore.getStoreObject(id);
  11614. }
  11615. else {
  11616. throw new Error(`Variable ${id} not found.`);
  11617. }
  11618. }
  11619. return this.store.get(id);
  11620. }
  11621. destroy() {
  11622. this.store.forEach(sto => sto.destroy(), this);
  11623. }
  11624. isDefined(id) {
  11625. if (!this.store.has(id)) {
  11626. if (this.nextStore != null) {
  11627. return this.nextStore.isDefined(id);
  11628. }
  11629. else {
  11630. return false;
  11631. }
  11632. }
  11633. return true;
  11634. }
  11635. }
  11636. exports.Store = Store;
  11637. /***/ }),
  11638. /***/ "./js/processor/store/storeObject.ts":
  11639. /*!*******************************************!*\
  11640. !*** ./js/processor/store/storeObject.ts ***!
  11641. \*******************************************/
  11642. /*! no static exports found */
  11643. /***/ (function(module, exports, __webpack_require__) {
  11644. "use strict";
  11645. Object.defineProperty(exports, "__esModule", { value: true });
  11646. exports.StoreObject = void 0;
  11647. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  11648. class StoreObject {
  11649. /**
  11650. *
  11651. * @param {Type} type
  11652. * @param {Number} loc_address
  11653. * @param {Boolean} readOnly
  11654. */
  11655. constructor(type, loc_address, readOnly = false) {
  11656. this._loc_address = loc_address;
  11657. this._type = type;
  11658. this._readOnly = readOnly;
  11659. this._id = undefined;
  11660. }
  11661. setID(id) {
  11662. this._id = id;
  11663. }
  11664. get id() {
  11665. return this._id;
  11666. }
  11667. get inStore() {
  11668. return this.id !== null;
  11669. }
  11670. get type() {
  11671. return this._type;
  11672. }
  11673. /**
  11674. * Returns the actual value stored at the loccation address present in this object.
  11675. * The returned value is compatible with @prop{StoreObject.type}
  11676. */
  11677. get value() {
  11678. const address = location_1.Location.find(this._loc_address);
  11679. if (address != null) {
  11680. return address.value;
  11681. }
  11682. else {
  11683. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  11684. }
  11685. }
  11686. get number() {
  11687. throw new Error("DOT NOT USE THIS PROPERTY!");
  11688. }
  11689. get readOnly() {
  11690. return this._readOnly;
  11691. }
  11692. set readOnly(value) {
  11693. this._readOnly = value;
  11694. }
  11695. isCompatible(another) {
  11696. return this.type.isCompatible(another.type);
  11697. }
  11698. destroy() {
  11699. return location_1.Location.deallocate(this._loc_address);
  11700. }
  11701. get locAddress() {
  11702. return this._loc_address;
  11703. }
  11704. }
  11705. exports.StoreObject = StoreObject;
  11706. /***/ }),
  11707. /***/ "./js/processor/store/storeObjectArray.ts":
  11708. /*!************************************************!*\
  11709. !*** ./js/processor/store/storeObjectArray.ts ***!
  11710. \************************************************/
  11711. /*! no static exports found */
  11712. /***/ (function(module, exports, __webpack_require__) {
  11713. "use strict";
  11714. Object.defineProperty(exports, "__esModule", { value: true });
  11715. exports.StoreObjectArray = void 0;
  11716. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  11717. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  11718. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  11719. class StoreObjectArray extends storeObject_1.StoreObject {
  11720. constructor(type, _lines, _columns, loc_addresses, readOnly = false) {
  11721. super(type, -1, readOnly);
  11722. this._lines = _lines;
  11723. this._columns = _columns;
  11724. this.loc_addresses = loc_addresses;
  11725. }
  11726. get lines() {
  11727. return this._lines;
  11728. }
  11729. get columns() {
  11730. return this._columns;
  11731. }
  11732. isCompatible(another) {
  11733. if (another instanceof array_store_value_1.ArrayStoreValue) {
  11734. const cols = another.columns == null ? 0 : another.columns;
  11735. if (this.lines === another.lines && this.columns === cols) {
  11736. return super.isCompatible(another);
  11737. }
  11738. }
  11739. return false;
  11740. }
  11741. get isVector() {
  11742. return this.type.dimensions === 1;
  11743. }
  11744. /**@override
  11745. * Returns the list of values stored by this array.
  11746. * All returned values are compatible with @prop{StoreObject.type}
  11747. */
  11748. get value() {
  11749. const values = [];
  11750. for (let i = 0; i < this.addresses.length; i += 1) {
  11751. const address = location_1.Location.find(this.addresses[i]);
  11752. if (address != null) {
  11753. values.push(address.value);
  11754. }
  11755. else {
  11756. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  11757. }
  11758. }
  11759. return values;
  11760. }
  11761. destroy() {
  11762. let bool = true;
  11763. for (let i = 0; i < this.addresses.length; i += 1) {
  11764. bool = bool && location_1.Location.deallocate(this.addresses[i]);
  11765. }
  11766. return bool;
  11767. }
  11768. /**
  11769. * @override
  11770. *
  11771. * Returns the address that contains a list of all addresses of the values present in the array
  11772. */
  11773. get locAddress() {
  11774. throw new Error("!!!Internal Error: Cannot invoke locAddress on StoreObjectArray");
  11775. }
  11776. get addresses() {
  11777. return this.loc_addresses;
  11778. }
  11779. getAt(line, column) {
  11780. if (this.isVector) {
  11781. if (column != null) {
  11782. throw new Error(this.id + " is not a matrix!");
  11783. }
  11784. column = line;
  11785. line = 0;
  11786. }
  11787. else if (column == null) {
  11788. // this is a whole line...
  11789. const values = [];
  11790. for (let col = 0; col < this.columns; col += 1) {
  11791. const index = this.getIndexOf(line, col);
  11792. const address = location_1.Location.find(this.addresses[index]);
  11793. values.push(address.value);
  11794. }
  11795. return values;
  11796. }
  11797. const index = this.getIndexOf(line, column);
  11798. const address = location_1.Location.find(this.addresses[index]);
  11799. return address.value;
  11800. }
  11801. setAt(value, line, column) {
  11802. let used_dims = 1;
  11803. if (column != null) {
  11804. used_dims += 1;
  11805. }
  11806. if (!this.type.canAccept(value.type, used_dims)) {
  11807. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  11808. }
  11809. if (this.isVector) {
  11810. if (column != null) {
  11811. throw new Error(this.id + " is not a matrix!");
  11812. }
  11813. column = line;
  11814. line = 0;
  11815. }
  11816. else if (column == null) {
  11817. throw new Error("!!!Internal Error: Attempting to insert a line into matrix " + this.id);
  11818. }
  11819. const pos = this.getIndexOf(line, column);
  11820. location_1.Location.updateAddress(this.addresses[pos], value.get());
  11821. }
  11822. getIndexOf(line, column) {
  11823. return line * this.columns + column;
  11824. }
  11825. getLocAddressOf(line, column) {
  11826. if (this.isVector) {
  11827. if (column != null) {
  11828. throw new Error(this.id + " is not a matrix!");
  11829. }
  11830. column = line;
  11831. line = 0;
  11832. }
  11833. else if (column == null) {
  11834. // this is a whole line...
  11835. const values = [];
  11836. for (let col = 0; col < this.columns; col += 1) {
  11837. const index = this.getIndexOf(line, col);
  11838. values.push(this.addresses[index]);
  11839. }
  11840. return values;
  11841. }
  11842. const index = this.getIndexOf(line, column);
  11843. return this.addresses[index];
  11844. }
  11845. }
  11846. exports.StoreObjectArray = StoreObjectArray;
  11847. /***/ }),
  11848. /***/ "./js/processor/store/storeObjectRef.ts":
  11849. /*!**********************************************!*\
  11850. !*** ./js/processor/store/storeObjectRef.ts ***!
  11851. \**********************************************/
  11852. /*! no static exports found */
  11853. /***/ (function(module, exports, __webpack_require__) {
  11854. "use strict";
  11855. Object.defineProperty(exports, "__esModule", { value: true });
  11856. exports.StoreObjectRef = void 0;
  11857. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  11858. class StoreObjectRef extends storeObject_1.StoreObject {
  11859. /**
  11860. *
  11861. * @param {StoreObject} stoValue
  11862. */
  11863. constructor(stoValue) {
  11864. super(stoValue.type, stoValue.getRefAddress(), false);
  11865. this.refObj = stoValue.id;
  11866. this.reference_dimension = stoValue.getReferenceDimension();
  11867. }
  11868. get isRef() {
  11869. return true;
  11870. }
  11871. getRefObj() {
  11872. return this.refObj;
  11873. }
  11874. getReferenceDimension() {
  11875. return this.reference_dimension;
  11876. }
  11877. destroy() {
  11878. return false;
  11879. }
  11880. }
  11881. exports.StoreObjectRef = StoreObjectRef;
  11882. /***/ }),
  11883. /***/ "./js/processor/store/store_object_array_ref.ts":
  11884. /*!******************************************************!*\
  11885. !*** ./js/processor/store/store_object_array_ref.ts ***!
  11886. \******************************************************/
  11887. /*! no static exports found */
  11888. /***/ (function(module, exports, __webpack_require__) {
  11889. "use strict";
  11890. Object.defineProperty(exports, "__esModule", { value: true });
  11891. exports.StoreObjectArrayRef = void 0;
  11892. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  11893. class StoreObjectArrayRef extends storeObjectArray_1.StoreObjectArray {
  11894. constructor(stoValue, lines, columns) {
  11895. super(stoValue.type, lines, columns, stoValue.getAddresses(), false);
  11896. this.refObj = stoValue.id;
  11897. }
  11898. get isRef() {
  11899. return true;
  11900. }
  11901. getRefObj() {
  11902. return this.refObj;
  11903. }
  11904. destroy() {
  11905. return false;
  11906. }
  11907. }
  11908. exports.StoreObjectArrayRef = StoreObjectArrayRef;
  11909. /***/ }),
  11910. /***/ "./js/processor/store/value/array_store_value.ts":
  11911. /*!*******************************************************!*\
  11912. !*** ./js/processor/store/value/array_store_value.ts ***!
  11913. \*******************************************************/
  11914. /*! no static exports found */
  11915. /***/ (function(module, exports, __webpack_require__) {
  11916. "use strict";
  11917. Object.defineProperty(exports, "__esModule", { value: true });
  11918. exports.ArrayStoreValue = void 0;
  11919. const array_type_1 = __webpack_require__(/*! ../../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11920. const store_value_address_1 = __webpack_require__(/*! ./store_value_address */ "./js/processor/store/value/store_value_address.ts");
  11921. class ArrayStoreValue {
  11922. constructor(type, values, lines, columns, id, isConst = false) {
  11923. this.type = type;
  11924. this.id = id;
  11925. this.isConst = isConst;
  11926. this.values = values;
  11927. this.lines = lines;
  11928. this.columns = columns;
  11929. }
  11930. get() {
  11931. return this.values;
  11932. }
  11933. /**
  11934. * @deprecated
  11935. * Potential not necessary since array access is occuring directly in the StoreObject
  11936. * @param line
  11937. * @param column
  11938. */
  11939. getAt(line, column) {
  11940. console.log("Column ", column);
  11941. if (this.isVector()) {
  11942. if (column != null) {
  11943. throw new Error(this.id + " is not a matrix!");
  11944. }
  11945. column = line;
  11946. line = 0;
  11947. }
  11948. else if (column == null) {
  11949. const values = [];
  11950. for (let col = 0; col < this.columns; col += 1) {
  11951. const index = line * this.lines + col;
  11952. values.push(this.values[index]);
  11953. }
  11954. const array_type = this.type;
  11955. const vector_type = new array_type_1.ArrayType(array_type.innerType, array_type.dimensions - 1);
  11956. return new ArrayStoreValue(vector_type, values, this.columns, 0, this.id, this.isConst);
  11957. }
  11958. const index = line * this.lines + column;
  11959. console.log("Get at: ", index);
  11960. return this.values[index];
  11961. }
  11962. setAt(value, line, column) {
  11963. let used_dims = 1;
  11964. if (column != null) {
  11965. used_dims += 1;
  11966. }
  11967. let actual_line = line;
  11968. let actual_column = column;
  11969. if (!this.type.canAccept(value.type, used_dims)) {
  11970. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  11971. }
  11972. if (this.isVector()) {
  11973. if (column != null) {
  11974. throw new Error(this.id + " is not a matrix!");
  11975. }
  11976. actual_column = actual_line;
  11977. actual_line = 0;
  11978. }
  11979. else if (column == null) {
  11980. if (!(value instanceof ArrayStoreValue)) {
  11981. throw new Error("Attempting to insert a single value as a line of matrix " + this.id);
  11982. }
  11983. const actual_values = value.get();
  11984. for (let i = 0; i < this.columns; i += 1) {
  11985. const pos = actual_line * this.columns + i;
  11986. const val = actual_values[i];
  11987. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, val.get(), actual_line, i, this.id, this.isConst);
  11988. }
  11989. }
  11990. const columns = this.columns == null ? 0 : this.columns;
  11991. const pos = actual_line * columns + actual_column;
  11992. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, value.get(), line, column, this.id, this.isConst);
  11993. }
  11994. inStore() {
  11995. return this.id != null;
  11996. }
  11997. isVector() {
  11998. return this.type.dimensions == 1;
  11999. }
  12000. }
  12001. exports.ArrayStoreValue = ArrayStoreValue;
  12002. /***/ }),
  12003. /***/ "./js/processor/store/value/array_store_value_ref.ts":
  12004. /*!***********************************************************!*\
  12005. !*** ./js/processor/store/value/array_store_value_ref.ts ***!
  12006. \***********************************************************/
  12007. /*! no static exports found */
  12008. /***/ (function(module, exports, __webpack_require__) {
  12009. "use strict";
  12010. Object.defineProperty(exports, "__esModule", { value: true });
  12011. exports.ArrayStoreValueRef = void 0;
  12012. class ArrayStoreValueRef {
  12013. constructor(type, values, addresses, lines, columns, id) {
  12014. this.type = type;
  12015. this.values = values;
  12016. this.addresses = addresses;
  12017. this.lines = lines;
  12018. this.columns = columns;
  12019. this.id = id;
  12020. this.isConst = false;
  12021. }
  12022. get() {
  12023. return this.values;
  12024. }
  12025. getAddresses() {
  12026. return this.addresses;
  12027. }
  12028. inStore() {
  12029. return this.id != null;
  12030. }
  12031. }
  12032. exports.ArrayStoreValueRef = ArrayStoreValueRef;
  12033. /***/ }),
  12034. /***/ "./js/processor/store/value/store_value.ts":
  12035. /*!*************************************************!*\
  12036. !*** ./js/processor/store/value/store_value.ts ***!
  12037. \*************************************************/
  12038. /*! no static exports found */
  12039. /***/ (function(module, exports, __webpack_require__) {
  12040. "use strict";
  12041. Object.defineProperty(exports, "__esModule", { value: true });
  12042. exports.StoreValue = void 0;
  12043. class StoreValue {
  12044. constructor(type, value, id, isConst = false) {
  12045. this.type = type;
  12046. this.id = id;
  12047. this.isConst = isConst;
  12048. this.value = value;
  12049. }
  12050. get() {
  12051. return this.value;
  12052. }
  12053. inStore() {
  12054. return this.id != null;
  12055. }
  12056. }
  12057. exports.StoreValue = StoreValue;
  12058. /***/ }),
  12059. /***/ "./js/processor/store/value/store_value_address.ts":
  12060. /*!*********************************************************!*\
  12061. !*** ./js/processor/store/value/store_value_address.ts ***!
  12062. \*********************************************************/
  12063. /*! no static exports found */
  12064. /***/ (function(module, exports, __webpack_require__) {
  12065. "use strict";
  12066. Object.defineProperty(exports, "__esModule", { value: true });
  12067. exports.StoreValueAddress = void 0;
  12068. const store_value_1 = __webpack_require__(/*! ./store_value */ "./js/processor/store/value/store_value.ts");
  12069. class StoreValueAddress extends store_value_1.StoreValue {
  12070. constructor(type, value, line, column, id, isConst = false) {
  12071. super(type, value, id, isConst);
  12072. this.line = line;
  12073. this.column = column;
  12074. }
  12075. }
  12076. exports.StoreValueAddress = StoreValueAddress;
  12077. /***/ }),
  12078. /***/ "./js/processor/store/value/store_value_ref.ts":
  12079. /*!*****************************************************!*\
  12080. !*** ./js/processor/store/value/store_value_ref.ts ***!
  12081. \*****************************************************/
  12082. /*! no static exports found */
  12083. /***/ (function(module, exports, __webpack_require__) {
  12084. "use strict";
  12085. Object.defineProperty(exports, "__esModule", { value: true });
  12086. exports.StoreValueRef = void 0;
  12087. class StoreValueRef {
  12088. constructor(type, value, loc_address, id) {
  12089. this.type = type;
  12090. this.value = value;
  12091. this.loc_address = loc_address;
  12092. this.id = id;
  12093. this.isConst = false;
  12094. this.reference_dimesion = 0;
  12095. }
  12096. get() {
  12097. return this.value;
  12098. }
  12099. getRefAddress() {
  12100. return this.loc_address;
  12101. }
  12102. inStore() {
  12103. return this.id != null;
  12104. }
  12105. getReferenceDimension() {
  12106. return this.reference_dimesion;
  12107. }
  12108. setReferenceDimension(dimension) {
  12109. this.reference_dimesion = dimension;
  12110. }
  12111. }
  12112. exports.StoreValueRef = StoreValueRef;
  12113. /***/ }),
  12114. /***/ "./js/runner.js":
  12115. /*!**********************!*\
  12116. !*** ./js/runner.js ***!
  12117. \**********************/
  12118. /*! exports provided: runner */
  12119. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12120. "use strict";
  12121. __webpack_require__.r(__webpack_exports__);
  12122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return runner; });
  12123. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast/ivprogParser */ "./js/ast/ivprogParser.js");
  12124. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  12125. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./io/domConsole */ "./js/io/domConsole.js");
  12126. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/languageService */ "./js/services/languageService.js");
  12127. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  12128. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memory/location */ "./js/memory/location.ts");
  12129. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_5__);
  12130. function runner() {
  12131. var ivprogLexer = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer(); // const lexer = new ivprogLexer(new InputStream(input));
  12132. // const stream = new CommonTokenStream(lexer);
  12133. // stream.fill();
  12134. // let i = 1;
  12135. // let token = null;
  12136. // while ((token = stream.LT(i)).type !== ivprogLexer.EOF && token.type !== ivprogLexer.WHITESPACE) {
  12137. // console.log(`${token.type}-${token.text}`);
  12138. // console.log('\n')
  12139. // i++;
  12140. // }
  12141. // const anaSin = new IVProgParser(input, ivprogLexer);
  12142. var editor = new window.JsonEditor('#json-renderer', {});
  12143. var domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"]("#console", true);
  12144. domConsole.hide(); // proc.interpretAST().then( sto => {
  12145. // console.log(sto.applyStore('a'));
  12146. // }).catch(e => console.log(e));
  12147. try {
  12148. window.$('#btn').click(function () {
  12149. var input = window.$('#input').val();
  12150. var analiser = new _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__["IVProgParser"](input, ivprogLexer);
  12151. try {
  12152. var data = analiser.parseTree();
  12153. var semAna = new _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__["SemanticAnalyser"](data);
  12154. var proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](semAna.analyseTree());
  12155. proc.registerInput(domConsole);
  12156. domConsole.clear();
  12157. proc.registerOutput(domConsole);
  12158. proc.interpretAST().then(function (sto) {
  12159. console.log(sto);
  12160. editor.load(sto.store);
  12161. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12162. })["catch"](function (e) {
  12163. alert(e);
  12164. console.log(e);
  12165. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12166. });
  12167. } catch (error) {
  12168. alert(error);
  12169. console.log(error);
  12170. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12171. }
  12172. });
  12173. } catch (a) {
  12174. console.log(a);
  12175. }
  12176. }
  12177. /***/ }),
  12178. /***/ "./js/services/i18nHelper.js":
  12179. /*!***********************************!*\
  12180. !*** ./js/services/i18nHelper.js ***!
  12181. \***********************************/
  12182. /*! exports provided: i18nHelper */
  12183. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12184. "use strict";
  12185. __webpack_require__.r(__webpack_exports__);
  12186. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18nHelper", function() { return i18nHelper; });
  12187. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12188. /* harmony import */ var _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localizedStringsService */ "./js/services/localizedStringsService.js");
  12189. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_0__["default"].StringTypes;
  12190. var i18nHelper = Object.freeze({
  12191. i18n: function i18n(identifier) {
  12192. var opts = identifier.split(':');
  12193. var type = opts[0].toLowerCase();
  12194. var id = opts[1];
  12195. if (StringTypes.ERROR === type) {
  12196. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getError(id);
  12197. } else if (StringTypes.MESSAGE === type) {
  12198. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getMessage(id);
  12199. } else if (StringTypes.UI === type) {
  12200. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI(id);
  12201. } else {
  12202. console.warn("A string has been passed to the i18n helper function that was not in the form type:id -> " + identifier);
  12203. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getString(identifier, type);
  12204. }
  12205. }
  12206. });
  12207. /***/ }),
  12208. /***/ "./js/services/languageService.js":
  12209. /*!****************************************!*\
  12210. !*** ./js/services/languageService.js ***!
  12211. \****************************************/
  12212. /*! exports provided: LanguageService */
  12213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12214. "use strict";
  12215. __webpack_require__.r(__webpack_exports__);
  12216. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageService", function() { return LanguageService; });
  12217. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12218. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12219. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12220. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12221. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12222. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12223. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12224. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12225. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12226. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12227. /* harmony import */ var _grammar___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../grammar/ */ "./grammar/index.js");
  12228. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12229. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  12230. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  12231. 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); }; }
  12232. 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; } }
  12233. /* global iLMparameters*/
  12234. var LanguageServiceExtended = /*#__PURE__*/function (_line_i18n$LanguageSe) {
  12235. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(LanguageServiceExtended, _line_i18n$LanguageSe);
  12236. var _super = _createSuper(LanguageServiceExtended);
  12237. function LanguageServiceExtended() {
  12238. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, LanguageServiceExtended);
  12239. return _super.call(this, typeof iLMparameters === "undefined" ? _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].default_lang : iLMparameters.lang);
  12240. }
  12241. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(LanguageServiceExtended, [{
  12242. key: "getDefaultLang",
  12243. value: function getDefaultLang() {
  12244. return "en";
  12245. }
  12246. }, {
  12247. key: "getCurrentLexer",
  12248. value: function getCurrentLexer() {
  12249. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12250. if (langInfo === null || langInfo === undefined) {
  12251. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].lexer;
  12252. } else {
  12253. return langInfo.lexer;
  12254. }
  12255. }
  12256. }, {
  12257. key: "getCurrentLangFuncs",
  12258. value: function getCurrentLangFuncs() {
  12259. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12260. if (langInfo === null || langInfo === undefined) {
  12261. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langFuncs;
  12262. } else {
  12263. return langInfo.langFuncs;
  12264. }
  12265. }
  12266. }, {
  12267. key: "getCurrentLangLibs",
  12268. value: function getCurrentLangLibs() {
  12269. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12270. if (langInfo === null || langInfo === undefined) {
  12271. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langLibs;
  12272. }
  12273. return langInfo.langLibs;
  12274. }
  12275. }]);
  12276. return LanguageServiceExtended;
  12277. }(line_i18n__WEBPACK_IMPORTED_MODULE_6__["default"].LanguageServiceNoLS);
  12278. var LanguageService = new LanguageServiceExtended();
  12279. /***/ }),
  12280. /***/ "./js/services/localizedStringsService.js":
  12281. /*!************************************************!*\
  12282. !*** ./js/services/localizedStringsService.js ***!
  12283. \************************************************/
  12284. /*! exports provided: LocalizedStrings, getInstance */
  12285. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12286. "use strict";
  12287. __webpack_require__.r(__webpack_exports__);
  12288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  12289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInstance", function() { return getInstance; });
  12290. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12291. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12292. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12293. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12294. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12295. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12296. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12297. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12298. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12299. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12300. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12301. /* harmony import */ var _languageService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./languageService */ "./js/services/languageService.js");
  12302. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  12303. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../i18n */ "./i18n/index.ts");
  12304. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_i18n__WEBPACK_IMPORTED_MODULE_8__);
  12305. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  12306. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  12307. 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); }; }
  12308. 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; } }
  12309. var IVProgLocalizedStrings = /*#__PURE__*/function (_line_i18n$LocalizedS) {
  12310. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IVProgLocalizedStrings, _line_i18n$LocalizedS);
  12311. var _super = _createSuper(IVProgLocalizedStrings);
  12312. function IVProgLocalizedStrings(langService, langsJsons) {
  12313. var shouldListenToChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  12314. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgLocalizedStrings);
  12315. return _super.call(this, langService, langsJsons, shouldListenToChange);
  12316. }
  12317. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgLocalizedStrings, [{
  12318. key: "translateType",
  12319. value: function translateType(type, dim) {
  12320. var type_string = this.getUI("type_".concat(type));
  12321. switch (dim) {
  12322. case 0:
  12323. return type_string;
  12324. default:
  12325. if (dim > 1) return this.getUI("matrix_info_string", [type_string]);else return this.getUI("vector_info_string", [type_string]);
  12326. }
  12327. }
  12328. }, {
  12329. key: "translateOp",
  12330. value: function translateOp(op) {
  12331. switch (op.ord) {
  12332. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].AND.ord:
  12333. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].OR.ord:
  12334. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NOT.ord:
  12335. return this.getUI("logic_operator_".concat(op.value));
  12336. default:
  12337. return op.value;
  12338. }
  12339. }
  12340. }, {
  12341. key: "translateInternalFunction",
  12342. value: function translateInternalFunction(name) {
  12343. var category = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  12344. if (category == null) {
  12345. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName(name);
  12346. } else {
  12347. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName("".concat(category, ".").concat(name));
  12348. }
  12349. }
  12350. }]);
  12351. return IVProgLocalizedStrings;
  12352. }(line_i18n__WEBPACK_IMPORTED_MODULE_5__["default"].LocalizedStrings);
  12353. var LocalizedStrings = Object.freeze(new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a, true));
  12354. var _instance = null;
  12355. function getInstance() {
  12356. if (_instance == null) {
  12357. _instance = new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a);
  12358. }
  12359. return _instance;
  12360. }
  12361. /***/ }),
  12362. /***/ "./js/services/userLog.js":
  12363. /*!********************************!*\
  12364. !*** ./js/services/userLog.js ***!
  12365. \********************************/
  12366. /*! exports provided: ActionTypes, registerClick, registerUserEvent, registerSystemEvent, getLogs, setRebuildMode, getLogsAsString, parseLogs */
  12367. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12368. "use strict";
  12369. __webpack_require__.r(__webpack_exports__);
  12370. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return ActionTypes; });
  12371. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return registerClick; });
  12372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return registerUserEvent; });
  12373. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSystemEvent", function() { return registerSystemEvent; });
  12374. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return getLogs; });
  12375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setRebuildMode", function() { return setRebuildMode; });
  12376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return getLogsAsString; });
  12377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return parseLogs; });
  12378. var clicks = [];
  12379. var inRebuildMode = false;
  12380. var ActionTypes = Object.freeze({
  12381. // registerUserEvent payload:
  12382. // (function_name, insert action)
  12383. INSERT_FUNCTION: "INSERT_FUNCTION",
  12384. // (function_name, remove action)
  12385. REMOVE_FUNCTION: "REMOVE_FUNCTION",
  12386. // (var_name,insert action, type, dim)
  12387. INSERT_GLOBAL_VAR: "INSERT_GLOBAL_VAR",
  12388. // (var name, remove action)
  12389. REMOVE_GLOBAL_VAR: "REMOVE_GLOBAL_VAR",
  12390. // (old function name, rename action, new function name)
  12391. RENAME_FUNCTION: "RENAME_FUNCTION",
  12392. // (old var name, rename action. new var name)
  12393. RENAME_GLOBAL_VAR: "RENAME_GLOBAL_VAR",
  12394. // (var name, set const action)
  12395. SET_GLOBAL_CONST: "SET_GLOBAL_CONST",
  12396. // (function name, change return action, type, dim)
  12397. CHANGE_FUNCTION_RETURN: "CHANGE_FUNCTION_RETURN",
  12398. // (var name, change type action, type, dim, rows?, columns?)
  12399. CHANGE_GLOBAL_TYPE: "CHANGE_GLOBAL_TYPE",
  12400. // (var name, change value action, value)
  12401. CHANGE_GLOBAL_VALUE: "CHANGE_GLOBAL_VALUE",
  12402. // (function name, insert param action, param varname, type, dim)
  12403. INSERT_FUNCTION_PARAM: "INSERT_FUNCTION_PARAM",
  12404. // (function name, remove param action, param varname)
  12405. REMOVE_FUNCTION_PARAM: "REMOVE_FUNCTION_PARAM",
  12406. // (function name, change param type action, type, dim)
  12407. CHANGE_PARAM_TYPE: "CHANGE_PARAM_TYPE",
  12408. // (function name, rename param action, old param name, new param name)
  12409. RENAME_FUNCTION_PARAM: "RENAME_FUNCTION_PARAM",
  12410. // (function name, insert var action, var name, type, dim)
  12411. INSERT_FUNCTION_VAR: "INSERT_FUCNTION_VAR",
  12412. // (function name, remove var action, var name)
  12413. REMOVE_FUNCTION_VAR: "REMOVE_FUNCTION_VAR",
  12414. // (function name, rename var action, old var name, new var name)
  12415. RENAME_FUNCTION_VAR: "RENAME_FUNCTION_VAR",
  12416. // (function name, change var type action, var name, type, dim, rows?, columns?)
  12417. CHANGE_VAR_TYPE: "CHANGE_VAR_TYPE",
  12418. // (function name, change var value action, var name, value)
  12419. CHANGE_VAR_VALUE: "CHANGE_VAR_VALUE",
  12420. // (function name, insert command action, command, path)
  12421. INSERT_COMMAND: "INSERT_COMMAND",
  12422. // (function name, remove command action, path)
  12423. REMOVE_COMMAND: "REMOVE_COMMAND",
  12424. // (function name, change command exp action, path, exp)
  12425. CHANGE_COMMAND_EXP: "CHANGE_COMMAND_EXP",
  12426. // (function name, change attrib exp action, path, exp)
  12427. CHANGE_ATTRIB_EXP: "CHANGE_ATTRIB_EXP",
  12428. // (function name, change attrib var action, path, var name, row_exp?, column_exp?)
  12429. CHANGE_ATTRIB_VAR: "CHANGE_ATTRIB_VAR",
  12430. // (function name, move command action, old path, new path)
  12431. MOVE_COMMAND: "MOVE_COMMAND",
  12432. // (function name, enter change name action, var name)
  12433. ENTER_CHANGE_VAR_NAME: 'ENTER_CHANGE_VAR_NAME',
  12434. // (function name, enter change value action, var name)
  12435. ENTER_CHANGE_VAR_VALUE: 'ENTER_CHANGE_VAR_VALUE',
  12436. // (var name, enter change name action)
  12437. ENTER_CHANGE_GLOBAL_NAME: 'ENTER_CHANGE_GLOBAL_NAME',
  12438. // (var name, enter change value action)
  12439. ENTER_CHANGE_GLOBAL_VALUE: 'ENTER_CHANGE_GLOBAL_VALUE',
  12440. // (function name, enter change name action, param name)
  12441. ENTER_CHANGE_PARAM_NAME: 'ENTER_CHANGE_PARAM_NAME'
  12442. });
  12443. function registerClick(x, y, details) {
  12444. if (inRebuildMode) {
  12445. return;
  12446. }
  12447. clicks.push([x, y, Date.now(), details]);
  12448. }
  12449. function registerUserEvent(command, action) {
  12450. for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  12451. params[_key - 2] = arguments[_key];
  12452. }
  12453. registerEvent('user_event', command, action, params);
  12454. }
  12455. function registerSystemEvent(command, action) {
  12456. for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  12457. params[_key2 - 2] = arguments[_key2];
  12458. }
  12459. registerEvent('system_event', command, action, params);
  12460. }
  12461. function registerEvent(tag, command, action, params) {
  12462. if (inRebuildMode) {
  12463. return;
  12464. }
  12465. var event = {
  12466. context: command,
  12467. action: action,
  12468. params: params
  12469. };
  12470. clicks.push([tag, Date.now(), event]);
  12471. }
  12472. function getLogs() {
  12473. return clicks;
  12474. }
  12475. function setRebuildMode(flag) {
  12476. inRebuildMode = flag;
  12477. }
  12478. function getLogsAsString() {
  12479. return JSON.stringify(clicks);
  12480. }
  12481. function parseLogs(logData) {
  12482. clicks = JSON.parse(logData);
  12483. }
  12484. /***/ }),
  12485. /***/ "./js/typeSystem/array_type.ts":
  12486. /*!*************************************!*\
  12487. !*** ./js/typeSystem/array_type.ts ***!
  12488. \*************************************/
  12489. /*! no static exports found */
  12490. /***/ (function(module, exports, __webpack_require__) {
  12491. "use strict";
  12492. Object.defineProperty(exports, "__esModule", { value: true });
  12493. exports.ArrayType = void 0;
  12494. class ArrayType {
  12495. constructor(type, dimensions) {
  12496. this.dimensions = dimensions;
  12497. this.innerType = type;
  12498. }
  12499. get isVector() {
  12500. return this.dimensions == 1;
  12501. }
  12502. isCompatible(another) {
  12503. if (another instanceof ArrayType) {
  12504. if (this.dimensions !== another.dimensions) {
  12505. return false;
  12506. }
  12507. return this.innerType.isCompatible(another.innerType);
  12508. }
  12509. return false;
  12510. }
  12511. stringInfo() {
  12512. const list = this.innerType.stringInfo();
  12513. list.forEach(v => {
  12514. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  12515. const tmp = v;
  12516. tmp.dim = this.dimensions;
  12517. });
  12518. return list;
  12519. }
  12520. get value() {
  12521. return undefined;
  12522. }
  12523. get ord() {
  12524. return undefined;
  12525. }
  12526. canAccept(another, used_dims) {
  12527. const free_dims = this.dimensions - used_dims;
  12528. if (another instanceof ArrayType) {
  12529. return free_dims == another.dimensions && this.innerType.isCompatible(another.innerType);
  12530. }
  12531. else {
  12532. return free_dims == 0 && this.innerType.isCompatible(another);
  12533. }
  12534. }
  12535. }
  12536. exports.ArrayType = ArrayType;
  12537. /***/ }),
  12538. /***/ "./js/typeSystem/multiType.ts":
  12539. /*!************************************!*\
  12540. !*** ./js/typeSystem/multiType.ts ***!
  12541. \************************************/
  12542. /*! no static exports found */
  12543. /***/ (function(module, exports, __webpack_require__) {
  12544. "use strict";
  12545. Object.defineProperty(exports, "__esModule", { value: true });
  12546. exports.MultiType = void 0;
  12547. class MultiType {
  12548. constructor(types) {
  12549. this.types = types;
  12550. }
  12551. get value() {
  12552. return undefined;
  12553. }
  12554. get ord() {
  12555. return undefined;
  12556. }
  12557. stringInfo() {
  12558. let list = [];
  12559. for (let i = 0; i < this.types.length; i++) {
  12560. const t = this.types[i];
  12561. list = list.concat(t.stringInfo());
  12562. }
  12563. return list;
  12564. }
  12565. isCompatible(another) {
  12566. for (let i = 0; i < this.types.length; i++) {
  12567. const t = this.types[i];
  12568. if (another.isCompatible(t)) {
  12569. return true;
  12570. }
  12571. }
  12572. return false;
  12573. }
  12574. }
  12575. exports.MultiType = MultiType;
  12576. /***/ }),
  12577. /***/ "./js/typeSystem/parsers.js":
  12578. /*!**********************************!*\
  12579. !*** ./js/typeSystem/parsers.js ***!
  12580. \**********************************/
  12581. /*! exports provided: toInt, toString, toChar, toReal, toBool, convertBoolToString, convertToString */
  12582. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12583. "use strict";
  12584. __webpack_require__.r(__webpack_exports__);
  12585. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toInt", function() { return toInt; });
  12586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return toString; });
  12587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toChar", function() { return toChar; });
  12588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toReal", function() { return toReal; });
  12589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toBool", function() { return toBool; });
  12590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBoolToString", function() { return convertBoolToString; });
  12591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToString", function() { return convertToString; });
  12592. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  12593. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ "./js/typeSystem/types.ts");
  12594. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_1__);
  12595. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  12596. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
  12597. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  12598. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_3__);
  12599. function toInt(str) {
  12600. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(str);
  12601. }
  12602. function toString(str) {
  12603. var value = str.replace(/^"/, "");
  12604. value = value.replace(/"$/, "");
  12605. value = value.replace(/\\b/g, "\b");
  12606. value = value.replace(/\\t/g, "\t");
  12607. value = value.replace(/\\n/g, "\n");
  12608. value = value.replace(/\\r/g, "\r");
  12609. value = value.replace(/\\"/g, '"');
  12610. value = value.replace(/\\'/g, "'");
  12611. value = value.replace(/\\\\/g, "\\");
  12612. return value;
  12613. }
  12614. function toChar(str) {
  12615. console.debug(str, str.length);
  12616. var value = str.replace(/^'/, "");
  12617. value = value.replace(/'$/, "");
  12618. value = value.replace(/\\b/g, "\b");
  12619. value = value.replace(/\\t/g, "\t");
  12620. value = value.replace(/\\n/g, "\n");
  12621. value = value.replace(/\\r/g, "\r");
  12622. value = value.replace(/\\"/g, '"');
  12623. value = value.replace(/\\'/g, "'");
  12624. value = value[0];
  12625. return value;
  12626. }
  12627. function toReal(value) {
  12628. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(value);
  12629. }
  12630. function toBool(str) {
  12631. var val = "'" + str + "'";
  12632. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  12633. var instance = new lexer(null);
  12634. if (instance.literalNames[lexer.RK_TRUE] === val) {
  12635. return true;
  12636. } else if (instance.literalNames[lexer.RK_FALSE] === val) {
  12637. return false;
  12638. } else {
  12639. // TODO: better error message
  12640. throw new Error(str + "not a valid boolean");
  12641. }
  12642. }
  12643. function convertBoolToString(bool) {
  12644. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  12645. var instance = new lexer(null);
  12646. var result = null;
  12647. if (bool) {
  12648. result = instance.literalNames[lexer.RK_TRUE];
  12649. } else {
  12650. result = instance.literalNames[lexer.RK_FALSE];
  12651. }
  12652. return result.replace(/'/g, "");
  12653. }
  12654. function convertToString(value, type) {
  12655. switch (type.ord) {
  12656. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER.ord:
  12657. return value.toString();
  12658. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL.ord:
  12659. {
  12660. if (value.dp() <= 0) {
  12661. return value.toFixed(1);
  12662. } else {
  12663. return value.toFixed(_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].decimalPlaces);
  12664. }
  12665. }
  12666. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN.ord:
  12667. return convertBoolToString(value);
  12668. default:
  12669. return value;
  12670. }
  12671. }
  12672. /***/ }),
  12673. /***/ "./js/typeSystem/type.ts":
  12674. /*!*******************************!*\
  12675. !*** ./js/typeSystem/type.ts ***!
  12676. \*******************************/
  12677. /*! no static exports found */
  12678. /***/ (function(module, exports, __webpack_require__) {
  12679. "use strict";
  12680. Object.defineProperty(exports, "__esModule", { value: true });
  12681. exports.Type = void 0;
  12682. class Type {
  12683. constructor(value, ord) {
  12684. this.value = value;
  12685. this.ord = ord;
  12686. }
  12687. stringInfo() {
  12688. return [{ type: this.value, dim: 0 }];
  12689. }
  12690. isCompatible(another) {
  12691. return this.value === another.value && this.ord === another.ord;
  12692. }
  12693. }
  12694. exports.Type = Type;
  12695. /***/ }),
  12696. /***/ "./js/typeSystem/types.ts":
  12697. /*!********************************!*\
  12698. !*** ./js/typeSystem/types.ts ***!
  12699. \********************************/
  12700. /*! no static exports found */
  12701. /***/ (function(module, exports, __webpack_require__) {
  12702. "use strict";
  12703. Object.defineProperty(exports, "__esModule", { value: true });
  12704. exports.fromOrdToType = exports.Types = void 0;
  12705. const type_1 = __webpack_require__(/*! ./type */ "./js/typeSystem/type.ts");
  12706. const multiType_1 = __webpack_require__(/*! ./multiType */ "./js/typeSystem/multiType.ts");
  12707. const maybe_1 = __webpack_require__(/*! ../util/maybe */ "./js/util/maybe.ts");
  12708. const INTEGER = new type_1.Type("integer", 0);
  12709. const REAL = new type_1.Type("real", 1);
  12710. const STRING = new type_1.Type("text", 2);
  12711. const BOOLEAN = new type_1.Type("boolean", 3);
  12712. const CHAR = new type_1.Type("char", 4);
  12713. const VOID = new type_1.Type("void", 5);
  12714. const UNDEFINED = new type_1.Type("undefined", 6);
  12715. const ALL = new multiType_1.MultiType([INTEGER, REAL, STRING, CHAR, BOOLEAN]);
  12716. exports.Types = Object.freeze({
  12717. INTEGER: INTEGER,
  12718. REAL: REAL,
  12719. STRING: STRING,
  12720. CHAR: CHAR,
  12721. BOOLEAN: BOOLEAN,
  12722. VOID: VOID,
  12723. UNDEFINED: UNDEFINED,
  12724. ALL: ALL
  12725. });
  12726. function fromOrdToType(ord) {
  12727. const typeMap = exports.Types;
  12728. for (const t in typeMap) {
  12729. if (typeMap[t].ord && typeMap[t].ord === ord) {
  12730. return maybe_1.Maybe.some(typeMap[t]);
  12731. }
  12732. }
  12733. return maybe_1.Maybe.none();
  12734. }
  12735. exports.fromOrdToType = fromOrdToType;
  12736. /***/ }),
  12737. /***/ "./js/util/auto_gen_output.js":
  12738. /*!************************************!*\
  12739. !*** ./js/util/auto_gen_output.js ***!
  12740. \************************************/
  12741. /*! exports provided: autoGenerateTestCaseOutput */
  12742. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12743. "use strict";
  12744. __webpack_require__.r(__webpack_exports__);
  12745. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return autoGenerateTestCaseOutput; });
  12746. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  12747. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  12748. /* harmony import */ var _inputTest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inputTest */ "./js/util/inputTest.js");
  12749. /* harmony import */ var _outputTest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./outputTest */ "./js/util/outputTest.js");
  12750. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  12751. function autoGenerateTestCaseOutput(program_text, testCases) {
  12752. var copyTestCases = testCases.map(function (test) {
  12753. return Object.assign({}, test);
  12754. });
  12755. try {
  12756. var program = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__["SemanticAnalyser"].analyseFromSource(program_text);
  12757. var resultList = testCases.map(function (test, id) {
  12758. var input = new _inputTest__WEBPACK_IMPORTED_MODULE_2__["InputTest"](test.input);
  12759. var output = new _outputTest__WEBPACK_IMPORTED_MODULE_3__["OutputTest"]();
  12760. var exec = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](program);
  12761. exec.registerInput(input);
  12762. exec.registerOutput(output);
  12763. return exec.interpretAST().then(function (_) {
  12764. return {
  12765. id: id,
  12766. program: exec
  12767. };
  12768. });
  12769. });
  12770. return Promise.all(resultList).then(function (result_final) {
  12771. for (var i = 0; i < result_final.length; ++i) {
  12772. var result = result_final[i];
  12773. var output = result.program.output.list;
  12774. var input = result.program.input;
  12775. if (input.index != input.inputList.length) {
  12776. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_unused_input", [result.id + 1]));
  12777. return Promise.resolve(false);
  12778. }
  12779. if (output.length == 0) {
  12780. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_empty", [result.id + 1]));
  12781. }
  12782. copyTestCases[result.id].output = output;
  12783. }
  12784. window.outputGenerated(copyTestCases);
  12785. return Promise.resolve(true);
  12786. });
  12787. } catch (error) {
  12788. return Promise.reject(error);
  12789. }
  12790. }
  12791. /***/ }),
  12792. /***/ "./js/util/config.ts":
  12793. /*!***************************!*\
  12794. !*** ./js/util/config.ts ***!
  12795. \***************************/
  12796. /*! no static exports found */
  12797. /***/ (function(module, exports, __webpack_require__) {
  12798. "use strict";
  12799. Object.defineProperty(exports, "__esModule", { value: true });
  12800. exports.Config = void 0;
  12801. class ConfigObject {
  12802. constructor() {
  12803. this.decimalPlaces = 8;
  12804. this.intConvertRoundMode = 2;
  12805. this.default_lang = 'pt';
  12806. this.enable_type_casting = true;
  12807. this.idle_input_interval = 5000;
  12808. this.suspend_threshold = 100;
  12809. // this.max_instruction_count = 350250; - automated evaluation limit
  12810. this.max_instruction_count = Number.MAX_SAFE_INTEGER;
  12811. }
  12812. setConfig(opts) {
  12813. const otherConfig = opts;
  12814. for (const key in otherConfig) {
  12815. if (Object.prototype.hasOwnProperty.call(this, key)) {
  12816. this[key] = otherConfig[key];
  12817. }
  12818. }
  12819. }
  12820. }
  12821. const config = new ConfigObject();
  12822. exports.Config = config;
  12823. /***/ }),
  12824. /***/ "./js/util/editorMode2.js":
  12825. /*!********************************!*\
  12826. !*** ./js/util/editorMode2.js ***!
  12827. \********************************/
  12828. /*! exports provided: CodeEditorMode */
  12829. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12830. "use strict";
  12831. __webpack_require__.r(__webpack_exports__);
  12832. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditorMode", function() { return CodeEditorMode; });
  12833. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./js/util/utils.js");
  12834. /**
  12835. * Source: https://raw.githubusercontent.com/codemirror/CodeMirror/master/mode/clike/clike.js
  12836. * @author arijn Haverbeke and others
  12837. * @author Lucas de Souza
  12838. * @param {CodeMirror} CodeMirror
  12839. */
  12840. function CodeEditorMode(CodeMirror) {
  12841. "use strict";
  12842. function Context(indented, column, type, info, align, prev) {
  12843. this.indented = indented;
  12844. this.column = column;
  12845. this.type = type;
  12846. this.info = info;
  12847. this.align = align;
  12848. this.prev = prev;
  12849. }
  12850. function pushContext(state, col, type, info) {
  12851. var indent = state.indented;
  12852. if (state.context && state.context.type == "statement" && type != "statement") indent = state.context.indented;
  12853. return state.context = new Context(indent, col, type, info, null, state.context);
  12854. }
  12855. function popContext(state) {
  12856. var t = state.context.type;
  12857. if (t == ")" || t == "]" || t == "}") state.indented = state.context.indented;
  12858. return state.context = state.context.prev;
  12859. }
  12860. function typeBefore(stream, state, pos) {
  12861. if (state.prevToken == "variable" || state.prevToken == "type") return true;
  12862. if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
  12863. if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
  12864. }
  12865. function isTopScope(context) {
  12866. for (;;) {
  12867. if (!context || context.type == "top") return true;
  12868. if (context.type == "}" && context.prev.info != "namespace") return false;
  12869. context = context.prev;
  12870. }
  12871. }
  12872. function contains(words, word) {
  12873. if (typeof words === "function") {
  12874. return words(word);
  12875. } else {
  12876. return Object.propertyIsEnumerable.call(words, word);
  12877. }
  12878. }
  12879. function tokenComment(stream, state) {
  12880. var maybeEnd = false,
  12881. ch;
  12882. while (ch = stream.next()) {
  12883. if (ch == "/" && maybeEnd) {
  12884. state.tokenize = null;
  12885. break;
  12886. }
  12887. maybeEnd = ch == "*";
  12888. }
  12889. return "comment";
  12890. }
  12891. CodeMirror.defineMode("ivprog", function (config, parserConfig) {
  12892. var indentUnit = config.indentUnit,
  12893. statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
  12894. dontAlignCalls = parserConfig.dontAlignCalls,
  12895. keywords = parserConfig.keywords || {},
  12896. switchKeyword = parserConfig.switchKeyword,
  12897. caseKeyword = parserConfig.caseKeyword,
  12898. defaultKeyword = parserConfig.defaultKeyword,
  12899. caseRegex = new RegExp("^\\s*(?:".concat(caseKeyword, " .*?:|").concat(defaultKeyword, ":|\\{\\}?|\\})$")),
  12900. ////,
  12901. types = parserConfig.types || {},
  12902. builtin = parserConfig.builtin || {},
  12903. blockKeywords = parserConfig.blockKeywords || {},
  12904. defKeywords = parserConfig.defKeywords || {},
  12905. atoms = parserConfig.atoms || {},
  12906. hooks = parserConfig.hooks || {},
  12907. multiLineStrings = parserConfig.multiLineStrings,
  12908. indentStatements = false,
  12909. namespaceSeparator = null,
  12910. isPunctuationChar = /[[\]{}(),;:\n]/,
  12911. numberStart = /[\d.]/,
  12912. number = /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)$/i,
  12913. isOperatorChar = /[+\-*%=<>!/&]/,
  12914. isIdentifierChar = /[a-zA-Z0-9_]/,
  12915. // An optional function that takes a {string} token and returns true if it
  12916. // should be treated as a builtin.
  12917. isReservedIdentifier = parserConfig.isReservedIdentifier || false;
  12918. var curPunc, isDefKeyword;
  12919. var tokenString = function tokenString() {
  12920. /*SKIP*/
  12921. };
  12922. function tokenBase(stream, state) {
  12923. var ch = stream.next();
  12924. if (hooks[ch]) {
  12925. var result = hooks[ch](stream, state);
  12926. if (result !== false) return result;
  12927. }
  12928. if (ch == '"') {
  12929. state.tokenize = tokenString(ch);
  12930. return state.tokenize(stream, state);
  12931. }
  12932. if (isPunctuationChar.test(ch)) {
  12933. curPunc = ch;
  12934. return null;
  12935. }
  12936. if (numberStart.test(ch)) {
  12937. stream.backUp(1);
  12938. if (stream.match(number)) return "number";
  12939. stream.next();
  12940. }
  12941. if (ch == "/") {
  12942. if (stream.eat("*")) {
  12943. state.tokenize = tokenComment;
  12944. return tokenComment(stream, state);
  12945. }
  12946. if (stream.eat("/")) {
  12947. stream.skipToEnd();
  12948. return "comment";
  12949. }
  12950. }
  12951. if (isOperatorChar.test(ch)) {
  12952. while (!stream.match(/^\/[/*]/, false) && stream.eat(isOperatorChar)) {
  12953. /* SKIP */
  12954. }
  12955. return "operator";
  12956. }
  12957. stream.eatWhile(isIdentifierChar);
  12958. if (namespaceSeparator) while (stream.match(namespaceSeparator)) {
  12959. stream.eatWhile(isIdentifierChar);
  12960. }
  12961. var cur = stream.current();
  12962. if (contains(keywords, cur)) {
  12963. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  12964. if (contains(defKeywords, cur)) isDefKeyword = true;
  12965. return "keyword";
  12966. }
  12967. if (contains(types, cur)) return "type";
  12968. if (contains(builtin, cur) || isReservedIdentifier && isReservedIdentifier(cur)) {
  12969. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  12970. return "builtin";
  12971. }
  12972. if (contains(atoms, cur)) return "atom";
  12973. return "variable";
  12974. }
  12975. tokenString = function tokenString(quote) {
  12976. return function (stream, state) {
  12977. var escaped = false,
  12978. next,
  12979. end = false;
  12980. while ((next = stream.next()) != null) {
  12981. if (next == quote && !escaped) {
  12982. end = true;
  12983. break;
  12984. }
  12985. escaped = !escaped && next == "\\";
  12986. }
  12987. if (end || !(escaped || multiLineStrings)) state.tokenize = null;
  12988. return "string";
  12989. };
  12990. };
  12991. function maybeEOL(stream, state) {
  12992. if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) state.typeAtEndOfLine = typeBefore(stream, state, stream.pos);
  12993. } // Interface
  12994. return {
  12995. startState: function startState(basecolumn) {
  12996. return {
  12997. tokenize: null,
  12998. context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
  12999. indented: 0,
  13000. startOfLine: true,
  13001. prevToken: null
  13002. };
  13003. },
  13004. token: function token(stream, state) {
  13005. var ctx = state.context;
  13006. if (stream.sol()) {
  13007. if (ctx.align == null) ctx.align = false;
  13008. state.indented = stream.indentation();
  13009. state.startOfLine = true;
  13010. }
  13011. if (stream.eatSpace()) {
  13012. maybeEOL(stream, state);
  13013. return null;
  13014. }
  13015. curPunc = isDefKeyword = null;
  13016. var style = (state.tokenize || tokenBase)(stream, state);
  13017. if (style == "comment" || style == "meta") return style;
  13018. if (ctx.align == null) ctx.align = true;
  13019. if (curPunc == ";" || curPunc == ":" || curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)) while (state.context.type == "statement") {
  13020. popContext(state);
  13021. } else if (curPunc == "{") pushContext(state, stream.column(), "}");else if (curPunc == "[") pushContext(state, stream.column(), "]");else if (curPunc == "(") pushContext(state, stream.column(), ")");else if (curPunc == "}") {
  13022. while (ctx.type == "statement") {
  13023. ctx = popContext(state);
  13024. }
  13025. if (ctx.type == "}") ctx = popContext(state);
  13026. while (ctx.type == "statement") {
  13027. ctx = popContext(state);
  13028. }
  13029. } else if (curPunc == ctx.type) popContext(state);else if (indentStatements && ((ctx.type == "}" || ctx.type == "top") && curPunc != ";" || ctx.type == "statement" && curPunc == "newstatement")) {
  13030. pushContext(state, stream.column(), "statement", stream.current());
  13031. }
  13032. if (style == "variable" && (state.prevToken == "def" || parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && isTopScope(state.context) && stream.match(/^\s*\(/, false))) style = "def";
  13033. if (hooks.token) {
  13034. var result = hooks.token(stream, state, style);
  13035. if (result !== undefined) style = result;
  13036. }
  13037. if (style == "def" && parserConfig.styleDefs === false) style = "variable";
  13038. state.startOfLine = false;
  13039. state.prevToken = isDefKeyword ? "def" : style || curPunc;
  13040. maybeEOL(stream, state);
  13041. return style;
  13042. },
  13043. indent: function indent(state, textAfter) {
  13044. if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
  13045. var ctx = state.context;
  13046. var firstChar = textAfter && textAfter.charAt(0);
  13047. var closing = firstChar == ctx.type;
  13048. if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
  13049. if (parserConfig.dontIndentStatements) while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) {
  13050. ctx = ctx.prev;
  13051. }
  13052. if (hooks.indent) {
  13053. var hook = hooks.indent(state, ctx, textAfter, indentUnit);
  13054. if (typeof hook == "number") return hook;
  13055. }
  13056. var switchBlock = ctx.prev && ctx.prev.info == switchKeyword;
  13057. if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
  13058. while (ctx.type != "top" && ctx.type != "}") {
  13059. ctx = ctx.prev;
  13060. }
  13061. return ctx.indented;
  13062. }
  13063. if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
  13064. if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
  13065. if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
  13066. var caseTestRegex = new RegExp("^(?:".concat(caseKeyword, "|").concat(defaultKeyword, ")\b"));
  13067. return ctx.indented + (closing ? 0 : indentUnit) + (!closing && switchBlock && !caseTestRegex.test(textAfter) ? indentUnit : 0);
  13068. },
  13069. electricInput: caseRegex,
  13070. blockCommentStart: "/*",
  13071. blockCommentEnd: "*/",
  13072. blockCommentContinue: " * ",
  13073. lineComment: "//",
  13074. fold: "brace"
  13075. };
  13076. });
  13077. function words(str) {
  13078. var obj = {},
  13079. words = str.split(" ");
  13080. for (var i = 0; i < words.length; ++i) {
  13081. obj[words[i]] = true;
  13082. }
  13083. return obj;
  13084. }
  13085. var codeConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getCodeEditorModeConfig"])();
  13086. var ivprogKeywords = codeConfig.keywords.join(" ");
  13087. var basicTypes = words(codeConfig.types.join(" "));
  13088. function ivprogTypes(identifier) {
  13089. return contains(basicTypes, identifier);
  13090. }
  13091. var ivprogBlockKeywords = codeConfig.blocks.join(" ");
  13092. var ivprogDefKeywords = "funcao const";
  13093. function def(mimes, mode) {
  13094. if (typeof mimes == "string") mimes = [mimes];
  13095. var words = [];
  13096. function add(obj) {
  13097. if (obj) {
  13098. for (var prop in obj) {
  13099. if (Object.hasOwnProperty.call(obj, prop)) {
  13100. words.push(prop);
  13101. }
  13102. }
  13103. }
  13104. }
  13105. add(mode.keywords);
  13106. add(mode.types);
  13107. add(mode.builtin);
  13108. add(mode.atoms);
  13109. if (words.length) {
  13110. mode.helperType = mimes[0];
  13111. CodeMirror.registerHelper("hintWords", mimes[0], words);
  13112. }
  13113. for (var i = 0; i < mimes.length; ++i) {
  13114. CodeMirror.defineMIME(mimes[i], mode);
  13115. }
  13116. }
  13117. def(["text/x-ivprog"], {
  13118. name: "ivprog",
  13119. keywords: words(ivprogKeywords),
  13120. types: ivprogTypes,
  13121. blockKeywords: words(ivprogBlockKeywords),
  13122. defKeywords: words(ivprogDefKeywords),
  13123. typeFirstDefinitions: true,
  13124. atoms: words(codeConfig.atoms.join(" ")),
  13125. switchKeyword: codeConfig.switchString,
  13126. caseKeyword: codeConfig.case_default[0],
  13127. defaultKeyword: codeConfig.case_default[1],
  13128. modeProps: {
  13129. fold: ["brace"]
  13130. }
  13131. });
  13132. }
  13133. /***/ }),
  13134. /***/ "./js/util/iassignHelpers.js":
  13135. /*!***********************************!*\
  13136. !*** ./js/util/iassignHelpers.js ***!
  13137. \***********************************/
  13138. /*! exports provided: prepareActivityToStudentHelper, autoEval */
  13139. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13140. "use strict";
  13141. __webpack_require__.r(__webpack_exports__);
  13142. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return prepareActivityToStudentHelper; });
  13143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return autoEval; });
  13144. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../visualUI/functions */ "./js/visualUI/functions.js");
  13145. /* harmony import */ var _visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../visualUI/code_generator */ "./js/visualUI/code_generator.js");
  13146. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  13147. /* harmony import */ var _testConsole__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./testConsole */ "./js/util/testConsole.js");
  13148. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  13149. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  13150. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./maybe */ "./js/util/maybe.ts");
  13151. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_maybe__WEBPACK_IMPORTED_MODULE_6__);
  13152. function parseActivityData(data) {
  13153. var algorithm_in_ilm = null;
  13154. if (data.split("\n::algorithm::")[1]) {
  13155. algorithm_in_ilm = data.split("\n::algorithm::")[1].split("\n::logs::")[0];
  13156. var logs = data.split("\n::algorithm::")[1].split("\n::logs::")[1];
  13157. if (logs != null) {
  13158. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"])(logs);
  13159. }
  13160. }
  13161. var content;
  13162. try {
  13163. content = JSON.parse(data.split("\n::algorithm::")[0]);
  13164. content["algorithm_in_ilm"] = algorithm_in_ilm;
  13165. } catch (e) {
  13166. console.error(e);
  13167. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].none();
  13168. }
  13169. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].some(content);
  13170. }
  13171. function prepareActivityToStudentHelper(ilm_cont) {
  13172. var maybe_content = parseActivityData(ilm_cont);
  13173. return maybe_content.map(function (content) {
  13174. var testCases = content.testcases;
  13175. Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["setTestCases"])(testCases);
  13176. var prog_type = null;
  13177. if (content.settings_programming_type) {
  13178. prog_type = content.settings_programming_type[0].value;
  13179. } else {
  13180. prog_type = "visual";
  13181. }
  13182. return {
  13183. settingsProgrammingType: prog_type,
  13184. settingsDataTypes: content.settings_data_types,
  13185. settingsCommands: content.settings_commands,
  13186. settingsFunctions: content.settings_functions,
  13187. algorithmInIlm: content.algorithm_in_ilm,
  13188. settingsFilter: content.settings_filter
  13189. };
  13190. });
  13191. }
  13192. function compareArray(a, b) {
  13193. for (var i = 0; i < a.length; ++i) {
  13194. var elementA = a[i];
  13195. var elementB = b[i];
  13196. if (elementA != elementB) {
  13197. return false;
  13198. }
  13199. }
  13200. return true;
  13201. }
  13202. function compareTestcases(original, student) {
  13203. if (original.length != student.length) {
  13204. return false;
  13205. }
  13206. for (var i = 0; i < original.length; ++i) {
  13207. var elementO = original[i];
  13208. var elementS = student[i];
  13209. if (!compareArray(elementO.input, elementS.input)) {
  13210. return false;
  13211. }
  13212. if (!compareArray(elementO.output, elementS.output)) {
  13213. return false;
  13214. }
  13215. }
  13216. return true;
  13217. }
  13218. function autoEval(originalData, callback) {
  13219. var code = Object(_visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__["generate"])(); //console.debug(code);
  13220. var original = parseActivityData(originalData).getOrElse(undefined);
  13221. if (original == null) {
  13222. alert("iAssign did not provide the original activity data!");
  13223. return callback(null);
  13224. }
  13225. if (code == null) {
  13226. return callback(-1); // @FeedbackConvention Casos de teste vazios
  13227. } else {
  13228. if (!compareTestcases(original.testcases, Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["getTestCases"])())) {
  13229. return callback(-2); // @FeedbackConvention Casos de teste alterados pelo aluno
  13230. }
  13231. try {
  13232. var ast_code = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__["SemanticAnalyser"].analyseFromSource(code);
  13233. var con = new _testConsole__WEBPACK_IMPORTED_MODULE_3__["TestConsole"]([]);
  13234. var autoAssessment = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__["IVProgAssessment"](ast_code, original.testcases, con);
  13235. autoAssessment.runTest().then(function (grade) {
  13236. return callback(grade);
  13237. })["catch"](function (err) {
  13238. console.log(err);
  13239. callback(-5); // @FeedbackConvention Falha na execução
  13240. });
  13241. } catch (e) {
  13242. console.error(e);
  13243. callback(-5);
  13244. }
  13245. }
  13246. }
  13247. /***/ }),
  13248. /***/ "./js/util/inputTest.js":
  13249. /*!******************************!*\
  13250. !*** ./js/util/inputTest.js ***!
  13251. \******************************/
  13252. /*! exports provided: InputTest */
  13253. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13254. "use strict";
  13255. __webpack_require__.r(__webpack_exports__);
  13256. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputTest", function() { return InputTest; });
  13257. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13258. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13259. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13260. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13261. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13262. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13263. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13264. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13265. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13266. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13267. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13268. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13269. 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); }; }
  13270. 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; } }
  13271. var InputTest = /*#__PURE__*/function (_Input) {
  13272. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputTest, _Input);
  13273. var _super = _createSuper(InputTest);
  13274. function InputTest(inputList) {
  13275. var _this;
  13276. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputTest);
  13277. _this = _super.call(this);
  13278. _this.index = 0;
  13279. _this.inputList = inputList;
  13280. return _this;
  13281. }
  13282. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputTest, [{
  13283. key: "requestInput",
  13284. value: function requestInput() {
  13285. var _this2 = this;
  13286. var promise = new Promise(function (resolve, reject) {
  13287. if (_this2.index < _this2.inputList.length) {
  13288. resolve(_this2.inputList[_this2.index]);
  13289. _this2.index++;
  13290. } else {
  13291. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13292. }
  13293. });
  13294. return promise;
  13295. }
  13296. }]);
  13297. return InputTest;
  13298. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13299. /***/ }),
  13300. /***/ "./js/util/input_assessment.js":
  13301. /*!*************************************!*\
  13302. !*** ./js/util/input_assessment.js ***!
  13303. \*************************************/
  13304. /*! exports provided: InputAssessment */
  13305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13306. "use strict";
  13307. __webpack_require__.r(__webpack_exports__);
  13308. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputAssessment", function() { return InputAssessment; });
  13309. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13310. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13311. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13312. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13313. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13314. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13315. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13316. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13317. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13318. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13319. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13320. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13321. 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); }; }
  13322. 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; } }
  13323. var InputAssessment = /*#__PURE__*/function (_Input) {
  13324. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputAssessment, _Input);
  13325. var _super = _createSuper(InputAssessment);
  13326. function InputAssessment(input_list) {
  13327. var _this;
  13328. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputAssessment);
  13329. _this = _super.call(this);
  13330. _this.index = 0;
  13331. _this.input_list = input_list.map(function (val) {
  13332. return {
  13333. "value": val,
  13334. "read": false
  13335. };
  13336. });
  13337. return _this;
  13338. }
  13339. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputAssessment, [{
  13340. key: "requestInput",
  13341. value: function requestInput() {
  13342. var _this2 = this;
  13343. var promise = new Promise(function (resolve, reject) {
  13344. if (_this2.index < _this2.input_list.length) {
  13345. var input = _this2.input_list[_this2.index];
  13346. input.read = true;
  13347. _this2.index += 1;
  13348. resolve(input.value);
  13349. } else {
  13350. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13351. }
  13352. });
  13353. return promise;
  13354. }
  13355. }, {
  13356. key: "isInputAvailable",
  13357. value: function isInputAvailable() {
  13358. return this.index < this.input_list.length;
  13359. }
  13360. }]);
  13361. return InputAssessment;
  13362. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13363. /***/ }),
  13364. /***/ "./js/util/maybe.ts":
  13365. /*!**************************!*\
  13366. !*** ./js/util/maybe.ts ***!
  13367. \**************************/
  13368. /*! no static exports found */
  13369. /***/ (function(module, exports, __webpack_require__) {
  13370. "use strict";
  13371. Object.defineProperty(exports, "__esModule", { value: true });
  13372. exports.Maybe = void 0;
  13373. /**
  13374. *
  13375. * Maybe Monad
  13376. * @Source: https://codewithstyle.info/advanced-functional-programming-in-typescript-maybe-monad/
  13377. * @Modified by: @lucascalion - 28/08/2019
  13378. *
  13379. **/
  13380. class Maybe {
  13381. constructor(value) {
  13382. this.value = value;
  13383. }
  13384. static some(value) {
  13385. if (!value) {
  13386. throw Error("Provided value must not be empty");
  13387. }
  13388. return new Maybe(value);
  13389. }
  13390. static none() {
  13391. return new Maybe(null);
  13392. }
  13393. static fromValue(value) {
  13394. return value ? Maybe.some(value) : Maybe.none();
  13395. }
  13396. getOrElse(defaultValue) {
  13397. return this.value === null ? defaultValue : this.value;
  13398. }
  13399. map(f) {
  13400. if (this.value === null) {
  13401. return Maybe.none();
  13402. }
  13403. else {
  13404. return Maybe.fromValue(f(this.value));
  13405. }
  13406. }
  13407. }
  13408. exports.Maybe = Maybe;
  13409. /***/ }),
  13410. /***/ "./js/util/outputTest.js":
  13411. /*!*******************************!*\
  13412. !*** ./js/util/outputTest.js ***!
  13413. \*******************************/
  13414. /*! exports provided: OutputTest */
  13415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13416. "use strict";
  13417. __webpack_require__.r(__webpack_exports__);
  13418. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputTest", function() { return OutputTest; });
  13419. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13420. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13421. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13422. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13423. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13424. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13425. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13426. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13427. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13428. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13429. /* harmony import */ var _io_output__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/output */ "./js/io/output.js");
  13430. 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); }; }
  13431. 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; } }
  13432. var OutputTest = /*#__PURE__*/function (_Output) {
  13433. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(OutputTest, _Output);
  13434. var _super = _createSuper(OutputTest);
  13435. function OutputTest() {
  13436. var _this;
  13437. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputTest);
  13438. _this = _super.call(this);
  13439. _this.list = [];
  13440. _this.currentLine = null;
  13441. return _this;
  13442. }
  13443. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputTest, [{
  13444. key: "write",
  13445. value: function write(text) {
  13446. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13447. if (this.currentLine == null) {
  13448. this.currentLine = this.list.push('') - 1;
  13449. }
  13450. this.list[this.currentLine] += text;
  13451. if (newLine) {
  13452. this.currentLine = null;
  13453. }
  13454. }
  13455. }, {
  13456. key: "sendOutput",
  13457. value: function sendOutput(text) {
  13458. var _this2 = this;
  13459. var output = '' + text;
  13460. if (output.indexOf('\n') !== -1) {
  13461. var outputList = output.split('\n');
  13462. var last = outputList.pop();
  13463. outputList.forEach(function (t) {
  13464. t = t.replace(/\t/g, '&#x0020;&#x0020;');
  13465. t = t.replace(/\s/g, "&#x0020;");
  13466. if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
  13467. });
  13468. last = last.replace(/\t/g, '&#x0020;&#x0020;');
  13469. last = last.replace(/\s/g, "&#x0020;");
  13470. if (last.length != 0) this.write(last);
  13471. } else {
  13472. output = output.replace(/\t/g, '&#x0020;&#x0020;');
  13473. output = output.replace(/\s/g, "&#x0020;");
  13474. this.write(output);
  13475. }
  13476. }
  13477. }]);
  13478. return OutputTest;
  13479. }(_io_output__WEBPACK_IMPORTED_MODULE_5__["Output"]);
  13480. /***/ }),
  13481. /***/ "./js/util/string_diff.js":
  13482. /*!********************************!*\
  13483. !*** ./js/util/string_diff.js ***!
  13484. \********************************/
  13485. /*! exports provided: default */
  13486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13487. "use strict";
  13488. __webpack_require__.r(__webpack_exports__);
  13489. /**
  13490. * Author: @jhchen - https://github.com/jhchen
  13491. * Modified by: @lucascalion - 23/07/2019
  13492. * This library modifies the diff-patch-match library by Neil Fraser
  13493. * by removing the patch and match functionality and certain advanced
  13494. * options in the diff function. The original license is as follows:
  13495. *
  13496. * ===
  13497. *
  13498. * Diff Match and Patch
  13499. *
  13500. * Copyright 2006 Google Inc.
  13501. * http://code.google.com/p/google-diff-match-patch/
  13502. *
  13503. * Licensed under the Apache License, Version 2.0 (the "License");
  13504. * you may not use this file except in compliance with the License.
  13505. * You may obtain a copy of the License at
  13506. *
  13507. * http://www.apache.org/licenses/LICENSE-2.0
  13508. *
  13509. * Unless required by applicable law or agreed to in writing, software
  13510. * distributed under the License is distributed on an "AS IS" BASIS,
  13511. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13512. * See the License for the specific language governing permissions and
  13513. * limitations under the License.
  13514. */
  13515. /**
  13516. * The data structure representing a diff is an array of tuples:
  13517. * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
  13518. * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
  13519. */
  13520. var DIFF_DELETE = -1;
  13521. var DIFF_INSERT = 1;
  13522. var DIFF_EQUAL = 0;
  13523. /**
  13524. * Find the differences between two texts. Simplifies the problem by stripping
  13525. * any common prefix or suffix off the texts before diffing.
  13526. * @param {string} text1 Old string to be diffed.
  13527. * @param {string} text2 New string to be diffed.
  13528. * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info
  13529. * @return {Array} Array of diff tuples.
  13530. */
  13531. function diff_main(text1, text2, cursor_pos, _fix_unicode) {
  13532. // Check for equality
  13533. if (text1 === text2) {
  13534. if (text1) {
  13535. return [[DIFF_EQUAL, text1]];
  13536. }
  13537. return [];
  13538. }
  13539. if (cursor_pos != null) {
  13540. var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
  13541. if (editdiff) {
  13542. return editdiff;
  13543. }
  13544. } // Trim off common prefix (speedup).
  13545. var commonlength = diff_commonPrefix(text1, text2);
  13546. var commonprefix = text1.substring(0, commonlength);
  13547. text1 = text1.substring(commonlength);
  13548. text2 = text2.substring(commonlength); // Trim off common suffix (speedup).
  13549. commonlength = diff_commonSuffix(text1, text2);
  13550. var commonsuffix = text1.substring(text1.length - commonlength);
  13551. text1 = text1.substring(0, text1.length - commonlength);
  13552. text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block.
  13553. var diffs = diff_compute_(text1, text2); // Restore the prefix and suffix.
  13554. if (commonprefix) {
  13555. diffs.unshift([DIFF_EQUAL, commonprefix]);
  13556. }
  13557. if (commonsuffix) {
  13558. diffs.push([DIFF_EQUAL, commonsuffix]);
  13559. }
  13560. diff_cleanupMerge(diffs, _fix_unicode);
  13561. return diffs;
  13562. }
  13563. /**
  13564. * Find the differences between two texts. Assumes that the texts do not
  13565. * have any common prefix or suffix.
  13566. * @param {string} text1 Old string to be diffed.
  13567. * @param {string} text2 New string to be diffed.
  13568. * @return {Array} Array of diff tuples.
  13569. */
  13570. function diff_compute_(text1, text2) {
  13571. var diffs;
  13572. if (!text1) {
  13573. // Just add some text (speedup).
  13574. return [[DIFF_INSERT, text2]];
  13575. }
  13576. if (!text2) {
  13577. // Just delete some text (speedup).
  13578. return [[DIFF_DELETE, text1]];
  13579. }
  13580. var longtext = text1.length > text2.length ? text1 : text2;
  13581. var shorttext = text1.length > text2.length ? text2 : text1;
  13582. var i = longtext.indexOf(shorttext);
  13583. if (i !== -1) {
  13584. // Shorter text is inside the longer text (speedup).
  13585. 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.
  13586. if (text1.length > text2.length) {
  13587. diffs[0][0] = diffs[2][0] = DIFF_DELETE;
  13588. }
  13589. return diffs;
  13590. }
  13591. if (shorttext.length === 1) {
  13592. // Single character string.
  13593. // After the previous speedup, the character can't be an equality.
  13594. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  13595. } // Check to see if the problem can be split in two.
  13596. var hm = diff_halfMatch_(text1, text2);
  13597. if (hm) {
  13598. // A half-match was found, sort out the return data.
  13599. var text1_a = hm[0];
  13600. var text1_b = hm[1];
  13601. var text2_a = hm[2];
  13602. var text2_b = hm[3];
  13603. var mid_common = hm[4]; // Send both pairs off for separate processing.
  13604. var diffs_a = diff_main(text1_a, text2_a);
  13605. var diffs_b = diff_main(text1_b, text2_b); // Merge the results.
  13606. return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
  13607. }
  13608. return diff_bisect_(text1, text2);
  13609. }
  13610. /**
  13611. * Find the 'middle snake' of a diff, split the problem in two
  13612. * and return the recursively constructed diff.
  13613. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
  13614. * @param {string} text1 Old string to be diffed.
  13615. * @param {string} text2 New string to be diffed.
  13616. * @return {Array} Array of diff tuples.
  13617. * @private
  13618. */
  13619. function diff_bisect_(text1, text2) {
  13620. // Cache the text lengths to prevent multiple calls.
  13621. var text1_length = text1.length;
  13622. var text2_length = text2.length;
  13623. var max_d = Math.ceil((text1_length + text2_length) / 2);
  13624. var v_offset = max_d;
  13625. var v_length = 2 * max_d;
  13626. var v1 = new Array(v_length);
  13627. var v2 = new Array(v_length); // Setting all elements to -1 is faster in Chrome & Firefox than mixing
  13628. // integers and undefined.
  13629. for (var x = 0; x < v_length; x++) {
  13630. v1[x] = -1;
  13631. v2[x] = -1;
  13632. }
  13633. v1[v_offset + 1] = 0;
  13634. v2[v_offset + 1] = 0;
  13635. var delta = text1_length - text2_length; // If the total number of characters is odd, then the front path will collide
  13636. // with the reverse path.
  13637. var front = delta % 2 !== 0; // Offsets for start and end of k loop.
  13638. // Prevents mapping of space beyond the grid.
  13639. var k1start = 0;
  13640. var k1end = 0;
  13641. var k2start = 0;
  13642. var k2end = 0;
  13643. for (var d = 0; d < max_d; d++) {
  13644. // Walk the front path one step.
  13645. for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
  13646. var k1_offset = v_offset + k1;
  13647. var x1 = void 0;
  13648. if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
  13649. x1 = v1[k1_offset + 1];
  13650. } else {
  13651. x1 = v1[k1_offset - 1] + 1;
  13652. }
  13653. var y1 = x1 - k1;
  13654. while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
  13655. x1++;
  13656. y1++;
  13657. }
  13658. v1[k1_offset] = x1;
  13659. if (x1 > text1_length) {
  13660. // Ran off the right of the graph.
  13661. k1end += 2;
  13662. } else if (y1 > text2_length) {
  13663. // Ran off the bottom of the graph.
  13664. k1start += 2;
  13665. } else if (front) {
  13666. var k2_offset = v_offset + delta - k1;
  13667. if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
  13668. // Mirror x2 onto top-left coordinate system.
  13669. var x2 = text1_length - v2[k2_offset];
  13670. if (x1 >= x2) {
  13671. // Overlap detfrontected.
  13672. return diff_bisectSplit_(text1, text2, x1, y1);
  13673. }
  13674. }
  13675. }
  13676. } // Walk the reverse path one step.
  13677. for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
  13678. var _k2_offset = v_offset + k2;
  13679. var _x = void 0;
  13680. if (k2 === -d || k2 !== d && v2[_k2_offset - 1] < v2[_k2_offset + 1]) {
  13681. _x = v2[_k2_offset + 1];
  13682. } else {
  13683. _x = v2[_k2_offset - 1] + 1;
  13684. }
  13685. var y2 = _x - k2;
  13686. while (_x < text1_length && y2 < text2_length && text1.charAt(text1_length - _x - 1) === text2.charAt(text2_length - y2 - 1)) {
  13687. _x++;
  13688. y2++;
  13689. }
  13690. v2[_k2_offset] = _x;
  13691. if (_x > text1_length) {
  13692. // Ran off the left of the graph.
  13693. k2end += 2;
  13694. } else if (y2 > text2_length) {
  13695. // Ran off the top of the graph.
  13696. k2start += 2;
  13697. } else if (!front) {
  13698. var _k1_offset = v_offset + delta - k2;
  13699. if (_k1_offset >= 0 && _k1_offset < v_length && v1[_k1_offset] !== -1) {
  13700. var _x2 = v1[_k1_offset];
  13701. var _y = v_offset + _x2 - _k1_offset; // Mirror x2 onto top-left coordinate system.
  13702. _x = text1_length - _x;
  13703. if (_x2 >= _x) {
  13704. // Overlap detected.
  13705. return diff_bisectSplit_(text1, text2, _x2, _y);
  13706. }
  13707. }
  13708. }
  13709. }
  13710. } // Diff took too long and hit the deadline or
  13711. // number of diffs equals number of characters, no commonality at all.
  13712. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  13713. }
  13714. /**
  13715. * Given the location of the 'middle snake', split the diff in two parts
  13716. * and recurse.
  13717. * @param {string} text1 Old string to be diffed.
  13718. * @param {string} text2 New string to be diffed.
  13719. * @param {number} x Index of split point in text1.
  13720. * @param {number} y Index of split point in text2.
  13721. * @return {Array} Array of diff tuples.
  13722. */
  13723. function diff_bisectSplit_(text1, text2, x, y) {
  13724. var text1a = text1.substring(0, x);
  13725. var text2a = text2.substring(0, y);
  13726. var text1b = text1.substring(x);
  13727. var text2b = text2.substring(y); // Compute both diffs serially.
  13728. var diffs = diff_main(text1a, text2a);
  13729. var diffsb = diff_main(text1b, text2b);
  13730. return diffs.concat(diffsb);
  13731. }
  13732. /**
  13733. * Determine the common prefix of two strings.
  13734. * @param {string} text1 First string.
  13735. * @param {string} text2 Second string.
  13736. * @return {number} The number of characters common to the start of each
  13737. * string.
  13738. */
  13739. function diff_commonPrefix(text1, text2) {
  13740. // Quick check for common null cases.
  13741. if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
  13742. return 0;
  13743. } // Binary search.
  13744. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  13745. var pointermin = 0;
  13746. var pointermax = Math.min(text1.length, text2.length);
  13747. var pointermid = pointermax;
  13748. var pointerstart = 0;
  13749. while (pointermin < pointermid) {
  13750. if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
  13751. pointermin = pointermid;
  13752. pointerstart = pointermin;
  13753. } else {
  13754. pointermax = pointermid;
  13755. }
  13756. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  13757. }
  13758. if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
  13759. pointermid--;
  13760. }
  13761. return pointermid;
  13762. }
  13763. /**
  13764. * Determine the common suffix of two strings.
  13765. * @param {string} text1 First string.
  13766. * @param {string} text2 Second string.
  13767. * @return {number} The number of characters common to the end of each string.
  13768. */
  13769. function diff_commonSuffix(text1, text2) {
  13770. // Quick check for common null cases.
  13771. if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
  13772. return 0;
  13773. } // Binary search.
  13774. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  13775. var pointermin = 0;
  13776. var pointermax = Math.min(text1.length, text2.length);
  13777. var pointermid = pointermax;
  13778. var pointerend = 0;
  13779. while (pointermin < pointermid) {
  13780. if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
  13781. pointermin = pointermid;
  13782. pointerend = pointermin;
  13783. } else {
  13784. pointermax = pointermid;
  13785. }
  13786. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  13787. }
  13788. if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
  13789. pointermid--;
  13790. }
  13791. return pointermid;
  13792. }
  13793. /**
  13794. * Do the two texts share a substring which is at least half the length of the
  13795. * longer text?
  13796. * This speedup can produce non-minimal diffs.
  13797. * @param {string} text1 First string.
  13798. * @param {string} text2 Second string.
  13799. * @return {Array.<string>} Five element Array, containing the prefix of
  13800. * text1, the suffix of text1, the prefix of text2, the suffix of
  13801. * text2 and the common middle. Or null if there was no match.
  13802. */
  13803. function diff_halfMatch_(text1, text2) {
  13804. var longtext = text1.length > text2.length ? text1 : text2;
  13805. var shorttext = text1.length > text2.length ? text2 : text1;
  13806. if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
  13807. return null; // Pointless.
  13808. }
  13809. /**
  13810. * Does a substring of shorttext exist within longtext such that the substring
  13811. * is at least half the length of longtext?
  13812. * Closure, but does not reference any external variables.
  13813. * @param {string} longtext Longer string.
  13814. * @param {string} shorttext Shorter string.
  13815. * @param {number} i Start index of quarter length substring within longtext.
  13816. * @return {Array.<string>} Five element Array, containing the prefix of
  13817. * longtext, the suffix of longtext, the prefix of shorttext, the suffix
  13818. * of shorttext and the common middle. Or null if there was no match.
  13819. * @private
  13820. */
  13821. function diff_halfMatchI_(longtext, shorttext, i) {
  13822. // Start with a 1/4 length substring at position i as a seed.
  13823. var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
  13824. var j = -1;
  13825. var best_common = '';
  13826. var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
  13827. while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {
  13828. var prefixLength = diff_commonPrefix(longtext.substring(i), shorttext.substring(j));
  13829. var suffixLength = diff_commonSuffix(longtext.substring(0, i), shorttext.substring(0, j));
  13830. if (best_common.length < suffixLength + prefixLength) {
  13831. best_common = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength);
  13832. best_longtext_a = longtext.substring(0, i - suffixLength);
  13833. best_longtext_b = longtext.substring(i + prefixLength);
  13834. best_shorttext_a = shorttext.substring(0, j - suffixLength);
  13835. best_shorttext_b = shorttext.substring(j + prefixLength);
  13836. }
  13837. }
  13838. if (best_common.length * 2 >= longtext.length) {
  13839. return [best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common];
  13840. } else {
  13841. return null;
  13842. }
  13843. } // First check if the second quarter is the seed for a half-match.
  13844. var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter.
  13845. var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
  13846. var hm;
  13847. if (!hm1 && !hm2) {
  13848. return null;
  13849. } else if (!hm2) {
  13850. hm = hm1;
  13851. } else if (!hm1) {
  13852. hm = hm2;
  13853. } else {
  13854. // Both matched. Select the longest.
  13855. hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
  13856. } // A half-match was found, sort out the return data.
  13857. var text1_a, text1_b, text2_a, text2_b;
  13858. if (text1.length > text2.length) {
  13859. text1_a = hm[0];
  13860. text1_b = hm[1];
  13861. text2_a = hm[2];
  13862. text2_b = hm[3];
  13863. } else {
  13864. text2_a = hm[0];
  13865. text2_b = hm[1];
  13866. text1_a = hm[2];
  13867. text1_b = hm[3];
  13868. }
  13869. var mid_common = hm[4];
  13870. return [text1_a, text1_b, text2_a, text2_b, mid_common];
  13871. }
  13872. /**
  13873. * Reorder and merge like edit sections. Merge equalities.
  13874. * Any edit section can move as long as it doesn't cross an equality.
  13875. * @param {Array} diffs Array of diff tuples.
  13876. * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff
  13877. */
  13878. function diff_cleanupMerge(diffs, fix_unicode) {
  13879. diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
  13880. var pointer = 0;
  13881. var count_delete = 0;
  13882. var count_insert = 0;
  13883. var text_delete = '';
  13884. var text_insert = '';
  13885. var commonlength;
  13886. var previous_equality;
  13887. while (pointer < diffs.length) {
  13888. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  13889. diffs.splice(pointer, 1);
  13890. continue;
  13891. }
  13892. switch (diffs[pointer][0]) {
  13893. case DIFF_INSERT:
  13894. count_insert++;
  13895. text_insert += diffs[pointer][1];
  13896. pointer++;
  13897. break;
  13898. case DIFF_DELETE:
  13899. count_delete++;
  13900. text_delete += diffs[pointer][1];
  13901. pointer++;
  13902. break;
  13903. case DIFF_EQUAL:
  13904. previous_equality = pointer - count_insert - count_delete - 1;
  13905. if (fix_unicode) {
  13906. // prevent splitting of unicode surrogate pairs. when fix_unicode is true,
  13907. // we assume that the old and new text in the diff are complete and correct
  13908. // unicode-encoded JS strings, but the tuple boundaries may fall between
  13909. // surrogate pairs. we fix this by shaving off stray surrogates from the end
  13910. // of the previous equality and the beginning of this equality. this may create
  13911. // empty equalities or a common prefix or suffix. for example, if AB and AC are
  13912. // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and
  13913. // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this
  13914. // particular case, both equalities go away, we absorb any previous inequalities,
  13915. // and we keep scanning for the next equality before rewriting the tuples.
  13916. if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
  13917. var stray = diffs[previous_equality][1].slice(-1);
  13918. diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
  13919. text_delete = stray + text_delete;
  13920. text_insert = stray + text_insert;
  13921. if (!diffs[previous_equality][1]) {
  13922. // emptied out previous equality, so delete it and include previous delete/insert
  13923. diffs.splice(previous_equality, 1);
  13924. pointer--;
  13925. var k = previous_equality - 1;
  13926. if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
  13927. count_insert++;
  13928. text_insert = diffs[k][1] + text_insert;
  13929. k--;
  13930. }
  13931. if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
  13932. count_delete++;
  13933. text_delete = diffs[k][1] + text_delete;
  13934. k--;
  13935. }
  13936. previous_equality = k;
  13937. }
  13938. }
  13939. if (starts_with_pair_end(diffs[pointer][1])) {
  13940. var _stray = diffs[pointer][1].charAt(0);
  13941. diffs[pointer][1] = diffs[pointer][1].slice(1);
  13942. text_delete += _stray;
  13943. text_insert += _stray;
  13944. }
  13945. }
  13946. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  13947. // for empty equality not at end, wait for next equality
  13948. diffs.splice(pointer, 1);
  13949. break;
  13950. }
  13951. if (text_delete.length > 0 || text_insert.length > 0) {
  13952. // note that diff_commonPrefix and diff_commonSuffix are unicode-aware
  13953. if (text_delete.length > 0 && text_insert.length > 0) {
  13954. // Factor out any common prefixes.
  13955. commonlength = diff_commonPrefix(text_insert, text_delete);
  13956. if (commonlength !== 0) {
  13957. if (previous_equality >= 0) {
  13958. diffs[previous_equality][1] += text_insert.substring(0, commonlength);
  13959. } else {
  13960. diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
  13961. pointer++;
  13962. }
  13963. text_insert = text_insert.substring(commonlength);
  13964. text_delete = text_delete.substring(commonlength);
  13965. } // Factor out any common suffixes.
  13966. commonlength = diff_commonSuffix(text_insert, text_delete);
  13967. if (commonlength !== 0) {
  13968. diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
  13969. text_insert = text_insert.substring(0, text_insert.length - commonlength);
  13970. text_delete = text_delete.substring(0, text_delete.length - commonlength);
  13971. }
  13972. } // Delete the offending records and add the merged ones.
  13973. var n = count_insert + count_delete;
  13974. if (text_delete.length === 0 && text_insert.length === 0) {
  13975. diffs.splice(pointer - n, n);
  13976. pointer = pointer - n;
  13977. } else if (text_delete.length === 0) {
  13978. diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
  13979. pointer = pointer - n + 1;
  13980. } else if (text_insert.length === 0) {
  13981. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
  13982. pointer = pointer - n + 1;
  13983. } else {
  13984. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
  13985. pointer = pointer - n + 2;
  13986. }
  13987. }
  13988. if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
  13989. // Merge this equality with the previous one.
  13990. diffs[pointer - 1][1] += diffs[pointer][1];
  13991. diffs.splice(pointer, 1);
  13992. } else {
  13993. pointer++;
  13994. }
  13995. count_insert = 0;
  13996. count_delete = 0;
  13997. text_delete = '';
  13998. text_insert = '';
  13999. break;
  14000. }
  14001. }
  14002. if (diffs[diffs.length - 1][1] === '') {
  14003. diffs.pop(); // Remove the dummy entry at the end.
  14004. } // Second pass: look for single edits surrounded on both sides by equalities
  14005. // which can be shifted sideways to eliminate an equality.
  14006. // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
  14007. var changes = false;
  14008. pointer = 1; // Intentionally ignore the first and last element (don't need checking).
  14009. while (pointer < diffs.length - 1) {
  14010. if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
  14011. // This is a single edit surrounded by equalities.
  14012. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
  14013. // Shift the edit over the previous equality.
  14014. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
  14015. diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
  14016. diffs.splice(pointer - 1, 1);
  14017. changes = true;
  14018. } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
  14019. // Shift the edit over the next equality.
  14020. diffs[pointer - 1][1] += diffs[pointer + 1][1];
  14021. diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
  14022. diffs.splice(pointer + 1, 1);
  14023. changes = true;
  14024. }
  14025. }
  14026. pointer++;
  14027. } // If shifts were made, the diff needs reordering and another shift sweep.
  14028. if (changes) {
  14029. diff_cleanupMerge(diffs, fix_unicode);
  14030. }
  14031. }
  14032. function is_surrogate_pair_start(charCode) {
  14033. return charCode >= 0xD800 && charCode <= 0xDBFF;
  14034. }
  14035. function is_surrogate_pair_end(charCode) {
  14036. return charCode >= 0xDC00 && charCode <= 0xDFFF;
  14037. }
  14038. function starts_with_pair_end(str) {
  14039. return is_surrogate_pair_end(str.charCodeAt(0));
  14040. }
  14041. function ends_with_pair_start(str) {
  14042. return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
  14043. }
  14044. function remove_empty_tuples(tuples) {
  14045. var ret = [];
  14046. for (var i = 0; i < tuples.length; i++) {
  14047. if (tuples[i][1].length > 0) {
  14048. ret.push(tuples[i]);
  14049. }
  14050. }
  14051. return ret;
  14052. }
  14053. function make_edit_splice(before, oldMiddle, newMiddle, after) {
  14054. if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
  14055. return null;
  14056. }
  14057. return remove_empty_tuples([[DIFF_EQUAL, before], [DIFF_DELETE, oldMiddle], [DIFF_INSERT, newMiddle], [DIFF_EQUAL, after]]);
  14058. }
  14059. function find_cursor_edit_diff(oldText, newText, cursor_pos) {
  14060. // note: this runs after equality check has ruled out exact equality
  14061. var oldRange = typeof cursor_pos === 'number' ? {
  14062. index: cursor_pos,
  14063. length: 0
  14064. } : cursor_pos.oldRange;
  14065. var newRange = typeof cursor_pos === 'number' ? null : cursor_pos.newRange; // take into account the old and new selection to generate the best diff
  14066. // possible for a text edit. for example, a text change from "xxx" to "xx"
  14067. // could be a delete or forwards-delete of any one of the x's, or the
  14068. // result of selecting two of the x's and typing "x".
  14069. var oldLength = oldText.length;
  14070. var newLength = newText.length;
  14071. if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
  14072. // see if we have an insert or delete before or after cursor
  14073. var oldCursor = oldRange.index;
  14074. var oldBefore = oldText.slice(0, oldCursor);
  14075. var oldAfter = oldText.slice(oldCursor);
  14076. var maybeNewCursor = newRange ? newRange.index : null;
  14077. editBefore: {
  14078. // is this an insert or delete right before oldCursor?
  14079. var newCursor = oldCursor + newLength - oldLength;
  14080. if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
  14081. break editBefore;
  14082. }
  14083. if (newCursor < 0 || newCursor > newLength) {
  14084. break editBefore;
  14085. }
  14086. var newBefore = newText.slice(0, newCursor);
  14087. var newAfter = newText.slice(newCursor);
  14088. if (newAfter !== oldAfter) {
  14089. break editBefore;
  14090. }
  14091. var prefixLength = Math.min(oldCursor, newCursor);
  14092. var oldPrefix = oldBefore.slice(0, prefixLength);
  14093. var newPrefix = newBefore.slice(0, prefixLength);
  14094. if (oldPrefix !== newPrefix) {
  14095. break editBefore;
  14096. }
  14097. var oldMiddle = oldBefore.slice(prefixLength);
  14098. var newMiddle = newBefore.slice(prefixLength);
  14099. return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
  14100. }
  14101. editAfter: {
  14102. // is this an insert or delete right after oldCursor?
  14103. if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
  14104. break editAfter;
  14105. }
  14106. var cursor = oldCursor;
  14107. var _newBefore = newText.slice(0, cursor);
  14108. var _newAfter = newText.slice(cursor);
  14109. if (_newBefore !== oldBefore) {
  14110. break editAfter;
  14111. }
  14112. var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
  14113. var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
  14114. var newSuffix = _newAfter.slice(_newAfter.length - suffixLength);
  14115. if (oldSuffix !== newSuffix) {
  14116. break editAfter;
  14117. }
  14118. var _oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
  14119. var _newMiddle = _newAfter.slice(0, _newAfter.length - suffixLength);
  14120. return make_edit_splice(oldBefore, _oldMiddle, _newMiddle, oldSuffix);
  14121. }
  14122. }
  14123. if (oldRange.length > 0 && newRange && newRange.length === 0) {
  14124. replaceRange: {
  14125. // see if diff could be a splice of the old selection range
  14126. var _oldPrefix = oldText.slice(0, oldRange.index);
  14127. var _oldSuffix = oldText.slice(oldRange.index + oldRange.length);
  14128. var _prefixLength = _oldPrefix.length;
  14129. var _suffixLength = _oldSuffix.length;
  14130. if (newLength < _prefixLength + _suffixLength) {
  14131. break replaceRange;
  14132. }
  14133. var _newPrefix = newText.slice(0, _prefixLength);
  14134. var _newSuffix = newText.slice(newLength - _suffixLength);
  14135. if (_oldPrefix !== _newPrefix || _oldSuffix !== _newSuffix) {
  14136. break replaceRange;
  14137. }
  14138. var _oldMiddle2 = oldText.slice(_prefixLength, oldLength - _suffixLength);
  14139. var _newMiddle2 = newText.slice(_prefixLength, newLength - _suffixLength);
  14140. return make_edit_splice(_oldPrefix, _oldMiddle2, _newMiddle2, _oldSuffix);
  14141. }
  14142. }
  14143. return null;
  14144. }
  14145. function diff(text1, text2, cursor_pos) {
  14146. // only pass fix_unicode=true at the top level, not when diff_main is
  14147. // recursively invoked
  14148. return diff_main(text1, text2, cursor_pos, true);
  14149. }
  14150. diff.INSERT = DIFF_INSERT;
  14151. diff.DELETE = DIFF_DELETE;
  14152. diff.EQUAL = DIFF_EQUAL;
  14153. /* harmony default export */ __webpack_exports__["default"] = (diff);
  14154. /***/ }),
  14155. /***/ "./js/util/testConsole.js":
  14156. /*!********************************!*\
  14157. !*** ./js/util/testConsole.js ***!
  14158. \********************************/
  14159. /*! exports provided: TestConsole */
  14160. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14161. "use strict";
  14162. __webpack_require__.r(__webpack_exports__);
  14163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestConsole", function() { return TestConsole; });
  14164. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  14165. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  14166. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  14167. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  14168. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../io/domConsole */ "./js/io/domConsole.js");
  14169. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14170. var LocalizedStrings = Object(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["getInstance"])();
  14171. var TestConsole = /*#__PURE__*/function () {
  14172. function TestConsole(inputList) {
  14173. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, TestConsole);
  14174. this.index = 0;
  14175. this.inputList = inputList;
  14176. this.list = [];
  14177. this.currentLine = null;
  14178. }
  14179. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(TestConsole, [{
  14180. key: "writeRawHTML",
  14181. value: function writeRawHTML(text) {
  14182. this._appendTextLn(text);
  14183. }
  14184. }, {
  14185. key: "write",
  14186. value: function write(text) {
  14187. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14188. this._appendText(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER, newLine);
  14189. }
  14190. }, {
  14191. key: "info",
  14192. value: function info(text) {
  14193. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO);
  14194. }
  14195. }, {
  14196. key: "err",
  14197. value: function err(text) {
  14198. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR);
  14199. }
  14200. }, {
  14201. key: "_appendText",
  14202. value: function _appendText(text, _type) {
  14203. var newLine = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14204. if (this.currentLine == null) {
  14205. this.currentLine = this.list.push('') - 1;
  14206. }
  14207. this.list[this.currentLine] += text;
  14208. if (newLine) {
  14209. this.currentLine = null;
  14210. }
  14211. }
  14212. }, {
  14213. key: "_appendTextLn",
  14214. value: function _appendTextLn(text) {
  14215. this.list.push(text);
  14216. this.currentLine = null;
  14217. }
  14218. }, {
  14219. key: "getClassForType",
  14220. value: function getClassForType(type) {
  14221. switch (type) {
  14222. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER:
  14223. return "ivprog-term-userText";
  14224. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO:
  14225. return "ivprog-term-info";
  14226. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR:
  14227. return "ivprog-term-error";
  14228. }
  14229. }
  14230. }, {
  14231. key: "requestInput",
  14232. value: function requestInput() {
  14233. var _this = this;
  14234. var promise = new Promise(function (resolve, reject) {
  14235. if (_this.index < _this.inputList.length) {
  14236. resolve(_this.inputList[_this.index]);
  14237. _this.index++;
  14238. } else {
  14239. reject(new Error(LocalizedStrings.getError("exceeded_input_request")));
  14240. }
  14241. });
  14242. return promise;
  14243. }
  14244. }, {
  14245. key: "sendOutput",
  14246. value: function sendOutput(text) {
  14247. var _this2 = this;
  14248. var output = '' + text;
  14249. if (output.indexOf('\n') !== -1) {
  14250. var outputList = output.split('\n');
  14251. var last = outputList.pop();
  14252. outputList.forEach(function (t) {
  14253. t = t.replace(/\t/g, '&#x0020;&#x0020;');
  14254. t = t.replace(/\s/g, "&#x0020;");
  14255. if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
  14256. });
  14257. last = last.replace(/\t/g, '&#x0020;&#x0020;');
  14258. last = last.replace(/\s/g, "&#x0020;");
  14259. if (last.length != 0) this.write(last);
  14260. } else {
  14261. output = output.replace(/\t/g, '&#x0020;&#x0020;');
  14262. output = output.replace(/\s/g, "&#x0020;");
  14263. this.write(output);
  14264. }
  14265. }
  14266. }]);
  14267. return TestConsole;
  14268. }();
  14269. /***/ }),
  14270. /***/ "./js/util/utils.js":
  14271. /*!**************************!*\
  14272. !*** ./js/util/utils.js ***!
  14273. \**************************/
  14274. /*! exports provided: scrollIt, isElementInViewport, isKeyword, isValidIdentifier, getCodeEditorModeConfig, levenshteinDistance, openAssessmentDetail, range, sleep */
  14275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14276. "use strict";
  14277. __webpack_require__.r(__webpack_exports__);
  14278. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollIt", function() { return scrollIt; });
  14279. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementInViewport", function() { return isElementInViewport; });
  14280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyword", function() { return isKeyword; });
  14281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidIdentifier", function() { return isValidIdentifier; });
  14282. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeEditorModeConfig", function() { return getCodeEditorModeConfig; });
  14283. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "levenshteinDistance", function() { return levenshteinDistance; });
  14284. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return openAssessmentDetail; });
  14285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
  14286. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sleep", function() { return sleep; });
  14287. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  14288. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  14289. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  14290. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  14291. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  14292. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);
  14293. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../services/languageService */ "./js/services/languageService.js");
  14294. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14295. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  14296. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_5__);
  14297. /**
  14298. * source: https://pawelgrzybek.com/page-scroll-in-vanilla-javascript/
  14299. *
  14300. */
  14301. function scrollIt(destination) {
  14302. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
  14303. var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'linear';
  14304. var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  14305. var easings = {
  14306. linear: function linear(t) {
  14307. return t;
  14308. },
  14309. easeInQuad: function easeInQuad(t) {
  14310. return t * t;
  14311. },
  14312. easeOutQuad: function easeOutQuad(t) {
  14313. return t * (2 - t);
  14314. },
  14315. easeInOutQuad: function easeInOutQuad(t) {
  14316. return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
  14317. },
  14318. easeInCubic: function easeInCubic(t) {
  14319. return t * t * t;
  14320. },
  14321. easeOutCubic: function easeOutCubic(t) {
  14322. return --t * t * t + 1;
  14323. },
  14324. easeInOutCubic: function easeInOutCubic(t) {
  14325. return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
  14326. },
  14327. easeInQuart: function easeInQuart(t) {
  14328. return t * t * t * t;
  14329. },
  14330. easeOutQuart: function easeOutQuart(t) {
  14331. return 1 - --t * t * t * t;
  14332. },
  14333. easeInOutQuart: function easeInOutQuart(t) {
  14334. return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
  14335. },
  14336. easeInQuint: function easeInQuint(t) {
  14337. return t * t * t * t * t;
  14338. },
  14339. easeOutQuint: function easeOutQuint(t) {
  14340. return 1 + --t * t * t * t * t;
  14341. },
  14342. easeInOutQuint: function easeInOutQuint(t) {
  14343. return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
  14344. }
  14345. };
  14346. var start = window.pageYOffset;
  14347. var startTime = 'now' in window.performance ? performance.now() : new Date().getTime();
  14348. var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
  14349. var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
  14350. var destinationOffset = typeof destination === 'number' ? destination : destination.offsetTop;
  14351. var destinationOffsetToScroll = Math.round(documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset);
  14352. if ('requestAnimationFrame' in window === false) {
  14353. window.scroll(0, destinationOffsetToScroll);
  14354. if (callback) {
  14355. callback();
  14356. }
  14357. return;
  14358. }
  14359. function scroll() {
  14360. var now = 'now' in window.performance ? performance.now() : new Date().getTime();
  14361. var time = Math.min(1, (now - startTime) / duration);
  14362. var timeFunction = easings[easing](time);
  14363. window.scroll(0, Math.ceil(timeFunction * (destinationOffsetToScroll - start) + start));
  14364. if (window.pageYOffset === destinationOffsetToScroll) {
  14365. if (callback) {
  14366. callback();
  14367. }
  14368. return;
  14369. }
  14370. requestAnimationFrame(scroll);
  14371. }
  14372. scroll();
  14373. }
  14374. /**
  14375. *
  14376. * source: https://stackoverflow.com/a/16270434
  14377. */
  14378. function isElementInViewport(el) {
  14379. var rect = el.getBoundingClientRect();
  14380. return rect.bottom > 0 && rect.right > 0 && rect.left < (window.innerWidth || document.documentElement.clientWidth) && rect.top < (window.innerHeight || document.documentElement.clientHeight);
  14381. }
  14382. var cacheMainList = null;
  14383. var cacheOp = null;
  14384. function fillCache() {
  14385. if (cacheMainList == null) {
  14386. cacheMainList = [];
  14387. 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"];
  14388. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  14389. var nullLexer = new lexerClass();
  14390. for (var key = 0; key < mainList.length; ++key) {
  14391. var word = mainList[key];
  14392. var keyword = nullLexer.literalNames[lexerClass[word]];
  14393. cacheMainList.push(keyword.substring(1, keyword.length - 1));
  14394. }
  14395. }
  14396. if (cacheOp == null) {
  14397. cacheOp = [];
  14398. 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];
  14399. for (var op = 0; op < logicOpList.length; ++op) {
  14400. var lOp = "logic_operator_".concat(logicOpList[op]);
  14401. cacheOp.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp));
  14402. }
  14403. }
  14404. }
  14405. function isKeyword(text) {
  14406. fillCache();
  14407. for (var key = 0; key < cacheMainList.length; ++key) {
  14408. var keyword = cacheMainList[key];
  14409. if (keyword == text) {
  14410. return true;
  14411. }
  14412. } // not in main list, check op
  14413. for (var op = 0; op < cacheOp.length; op++) {
  14414. var lOp = cacheOp[op];
  14415. if (lOp == text) {
  14416. return true;
  14417. }
  14418. }
  14419. return false;
  14420. }
  14421. function isValidIdentifier(identifier_str) {
  14422. var validRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  14423. if (!validRegex) {
  14424. return false;
  14425. }
  14426. return !isKeyword(identifier_str);
  14427. }
  14428. function getCodeEditorModeConfig() {
  14429. 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"];
  14430. var keywordsList = ["RK_CONST", "RK_RETURN", "RK_BREAK", "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS", "RK_DO_UNTIL"];
  14431. var typeList = ["RK_REAL", "RK_VOID", "RK_BOOLEAN", "RK_STRING", "RK_INTEGER", "RK_CHARACTER"];
  14432. var atomList = ["RK_FALSE", "RK_TRUE"];
  14433. var case_default = [];
  14434. var blocks = [];
  14435. var keywords = [];
  14436. var types = [];
  14437. var atoms = [];
  14438. var switchString = "";
  14439. cacheMainList = [];
  14440. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  14441. var nullLexer = new lexerClass();
  14442. blockList.forEach(function (v) {
  14443. var keyword = nullLexer.literalNames[lexerClass[v]];
  14444. var value = keyword.substring(1, keyword.length - 1);
  14445. cacheMainList.push(value);
  14446. keywords.push(value);
  14447. blocks.push(value);
  14448. if (v == "RK_SWITCH") {
  14449. switchString = value;
  14450. } else if (v == "RK_CASE" || v == "RK_DEFAULT") {
  14451. case_default.push(value);
  14452. }
  14453. });
  14454. keywordsList.forEach(function (v) {
  14455. var keyword = nullLexer.literalNames[lexerClass[v]];
  14456. var value = keyword.substring(1, keyword.length - 1);
  14457. cacheMainList.push(value);
  14458. keywords.push(value);
  14459. });
  14460. typeList.forEach(function (v) {
  14461. var keyword = nullLexer.literalNames[lexerClass[v]];
  14462. var value = keyword.substring(1, keyword.length - 1);
  14463. cacheMainList.push(value);
  14464. types.push(value);
  14465. });
  14466. atomList.forEach(function (v) {
  14467. var keyword = nullLexer.literalNames[lexerClass[v]];
  14468. var value = keyword.substring(1, keyword.length - 1);
  14469. cacheMainList.push(value);
  14470. atoms.push(value);
  14471. });
  14472. cacheOp = [];
  14473. 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];
  14474. for (var op = 0; op < logicOpList.length; ++op) {
  14475. var lOp = "logic_operator_".concat(logicOpList[op]);
  14476. var value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp);
  14477. cacheOp.push(value);
  14478. keywords.push(value);
  14479. }
  14480. return {
  14481. case_default: case_default,
  14482. atoms: atoms,
  14483. keywords: keywords,
  14484. switchString: switchString,
  14485. types: types,
  14486. blocks: blocks
  14487. };
  14488. }
  14489. /**
  14490. * Source: https://gist.github.com/andrei-m/982927
  14491. * @param {string} a
  14492. * @param {string} b
  14493. */
  14494. function levenshteinDistance(a, b) {
  14495. if (a.length == 0) return b.length;
  14496. if (b.length == 0) return a.length;
  14497. var matrix = []; // increment along the first column of each row
  14498. var i;
  14499. for (i = 0; i <= b.length; i++) {
  14500. matrix[i] = [i];
  14501. } // increment each column in the first row
  14502. var j;
  14503. for (j = 0; j <= a.length; j++) {
  14504. matrix[0][j] = j;
  14505. } // Fill in the rest of the matrix
  14506. for (i = 1; i <= b.length; i++) {
  14507. for (j = 1; j <= a.length; j++) {
  14508. if (b.charCodeAt(i - 1) == a.charCodeAt(j - 1)) {
  14509. matrix[i][j] = matrix[i - 1][j - 1];
  14510. } else {
  14511. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
  14512. Math.min(matrix[i][j - 1] + 1, // insertion
  14513. matrix[i - 1][j] + 1)); // deletion
  14514. }
  14515. }
  14516. }
  14517. return matrix[b.length][a.length];
  14518. }
  14519. var win = null;
  14520. function openAssessmentDetail(event) {
  14521. event.preventDefault();
  14522. var page_code = event.currentTarget.dataset.page;
  14523. if (win != null) {
  14524. win.close();
  14525. }
  14526. win = window.open("", "DetailWindow", "width=550,height=600");
  14527. win.document.open();
  14528. win.document.write(page_code);
  14529. win.document.close();
  14530. }
  14531. function range(size) {
  14532. var startAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  14533. return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(Array(size).keys()).map(function (i) {
  14534. return i + startAt;
  14535. });
  14536. }
  14537. /**
  14538. *
  14539. * @param {number} ms
  14540. */
  14541. function sleep(_x) {
  14542. return _sleep.apply(this, arguments);
  14543. }
  14544. function _sleep() {
  14545. _sleep = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(ms) {
  14546. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  14547. while (1) {
  14548. switch (_context.prev = _context.next) {
  14549. case 0:
  14550. return _context.abrupt("return", new Promise(function (res, _) {
  14551. return setTimeout(res, ms);
  14552. }));
  14553. case 1:
  14554. case "end":
  14555. return _context.stop();
  14556. }
  14557. }
  14558. }, _callee);
  14559. }));
  14560. return _sleep.apply(this, arguments);
  14561. }
  14562. /***/ }),
  14563. /***/ "./js/visualUI/algorithm.js":
  14564. /*!**********************************!*\
  14565. !*** ./js/visualUI/algorithm.js ***!
  14566. \**********************************/
  14567. /*! exports provided: renderAlgorithm */
  14568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14569. "use strict";
  14570. __webpack_require__.r(__webpack_exports__);
  14571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderAlgorithm", function() { return renderAlgorithm; });
  14572. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  14573. /* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions */ "./js/visualUI/functions.js");
  14574. window.block_render = false;
  14575. function renderAlgorithm() {
  14576. if (window.block_render) {
  14577. return;
  14578. }
  14579. if (window.draging) {
  14580. return;
  14581. }
  14582. window.block_render = true;
  14583. $('.all_functions').children().off();
  14584. $('.all_functions').empty();
  14585. $('.list_globals').children().off();
  14586. $('.list_globals').empty();
  14587. for (var i = 0; i < window.program_obj.functions.length; i++) {
  14588. _functions__WEBPACK_IMPORTED_MODULE_1__["renderFunction"](window.program_obj.functions[i]);
  14589. }
  14590. for (var i = 0; i < window.program_obj.globals.length; i++) {
  14591. _globals__WEBPACK_IMPORTED_MODULE_0__["renderGlobal"](window.program_obj.globals[i]);
  14592. }
  14593. setTimeout(function () {
  14594. window.block_render = false;
  14595. }, 100);
  14596. if (settingsFilter && settingsFilter[0]) {
  14597. blockAllEditingOptions();
  14598. }
  14599. }
  14600. /***/ }),
  14601. /***/ "./js/visualUI/code_generator.js":
  14602. /*!***************************************!*\
  14603. !*** ./js/visualUI/code_generator.js ***!
  14604. \***************************************/
  14605. /*! exports provided: generate */
  14606. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14607. "use strict";
  14608. __webpack_require__.r(__webpack_exports__);
  14609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
  14610. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  14611. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  14612. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14613. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  14614. /* eslint-disable @typescript-eslint/no-use-before-define */
  14615. /* globals $*/
  14616. function generate() {
  14617. $(".ivprog_visual_panel").find(".error_icon").remove();
  14618. var code = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("program") + " { ";
  14619. code += globalsCode();
  14620. code += "\n";
  14621. var has_error = false;
  14622. for (var i = 0; i < window.program_obj.functions.length; i++) {
  14623. var n_code = functionsCode(window.program_obj.functions[i]);
  14624. if (n_code == null) {
  14625. has_error = true;
  14626. }
  14627. code += n_code;
  14628. code += "\n";
  14629. }
  14630. code += "\n}";
  14631. if (has_error) {
  14632. return null;
  14633. } else {
  14634. return code;
  14635. }
  14636. }
  14637. function functionsCode(function_obj) {
  14638. var ret = "\n\t" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + " ";
  14639. var has_error = false;
  14640. switch (function_obj.return_type) {
  14641. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  14642. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  14643. break;
  14644. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  14645. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  14646. break;
  14647. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  14648. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  14649. break;
  14650. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  14651. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  14652. break;
  14653. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  14654. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  14655. break;
  14656. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID:
  14657. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_void");
  14658. break;
  14659. }
  14660. ret += " ";
  14661. if (function_obj.return_dimensions == 1) {
  14662. ret += "[] ";
  14663. } else if (function_obj.return_dimensions == 2) {
  14664. ret += "[][] ";
  14665. }
  14666. if (function_obj.is_main) {
  14667. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("start");
  14668. } else {
  14669. ret += function_obj.name;
  14670. }
  14671. ret += " ( ";
  14672. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  14673. ret += parametersCode(function_obj.parameters_list[j]);
  14674. if (j + 1 < function_obj.parameters_list.length) {
  14675. ret += ", ";
  14676. }
  14677. }
  14678. ret += " ) {";
  14679. for (var _j = 0; _j < function_obj.variables_list.length; _j++) {
  14680. ret += variablesCode(function_obj.variables_list[_j]);
  14681. }
  14682. for (var _j2 = 0; _j2 < function_obj.commands.length; _j2++) {
  14683. //try {
  14684. ret += commandsCode(function_obj.commands[_j2]);
  14685. /*} catch (err) {
  14686. has_error = true;
  14687. console.error(err.message);
  14688. var todos = $('body').find('.command_container');
  14689. for (var i = 0; i < todos.length; i++) {
  14690. if ($(todos[i]).data('command') == function_obj.commands[j]) {
  14691. $( todos[i] ).prepend( ' <i class="ui icon red exclamation triangle error_icon"></i> ' );
  14692. break;
  14693. }
  14694. }
  14695. }*/
  14696. }
  14697. ret += "\n\t}";
  14698. if (has_error) {
  14699. return null;
  14700. } else {
  14701. return ret;
  14702. }
  14703. }
  14704. function commandsCode(command_obj) {
  14705. var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  14706. switch (command_obj.type) {
  14707. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["break"]:
  14708. return breaksCode(command_obj, indentation);
  14709. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].comment:
  14710. return commentsCode(command_obj, indentation);
  14711. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].reader:
  14712. return readersCode(command_obj, indentation);
  14713. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer:
  14714. return writersCode(command_obj, indentation);
  14715. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].functioncall:
  14716. return functioncallsCode(command_obj, indentation);
  14717. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution:
  14718. return attributionsCode(command_obj, indentation);
  14719. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].whiletrue:
  14720. return whiletruesCode(command_obj, indentation);
  14721. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].dowhiletrue:
  14722. return doWhilesCode(command_obj, indentation);
  14723. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].iftrue:
  14724. return iftruesCode(command_obj, indentation);
  14725. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].repeatNtimes:
  14726. return repeatNtimesCode(command_obj, indentation);
  14727. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["switch"]:
  14728. return switchsCode(command_obj, indentation);
  14729. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["return"]:
  14730. return returnsCode(command_obj, indentation);
  14731. }
  14732. }
  14733. function returnsCode(command_obj, indentation) {
  14734. var ret = "\n";
  14735. for (var i = 0; i < indentation; i++) {
  14736. ret += "\t";
  14737. }
  14738. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_return");
  14739. if (command_obj.variable_value_menu) {
  14740. try {
  14741. ret += " " + elementExpressionCode(command_obj.variable_value_menu); //ret += ' ' + variableValueMenuCode(command_obj.variable_value_menu, true);
  14742. } catch (err) {//Empty block
  14743. }
  14744. }
  14745. return ret;
  14746. }
  14747. function breaksCode(_command_obj, indentation) {
  14748. var ret = "\n";
  14749. for (var i = 0; i < indentation; i++) {
  14750. ret += "\t";
  14751. }
  14752. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_break");
  14753. return ret;
  14754. }
  14755. function switchsCode(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_code_switch") + " ( ";
  14761. ret += variableValueMenuCode(command_obj.variable);
  14762. ret += " ) { ";
  14763. if (command_obj.cases) {
  14764. for (var _i = 0; _i < command_obj.cases.length; _i++) {
  14765. ret += switchcasesCode(command_obj.cases[_i], indentation + 1);
  14766. }
  14767. }
  14768. ret += "\n";
  14769. for (var _i2 = 0; _i2 < indentation; _i2++) {
  14770. ret += "\t";
  14771. }
  14772. ret += "} ";
  14773. return ret;
  14774. }
  14775. function switchcasesCode(switchcase, indentation) {
  14776. var ret = "\n";
  14777. for (var i = 0; i < indentation; i++) {
  14778. ret += "\t";
  14779. }
  14780. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_case") + " ";
  14781. ret += variableValueMenuCode(switchcase.variable_value_menu);
  14782. ret += " :";
  14783. if (switchcase.commands_block) {
  14784. for (var _i3 = 0; _i3 < switchcase.commands_block.length; _i3++) {
  14785. ret += commandsCode(switchcase.commands_block[_i3], indentation + 1);
  14786. }
  14787. }
  14788. return ret;
  14789. }
  14790. function repeatNtimesCode(command_obj, indentation) {
  14791. var ret = "\n";
  14792. for (var i = 0; i < indentation; i++) {
  14793. ret += "\t";
  14794. }
  14795. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_for") + " ";
  14796. if (command_obj.var_attribution) {
  14797. ret += variableValueMenuCode(command_obj.var_attribution);
  14798. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
  14799. ret += variableValueMenuCode(command_obj.expression1);
  14800. }
  14801. if (command_obj.expression2) {
  14802. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
  14803. ret += variableValueMenuCode(command_obj.expression2);
  14804. }
  14805. if (command_obj.expression3) {
  14806. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
  14807. switch (command_obj.expression3.itens[1]) {
  14808. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  14809. ret += " +";
  14810. break;
  14811. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  14812. ret += " -";
  14813. break;
  14814. }
  14815. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  14816. }
  14817. /*if (command_obj.var_incrementation) {
  14818. ret += variableValueMenuCode(command_obj.var_incrementation);
  14819. ret += ' <- ';
  14820. ret += variableValueMenuCode(command_obj.expression3.itens[0]);
  14821. switch (command_obj.expression3.itens[1]) {
  14822. case Models.ARITHMETIC_TYPES.plus:
  14823. ret += ' + ';
  14824. break;
  14825. case Models.ARITHMETIC_TYPES.minus:
  14826. ret += ' - ';
  14827. break;
  14828. case Models.ARITHMETIC_TYPES.multiplication:
  14829. ret += ' * ';
  14830. break;
  14831. case Models.ARITHMETIC_TYPES.division:
  14832. ret += ' / ';
  14833. break;
  14834. case Models.ARITHMETIC_TYPES.module:
  14835. ret += ' % ';
  14836. break;
  14837. }
  14838. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  14839. }*/
  14840. ret += " { ";
  14841. if (command_obj.commands_block) {
  14842. for (var _i4 = 0; _i4 < command_obj.commands_block.length; _i4++) {
  14843. ret += commandsCode(command_obj.commands_block[_i4], indentation + 1);
  14844. }
  14845. }
  14846. ret += "\n";
  14847. for (var _i5 = 0; _i5 < indentation; _i5++) {
  14848. ret += "\t";
  14849. }
  14850. ret += "}";
  14851. return ret;
  14852. }
  14853. function iftruesCode(command_obj, indentation) {
  14854. var ret = "\n";
  14855. for (var i = 0; i < indentation; i++) {
  14856. ret += "\t";
  14857. }
  14858. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_if");
  14859. if (!command_obj.expression) {
  14860. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  14861. } else {
  14862. ret += " ( ";
  14863. ret += elementExpressionCode(command_obj.expression);
  14864. ret += " ) ";
  14865. }
  14866. /*switch (command_obj.expression.expression.type) {
  14867. case Models.EXPRESSION_TYPES.exp_logic:
  14868. ret += logicExpressionCode(command_obj.expression.expression);
  14869. break;
  14870. case Models.EXPRESSION_TYPES.exp_arithmetic:
  14871. ret += arithmeticExpressionCode(command_obj.expression.expression);
  14872. break;
  14873. }*/
  14874. ret += " { ";
  14875. if (command_obj.commands_block) {
  14876. for (var _i6 = 0; _i6 < command_obj.commands_block.length; _i6++) {
  14877. ret += commandsCode(command_obj.commands_block[_i6], indentation + 1);
  14878. }
  14879. }
  14880. ret += "\n";
  14881. for (var _i7 = 0; _i7 < indentation; _i7++) {
  14882. ret += "\t";
  14883. }
  14884. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_else") + " {";
  14885. if (command_obj.commands_else) {
  14886. for (var _i8 = 0; _i8 < command_obj.commands_else.length; _i8++) {
  14887. ret += commandsCode(command_obj.commands_else[_i8], indentation + 1);
  14888. }
  14889. }
  14890. ret += "\n";
  14891. for (var _i9 = 0; _i9 < indentation; _i9++) {
  14892. ret += "\t";
  14893. }
  14894. ret += "}";
  14895. return ret;
  14896. }
  14897. function doWhilesCode(command_obj, indentation) {
  14898. var ret = "\n";
  14899. for (var i = 0; i < indentation; i++) {
  14900. ret += "\t";
  14901. }
  14902. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do") + " { ";
  14903. if (command_obj.commands_block) {
  14904. for (var _i10 = 0; _i10 < command_obj.commands_block.length; _i10++) {
  14905. ret += commandsCode(command_obj.commands_block[_i10], indentation + 1);
  14906. }
  14907. }
  14908. ret += "\n";
  14909. for (var _i11 = 0; _i11 < indentation; _i11++) {
  14910. ret += "\t";
  14911. }
  14912. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do_until");
  14913. if (!command_obj.expression) {
  14914. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  14915. }
  14916. /*switch (command_obj.expression.expression.type) {
  14917. case Models.EXPRESSION_TYPES.exp_logic:
  14918. ret += logicExpressionCode(command_obj.expression.expression);
  14919. break;
  14920. case Models.EXPRESSION_TYPES.exp_arithmetic:
  14921. ret += arithmeticExpressionCode(command_obj.expression.expression);
  14922. break;
  14923. }*/
  14924. if (command_obj.expression) {
  14925. ret += " ( ";
  14926. ret += elementExpressionCode(command_obj.expression);
  14927. ret += " ) ";
  14928. }
  14929. return ret;
  14930. }
  14931. function whiletruesCode(command_obj, indentation) {
  14932. var ret = "\n";
  14933. for (var i = 0; i < indentation; i++) {
  14934. ret += "\t";
  14935. }
  14936. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_while");
  14937. if (!command_obj.expression) {
  14938. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  14939. }
  14940. /*switch (command_obj.expression.expression.type) {
  14941. case Models.EXPRESSION_TYPES.exp_logic:
  14942. ret += logicExpressionCode(command_obj.expression.expression);
  14943. break;
  14944. case Models.EXPRESSION_TYPES.exp_arithmetic:
  14945. ret += arithmeticExpressionCode(command_obj.expression.expression);
  14946. break;
  14947. }*/
  14948. if (command_obj.expression) {
  14949. ret += " ( ";
  14950. ret += elementExpressionCode(command_obj.expression);
  14951. ret += " ) ";
  14952. }
  14953. ret += " { ";
  14954. if (command_obj.commands_block) {
  14955. for (var _i12 = 0; _i12 < command_obj.commands_block.length; _i12++) {
  14956. ret += commandsCode(command_obj.commands_block[_i12], indentation + 1);
  14957. }
  14958. }
  14959. ret += "\n";
  14960. for (var _i13 = 0; _i13 < indentation; _i13++) {
  14961. ret += "\t";
  14962. }
  14963. ret += "}";
  14964. return ret;
  14965. }
  14966. function logicExpressionCode(expression) {
  14967. var ret = " ( ";
  14968. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  14969. ret += logicExpressionCode(expression.first_operand);
  14970. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  14971. ret += arithmeticExpressionCode(expression.first_operand);
  14972. } else {
  14973. ret += variableValueMenuCode(expression.first_operand);
  14974. }
  14975. if (expression.operator) {
  14976. switch (expression.operator) {
  14977. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  14978. ret += " == ";
  14979. break;
  14980. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  14981. ret += " != ";
  14982. break;
  14983. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  14984. ret += " && ";
  14985. break;
  14986. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  14987. ret += " || ";
  14988. break;
  14989. }
  14990. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  14991. ret += logicExpressionCode(expression.second_operand);
  14992. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  14993. ret += arithmeticExpressionCode(expression.second_operand);
  14994. } else {
  14995. ret += variableValueMenuCode(expression.second_operand);
  14996. }
  14997. }
  14998. ret += " ) ";
  14999. return ret;
  15000. }
  15001. function arithmeticExpressionCode(expression) {
  15002. var ret = " ( ";
  15003. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15004. ret += logicExpressionCode(expression.first_operand);
  15005. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15006. ret += arithmeticExpressionCode(expression.first_operand);
  15007. } else {
  15008. ret += variableValueMenuCode(expression.first_operand);
  15009. }
  15010. switch (expression.operator) {
  15011. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15012. ret += " > ";
  15013. break;
  15014. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15015. ret += " < ";
  15016. break;
  15017. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to:
  15018. ret += " == ";
  15019. break;
  15020. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to:
  15021. ret += " != ";
  15022. break;
  15023. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15024. ret += " >= ";
  15025. break;
  15026. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15027. ret += " <= ";
  15028. break;
  15029. }
  15030. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15031. ret += logicExpressionCode(expression.second_operand);
  15032. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15033. ret += arithmeticExpressionCode(expression.second_operand);
  15034. } else {
  15035. ret += variableValueMenuCode(expression.second_operand);
  15036. }
  15037. ret += " ) ";
  15038. return ret;
  15039. }
  15040. function attributionsCode(command_obj, indentation) {
  15041. var ret = "\n";
  15042. for (var i = 0; i < indentation; i++) {
  15043. ret += "\t";
  15044. }
  15045. ret += variableValueMenuCode(command_obj.variable) + " <- ";
  15046. /*for (var i = 0; i < command_obj.expression.length; i++) {
  15047. ret += elementExpressionCode(command_obj.expression[i]);
  15048. }*/
  15049. ret += elementExpressionCode(command_obj.expression);
  15050. return ret;
  15051. }
  15052. function elementExpressionCode(expression_obj) {
  15053. var ret = "";
  15054. for (var i = 0; i < expression_obj.length; i++) {
  15055. if (expression_obj[i].type) {
  15056. ret += variableValueMenuCode(expression_obj[i]);
  15057. } else if (expression_obj[i].type_op) {
  15058. switch (expression_obj[i].item) {
  15059. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15060. ret += " + ";
  15061. break;
  15062. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15063. ret += " - ";
  15064. break;
  15065. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication:
  15066. ret += " * ";
  15067. break;
  15068. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division:
  15069. ret += " / ";
  15070. break;
  15071. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module:
  15072. ret += " % ";
  15073. break;
  15074. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  15075. ret += " == ";
  15076. break;
  15077. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  15078. ret += " != ";
  15079. break;
  15080. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15081. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + " ";
  15082. break;
  15083. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15084. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_or") + " ";
  15085. break;
  15086. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not:
  15087. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_not") + " ";
  15088. break;
  15089. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15090. ret += " > ";
  15091. break;
  15092. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15093. ret += " < ";
  15094. break;
  15095. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15096. ret += " >= ";
  15097. break;
  15098. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15099. ret += " <= ";
  15100. break;
  15101. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep:
  15102. ret += ", ";
  15103. break;
  15104. }
  15105. } else {
  15106. ret += " " + expression_obj[i] + " ";
  15107. }
  15108. }
  15109. return ret;
  15110. }
  15111. function functioncallsCode(command_obj, indentation) {
  15112. var ret = "\n";
  15113. for (var i = 0; i < indentation; i++) {
  15114. ret += "\t";
  15115. }
  15116. ret += variableValueMenuCode(command_obj.function_called);
  15117. return ret;
  15118. }
  15119. function readersCode(command_obj, indentation) {
  15120. var ret = "\n";
  15121. for (var i = 0; i < indentation; i++) {
  15122. ret += "\t";
  15123. }
  15124. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_read") + " ( ";
  15125. ret += variableValueMenuCode(command_obj.variable_value_menu);
  15126. ret += " ) ";
  15127. return ret;
  15128. }
  15129. function variableValueMenuCode(variable_obj) {
  15130. var is_return = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  15131. var ret = "";
  15132. try {
  15133. if (variable_obj.function_called) {
  15134. if (variable_obj.function_called.name) {
  15135. ret += variable_obj.function_called.name + " ( ";
  15136. } else {
  15137. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + " ( ";
  15138. }
  15139. if (variable_obj.parameters_list) {
  15140. for (var i = 0; i < variable_obj.parameters_list.length; i++) {
  15141. ret += variableValueMenuCode(variable_obj.parameters_list[i]);
  15142. if (i + 1 < variable_obj.parameters_list.length) {
  15143. ret += ", ";
  15144. }
  15145. }
  15146. }
  15147. ret += " )";
  15148. } else if (variable_obj.content.type) {
  15149. ret += variable_obj.content.name;
  15150. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  15151. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15152. }
  15153. if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  15154. ret += " [ " + variableValueMenuCode(variable_obj.row) + " ] ";
  15155. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15156. }
  15157. } else {
  15158. var content = String(variable_obj.content);
  15159. if (isNaN(content)) {
  15160. // console.debug("Content length: ", content.length);
  15161. // console.debug("Char code at 0", content.charCodeAt(0));
  15162. var isBackslash = content.charCodeAt(0) === 92;
  15163. if (content.length === 1 || content.length === 2 && isBackslash) {
  15164. ret += "'".concat(content, "'");
  15165. } else {
  15166. ret += '"' + variable_obj.content + '"';
  15167. }
  15168. } else if (content.length == 0) {
  15169. ret += '""';
  15170. } else if (content.trim().length == 0) {
  15171. ret += '"' + content + '"';
  15172. } else {
  15173. ret += variable_obj.content;
  15174. }
  15175. }
  15176. } catch (err) {
  15177. if (!is_return) {
  15178. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_content"));
  15179. throw err;
  15180. }
  15181. }
  15182. return ret;
  15183. }
  15184. function writersCode(command_obj, indentation) {
  15185. var ret = "\n";
  15186. for (var i = 0; i < indentation; i++) {
  15187. ret += "\t";
  15188. }
  15189. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_write") + " ( ";
  15190. /*for (var i = 0; i < command_obj.content.length; i++) {
  15191. ret += variableValueMenuCode(command_obj.content[i]);
  15192. if ((i + 1) < command_obj.content.length) {
  15193. ret += ' + ';
  15194. }
  15195. }*/
  15196. ret += elementExpressionCode(command_obj.content);
  15197. if (command_obj.newline) {
  15198. ret += ', "\\n"';
  15199. }
  15200. ret += " ) ";
  15201. return ret;
  15202. }
  15203. function commentsCode(command_obj, indentation) {
  15204. var ret = "\n";
  15205. for (var i = 0; i < indentation; i++) {
  15206. ret += "\t";
  15207. }
  15208. ret += "// ";
  15209. ret += command_obj.comment_text.content;
  15210. return ret;
  15211. }
  15212. function parametersCode(parameter_obj) {
  15213. var ret = "";
  15214. switch (parameter_obj.type) {
  15215. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15216. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15217. break;
  15218. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15219. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15220. break;
  15221. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15222. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15223. break;
  15224. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15225. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15226. break;
  15227. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15228. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15229. break;
  15230. }
  15231. ret += parameter_obj.name + "";
  15232. if (parameter_obj.dimensions == 1) {
  15233. ret += " []";
  15234. } else if (parameter_obj.dimensions == 2) {
  15235. ret += " [][]";
  15236. }
  15237. return ret;
  15238. }
  15239. function variablesCode(variable_obj) {
  15240. var ret = "";
  15241. var temp = variable_obj;
  15242. ret += "\n\t\t";
  15243. if (temp.is_constant) {
  15244. ret += "const ";
  15245. }
  15246. switch (temp.type) {
  15247. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15248. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15249. break;
  15250. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15251. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15252. break;
  15253. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15254. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15255. break;
  15256. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15257. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15258. break;
  15259. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15260. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15261. break;
  15262. }
  15263. ret += temp.name + " ";
  15264. if (temp.dimensions == 1) {
  15265. ret += "[" + temp.columns + "] ";
  15266. switch (temp.type) {
  15267. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15268. ret += "<- {";
  15269. for (var j = 0; j < temp.value.length; j++) {
  15270. ret += temp.value[j];
  15271. if (j + 1 < temp.value.length) {
  15272. ret += ", ";
  15273. }
  15274. }
  15275. ret += "}";
  15276. break;
  15277. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15278. ret += "<- {";
  15279. for (var _j3 = 0; _j3 < temp.value.length; _j3++) {
  15280. ret += temp.value[_j3].toFixed(2);
  15281. if (_j3 + 1 < temp.value.length) {
  15282. ret += ", ";
  15283. }
  15284. }
  15285. ret += "}";
  15286. break;
  15287. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15288. ret += "<- {";
  15289. for (var _j4 = 0; _j4 < temp.value.length; _j4++) {
  15290. ret += '"' + temp.value[_j4] + '"';
  15291. if (_j4 + 1 < temp.value.length) {
  15292. ret += ", ";
  15293. }
  15294. }
  15295. ret += "}";
  15296. break;
  15297. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15298. ret += "<- {";
  15299. for (var _j5 = 0; _j5 < temp.value.length; _j5++) {
  15300. if (temp.value[_j5]) {
  15301. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15302. } else {
  15303. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15304. }
  15305. if (_j5 + 1 < temp.value.length) {
  15306. ret += ", ";
  15307. }
  15308. }
  15309. ret += "}";
  15310. break;
  15311. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15312. ret += "<- {";
  15313. for (var _j6 = 0; _j6 < temp.value.length; _j6++) {
  15314. ret += "'" + temp.value[_j6] + "'";
  15315. if (_j6 + 1 < temp.value.length) {
  15316. ret += ", ";
  15317. }
  15318. }
  15319. ret += "}";
  15320. break;
  15321. }
  15322. } else if (temp.dimensions == 2) {
  15323. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  15324. switch (temp.type) {
  15325. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15326. ret += "<- {";
  15327. for (var _j7 = 0; _j7 < temp.rows; _j7++) {
  15328. ret += "{";
  15329. for (var k = 0; k < temp.columns; k++) {
  15330. ret += temp.value[_j7][k];
  15331. if (k + 1 < temp.columns) {
  15332. ret += ", ";
  15333. }
  15334. }
  15335. ret += "}";
  15336. if (_j7 + 1 < temp.rows) {
  15337. ret += ", ";
  15338. }
  15339. }
  15340. ret += "}";
  15341. break;
  15342. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15343. ret += "<- {";
  15344. for (var _j8 = 0; _j8 < temp.rows; _j8++) {
  15345. ret += "{";
  15346. for (var _k = 0; _k < temp.columns; _k++) {
  15347. ret += temp.value[_j8][_k].toFixed(2);
  15348. if (_k + 1 < temp.columns) {
  15349. ret += ", ";
  15350. }
  15351. }
  15352. ret += "}";
  15353. if (_j8 + 1 < temp.rows) {
  15354. ret += ", ";
  15355. }
  15356. }
  15357. ret += "}";
  15358. break;
  15359. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15360. ret += "<- {";
  15361. for (var _j9 = 0; _j9 < temp.rows; _j9++) {
  15362. ret += "{";
  15363. for (var _k2 = 0; _k2 < temp.columns; _k2++) {
  15364. ret += '"' + temp.value[_j9][_k2] + '"';
  15365. if (_k2 + 1 < temp.columns) {
  15366. ret += ", ";
  15367. }
  15368. }
  15369. ret += "}";
  15370. if (_j9 + 1 < temp.rows) {
  15371. ret += ", ";
  15372. }
  15373. }
  15374. ret += "}";
  15375. break;
  15376. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15377. ret += "<- {";
  15378. for (var _j10 = 0; _j10 < temp.rows; _j10++) {
  15379. ret += "{";
  15380. for (var _k3 = 0; _k3 < temp.columns; _k3++) {
  15381. if (temp.value[_j10][_k3]) {
  15382. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15383. } else {
  15384. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15385. }
  15386. if (_k3 + 1 < temp.columns) {
  15387. ret += ", ";
  15388. }
  15389. }
  15390. ret += "}";
  15391. if (_j10 + 1 < temp.rows) {
  15392. ret += ", ";
  15393. }
  15394. }
  15395. ret += "}";
  15396. break;
  15397. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15398. ret += "<- {";
  15399. for (var _j11 = 0; _j11 < temp.rows; _j11++) {
  15400. ret += "{";
  15401. for (var _k4 = 0; _k4 < temp.columns; _k4++) {
  15402. ret += "'" + temp.value[_j11][_k4] + "'";
  15403. if (_k4 + 1 < temp.columns) {
  15404. ret += ", ";
  15405. }
  15406. }
  15407. ret += "}";
  15408. if (_j11 + 1 < temp.rows) {
  15409. ret += ", ";
  15410. }
  15411. }
  15412. ret += "}";
  15413. break;
  15414. }
  15415. } else {
  15416. switch (temp.type) {
  15417. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15418. ret += "<- " + temp.value;
  15419. break;
  15420. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15421. ret += "<- " + temp.value.toFixed(2);
  15422. break;
  15423. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15424. ret += '<- "' + temp.value + '"';
  15425. break;
  15426. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15427. ret += "<- ";
  15428. if (temp.value) {
  15429. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15430. } else {
  15431. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15432. }
  15433. break;
  15434. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15435. ret += "<- '" + temp.value + "'";
  15436. break;
  15437. }
  15438. }
  15439. return ret;
  15440. }
  15441. function globalsCode() {
  15442. var ret = "";
  15443. if (window.program_obj.globals) {
  15444. for (var i = 0; i < window.program_obj.globals.length; i++) {
  15445. var temp = window.program_obj.globals[i];
  15446. ret += "\n\t";
  15447. if (temp.is_constant) {
  15448. ret += "const ";
  15449. }
  15450. switch (temp.type) {
  15451. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15452. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  15453. break;
  15454. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15455. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  15456. break;
  15457. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15458. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  15459. break;
  15460. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15461. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  15462. break;
  15463. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15464. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  15465. break;
  15466. }
  15467. ret += " " + temp.name + " ";
  15468. if (temp.dimensions == 1) {
  15469. ret += "[" + temp.columns + "] ";
  15470. switch (temp.type) {
  15471. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15472. ret += "<- {";
  15473. for (var j = 0; j < temp.value.length; j++) {
  15474. ret += temp.value[j];
  15475. if (j + 1 < temp.value.length) {
  15476. ret += ", ";
  15477. }
  15478. }
  15479. ret += "}";
  15480. break;
  15481. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15482. ret += "<- {";
  15483. for (var _j12 = 0; _j12 < temp.value.length; _j12++) {
  15484. ret += temp.value[_j12].toFixed(2);
  15485. if (_j12 + 1 < temp.value.length) {
  15486. ret += ", ";
  15487. }
  15488. }
  15489. ret += "}";
  15490. break;
  15491. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15492. ret += "<- {";
  15493. for (var _j13 = 0; _j13 < temp.value.length; _j13++) {
  15494. ret += '"' + temp.value[_j13] + '"';
  15495. if (_j13 + 1 < temp.value.length) {
  15496. ret += ", ";
  15497. }
  15498. }
  15499. ret += "}";
  15500. break;
  15501. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15502. ret += "<- {";
  15503. for (var _j14 = 0; _j14 < temp.value.length; _j14++) {
  15504. if (temp.value[_j14]) {
  15505. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15506. } else {
  15507. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15508. }
  15509. if (_j14 + 1 < temp.value.length) {
  15510. ret += ", ";
  15511. }
  15512. }
  15513. ret += "}";
  15514. break;
  15515. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15516. ret += "<- {";
  15517. for (var _j15 = 0; _j15 < temp.value.length; _j15++) {
  15518. ret += "'" + temp.value[_j15] + "'";
  15519. if (_j15 + 1 < temp.value.length) {
  15520. ret += ", ";
  15521. }
  15522. }
  15523. ret += "}";
  15524. break;
  15525. }
  15526. } else if (temp.dimensions == 2) {
  15527. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  15528. switch (temp.type) {
  15529. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15530. ret += "<- {";
  15531. for (var _j16 = 0; _j16 < temp.rows; _j16++) {
  15532. ret += "{";
  15533. for (var k = 0; k < temp.columns; k++) {
  15534. ret += temp.value[_j16][k];
  15535. if (k + 1 < temp.columns) {
  15536. ret += ", ";
  15537. }
  15538. }
  15539. ret += "}";
  15540. if (_j16 + 1 < temp.rows) {
  15541. ret += ", ";
  15542. }
  15543. }
  15544. ret += "}";
  15545. break;
  15546. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15547. ret += "<- {";
  15548. for (var _j17 = 0; _j17 < temp.rows; _j17++) {
  15549. ret += "{";
  15550. for (var _k5 = 0; _k5 < temp.columns; _k5++) {
  15551. ret += temp.value[_j17][_k5].toFixed(2);
  15552. if (_k5 + 1 < temp.columns) {
  15553. ret += ", ";
  15554. }
  15555. }
  15556. ret += "}";
  15557. if (_j17 + 1 < temp.rows) {
  15558. ret += ", ";
  15559. }
  15560. }
  15561. ret += "}";
  15562. break;
  15563. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15564. ret += "<- {";
  15565. for (var _j18 = 0; _j18 < temp.rows; _j18++) {
  15566. ret += "{";
  15567. for (var _k6 = 0; _k6 < temp.columns; _k6++) {
  15568. ret += '"' + temp.value[_j18][_k6] + '"';
  15569. if (_k6 + 1 < temp.columns) {
  15570. ret += ", ";
  15571. }
  15572. }
  15573. ret += "}";
  15574. if (_j18 + 1 < temp.rows) {
  15575. ret += ", ";
  15576. }
  15577. }
  15578. ret += "}";
  15579. break;
  15580. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15581. ret += "<- {";
  15582. for (var _j19 = 0; _j19 < temp.rows; _j19++) {
  15583. ret += "{";
  15584. for (var _k7 = 0; _k7 < temp.columns; _k7++) {
  15585. if (temp.value[_j19][_k7]) {
  15586. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15587. } else {
  15588. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15589. }
  15590. if (_k7 + 1 < temp.columns) {
  15591. ret += ", ";
  15592. }
  15593. }
  15594. ret += "}";
  15595. if (_j19 + 1 < temp.rows) {
  15596. ret += ", ";
  15597. }
  15598. }
  15599. ret += "}";
  15600. break;
  15601. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15602. ret += "<- {";
  15603. for (var _j20 = 0; _j20 < temp.rows; _j20++) {
  15604. ret += "{";
  15605. for (var _k8 = 0; _k8 < temp.columns; _k8++) {
  15606. ret += "'" + temp.value[_j20][_k8] + "'";
  15607. if (_k8 + 1 < temp.columns) {
  15608. ret += ", ";
  15609. }
  15610. }
  15611. ret += "}";
  15612. if (_j20 + 1 < temp.rows) {
  15613. ret += ", ";
  15614. }
  15615. }
  15616. ret += "}";
  15617. break;
  15618. }
  15619. } else {
  15620. switch (temp.type) {
  15621. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15622. ret += "<- " + temp.value;
  15623. break;
  15624. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15625. ret += "<- " + temp.value.toFixed(2);
  15626. break;
  15627. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15628. ret += '<- "' + temp.value + '"';
  15629. break;
  15630. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15631. ret += "<- ";
  15632. if (temp.value) {
  15633. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15634. } else {
  15635. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15636. }
  15637. break;
  15638. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15639. ret += "<- '" + temp.value + "'";
  15640. break;
  15641. }
  15642. }
  15643. }
  15644. }
  15645. return ret;
  15646. }
  15647. /***/ }),
  15648. /***/ "./js/visualUI/commands.js":
  15649. /*!*********************************!*\
  15650. !*** ./js/visualUI/commands.js ***!
  15651. \*********************************/
  15652. /*! exports provided: removeCommand, createFloatingCommand, renderCommand, genericCreateCommand */
  15653. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15654. "use strict";
  15655. __webpack_require__.r(__webpack_exports__);
  15656. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCommand", function() { return removeCommand; });
  15657. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  15658. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  15659. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericCreateCommand", function() { return genericCreateCommand; });
  15660. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15661. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15662. /* harmony import */ var _commands_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commands/comment */ "./js/visualUI/commands/comment.js");
  15663. /* harmony import */ var _commands_reader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/reader */ "./js/visualUI/commands/reader.js");
  15664. /* harmony import */ var _commands_writer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/writer */ "./js/visualUI/commands/writer.js");
  15665. /* harmony import */ var _commands_attribution__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/attribution */ "./js/visualUI/commands/attribution.js");
  15666. /* harmony import */ var _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/iftrue */ "./js/visualUI/commands/iftrue.js");
  15667. /* harmony import */ var _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  15668. /* harmony import */ var _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/whiletrue */ "./js/visualUI/commands/whiletrue.js");
  15669. /* harmony import */ var _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/dowhiletrue */ "./js/visualUI/commands/dowhiletrue.js");
  15670. /* harmony import */ var _commands_switch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/switch */ "./js/visualUI/commands/switch.js");
  15671. /* harmony import */ var _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/functioncall */ "./js/visualUI/commands/functioncall.js");
  15672. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  15673. /* harmony import */ var _commands_break__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/break */ "./js/visualUI/commands/break.js");
  15674. /* harmony import */ var _commands_return__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/return */ "./js/visualUI/commands/return.js");
  15675. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  15676. // let has_element_created_draged = false;
  15677. // let which_element_is_draged = null;
  15678. function removeCommand(command, function_obj, dom_obj) {
  15679. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_COMMAND, command.type, '/', 0);
  15680. if (function_obj.commands.indexOf(command) > -1) {
  15681. function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  15682. return true;
  15683. } // Utilize dois parantNode, pois o primeiro é o div de comandos
  15684. try {
  15685. if (dom_obj.parent().parent().data('command').commands_block.indexOf(command) > -1) {
  15686. dom_obj.parent().parent().data('command').commands_block.splice(dom_obj.parent().parent().data('command').commands_block.indexOf(command), 1);
  15687. return true;
  15688. }
  15689. } catch (err) {}
  15690. try {
  15691. if (dom_obj.parent().parent().data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  15692. if (dom_obj.parent().parent().data('command').commands_else.indexOf(command) > -1) {
  15693. dom_obj.parent().parent().data('command').commands_else.splice(dom_obj.parent().parent().data('command').commands_else.indexOf(command), 1);
  15694. return true;
  15695. }
  15696. }
  15697. } catch (err) {}
  15698. if (dom_obj.parent().data('switchcase')) {
  15699. console.log("o que encontrei: ");
  15700. console.log(dom_obj.parent().data('switchcase'));
  15701. dom_obj.parent().data('switchcase').commands_block.splice(dom_obj.parent().data('switchcase').commands_block.indexOf(command), 1);
  15702. return true;
  15703. }
  15704. return false;
  15705. }
  15706. window.function_container_active = null;
  15707. function createFloatingCommand(function_obj, function_container, command_type, mouse_event) {
  15708. var floatingObject;
  15709. switch (command_type) {
  15710. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  15711. floatingObject = _commands_break__WEBPACK_IMPORTED_MODULE_13__["createFloatingCommand"]();
  15712. break;
  15713. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  15714. floatingObject = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"]();
  15715. break;
  15716. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  15717. floatingObject = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["createFloatingCommand"]();
  15718. break;
  15719. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  15720. floatingObject = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["createFloatingCommand"]();
  15721. break;
  15722. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  15723. floatingObject = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"]();
  15724. break;
  15725. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  15726. floatingObject = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["createFloatingCommand"]();
  15727. break;
  15728. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  15729. floatingObject = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["createFloatingCommand"]();
  15730. break;
  15731. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  15732. floatingObject = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["createFloatingCommand"]();
  15733. break;
  15734. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  15735. floatingObject = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["createFloatingCommand"]();
  15736. break;
  15737. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  15738. floatingObject = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["createFloatingCommand"]();
  15739. break;
  15740. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  15741. floatingObject = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["createFloatingCommand"]();
  15742. break;
  15743. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  15744. floatingObject = _commands_return__WEBPACK_IMPORTED_MODULE_14__["createFloatingCommand"]();
  15745. break;
  15746. }
  15747. floatingObject.draggable().appendTo("body");
  15748. $('body').mouseup(function (evt) {
  15749. manageCommand(function_obj, function_container, evt, command_type);
  15750. $('body').off('mouseup');
  15751. $('body').off('mouseover');
  15752. });
  15753. if (!function_container.hasClass('function_div') || function_container.length < 1) {
  15754. window.mouse_event = mouse_event;
  15755. function_container = $(mouse_event.originalEvent.srcElement.closest('.function_div'));
  15756. }
  15757. console.log('function_container', function_container);
  15758. function_container_active = function_container;
  15759. function_container.find('.commands_list_div').on('mousemove', function (evt) {
  15760. addGhostDiv(evt);
  15761. });
  15762. function_container.find('.commands_list_div').find("*").on('mousemove', function (evt) {
  15763. addGhostDiv(evt);
  15764. });
  15765. function_container.on('mouseout', function (event) {
  15766. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  15767. if (el.closest('.commands_list_div').length < 1) {
  15768. window.ghostDiv.remove();
  15769. }
  15770. });
  15771. floatingObject.css("position", "absolute");
  15772. mouse_event.type = "mousedown.draggable";
  15773. mouse_event.target = floatingObject[0];
  15774. floatingObject.css("left", mouse_event.pageX - window.divx);
  15775. floatingObject.css("top", mouse_event.pageY);
  15776. floatingObject.trigger(mouse_event);
  15777. }
  15778. window.divx = 100;
  15779. window.ghostDiv = $('<div class="ghost_div">');
  15780. window.active_container = null;
  15781. function addGhostToEmptyBlock(element, evt) {
  15782. $('.ghost_div').remove();
  15783. var container = element.closest('.command_container');
  15784. if (container.hasClass('switch')) {
  15785. container = $(evt.target).closest('.case_div');
  15786. }
  15787. if (!container.hasClass('dowhiletrue') && !container.hasClass('iftrue') && !container.hasClass('repeatNtimes') && !container.hasClass('case_div') && !container.hasClass('whiletrue')) {
  15788. addGhostToNotEmptyBlock(element, evt);
  15789. return;
  15790. }
  15791. if (window.active_container != null) {
  15792. if (window.active_container.is(container)) {
  15793. console.log('é o mesmo, não mudou!');
  15794. } else {
  15795. if (container.length < 1) {
  15796. container = element.closest('.commands_list_div');
  15797. if (window.active_container.is(container)) {
  15798. console.log('é o mesmo command list');
  15799. } else {
  15800. console.log('mudou para um command list');
  15801. window.active_container = container;
  15802. }
  15803. } else {
  15804. console.log('mudou para um outro container?');
  15805. }
  15806. }
  15807. }
  15808. window.active_container = container;
  15809. if (container.hasClass('iftrue')) {
  15810. var containerIf = container.find('.commands_if').get(0);
  15811. var containerElse = container.find('.commands_else').get(0);
  15812. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  15813. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  15814. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  15815. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  15816. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  15817. $(containerIf).append(window.ghostDiv);
  15818. } else {
  15819. $(containerElse).append(window.ghostDiv);
  15820. }
  15821. } else if (container.hasClass('case_div')) {
  15822. container.find('.case_commands_block').append(window.ghostDiv);
  15823. } else {
  15824. container.find('.block_commands').append(window.ghostDiv);
  15825. }
  15826. }
  15827. function addGhostToNotEmptyBlock(element, evt) {
  15828. $('.ghost_div').remove();
  15829. var container = element.closest('.dowhiletrue, .iftrue, .repeatNtimes, .case_div, .whiletrue'); //console.log("\n\nNOT EMPTY: ", container);
  15830. //if (window.active_container != null) {
  15831. //}
  15832. if (container.length < 1) {
  15833. container = element.closest('.commands_list_div');
  15834. window.active_container = container;
  15835. addGhostToFunctionArea(element, evt);
  15836. } else {//console.log('mudou para um outro container?');
  15837. }
  15838. window.active_container = container; // quem está mais próximo? // Essa regra se aplica somente quando o over está sobre um comando
  15839. var allfilhos;
  15840. console.log('olha o container: ', container);
  15841. if (container.hasClass('iftrue')) {
  15842. if ($(evt.target).closest('.data_block_if').length > 0) {
  15843. allfilhos = container.find('.commands_if').children('.command_container');
  15844. } else if ($(evt.target).closest('.data_block_else').length > 0) {
  15845. allfilhos = container.find('.commands_else').children('.command_container');
  15846. } else {
  15847. var containerIf = container.find('.commands_if').get(0);
  15848. var containerElse = container.find('.commands_else').get(0);
  15849. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  15850. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  15851. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  15852. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  15853. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  15854. allfilhos = $(containerIf).children('.command_container');
  15855. } else {
  15856. allfilhos = $(containerElse).children('.command_container');
  15857. }
  15858. }
  15859. } else if (container.hasClass('case_div')) {
  15860. allfilhos = container.children('.case_commands_block').children('.command_container');
  15861. } else if (container.hasClass('commands_list_div')) {
  15862. allfilhos = container.children('.command_container');
  15863. } else {
  15864. allfilhos = container.children('.block_commands').children('.command_container');
  15865. }
  15866. var topDistances = [];
  15867. var bottomDistances = [];
  15868. for (var i = 0; i < allfilhos.length; i++) {
  15869. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  15870. topDistances.push(topD);
  15871. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  15872. bottomDistances.push(botD);
  15873. }
  15874. console.log('topDistances\n', topDistances, '\nbottomDistances\n', bottomDistances);
  15875. var menorTop = Math.min.apply(null, topDistances);
  15876. var indiceTop = topDistances.indexOf(menorTop);
  15877. var menorBot = Math.min.apply(null, bottomDistances);
  15878. var indiceBot = bottomDistances.indexOf(menorBot);
  15879. if (menorTop < menorBot) {
  15880. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  15881. } else {
  15882. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  15883. }
  15884. console.log('distancias: menorTop ', menorTop, ' menorBot ', menorBot);
  15885. }
  15886. function addGhostToFunctionArea(undermouse, evt) {
  15887. $('.ghost_div').remove();
  15888. var allfilhos = undermouse.closest('.commands_list_div').children('.command_container');
  15889. var topDistances = [];
  15890. var bottomDistances = [];
  15891. for (var i = 0; i < allfilhos.length; i++) {
  15892. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  15893. topDistances.push(topD);
  15894. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  15895. bottomDistances.push(botD);
  15896. }
  15897. var menorTop = Math.min.apply(null, topDistances);
  15898. var indiceTop = topDistances.indexOf(menorTop);
  15899. var menorBot = Math.min.apply(null, bottomDistances);
  15900. var indiceBot = bottomDistances.indexOf(menorBot);
  15901. if (menorTop < menorBot) {
  15902. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  15903. } else {
  15904. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  15905. }
  15906. }
  15907. function addGhostDiv(evt) {
  15908. var undermouse = $(evt.target);
  15909. if (undermouse.hasClass('ghost_div')) {
  15910. return;
  15911. } else if (undermouse.hasClass('commands_list_div')) {
  15912. addGhostToFunctionArea(undermouse, evt);
  15913. return;
  15914. } else if (undermouse.hasClass('block_commands')) {
  15915. if (undermouse.find('.command_container').length > 0) {
  15916. addGhostToNotEmptyBlock(undermouse, evt);
  15917. } else {
  15918. addGhostToEmptyBlock(undermouse, evt);
  15919. }
  15920. } else if (undermouse.hasClass('case_div')) {
  15921. if (undermouse.find('.case_commands_block').find('.command_container').length > 0) {
  15922. addGhostToNotEmptyBlock(undermouse, evt);
  15923. } else {
  15924. addGhostToEmptyBlock(undermouse, evt);
  15925. }
  15926. } else {
  15927. addGhostToNotEmptyBlock(undermouse, evt);
  15928. }
  15929. }
  15930. function borderMouseDragCommand(function_obj, function_container, evt) {
  15931. function_container.find('.over_command_drag').each(function (index) {
  15932. $(this).removeClass('over_command_drag');
  15933. });
  15934. var prev = null;
  15935. function_container.find('.commands_list_div').each(function (index) {
  15936. prev = $(this);
  15937. if (prev) {
  15938. var objLeft = prev.offset().left;
  15939. var objTop = prev.offset().top;
  15940. var objRight = objLeft + prev.width();
  15941. var objBottom = objTop + prev.height();
  15942. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  15943. prev.addClass("over_command_drag");
  15944. }
  15945. }
  15946. });
  15947. function_container.find('.command_container').each(function (index) {
  15948. var obj = $(this);
  15949. var objLeft = obj.offset().left;
  15950. var objTop = obj.offset().top;
  15951. var objRight = objLeft + obj.width();
  15952. var objBottom = objTop + obj.height();
  15953. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  15954. if (prev) {
  15955. prev.removeClass('over_command_drag');
  15956. }
  15957. obj.addClass("over_command_drag");
  15958. return;
  15959. }
  15960. });
  15961. } // before_after_inside: 1 -> before, 2 -> after, 3 -> inside
  15962. function renderCommand(command, element_reference, before_after_inside, function_obj) {
  15963. var createdElement;
  15964. switch (command.type) {
  15965. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  15966. createdElement = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command, function_obj);
  15967. break;
  15968. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  15969. createdElement = _commands_break__WEBPACK_IMPORTED_MODULE_13__["renderCommand"](command, function_obj);
  15970. break;
  15971. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  15972. createdElement = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["renderCommand"](command, function_obj);
  15973. break;
  15974. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  15975. createdElement = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["renderCommand"](command, function_obj);
  15976. break;
  15977. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  15978. createdElement = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](command, function_obj);
  15979. break;
  15980. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  15981. createdElement = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["renderCommand"](command, function_obj);
  15982. break;
  15983. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  15984. createdElement = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["renderCommand"](command, function_obj);
  15985. break;
  15986. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  15987. createdElement = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["renderCommand"](command, function_obj);
  15988. break;
  15989. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  15990. createdElement = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["renderCommand"](command, function_obj);
  15991. break;
  15992. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  15993. createdElement = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["renderCommand"](command, function_obj);
  15994. break;
  15995. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  15996. createdElement = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["renderCommand"](command, function_obj);
  15997. break;
  15998. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  15999. createdElement = _commands_return__WEBPACK_IMPORTED_MODULE_14__["renderCommand"](command, function_obj);
  16000. break;
  16001. }
  16002. switch (before_after_inside) {
  16003. case 1:
  16004. createdElement.insertBefore(element_reference);
  16005. break;
  16006. case 2:
  16007. createdElement.insertAfter(element_reference);
  16008. break;
  16009. case 3:
  16010. element_reference.append(createdElement);
  16011. break;
  16012. }
  16013. }
  16014. function genericCreateCommand(command_type) {
  16015. switch (command_type) {
  16016. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16017. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Break"]();
  16018. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16019. 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));
  16020. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16021. 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));
  16022. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16023. 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)]);
  16024. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16025. 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), []);
  16026. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16027. 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);
  16028. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16029. 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)]);
  16030. //(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block)
  16031. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16032. 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);
  16033. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16034. 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);
  16035. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16036. 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);
  16037. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16038. 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))];
  16039. 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);
  16040. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16041. 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)]);
  16042. }
  16043. }
  16044. function dragTrash(event) {
  16045. $('.ghost_div').remove();
  16046. var trash = $('<i class="ui icon trash alternate outline"></i>');
  16047. $('body').append(trash);
  16048. trash.css('position', 'absolute');
  16049. trash.css('top', event.clientY);
  16050. trash.css('left', event.clientX - 20);
  16051. trash.css('font-size', '3em');
  16052. trash.css('display', 'none');
  16053. function_container_active.find('.commands_list_div').off('mousemove');
  16054. function_container_active.find('.commands_list_div').find("*").off('mousemove');
  16055. trash.fadeIn(200, function () {
  16056. trash.fadeOut(200, function () {
  16057. trash.remove();
  16058. });
  16059. });
  16060. }
  16061. function findSingleElement(searching, query) {
  16062. if (!searching || !query) {
  16063. return '';
  16064. }
  16065. 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) {
  16066. if (searching.commands_block) {
  16067. return '' + searching.commands_block.indexOf(query);
  16068. } else {
  16069. return '0';
  16070. }
  16071. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16072. if (searching.commands_block == null) {
  16073. searching.commands_block = [];
  16074. }
  16075. if (searching.commands_else == null) {
  16076. searching.commands_else = [];
  16077. }
  16078. console.log('\n\nveja onde: ', searching.commands_block, ' \n\nquery: ', query);
  16079. if (searching.commands_block.indexOf(query) >= 0) {
  16080. return 'if[' + searching.commands_block.indexOf(query) + ']';
  16081. } else {
  16082. return 'else[' + searching.commands_else.indexOf(query) + ']';
  16083. }
  16084. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16085. for (var i = 0; i < searching.cases.length; i++) {
  16086. if (searching.cases[i].commands_block.indexOf(query) >= 0) {
  16087. return 'case[' + searching.cases[i].commands_block.indexOf(query) + ']';
  16088. }
  16089. }
  16090. }
  16091. }
  16092. function findPathRecursive(starter_index, hierarquia_bottom_up, function_obj) {
  16093. var index_command = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
  16094. var actual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  16095. var full_path = '';
  16096. for (var i = 0; i <= hierarquia_bottom_up.length; i++) {
  16097. console.log('\n\n:: ', i, ':\n', hierarquia_bottom_up[i]);
  16098. full_path += findSingleElement(hierarquia_bottom_up[i], hierarquia_bottom_up[i + 1]) + '-';
  16099. }
  16100. return full_path;
  16101. }
  16102. function manageCommand(function_obj, function_container, event, command_type) {
  16103. $(".created_element").each(function (index) {
  16104. $(this).remove();
  16105. });
  16106. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16107. if (el.hasClass('ghost_div')) {
  16108. if (el.closest('.command_container').length < 1) {
  16109. console.log('\n\nvou tentar!!!!');
  16110. console.log(el.closest('.commands_list_div'), '\n\n');
  16111. el.closest('.commands_list_div').css('height', el.closest('.commands_list_div').css('height') + 30); //$('.ghost_div').remove();
  16112. el = el.closest('.commands_list_div');
  16113. }
  16114. }
  16115. console.log('soltou no: ');
  16116. console.log(el);
  16117. console.log(el.data('fun')); // Primeiro verificar se ele soltou no espaço da função correta:
  16118. var hier = el.parentsUntil(".all_functions");
  16119. var esta_correto = false;
  16120. var esta_na_div_correta = false;
  16121. if (el.hasClass("commands_list_div")) {
  16122. esta_na_div_correta = true;
  16123. }
  16124. for (var i = 0; i < hier.length; i++) {
  16125. var temp = $(hier[i]);
  16126. if (temp.hasClass("commands_list_div")) {
  16127. esta_na_div_correta = true;
  16128. }
  16129. if (temp.data('fun') == function_obj) {
  16130. esta_correto = true;
  16131. break;
  16132. }
  16133. }
  16134. if (!esta_correto) {
  16135. // has_element_created_draged = false;
  16136. // which_element_is_draged = null;
  16137. dragTrash(event);
  16138. return;
  16139. } else {
  16140. if (!esta_na_div_correta) {
  16141. // has_element_created_draged = false;
  16142. // which_element_is_draged = null;
  16143. dragTrash(event);
  16144. return;
  16145. }
  16146. }
  16147. var hierarquia_bottom_up = null; // Agora é descobrir qual o escopo para adicionar o comando:
  16148. console.log('ev0'); // Se o elemento clicado possuir o atributo "fun", então, é direto na div dos comandos:
  16149. if (typeof el.data('fun') !== 'undefined') {
  16150. // Se a lista de comandos estiver vazia, então é o primeiro.
  16151. // Portanto, ele deve soltar o elemento obrigatoriamente no objeto vazio
  16152. if (el.data('fun').commands == null || el.data('fun').commands.length == 0) {
  16153. // pode adicionar
  16154. el.data('fun').commands = [];
  16155. var new_cmd = genericCreateCommand(command_type);
  16156. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', 0);
  16157. el.data('fun').commands.push(new_cmd);
  16158. renderCommand(new_cmd, $(function_container).find('.commands_list_div'), 3, function_obj);
  16159. } else {
  16160. // Entra nesse else, caso já existam outros comandos no bloco:
  16161. findNearbyCommandToAddInFunctionScope(el, event, $(function_container).find('.commands_list_div'), function_obj, command_type);
  16162. }
  16163. } else {
  16164. console.log("soltou em um comando"); // descobrir em qual comando ele soltou:
  16165. var hier_find = el.parentsUntil(".commands_list_div");
  16166. hierarquia_bottom_up = [];
  16167. if (typeof el.data('command') !== 'undefined') {
  16168. hierarquia_bottom_up.push(el.data('command'));
  16169. }
  16170. for (var i = 0; i < hier_find.length; i++) {
  16171. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16172. hierarquia_bottom_up.push($(hier_find[i]).data('command'));
  16173. }
  16174. }
  16175. console.log("comando em que soltou: ");
  16176. console.log(hierarquia_bottom_up[0]);
  16177. console.log("hierarquia de baixo para cima na árvore, de onde ele soltou: ");
  16178. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  16179. console.log(hierarquia_bottom_up[i]);
  16180. } // Se for do tipo break, verificar se está no contexto correto:
  16181. // Caso não esteja no contexto, apenas retorna sem dar continuidade:
  16182. var is_correct_context = false;
  16183. if (command_type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]) {
  16184. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  16185. 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"]) {
  16186. is_correct_context = true;
  16187. break;
  16188. }
  16189. }
  16190. if (!is_correct_context) {
  16191. console.error("Context not allowed to insert BREAK COMMAND!");
  16192. return;
  16193. }
  16194. } // se a hierarquia possuir apenas um elemento, então está na raiz dos comandos:
  16195. if (hierarquia_bottom_up.length == 1) {
  16196. console.log('QQ1');
  16197. var sub_elemento = false;
  16198. for (var i = 0; i < hier_find.length; i++) {
  16199. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16200. console.log('QQ2');
  16201. findBeforeOrAfterCommandToAdd(hier_find[i], event, function_obj, command_type);
  16202. sub_elemento = true;
  16203. break;
  16204. }
  16205. }
  16206. if (!sub_elemento) {
  16207. console.log('QQ3');
  16208. findBeforeOrAfterCommandToAdd(el[0], event, function_obj, command_type);
  16209. }
  16210. } else {
  16211. console.log('QQ4'); // caso exista mais de um elemento na hierarquia:
  16212. if (typeof $(el).data('command') !== 'undefined') {
  16213. console.log('QQ5');
  16214. console.log("PPP1");
  16215. insertCommandInBlockHierar(el[0], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16216. } else {
  16217. console.log('QQ6');
  16218. var sub_elemento = false;
  16219. for (var i = 0; i < hier_find.length; i++) {
  16220. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16221. console.log('QQ7');
  16222. insertCommandInBlockHierar(hier_find[i], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16223. sub_elemento = true;
  16224. break;
  16225. }
  16226. }
  16227. }
  16228. }
  16229. } // has_element_created_draged = false;
  16230. // which_element_is_draged = null;
  16231. if (hierarquia_bottom_up) {
  16232. console.log('\n\n:::índices::\n\n');
  16233. var i = hierarquia_bottom_up.length - 1;
  16234. var starter_index = window.program_obj.functions[window.program_obj.functions.indexOf(function_obj)].commands.indexOf(hierarquia_bottom_up[i]);
  16235. var all_str_path = starter_index + '-' + findPathRecursive(starter_index, hierarquia_bottom_up, function_obj);
  16236. 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);
  16237. console.log('\n\nfull path: \n\n', all_str_path);
  16238. console.log('fim dos índices');
  16239. }
  16240. renderAlgorithm();
  16241. }
  16242. function insertCommandInBlockHierar(el, event, function_obj, command_type, hier_dom, hier_obj) {
  16243. var el_jq = $(el);
  16244. var command_parent = el_jq.data('command');
  16245. 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"]) {
  16246. console.log('QQ17');
  16247. 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) {
  16248. console.log('QQ18'); // Se não tiver outro comando ainda no bloco, só adiciona:
  16249. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16250. command_parent.commands_block = [];
  16251. var recentComand = genericCreateCommand(command_type);
  16252. command_parent.commands_block.push(recentComand);
  16253. 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);
  16254. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  16255. } else {
  16256. // Se já tem algum comando no bloco:
  16257. findNearbyCommandToAddInBlockScope(el, event, el, function_obj, command_type, command_parent);
  16258. }
  16259. } else {
  16260. // QUANDO FOR BLOCO DO TIPO IF OU SWITCH/CASE:
  16261. addCommandToSwitchCase(event, function_obj, command_type);
  16262. }
  16263. } else {
  16264. console.log('QQ19'); // entra neste bloco, se soltou o comando sobre outro comando dentro de um subbloco:
  16265. findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type);
  16266. }
  16267. }
  16268. function findNearbyCommandToAddInBlockScope(el, event, node_list_commands, function_obj, command_type, command_parent) {
  16269. console.log("\n\n\n::COMANDOS:\n\n", el, event, node_list_commands, function_obj, command_type, command_parent);
  16270. var all_sub = $(node_list_commands).find('div.command_container');
  16271. var menor_distancia = 999999999;
  16272. var elemento_menor_distancia = null;
  16273. var antes = true;
  16274. var t_bot;
  16275. var t_top; // Descobrindo o elemento mais próximo:
  16276. for (var i = 0; i < all_sub.length; i++) {
  16277. t_top = all_sub[i].getBoundingClientRect().top;
  16278. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16279. if (t_top - event.clientY < menor_distancia) {
  16280. menor_distancia = event.clientY - t_top;
  16281. elemento_menor_distancia = all_sub[i];
  16282. }
  16283. }
  16284. 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:
  16285. if (borda_inferior - event.clientY < menor_distancia) {
  16286. var recentComand = genericCreateCommand(command_type);
  16287. command_parent.commands_block.push(recentComand); //
  16288. renderCommand(recentComand, node_list_commands, 3, function_obj);
  16289. } else {
  16290. var recentComand = genericCreateCommand(command_type);
  16291. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16292. if (index > -1) {
  16293. command_parent.commands_block.splice(index, 0, recentComand);
  16294. }
  16295. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16296. }
  16297. }
  16298. function findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type) {
  16299. var el_jq = $(el);
  16300. var command_parent = $(el.parentNode.parentNode).data('command');
  16301. var command_target = el_jq.data('command');
  16302. var temp_parent = $(el.parentNode.parentNode);
  16303. var is_in_else = false;
  16304. if (!command_parent) {
  16305. command_parent = el_jq.data('command');
  16306. temp_parent = el_jq;
  16307. var hier = el_jq.parentsUntil(".command_container");
  16308. for (var i = 0; i < hier.length; i++) {
  16309. var temp = $(hier[i]);
  16310. if (typeof temp.data('else') != 'undefined') {
  16311. is_in_else = true;
  16312. }
  16313. if (typeof temp.data('command') != 'undefined') {
  16314. command_parent = temp.data('command');
  16315. temp_parent = temp;
  16316. }
  16317. }
  16318. }
  16319. var hier = el_jq.parentsUntil(".command_container");
  16320. for (var i = 0; i < hier.length; i++) {
  16321. var temp = $(hier[i]);
  16322. if (typeof temp.data('else') != 'undefined') {
  16323. is_in_else = true;
  16324. }
  16325. }
  16326. if (command_parent == command_target) {
  16327. var hier = el_jq.parentsUntil(".command_container");
  16328. for (var i = 0; i < hier.length; i++) {
  16329. var temp = $(hier[i]);
  16330. if (typeof temp.data('else') !== 'undefined') {
  16331. is_in_else = true;
  16332. break;
  16333. }
  16334. }
  16335. }
  16336. 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"]) {
  16337. var hier = temp_parent.parentsUntil(".all_cases_div");
  16338. console.log("vou procurar!!");
  16339. for (var i = 0; i < hier.length; i++) {
  16340. console.log("estou vasculhando...");
  16341. var temp = $(hier[i]);
  16342. if (typeof temp.data('switchcase') !== 'undefined') {
  16343. console.log("encontrei");
  16344. command_parent = temp.data('switchcase');
  16345. is_in_else = false;
  16346. break;
  16347. }
  16348. }
  16349. }
  16350. console.log('debugging:');
  16351. console.log('el_jq');
  16352. console.log(el_jq);
  16353. console.log('command_parent');
  16354. console.log(command_parent);
  16355. console.log('command_target');
  16356. console.log(command_target);
  16357. var menor_distancia = 999999999;
  16358. var antes = true;
  16359. var t_bot;
  16360. var t_top;
  16361. t_top = el.getBoundingClientRect().top;
  16362. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  16363. var d_top = event.clientY - t_top; // distancia topo
  16364. var d_bot = t_bot - event.clientY; // distancia baixo
  16365. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16366. if (d_top < d_bot) {
  16367. var recentComand = genericCreateCommand(command_type);
  16368. console.log('MMM1');
  16369. if (is_in_else) {
  16370. console.log('MMM2');
  16371. if (command_parent == command_target) {
  16372. console.log('MMM3');
  16373. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16374. command_parent.commands_else = [];
  16375. var recentComand = genericCreateCommand(command_type);
  16376. command_parent.commands_else.push(recentComand);
  16377. renderCommand(recentComand, el_jq, 3, function_obj);
  16378. } else {
  16379. // Se já tem algum comando no bloco:
  16380. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16381. }
  16382. return;
  16383. }
  16384. console.log('MMM7');
  16385. var index = command_parent.commands_else.indexOf(command_target);
  16386. if (index > -1) {
  16387. command_parent.commands_else.splice(index, 0, recentComand);
  16388. }
  16389. renderCommand(recentComand, el, 1, function_obj);
  16390. } else {
  16391. console.log('MMM4');
  16392. if (command_parent == command_target) {
  16393. console.log('Nxxxx5');
  16394. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16395. command_parent.commands_block = [];
  16396. console.log('SSS4');
  16397. var recentComand = genericCreateCommand(command_type);
  16398. command_parent.commands_block.push(recentComand);
  16399. renderCommand(recentComand, el_jq, 3, function_obj);
  16400. } else {
  16401. console.log('SSS5');
  16402. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16403. }
  16404. return;
  16405. }
  16406. console.log('MMM6');
  16407. var index = command_parent.commands_block.indexOf(command_target);
  16408. if (index > -1) {
  16409. command_parent.commands_block.splice(index, 0, recentComand);
  16410. }
  16411. renderCommand(recentComand, el, 1, function_obj);
  16412. }
  16413. } else {
  16414. console.log('XXX1');
  16415. var recentComand = genericCreateCommand(command_type);
  16416. if (is_in_else) {
  16417. if (command_parent == command_target) {
  16418. console.log('MMM3');
  16419. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16420. command_parent.commands_else = [];
  16421. console.log('SSS1');
  16422. var recentComand = genericCreateCommand(command_type);
  16423. command_parent.commands_else.push(recentComand);
  16424. renderCommand(recentComand, el_jq, 3, function_obj);
  16425. } else {
  16426. // Se já tem algum comando no bloco:
  16427. console.log('SSS2');
  16428. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16429. }
  16430. return;
  16431. }
  16432. console.log('XXX2');
  16433. var index = command_parent.commands_else.indexOf(command_target);
  16434. if (index > -1) {
  16435. command_parent.commands_else.splice(index + 1, 0, recentComand);
  16436. }
  16437. renderCommand(recentComand, el, 2, function_obj);
  16438. } else {
  16439. if (command_parent == command_target) {
  16440. console.log('Nxxxx78');
  16441. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16442. command_parent.commands_block = [];
  16443. var recentComand = genericCreateCommand(command_type);
  16444. command_parent.commands_block.push(recentComand);
  16445. console.log('SSS6');
  16446. renderCommand(recentComand, el_jq, 3, function_obj);
  16447. } else {
  16448. console.log('SSS7');
  16449. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16450. }
  16451. return;
  16452. }
  16453. console.log('XXX3');
  16454. var index = command_parent.commands_block.indexOf(command_target);
  16455. if (index > -1) {
  16456. command_parent.commands_block.splice(index + 1, 0, recentComand);
  16457. }
  16458. renderCommand(recentComand, el, 2, function_obj);
  16459. }
  16460. }
  16461. }
  16462. function insertCommandInBlock(el, event, function_obj, command_type) {
  16463. var el_jq = $(el);
  16464. var command_parent = el_jq.data('command');
  16465. 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) {
  16466. // Se não tiver outro comando ainda no bloco, só adiciona:
  16467. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16468. command_parent.commands_block = [];
  16469. var recentComand = genericCreateCommand(command_type);
  16470. command_parent.commands_block.push(recentComand);
  16471. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  16472. } else {
  16473. // Se já tem algum comando no bloco:
  16474. findInBlockCorrectPlace(el, event, function_obj, command_type);
  16475. }
  16476. } else if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16477. console.log('QQ9'); // no if ou no else?
  16478. var correct_div = $(document.elementFromPoint(event.pageX, event.pageY));
  16479. var is_in_if = true;
  16480. if (correct_div.data('if')) {
  16481. is_in_if = true;
  16482. } else if (correct_div.data('else')) {
  16483. is_in_if = false;
  16484. } else {
  16485. var hier = correct_div.parentsUntil(".command_container");
  16486. for (var i = 0; i < hier.length; i++) {
  16487. var temp = $(hier[i]);
  16488. if (typeof temp.data('if') !== 'undefined') {
  16489. is_in_if = true;
  16490. break;
  16491. }
  16492. if (typeof temp.data('else') !== 'undefined') {
  16493. is_in_if = false;
  16494. break;
  16495. }
  16496. }
  16497. }
  16498. if (is_in_if) {
  16499. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16500. command_parent.commands_block = [];
  16501. var recentComand = genericCreateCommand(command_type);
  16502. command_parent.commands_block.push(recentComand);
  16503. renderCommand(recentComand, el_jq.find('.commands_if'), 3, function_obj);
  16504. } else {
  16505. // Se já tem algum comando no bloco:
  16506. findInBlockCorrectPlace(el_jq.find('.commands_if'), event, function_obj, command_type);
  16507. }
  16508. } else {
  16509. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16510. command_parent.commands_else = [];
  16511. var recentComand = genericCreateCommand(command_type);
  16512. command_parent.commands_else.push(recentComand);
  16513. renderCommand(recentComand, el_jq.find('.commands_else'), 3, function_obj);
  16514. } else {
  16515. // Se já tem algum comando no bloco:
  16516. findInBlockCorrectPlace(el_jq.find('.commands_else'), event, function_obj, command_type, true);
  16517. }
  16518. }
  16519. } else {
  16520. // é do tipo switch
  16521. console.log("está tentando inserir em um switch que está na raiz!");
  16522. addCommandToSwitchCase(event, function_obj, command_type);
  16523. }
  16524. }
  16525. function addCommandToSwitchCase(event, function_obj, command_type) {
  16526. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16527. var which_case = el.data('switchcase');
  16528. var case_div = el;
  16529. if (!which_case) {
  16530. var hier_find = el.parentsUntil(".all_cases_div");
  16531. for (var i = 0; i < hier_find.length; i++) {
  16532. if (typeof $(hier_find[i]).data('switchcase') !== 'undefined') {
  16533. which_case = $(hier_find[i]).data('switchcase');
  16534. case_div = $(hier_find[i]);
  16535. break;
  16536. }
  16537. }
  16538. }
  16539. if (which_case.commands_block == null || which_case.commands_block.length < 1) {
  16540. which_case.commands_block = [];
  16541. var recentComand = genericCreateCommand(command_type);
  16542. which_case.commands_block.push(recentComand);
  16543. renderCommand(recentComand, case_div.find('.case_commands_block'), 3, function_obj);
  16544. } else {
  16545. findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type);
  16546. }
  16547. }
  16548. function findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type) {
  16549. var all_sub = case_div.find('div.command_container');
  16550. var menor_distancia = 999999999;
  16551. var elemento_menor_distancia = null;
  16552. var antes = true;
  16553. var t_bot;
  16554. var t_top; // Descobrindo o elemento mais próximo:
  16555. for (var i = 0; i < all_sub.length; i++) {
  16556. t_top = all_sub[i].getBoundingClientRect().top;
  16557. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16558. if (t_top - event.clientY < menor_distancia) {
  16559. menor_distancia = event.clientY - t_top;
  16560. elemento_menor_distancia = all_sub[i];
  16561. }
  16562. }
  16563. 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:
  16564. if (borda_inferior - event.clientY < menor_distancia) {
  16565. var recentComand = genericCreateCommand(command_type);
  16566. which_case.commands_block.push(recentComand);
  16567. renderCommand(recentComand, $(case_div.find('.case_commands_block')[0]), 3, function_obj);
  16568. } else {
  16569. var recentComand = genericCreateCommand(command_type);
  16570. var index = which_case.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16571. if (index > -1) {
  16572. which_case.commands_block.splice(index, 0, recentComand);
  16573. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16574. }
  16575. }
  16576. }
  16577. function findInBlockCorrectPlace(el, event, function_obj, command_type) {
  16578. var is_in_else = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  16579. var el_jq = $(el);
  16580. var all_sub = el_jq.find('div.command_container');
  16581. var menor_distancia = 999999999;
  16582. var elemento_menor_distancia = null;
  16583. var antes = true;
  16584. var t_bot;
  16585. var t_top; // Descobrindo o elemento mais próximo:
  16586. for (var i = 0; i < all_sub.length; i++) {
  16587. t_top = all_sub[i].getBoundingClientRect().top;
  16588. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16589. if (t_top - event.clientY < menor_distancia) {
  16590. menor_distancia = event.clientY - t_top;
  16591. elemento_menor_distancia = all_sub[i];
  16592. }
  16593. }
  16594. var borda_inferior = elemento_menor_distancia.parentNode.getBoundingClientRect().top + elemento_menor_distancia.parentNode.getBoundingClientRect().height;
  16595. console.log("menor_distancia: ");
  16596. console.log(elemento_menor_distancia); // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16597. if (borda_inferior - event.clientY < menor_distancia) {
  16598. console.log('QQ11');
  16599. var recentComand = genericCreateCommand(command_type);
  16600. var command_parent = el_jq.data('command');
  16601. if (is_in_else) {
  16602. console.log('QQ15');
  16603. command_parent.commands_else.push(recentComand);
  16604. console.log('el_jq');
  16605. console.log(el_jq);
  16606. console.log("$(el_jq.find('.commands_else')[0]):: ");
  16607. console.log($(el_jq.find('.commands_else')[0]));
  16608. renderCommand(recentComand, el_jq, 3, function_obj);
  16609. } else {
  16610. console.log('QQ16');
  16611. command_parent.commands_block.push(recentComand);
  16612. renderCommand(recentComand, $(el_jq.find('.block_commands')[0]), 3, function_obj);
  16613. }
  16614. } else {
  16615. console.log('QQ12');
  16616. var recentComand = genericCreateCommand(command_type);
  16617. var command_parent = el_jq.data('command');
  16618. if (is_in_else) {
  16619. var index = command_parent.commands_else.indexOf($(elemento_menor_distancia).data('command'));
  16620. if (index > -1) {
  16621. command_parent.commands_else.splice(index, 0, recentComand);
  16622. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16623. }
  16624. } else {
  16625. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16626. if (index > -1) {
  16627. command_parent.commands_block.splice(index, 0, recentComand);
  16628. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16629. }
  16630. }
  16631. }
  16632. }
  16633. function findBeforeOrAfterCommandToAdd(el, event, function_obj, command_type) {
  16634. switch ($(el).data('command').type) {
  16635. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16636. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16637. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16638. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16639. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16640. insertCommandInBlock(el, event, function_obj, command_type);
  16641. return;
  16642. }
  16643. var menor_distancia = 999999999;
  16644. var antes = true;
  16645. var t_bot;
  16646. var t_top;
  16647. t_top = el.getBoundingClientRect().top;
  16648. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  16649. var d_top = event.clientY - t_top; // distancia topo
  16650. var d_bot = t_bot - event.clientY; // distancia baixo
  16651. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16652. if (d_top < d_bot) {
  16653. var recentComand = genericCreateCommand(command_type);
  16654. var index = function_obj.commands.indexOf($(el).data('command'));
  16655. if (index > -1) {
  16656. function_obj.commands.splice(index, 0, recentComand);
  16657. }
  16658. renderCommand(recentComand, el, 1, function_obj);
  16659. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  16660. } else {
  16661. var recentComand = genericCreateCommand(command_type);
  16662. var index = function_obj.commands.indexOf($(el).data('command'));
  16663. if (index > -1) {
  16664. function_obj.commands.splice(index + 1, 0, recentComand);
  16665. }
  16666. renderCommand(recentComand, el, 2, function_obj);
  16667. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  16668. }
  16669. }
  16670. function findNearbyCommandToAddInFunctionScope(el, event, node_list_commands, function_obj, command_type) {
  16671. var all_sub = $(node_list_commands).find('div.command_container');
  16672. var menor_distancia = 999999999;
  16673. var elemento_menor_distancia = null;
  16674. var antes = true;
  16675. var t_bot;
  16676. var t_top; // Descobrindo o elemento mais próximo:
  16677. for (var i = 0; i < all_sub.length; i++) {
  16678. t_top = all_sub[i].getBoundingClientRect().top;
  16679. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16680. if (t_top - event.clientY < menor_distancia) {
  16681. menor_distancia = event.clientY - t_top;
  16682. elemento_menor_distancia = all_sub[i];
  16683. }
  16684. }
  16685. 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:
  16686. if (borda_inferior - event.clientY < menor_distancia) {
  16687. var recentComand = genericCreateCommand(command_type);
  16688. function_obj.commands.push(recentComand); //
  16689. renderCommand(recentComand, node_list_commands, 3, function_obj);
  16690. 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);
  16691. } else {
  16692. var recentComand = genericCreateCommand(command_type);
  16693. var index = function_obj.commands.indexOf($(elemento_menor_distancia).data('command'));
  16694. if (index > -1) {
  16695. function_obj.commands.splice(index, 0, recentComand);
  16696. }
  16697. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16698. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  16699. }
  16700. }
  16701. /***/ }),
  16702. /***/ "./js/visualUI/commands/attribution.js":
  16703. /*!*********************************************!*\
  16704. !*** ./js/visualUI/commands/attribution.js ***!
  16705. \*********************************************/
  16706. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, renderMenuOperations */
  16707. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16708. "use strict";
  16709. __webpack_require__.r(__webpack_exports__);
  16710. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16711. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16712. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  16713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenuOperations", function() { return renderMenuOperations; });
  16714. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  16715. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16716. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16717. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  16718. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  16719. function createFloatingCommand() {
  16720. return $('<div class="ui attribution created_element"> <i class="ui icon small arrow left"></i> <span> x <&#8212; 1 + 1 </span></div>');
  16721. }
  16722. function renderCommand(command, function_obj) {
  16723. 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> </div>');
  16724. el.data('command', command);
  16725. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.var_attributed'), function_obj);
  16726. if (!command.expression || command.expression.length < 1) {
  16727. 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);
  16728. command.expression.push(exp);
  16729. }
  16730. addHandlers(command, function_obj, el);
  16731. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.expression); //renderExpressionElements(command, function_obj, el);
  16732. return el;
  16733. }
  16734. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, selectedItem, expression_element) {
  16735. var index_to_move = expression_element.itens.indexOf(ref_object);
  16736. switch (selectedItem.data('exp')) {
  16737. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  16738. 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)]);
  16739. expression_element.itens[index_to_move] = exp;
  16740. break;
  16741. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  16742. 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]]);
  16743. expression_element.itens[index_to_move] = exp;
  16744. break;
  16745. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  16746. 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]]);
  16747. expression_element.itens[index_to_move] = exp;
  16748. break;
  16749. }
  16750. renderExpressionElements(command, function_obj, dom_object);
  16751. }
  16752. function renderExpressionElements(command, function_obj, el) {
  16753. var expression_div = el.find('.expression_elements');
  16754. var command_container;
  16755. if (el.hasClass("command_container") == false) {
  16756. var hier = el.parentsUntil(".command_container");
  16757. for (var i = 0; i < hier.length; i++) {
  16758. if ($(hier[i]).hasClass("command_container")) {
  16759. command_container = $(hier[i]);
  16760. break;
  16761. }
  16762. if ($(hier[i]).hasClass("expression_elements")) {
  16763. expression_div = $(hier[i]);
  16764. break;
  16765. }
  16766. }
  16767. }
  16768. if (command_container) {
  16769. expression_div = command_container.find('.expression_elements');
  16770. }
  16771. expression_div.text('');
  16772. for (var i = 0; i < command.expression.length; i++) {
  16773. var temp = $('<div class="expression_element"></div>');
  16774. temp.data('ref_element', command.expression[i]);
  16775. temp.data('ref_index', i);
  16776. expression_div.append(temp);
  16777. renderElement(command, function_obj, temp, command.expression[i]);
  16778. }
  16779. }
  16780. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  16781. var context_menu = '<div class="ui dropdown"><div class="text">';
  16782. switch (expression_element.itens[index_op]) {
  16783. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  16784. context_menu += '+';
  16785. break;
  16786. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  16787. context_menu += '-';
  16788. break;
  16789. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  16790. context_menu += '*';
  16791. break;
  16792. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  16793. context_menu += '/';
  16794. break;
  16795. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  16796. context_menu += '%';
  16797. break;
  16798. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none:
  16799. context_menu += '...';
  16800. break;
  16801. }
  16802. context_menu += '</div><div class="menu">';
  16803. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus + '">+</div>';
  16804. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus + '">-</div>';
  16805. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  16806. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division + '">/</div>';
  16807. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module + '">%</div>';
  16808. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none + '" data-text="...">Nenhum</div>';
  16809. context_menu += '</div></div>';
  16810. context_menu = $(context_menu);
  16811. temp_op.append(context_menu);
  16812. context_menu.dropdown({
  16813. onChange: function onChange(value, text, $selectedItem) {
  16814. expression_element.itens[index_op] = value;
  16815. }
  16816. });
  16817. }
  16818. function renderMenuAddExpression(command, function_obj, el, dom_append_menu, expression_append_new_expression) {
  16819. if (el.hasClass("command_container") == false) {
  16820. var hier = el.parentsUntil(".commands_list_div");
  16821. for (var i = 0; i < hier.length; i++) {
  16822. if ($(hier[i]).hasClass("command_container")) {
  16823. el = $(hier[i]);
  16824. break;
  16825. }
  16826. }
  16827. }
  16828. if (dom_append_menu.hasClass("expression_elements") == false) {
  16829. var hier = el.parentsUntil(".commands_list_div");
  16830. for (var i = 0; i < hier.length; i++) {
  16831. if ($(hier[i]).hasClass("expression_elements")) {
  16832. dom_append_menu = $(hier[i]);
  16833. break;
  16834. }
  16835. }
  16836. }
  16837. var context_menu = '<div class="ui dropdown"><div class="text"></div><i class="ui icon arrow alternate circle right outline"></i><div class="menu">';
  16838. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp + '">EXP OP EXP</div>';
  16839. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp + '">OP EXP</div>';
  16840. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par + '">( EXP )</div>';
  16841. context_menu += '</div></div>';
  16842. context_menu = $(context_menu);
  16843. dom_append_menu.append(context_menu);
  16844. context_menu.dropdown({
  16845. onChange: function onChange(value, text, $selectedItem) {
  16846. switch (value) {
  16847. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  16848. 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)]);
  16849. expression_append_new_expression.push(exp);
  16850. break;
  16851. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  16852. 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)]);
  16853. expression_append_new_expression.push(exp);
  16854. break;
  16855. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  16856. 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)]);
  16857. expression_append_new_expression.push(exp);
  16858. break;
  16859. }
  16860. renderExpressionElements(command, function_obj, el);
  16861. }
  16862. });
  16863. }
  16864. function renderElement(command, function_obj, el, expression_element) {
  16865. switch (expression_element.type_exp) {
  16866. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  16867. var temp_op = $('<div class="component_element"></div>');
  16868. var temp_exp_1 = $('<div class="component_element"></div>');
  16869. var temp_exp_2 = $('<div class="component_element"></div>');
  16870. el.append(temp_exp_1);
  16871. el.append(temp_op);
  16872. el.append(temp_exp_2);
  16873. if (expression_element.itens[0].type) {
  16874. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[0], temp_exp_1, function_obj, 2, expression_element);
  16875. } else {
  16876. renderElement(command, function_obj, temp_exp_1, expression_element.itens[0]);
  16877. }
  16878. renderOperator(command, function_obj, temp_op, expression_element, 1);
  16879. if (expression_element.itens[2].type) {
  16880. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[2], temp_exp_2, function_obj, 2, expression_element);
  16881. } else {
  16882. renderElement(command, function_obj, temp_exp_2, expression_element.itens[2]);
  16883. }
  16884. break;
  16885. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  16886. var temp_op = $('<div class="component_element"></div>');
  16887. var temp_exp = $('<div class="component_element"></div>');
  16888. el.append(temp_op);
  16889. el.append(temp_exp);
  16890. renderOperator(command, function_obj, temp_op, expression_element, 0);
  16891. if (expression_element.itens[1].type) {
  16892. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[1], temp_exp, function_obj, 2, expression_element);
  16893. } else {
  16894. renderElement(command, function_obj, temp_exp, expression_element.itens[1]);
  16895. }
  16896. break;
  16897. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  16898. var temp_par_1 = $('<div class="component_element"> ( </div>');
  16899. var temp_exp = $('<div class="component_element"></div>');
  16900. var temp_par_2 = $('<div class="component_element"> ) </div>');
  16901. el.append(temp_par_1);
  16902. el.append(temp_exp);
  16903. for (var j = 0; j < expression_element.itens.length; j++) {
  16904. if (expression_element.itens[j].type) {
  16905. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[j], temp_exp, function_obj, 2, expression_element);
  16906. } else {
  16907. renderElement(command, function_obj, temp_exp, expression_element.itens[j]);
  16908. }
  16909. } //renderMenuAddExpression(command, function_obj, el, el, expression_element.itens);
  16910. el.append(temp_par_2);
  16911. break;
  16912. }
  16913. }
  16914. function renderExpression(command, function_obj, el) {
  16915. var expression_div = el.find('.expression_elements');
  16916. expression_div.text('');
  16917. var menu_add_item = $('<div class="menu_add_item"></div>');
  16918. menu_add_item.data('index_add', 0);
  16919. expression_div.append(menu_add_item);
  16920. for (var i = 0; i < command.expression.length; i++) {
  16921. if (command.expression[i].type) {
  16922. var temp = $('<div class="expression_element"></div>');
  16923. temp.data('ref_element', command.expression[i]);
  16924. temp.data('ref_index', i);
  16925. expression_div.append(temp);
  16926. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.expression[i], temp, function_obj);
  16927. } else if (command.expression[i] == "(" || command.expression[i] == ")") {
  16928. var temp = $('<div class="expression_element">' + command.expression[i] + '</div>');
  16929. temp.data('ref_element', command.expression[i]);
  16930. temp.data('ref_index', i);
  16931. expression_div.append(temp);
  16932. } else {
  16933. var temp = '<div class="expression_element">';
  16934. switch (command.expression[i]) {
  16935. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  16936. temp += '+';
  16937. break;
  16938. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  16939. temp += '-';
  16940. break;
  16941. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  16942. temp += '*';
  16943. break;
  16944. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  16945. temp += '/';
  16946. break;
  16947. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  16948. temp += '%';
  16949. break;
  16950. }
  16951. temp += '</div>';
  16952. temp = $(temp);
  16953. temp.data('ref_element', command.expression[i]);
  16954. temp.data('ref_index', i);
  16955. expression_div.append(temp);
  16956. }
  16957. var menu_add_item_seq = $('<div class="menu_add_item"></div>');
  16958. var index_temp = i + 1;
  16959. menu_add_item_seq.data('index_add', index_temp);
  16960. expression_div.append(menu_add_item_seq);
  16961. }
  16962. addMenuItens(command, function_obj, el);
  16963. }
  16964. function addMenuItens(command, function_obj, expression_div) {
  16965. var divs_expression = expression_div.find('.menu_add_item');
  16966. for (var i = 0; i < divs_expression.length; i++) {
  16967. var temp = $(divs_expression[i]).data('index_add');
  16968. var context_menu = '<div class="ui dropdown context_menu_clear"><i class="ui icon plus square outline"></i><div class="menu">';
  16969. context_menu += '<div class="item" data-option="value" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_value') + '</div>';
  16970. context_menu += '<div class="item" data-option="operator" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_operator') + '</div>';
  16971. context_menu += '<div class="item" data-option="parentheses" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_parentheses') + '</div>';
  16972. context_menu += '</div></div>';
  16973. context_menu = $(context_menu);
  16974. $(divs_expression[i]).append(context_menu);
  16975. context_menu.dropdown({
  16976. on: 'hover',
  16977. onChange: function onChange(value, text, $selectedItem) {
  16978. switch ($selectedItem.data('option')) {
  16979. case "value":
  16980. 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));
  16981. renderExpression(command, function_obj, expression_div);
  16982. break;
  16983. case "operator":
  16984. command.expression.splice($selectedItem.data('index'), 0, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus);
  16985. renderExpression(command, function_obj, expression_div);
  16986. break;
  16987. case "parentheses":
  16988. command.expression.splice($selectedItem.data('index'), 0, "(");
  16989. 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));
  16990. command.expression.splice($selectedItem.data('index') + 2, 0, ")");
  16991. renderExpression(command, function_obj, expression_div);
  16992. break;
  16993. }
  16994. }
  16995. });
  16996. }
  16997. }
  16998. function addHandlers(command, function_obj, attribution_dom) {
  16999. attribution_dom.find('.button_remove_command').on('click', function () {
  17000. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, attribution_dom)) {
  17001. attribution_dom.fadeOut(400, function () {
  17002. attribution_dom.remove();
  17003. });
  17004. }
  17005. });
  17006. attribution_dom.find('.button_refresh_attribution').on('click', function () {
  17007. renderExpressionElements(command, function_obj, attribution_dom);
  17008. });
  17009. }
  17010. function renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected) {
  17011. /*console.log("recebido o seguinte DOM: ");
  17012. console.log(dom_object);
  17013. if (dom_object.hasClass('var_attributed')) {
  17014. return;
  17015. } else {
  17016. var hier = dom_object.parentsUntil(".command_container");
  17017. for (var i = 0; i < hier.length; i++) {
  17018. if ($(hier[i]).hasClass('var_attributed') || $(hier[i]).hasClass('parameters_function_called')) {
  17019. return;
  17020. }
  17021. }
  17022. }
  17023. dom_object.find('.context_menu_clear').remove();
  17024. var menu_operations = '<div class="ui dropdown menu_operations"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17025. for (var tm in Models.ARITHMETIC_TYPES) {
  17026. menu_operations += '<div class="item" data-option="'+tm+'">'+LocalizedStrings.getUI('btn_arithmetic_' + tm)+'</div>';
  17027. }
  17028. menu_operations += '<div class="item" data-option="clear">'+LocalizedStrings.getUI('btn_clear')+'</div>';
  17029. menu_operations += '</div></div>';
  17030. menu_operations = $(menu_operations);
  17031. dom_object.append(menu_operations);
  17032. menu_operations.dropdown({
  17033. onChange: function(value, text, $selectedItem) {
  17034. switch ($($selectedItem).data('option')) {
  17035. case "clear":
  17036. $(dom_object).text('');
  17037. VariableValueMenu.renderMenu(command, ref_object, dom_object, function_obj);
  17038. break;
  17039. default:
  17040. createExpressionAround(command, ref_object, dom_object, function_obj);
  17041. menu_operations.find('.text').text('');
  17042. }
  17043. }
  17044. });*/
  17045. }
  17046. function createExpressionAround(command, ref_object, dom_object, function_obj) {
  17047. $('<span> ( </span>').insertBefore(dom_object);
  17048. $('<span> ) </span>').insertAfter(dom_object);
  17049. _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);
  17050. }
  17051. /***/ }),
  17052. /***/ "./js/visualUI/commands/break.js":
  17053. /*!***************************************!*\
  17054. !*** ./js/visualUI/commands/break.js ***!
  17055. \***************************************/
  17056. /*! exports provided: createFloatingCommand, renderCommand */
  17057. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17058. "use strict";
  17059. __webpack_require__.r(__webpack_exports__);
  17060. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17061. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17062. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17063. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17064. function createFloatingCommand() {
  17065. 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>');
  17066. }
  17067. function renderCommand(command, function_obj) {
  17068. 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>');
  17069. el.data('command', command);
  17070. addHandlers(command, function_obj, el);
  17071. return el;
  17072. }
  17073. function addHandlers(command, function_obj, break_dom) {
  17074. break_dom.find('.button_remove_command').on('click', function () {
  17075. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, break_dom)) {
  17076. break_dom.fadeOut(400, function () {
  17077. break_dom.remove();
  17078. });
  17079. }
  17080. });
  17081. }
  17082. /***/ }),
  17083. /***/ "./js/visualUI/commands/comment.js":
  17084. /*!*****************************************!*\
  17085. !*** ./js/visualUI/commands/comment.js ***!
  17086. \*****************************************/
  17087. /*! exports provided: createFloatingCommand, renderCommand */
  17088. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17089. "use strict";
  17090. __webpack_require__.r(__webpack_exports__);
  17091. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17092. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17093. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17094. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17095. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17096. function createFloatingCommand() {
  17097. 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>');
  17098. }
  17099. function renderCommand(command, function_obj) {
  17100. 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>');
  17101. el.data('command', command);
  17102. addHandlers(command, function_obj, el);
  17103. renderTextComment(command, function_obj, el);
  17104. return el;
  17105. }
  17106. function renderTextComment(command, function_obj, el) {
  17107. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.comment_text, el.find('.var_value_menu_div'), function_obj, 20);
  17108. }
  17109. function addHandlers(command, function_obj, comment_dom) {
  17110. comment_dom.find('.button_remove_command').on('click', function () {
  17111. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, comment_dom)) {
  17112. comment_dom.fadeOut(400, function () {
  17113. comment_dom.remove();
  17114. });
  17115. }
  17116. });
  17117. }
  17118. /***/ }),
  17119. /***/ "./js/visualUI/commands/conditional_expression.js":
  17120. /*!********************************************************!*\
  17121. !*** ./js/visualUI/commands/conditional_expression.js ***!
  17122. \********************************************************/
  17123. /*! exports provided: renderExpression */
  17124. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17125. "use strict";
  17126. __webpack_require__.r(__webpack_exports__);
  17127. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17128. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17129. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17130. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17131. function renderExpression(command, expression, function_obj, initial_el_to_render) {
  17132. expression.dom_object = initial_el_to_render;
  17133. if (expression.expression == null || expression.expression.length < 1) {
  17134. renderStartMenu(command, expression, function_obj, initial_el_to_render);
  17135. } else {
  17136. var main_div = $('<div class="expression_elements"></div>');
  17137. switch (expression.expression.type) {
  17138. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17139. renderLogicExpression(command, expression, expression.expression, function_obj, main_div, initial_el_to_render);
  17140. break;
  17141. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17142. renderArithmeticExpression(command, expression, expression.expression, function_obj, main_div);
  17143. break;
  17144. }
  17145. initial_el_to_render.append(main_div);
  17146. var restartMenu = $('<div class="ui restart_expression"><i class="ui icon undo"></i></div>');
  17147. initial_el_to_render.append(restartMenu);
  17148. restartMenu.on('click', function (e) {
  17149. expression.expression = null;
  17150. initial_el_to_render.empty();
  17151. renderExpression(command, expression, function_obj, initial_el_to_render);
  17152. });
  17153. }
  17154. }
  17155. function renderArithmeticOperator(command, all_expression, expression_arithmetic, arithmetic_operator, function_obj, element_to_append) {
  17156. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17157. menu_operator.dropdown({
  17158. values: [{
  17159. name: '>',
  17160. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than,
  17161. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than
  17162. }, {
  17163. name: '<',
  17164. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than,
  17165. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than
  17166. }, {
  17167. name: '==',
  17168. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to,
  17169. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to
  17170. }, {
  17171. name: '!=',
  17172. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to,
  17173. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to
  17174. }, {
  17175. name: '>=',
  17176. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to,
  17177. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to
  17178. }, {
  17179. name: '<=',
  17180. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to,
  17181. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to
  17182. }],
  17183. onChange: function onChange(value, text, $selectedItem) {
  17184. expression_arithmetic.operator = value;
  17185. }
  17186. });
  17187. element_to_append.append(menu_operator);
  17188. }
  17189. function renderLogicOperator(command, all_expression, expression_logic, logic_operator, function_obj, element_to_append, initial_el_to_render) {
  17190. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17191. menu_operator.dropdown({
  17192. values: [{
  17193. name: '==',
  17194. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to,
  17195. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to
  17196. }, {
  17197. name: '!=',
  17198. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to,
  17199. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to
  17200. }, {
  17201. name: '&&',
  17202. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and,
  17203. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and
  17204. }, {
  17205. name: '||',
  17206. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or,
  17207. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or
  17208. }],
  17209. onChange: function onChange(value, text, $selectedItem) {
  17210. if ($selectedItem) {
  17211. expression_logic.operator = value;
  17212. if (expression_logic.second_operand == null) {
  17213. 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);
  17214. initial_el_to_render.empty();
  17215. renderExpression(command, all_expression, function_obj, initial_el_to_render);
  17216. }
  17217. }
  17218. }
  17219. });
  17220. element_to_append.append(menu_operator);
  17221. }
  17222. function renderLogicExpression(command, all_expression, expression_logic, function_obj, element_to_append, initial_el_to_render) {
  17223. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17224. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17225. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17226. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17227. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17228. if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17229. renderLogicExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17230. } else if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17231. renderArithmeticExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17232. } else {
  17233. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.first_operand, exp_el_expr_el_1, function_obj);
  17234. }
  17235. element_to_append.append(exp_el_par_1);
  17236. element_to_append.append(exp_el_expr_el_1);
  17237. renderLogicOperator(command, all_expression, expression_logic, expression_logic.operator, function_obj, exp_el_expr_operand, initial_el_to_render);
  17238. element_to_append.append(exp_el_expr_operand);
  17239. if (expression_logic.second_operand) {
  17240. if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17241. renderLogicExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17242. } else if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17243. renderArithmeticExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17244. } else {
  17245. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.second_operand, exp_el_expr_el_2, function_obj);
  17246. }
  17247. element_to_append.append(exp_el_expr_el_2);
  17248. }
  17249. element_to_append.append(exp_el_par_2);
  17250. }
  17251. function renderArithmeticExpression(command, all_expression, expression_arithmetic, function_obj, element_to_append) {
  17252. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17253. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17254. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17255. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17256. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17257. if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17258. renderLogicExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17259. } else if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17260. renderArithmeticExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17261. } else {
  17262. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.first_operand, exp_el_expr_el_1, function_obj);
  17263. }
  17264. if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17265. renderLogicExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17266. } else if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17267. renderArithmeticExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17268. } else {
  17269. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.second_operand, exp_el_expr_el_2, function_obj);
  17270. }
  17271. renderArithmeticOperator(command, all_expression, expression_arithmetic, expression_arithmetic.operator, function_obj, exp_el_expr_operand);
  17272. element_to_append.append(exp_el_par_1);
  17273. element_to_append.append(exp_el_expr_el_1);
  17274. element_to_append.append(exp_el_expr_operand);
  17275. element_to_append.append(exp_el_expr_el_2);
  17276. element_to_append.append(exp_el_par_2);
  17277. }
  17278. function renderStartMenu(command, expression, function_obj, initial_el_to_render) {
  17279. var start_menu = '';
  17280. 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">';
  17281. 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>';
  17282. 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>';
  17283. start_menu += '</div></div>';
  17284. start_menu = $(start_menu);
  17285. start_menu.dropdown({
  17286. onChange: function onChange(value, text, $selectedItem) {
  17287. switch ($selectedItem.data('exp')) {
  17288. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17289. 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));
  17290. break;
  17291. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17292. 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);
  17293. break;
  17294. }
  17295. initial_el_to_render.html('');
  17296. renderExpression(command, expression, function_obj, initial_el_to_render);
  17297. },
  17298. selectOnKeydown: false
  17299. });
  17300. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17301. initial_el_to_render.append(start_menu);
  17302. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17303. }
  17304. /***/ }),
  17305. /***/ "./js/visualUI/commands/contextualized_menu.js":
  17306. /*!*****************************************************!*\
  17307. !*** ./js/visualUI/commands/contextualized_menu.js ***!
  17308. \*****************************************************/
  17309. /*! exports provided: renderMenu */
  17310. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17311. "use strict";
  17312. __webpack_require__.r(__webpack_exports__);
  17313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  17314. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17315. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17316. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17317. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17318. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./switch */ "./js/visualUI/commands/switch.js");
  17319. function renderMenu(command, dom_where_render, function_obj, dom_command) {
  17320. var menu_div = '<button class="ui icon button minimize_block_button tiny"><i class="icon window minimize"></i></button> <div class="ui dropdown menu_commands pause" ><i class="icon pause"></i> <div class="menu"> ';
  17321. 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) {
  17322. 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>';
  17323. } else {
  17324. 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>';
  17325. menu_div += '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase + '"><i class="pause icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_case') + ' </a>';
  17326. }
  17327. menu_div += '</div></div>';
  17328. menu_div = $(menu_div);
  17329. dom_where_render.append(menu_div);
  17330. addHandlers(command, dom_where_render, function_obj, dom_command);
  17331. if (command.collapsed) {
  17332. dom_command.children('.ui.block_commands').toggle();
  17333. }
  17334. }
  17335. function addHandlers(command, dom_where_render, function_obj, dom_command) {
  17336. dom_where_render.find('.minimize_block_button').on('click', function (evt) {
  17337. dom_command.children('.ui.block_commands').toggle();
  17338. command.collapsed = !command.collapsed;
  17339. });
  17340. dom_where_render.find('.menu_commands').dropdown({
  17341. on: 'hover'
  17342. });
  17343. dom_where_render.find('.menu_commands a').on('click', function (evt) {
  17344. 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) {
  17345. if (command.commands_block == null || command.commands_block.length == 0) {
  17346. command.commands_block = [];
  17347. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_2__["genericCreateCommand"]($(this).data('command'));
  17348. command.commands_block.push(new_cmd);
  17349. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](new_cmd, dom_command.find('.block_commands'), 3, function_obj);
  17350. } else {
  17351. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  17352. }
  17353. } else {
  17354. switch ($(this).data('command')) {
  17355. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  17356. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  17357. break;
  17358. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase:
  17359. addCaseToSwitch(command, dom_where_render, function_obj, dom_command);
  17360. break;
  17361. }
  17362. }
  17363. });
  17364. }
  17365. function addCaseToSwitch(command, dom_where_render, function_obj, dom_command) {
  17366. if (command.cases == null) {
  17367. command.cases = [];
  17368. }
  17369. 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));
  17370. command.cases.push(sc);
  17371. _switch__WEBPACK_IMPORTED_MODULE_4__["renderCase"](sc, command, function_obj, dom_command.find('.all_cases_div'));
  17372. }
  17373. /***/ }),
  17374. /***/ "./js/visualUI/commands/dowhiletrue.js":
  17375. /*!*********************************************!*\
  17376. !*** ./js/visualUI/commands/dowhiletrue.js ***!
  17377. \*********************************************/
  17378. /*! exports provided: createFloatingCommand, renderCommand */
  17379. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17380. "use strict";
  17381. __webpack_require__.r(__webpack_exports__);
  17382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17384. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17385. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17386. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  17387. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  17388. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  17389. function createFloatingCommand() {
  17390. 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>');
  17391. }
  17392. function renderCommand(command, function_obj) {
  17393. var ret = '';
  17394. 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> <div class="ui context_menu"></div> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_do') + ' </span>';
  17395. ret += '<div class="ui block_commands" data-subblock="" data-idcommand="">';
  17396. ret += '</div>';
  17397. 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="span_command_spec"> ) </span>';
  17398. ret += '</div>';
  17399. var el = $(ret);
  17400. el.data('command', command);
  17401. el.find('.block_commands').data('command', command);
  17402. addHandlers(command, function_obj, el);
  17403. _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'));
  17404. if (command.expression) {
  17405. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  17406. }
  17407. if (command.commands_block) {
  17408. for (var j = 0; j < command.commands_block.length; j++) {
  17409. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  17410. }
  17411. }
  17412. return el;
  17413. }
  17414. function addHandlers(command, function_obj, dowhiletrue_dom) {
  17415. dowhiletrue_dom.find('.button_remove_command').on('click', function () {
  17416. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, dowhiletrue_dom)) {
  17417. dowhiletrue_dom.fadeOut(400, function () {
  17418. dowhiletrue_dom.remove();
  17419. });
  17420. }
  17421. });
  17422. }
  17423. /***/ }),
  17424. /***/ "./js/visualUI/commands/functioncall.js":
  17425. /*!**********************************************!*\
  17426. !*** ./js/visualUI/commands/functioncall.js ***!
  17427. \**********************************************/
  17428. /*! exports provided: createFloatingCommand, renderCommand */
  17429. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17430. "use strict";
  17431. __webpack_require__.r(__webpack_exports__);
  17432. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17434. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17435. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17436. function createFloatingCommand() {
  17437. return $('<div class="ui functioncall created_element"> <i class="hand point right icon"></i> <span> funcao() </span></div>');
  17438. }
  17439. function renderCommand(command, function_obj) {
  17440. 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>');
  17441. el.data('command', command);
  17442. _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__["renderMenu"](command, command.function_called, el.find('.var_value_menu_div'), function_obj);
  17443. addHandlers(command, function_obj, el);
  17444. return el;
  17445. }
  17446. function addHandlers(command, function_obj, functioncall_dom) {
  17447. functioncall_dom.find('.button_remove_command').on('click', function () {
  17448. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, functioncall_dom)) {
  17449. functioncall_dom.fadeOut(400, function () {
  17450. functioncall_dom.remove();
  17451. });
  17452. }
  17453. });
  17454. }
  17455. /***/ }),
  17456. /***/ "./js/visualUI/commands/generic_expression.js":
  17457. /*!****************************************************!*\
  17458. !*** ./js/visualUI/commands/generic_expression.js ***!
  17459. \****************************************************/
  17460. /*! exports provided: renderExpression */
  17461. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17462. "use strict";
  17463. __webpack_require__.r(__webpack_exports__);
  17464. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17465. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  17466. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17467. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17468. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17469. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../services/userLog */ "./js/services/userLog.js");
  17470. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  17471. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__);
  17472. window.timer = false;
  17473. function renderExpression(command, function_obj, div_to_render, expression_array) {
  17474. div_to_render.empty();
  17475. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command, "expression");
  17476. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command, "expression", function () {
  17477. if (window.timer) return;
  17478. var m = div_to_render.find(".single_element_expression").not(".mouse_distance").not(".add_parentheses");
  17479. var s = "";
  17480. m.each(function (e) {
  17481. if ($(this).hasClass("parentheses_in_expression")) {
  17482. s += $(this).text() + " ";
  17483. } else {
  17484. s += $(this).find(".text").text();
  17485. s += $(this).find(".var_name").text();
  17486. s += $(this).find(".parameters_function_called").text();
  17487. s += $(this).find(".value_rendered").text();
  17488. s += " ";
  17489. }
  17490. });
  17491. if (s) {
  17492. window.timer = true;
  17493. } else {
  17494. return;
  17495. }
  17496. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_COMMAND_EXP, command.type, "/", s);
  17497. setTimeout(function () {
  17498. window.timer = false;
  17499. }, 200);
  17500. }, 20, true);
  17501. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution) {
  17502. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command.variable);
  17503. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command.variable, function () {
  17504. renderExpression(command, function_obj, div_to_render, expression_array);
  17505. }, 0);
  17506. if (command.variable.content) {
  17507. var types_included = [];
  17508. if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER || command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  17509. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17510. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  17511. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  17512. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  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"].TEXT) {
  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 {
  17519. console.log("NÃO RECONHECI! VEJA: ", command.variable.content.type);
  17520. }
  17521. renderElements(command, function_obj, div_to_render, expression_array, types_included);
  17522. } else {
  17523. div_to_render.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("var_menu_select_var").toLowerCase());
  17524. }
  17525. } else {
  17526. var _types_included = [];
  17527. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  17528. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  17529. 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);
  17530. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17531. renderElements(command, function_obj, div_to_render, expression_array, _types_included);
  17532. }
  17533. div_to_render.children(".mouse_distance").addClass("mouse_distance_hidden");
  17534. div_to_render.children(".higher_element").on("mousemove", function (evt) {
  17535. if (!window.open_or_close) {
  17536. $(this).css("position", "relative", "!important");
  17537. $(this).children(".mouse_distance").css("opacity", "1");
  17538. }
  17539. });
  17540. div_to_render.children(".higher_element").on("mouseout", function (evt) {
  17541. if (!window.open_or_close) {
  17542. $(this).css("position", "absolute", "!important");
  17543. $(this).children(".mouse_distance").css("opacity", "0");
  17544. }
  17545. });
  17546. var lixeira = $('<div class="lixeira" draggable="true"></div>');
  17547. div_to_render.find(".single_element_expression").on("mousedown", function (evt) {
  17548. window.posX = evt.clientX;
  17549. window.posY = evt.clientY;
  17550. });
  17551. Sortable.create(div_to_render[0], {
  17552. animation: 100,
  17553. ghostClass: "ghost",
  17554. group: {
  17555. name: "shared",
  17556. put: false // Do not allow items to be put into this list
  17557. },
  17558. draggable: ".single_element_expression",
  17559. sort: false,
  17560. filter: ".not_allowed",
  17561. onStart: function onStart() {
  17562. $("body").append(lixeira);
  17563. lixeira.css("display", "block");
  17564. lixeira.css("top", window.posY + 70, "!important");
  17565. lixeira.css("left", window.posX - 20, "!important");
  17566. },
  17567. onMove: function onMove() {
  17568. lixeira.addClass("color_test");
  17569. },
  17570. onEnd: function onEnd() {
  17571. lixeira.remove();
  17572. div_to_render.find(".ghost").removeClass("ghost");
  17573. }
  17574. });
  17575. new Sortable(lixeira[0], {
  17576. group: "shared",
  17577. animation: 150,
  17578. onAdd: function onAdd(evt) {
  17579. lixeira.css("display", "none");
  17580. lixeira.find(".single_element_expression").remove();
  17581. lixeira.css("background-color", "");
  17582. lixeira.remove();
  17583. removeElement(evt, expression_array);
  17584. renderExpression(command, function_obj, div_to_render, expression_array);
  17585. }
  17586. });
  17587. }
  17588. function removeElement(event, expression_array) {
  17589. var indice = $(event.item).data("index");
  17590. var first = expression_array[0];
  17591. console.log("indice: ", indice);
  17592. if (expression_array[indice].type) {
  17593. // if is alone in expression:
  17594. if (expression_array.length == 1) {
  17595. //function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  17596. expression_array.splice(0, 1);
  17597. } else if (expression_array.length > 1) {
  17598. if (indice > 0 && expression_array[indice - 1].type_op) {
  17599. if (indice < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice + 1].type_op) {
  17600. expression_array.splice(indice + 1, 1);
  17601. }
  17602. expression_array.splice(indice, 1);
  17603. expression_array.splice(indice - 1, 1);
  17604. if (indice - 2 < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice - 1] == ")") {
  17605. expression_array.splice(indice - 1, 1);
  17606. expression_array.splice(indice - 2, 1);
  17607. if (indice - 3 >= 0 && indice - 3 < expression_array.length && expression_array[indice - 3].type_op) {
  17608. expression_array.splice(indice - 3, 1);
  17609. }
  17610. }
  17611. } else if (indice < expression_array.length - 1 && expression_array[indice + 1].type_op) {
  17612. expression_array.splice(indice + 1, 1);
  17613. expression_array.splice(indice, 1);
  17614. } else if (indice < expression_array.length - 1 && indice > 0 && expression_array[indice - 1] == "(" && expression_array[indice + 1] == ")") {
  17615. if (indice > 1 && expression_array[indice - 2].type_op) {
  17616. expression_array.splice(indice + 1, 1);
  17617. expression_array.splice(indice, 1);
  17618. expression_array.splice(indice - 1, 1);
  17619. expression_array.splice(indice - 2, 1);
  17620. } else if (indice < expression_array.length - 2 && expression_array[indice + 2].type_op) {
  17621. expression_array.splice(indice + 1, 1);
  17622. expression_array.splice(indice, 1);
  17623. expression_array.splice(indice - 1, 1);
  17624. } else {
  17625. expression_array.splice(indice + 1, 1);
  17626. expression_array.splice(indice, 1);
  17627. expression_array.splice(indice - 1, 1);
  17628. }
  17629. }
  17630. }
  17631. } else if (expression_array[indice].type_op) {// iVProg doesn't support operator remove
  17632. } else {
  17633. var opening = -1;
  17634. var closing = -1;
  17635. if (expression_array[indice] == "(") {
  17636. opening = indice;
  17637. for (var i = indice + 1; i < expression_array.length; i++) {
  17638. if (expression_array[i] == ")") {
  17639. closing = i;
  17640. break;
  17641. }
  17642. }
  17643. } else {
  17644. closing = indice;
  17645. for (var i = indice - 1; i >= 0; i--) {
  17646. if (expression_array[i] == "(") {
  17647. opening = i;
  17648. break;
  17649. }
  17650. }
  17651. }
  17652. if (expression_array[opening + 1].type_op) {
  17653. expression_array.splice(closing, 1);
  17654. expression_array.splice(opening + 1, 1);
  17655. expression_array.splice(opening, 1);
  17656. } else {
  17657. expression_array.splice(closing, 1);
  17658. expression_array.splice(opening, 1);
  17659. }
  17660. } // if expression is empty, add a new var value:
  17661. if (expression_array.length == 0) {
  17662. 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));
  17663. }
  17664. if (first != expression_array[0] && expression_array[0].type_op) {
  17665. expression_array.splice(0, 1);
  17666. }
  17667. }
  17668. function renderElements(command, function_obj, div_to_render, expression_array, types_included) {
  17669. /*if (expression_array.length > 0) {
  17670. if (!expression_array[0].type_op) {
  17671. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  17672. }
  17673. }*/
  17674. var i = 0;
  17675. for (i = 0; i < expression_array.length; i++) {
  17676. if (expression_array[i].type == "var_value") {
  17677. var div_temp = $('<div class="single_element_expression" data-index="' + i + '"></div>');
  17678. if (i == 0) {
  17679. if (expression_array.length > 0 && !expression_array[0].type_op) {//renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  17680. }
  17681. }
  17682. _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, expression_array[i], div_temp, function_obj);
  17683. div_to_render.append(div_temp);
  17684. } else if (expression_array[i] == "(" || expression_array[i] == ")") {
  17685. if (expression_array[i] == ")") {
  17686. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i);
  17687. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  17688. } else if (expression_array[i] == "(" && !expression_array[i + 1].type_op) {
  17689. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  17690. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, i + 1);
  17691. } else {
  17692. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  17693. }
  17694. } else {
  17695. if (i == 0) {
  17696. console.log("NEGAÇÃO NO PRIMEIRO ELEMENTO");
  17697. } else if (expression_array[i - 1] == "(") {
  17698. console.log("NEGAÇÃO APÓS O PARÊNTESES");
  17699. }
  17700. renderOperatorMenu(command, function_obj, div_to_render, expression_array[i], types_included, i, expression_array);
  17701. }
  17702. }
  17703. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i, true);
  17704. renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included);
  17705. }
  17706. window.parentheses_activate = false;
  17707. window.open_or_close = null;
  17708. function renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included) {
  17709. 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>');
  17710. div_to_render.append(addParentheses);
  17711. addParentheses.popup({
  17712. content: "Adicionar parênteses",
  17713. delay: {
  17714. show: 750,
  17715. hide: 0
  17716. }
  17717. });
  17718. addParentheses.on("click", function (mouse_event) {
  17719. // verificar se já está ativado
  17720. if (window.parentheses_activate) {
  17721. return;
  17722. }
  17723. div_to_render.find(".usepointer").off("click");
  17724. window.parentheses_activate = true;
  17725. window.open_or_close = "open";
  17726. div_to_render.find(".dropdown").addClass("disabled");
  17727. div_to_render.find(".ghost_element").addClass("temp_class");
  17728. div_to_render.find(".ghost_element").removeClass("ghost_element");
  17729. var floatingObject = $('<div class="floating_parenthesis"> ( </div>');
  17730. floatingObject.draggable().appendTo("body");
  17731. floatingObject.css("position", "absolute");
  17732. mouse_event.type = "mousedown.draggable";
  17733. mouse_event.target = floatingObject[0];
  17734. floatingObject.css("left", mouse_event.pageX + 10);
  17735. floatingObject.css("top", mouse_event.pageY + 10);
  17736. floatingObject.trigger(mouse_event);
  17737. div_to_render.on("mousemove", function (evt) {
  17738. var actual_target = null;
  17739. if ($(evt.target).hasClass("single_element_expression")) {
  17740. actual_target = $(evt.target);
  17741. } else {
  17742. actual_target = $(evt.target).closest(".single_element_expression");
  17743. }
  17744. 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")) {
  17745. return;
  17746. }
  17747. renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array);
  17748. });
  17749. div_to_render.on("mouseleave", function () {
  17750. /*window.open_parentheses.remove();
  17751. window.close_parentheses.remove();*/
  17752. });
  17753. var floating;
  17754. $("body").on("mouseup", function (evt) {
  17755. if (window.open_or_close == "open") {
  17756. window.open_or_close = "close";
  17757. floatingObject.remove();
  17758. var comando_que_esta = $(evt.target).closest(".command_container");
  17759. var comando_certo = div_to_render.closest(".command_container");
  17760. if (!comando_que_esta.is(comando_certo)) {
  17761. window.parentheses_activate = false;
  17762. div_to_render.find(".temp_class").addClass("ghost_element");
  17763. div_to_render.find(".temp_class").removeClass("temp_class");
  17764. div_to_render.off("mousemove");
  17765. div_to_render.off("mouseleave");
  17766. $("body").off("mouseup");
  17767. window.open_parentheses.remove();
  17768. window.close_parentheses.remove();
  17769. window.inserir_open = -1;
  17770. window.inserir_close = -1;
  17771. window.open_or_close = null;
  17772. renderExpression(command, function_obj, div_to_render, expression_array);
  17773. return;
  17774. }
  17775. window.open_parentheses.addClass("parentheses_fixed");
  17776. floating = $('<div class="floating_parenthesis"> ) </div>');
  17777. floating.draggable().appendTo("body");
  17778. floating.css("position", "absolute");
  17779. floating.css("left", evt.pageX + 10);
  17780. floating.css("top", evt.pageY + 10);
  17781. $("body").on("mousemove", function (evts) {
  17782. floating.css("left", evts.pageX + 10);
  17783. floating.css("top", evts.pageY + 10);
  17784. });
  17785. } else {
  17786. floating.remove();
  17787. window.open_parentheses.removeClass("parentheses_fixed");
  17788. div_to_render.off("mousemove");
  17789. div_to_render.off("mouseleave");
  17790. $("body").off("mouseup");
  17791. setTimeout(function () {
  17792. window.parentheses_activate = false;
  17793. }, 50);
  17794. var comando_que_esta = $(evt.target).closest(".command_container");
  17795. var comando_certo = div_to_render.closest(".command_container");
  17796. var is_correct = false;
  17797. if (comando_que_esta.is(comando_certo)) {
  17798. is_correct = true;
  17799. }
  17800. if (is_correct) {
  17801. expression_array.splice(window.inserir_open, 0, "(");
  17802. expression_array.splice(window.inserir_close, 0, ")");
  17803. }
  17804. window.inserir_open = -1;
  17805. window.inserir_close = -1;
  17806. window.open_or_close = null;
  17807. renderExpression(command, function_obj, div_to_render, expression_array);
  17808. }
  17809. });
  17810. });
  17811. }
  17812. window.open_parentheses = $('<div class="parentheses_ghost">(</div>');
  17813. window.close_parentheses = $('<div class="parentheses_ghost">)</div>');
  17814. window.inserir_open = -1;
  17815. window.inserir_close = -1;
  17816. function renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array) {
  17817. /*window.open_parentheses.remove();
  17818. window.close_parentheses.remove();*/
  17819. var index_in_array = actual_target.data("index");
  17820. if (expression_array[index_in_array] == "(" || expression_array[index_in_array] == ")") {
  17821. return;
  17822. }
  17823. if (window.open_or_close == "close") {
  17824. if (index_in_array < window.inserir_open) {
  17825. return;
  17826. }
  17827. } // Tratando a situação quando é na primeira posição:
  17828. if (index_in_array == 0) {
  17829. if (expression_array[index_in_array].type == "var_value") {
  17830. if (window.open_or_close == "open") {
  17831. window.open_parentheses.insertBefore(actual_target);
  17832. window.inserir_open = index_in_array;
  17833. }
  17834. /*if (expression_array.length == 1) {
  17835. if (window.open_or_close == "close") {
  17836. window.close_parentheses.insertAfter(actual_target);
  17837. window.inserir_close = index_in_array + 2;
  17838. }*/
  17839. //} else {
  17840. var count_opened = 0;
  17841. var count_closed = 0;
  17842. for (var i = 0; i < expression_array.length; i++) {
  17843. if (expression_array[i] == "(") {
  17844. count_opened++;
  17845. }
  17846. if (expression_array[i] == ")") {
  17847. count_closed++;
  17848. }
  17849. if (count_opened != count_closed) {} else {
  17850. if (count_opened > 0) {
  17851. if (window.open_or_close == "close") {
  17852. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17853. window.inserir_close = i + 2;
  17854. }
  17855. break;
  17856. } else {
  17857. if (expression_array[i].type == "var_value") {
  17858. if (window.open_or_close == "close") {
  17859. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17860. window.inserir_close = i + 2;
  17861. }
  17862. break;
  17863. }
  17864. }
  17865. }
  17866. } //}
  17867. } else if (expression_array[index_in_array].type_op) {
  17868. if (window.open_or_close == "open") {
  17869. window.open_parentheses.insertBefore(actual_target);
  17870. window.inserir_open = index_in_array;
  17871. }
  17872. var count_opened = 0;
  17873. var count_closed = 0;
  17874. for (var i = 1; i < expression_array.length; i++) {
  17875. // $('.slide-link[data-slide="0"]')
  17876. if (expression_array[i] == "(") {
  17877. count_opened++;
  17878. }
  17879. if (expression_array[i] == ")") {
  17880. count_closed++;
  17881. }
  17882. if (count_opened != count_closed) {} else {
  17883. if (count_opened > 0) {
  17884. if (expression_array[i].type == "var_value") {
  17885. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17886. window.inserir_close = i + 2;
  17887. }
  17888. break;
  17889. } else {
  17890. if (expression_array[i].type == "var_value") {
  17891. if (expression_array[i].type == "var_value") {
  17892. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17893. window.inserir_close = i + 2;
  17894. }
  17895. break;
  17896. }
  17897. }
  17898. }
  17899. }
  17900. }
  17901. return;
  17902. } // Tratando quando não é no índice 0:
  17903. if (expression_array[index_in_array].type == "var_value") {
  17904. if (window.open_or_close == "open") {
  17905. window.open_parentheses.insertBefore(actual_target);
  17906. window.inserir_open = index_in_array;
  17907. }
  17908. if (window.open_or_close == "close") {
  17909. window.close_parentheses.insertAfter(actual_target);
  17910. window.inserir_close = index_in_array + 2;
  17911. }
  17912. return;
  17913. }
  17914. if (expression_array[index_in_array].type_op) {
  17915. // buscar para a esquerda primeiro:
  17916. if (expression_array[index_in_array - 1] == "(") {
  17917. if (window.open_or_close == "open") {
  17918. window.open_parentheses.insertBefore(actual_target);
  17919. window.inserir_open = index_in_array;
  17920. }
  17921. } else if (expression_array[index_in_array - 1] == ")") {
  17922. // buscar a abertura
  17923. var count_opened = 0;
  17924. var count_closed = 0;
  17925. for (var j = index_in_array - 1; j >= 0; j--) {
  17926. if (expression_array[j] == "(") {
  17927. count_opened++;
  17928. }
  17929. if (expression_array[j] == ")") {
  17930. count_closed++;
  17931. }
  17932. if (count_opened != count_closed) {} else {
  17933. if (count_closed > 0) {
  17934. if (window.open_or_close == "open") {
  17935. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  17936. window.inserir_open = j;
  17937. }
  17938. break;
  17939. }
  17940. }
  17941. }
  17942. } else if (expression_array[index_in_array - 1].type == "var_value") {
  17943. if (window.open_or_close == "open") {
  17944. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + (index_in_array - 1) + '"]'));
  17945. window.inserir_open = index_in_array - 1;
  17946. }
  17947. } // buscar para a direita agora:
  17948. if (expression_array[index_in_array + 1] == "(") {
  17949. // buscar o fechamento:
  17950. var count_opened = 0;
  17951. var count_closed = 0;
  17952. for (var j = index_in_array + 1; j < expression_array.length; j++) {
  17953. if (expression_array[j] == "(") {
  17954. count_opened++;
  17955. }
  17956. if (expression_array[j] == ")") {
  17957. count_closed++;
  17958. }
  17959. if (count_opened != count_closed) {} else {
  17960. if (count_opened > 0) {
  17961. if (window.open_or_close == "close") {
  17962. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  17963. window.inserir_close = j + 2;
  17964. }
  17965. break;
  17966. }
  17967. }
  17968. }
  17969. } else if (expression_array[index_in_array + 1].type == "var_value") {
  17970. if (window.open_or_close == "close") {
  17971. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + (index_in_array + 1) + '"]'));
  17972. window.inserir_close = index_in_array + 3;
  17973. }
  17974. }
  17975. }
  17976. }
  17977. function renderParenthesis(div_to_render, expression_content, command, function_obj, position, expression_array) {
  17978. var ghost_parenthesis = $('<div class="single_element_expression parentheses_in_expression" data-index="' + position + '">' + expression_content + "</div>");
  17979. div_to_render.append(ghost_parenthesis);
  17980. }
  17981. function renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, position) {
  17982. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  17983. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  17984. if (types_included.length > 1) {
  17985. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  17986. menu_final += getArithmeticOperators();
  17987. menu_final += "</div></div>";
  17988. } else {
  17989. menu_final += getArithmeticOperators();
  17990. }
  17991. }
  17992. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  17993. if (types_included.length > 1) {
  17994. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  17995. menu_final += getLogicOperators();
  17996. menu_final += "</div></div>";
  17997. } else {
  17998. menu_final += getLogicOperators();
  17999. }
  18000. }
  18001. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18002. if (types_included.length > 1) {
  18003. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18004. menu_final += getRelationalOperators();
  18005. menu_final += "</div></div>";
  18006. } else {
  18007. menu_final += getRelationalOperators();
  18008. }
  18009. }
  18010. menu_final += "</div></div>";
  18011. menu_final = $(menu_final);
  18012. var div_temp = $('<div class="single_element_expression ghost_element mouse_distance"></div>');
  18013. div_temp.append(menu_final);
  18014. var div_higher = $('<div class="higher_element"></div>');
  18015. div_higher.append(div_temp);
  18016. div_to_render.append(div_higher);
  18017. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus);
  18018. div_temp.on("click", function () {
  18019. if (!window.open_or_close) {
  18020. var sera = position;
  18021. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18022. console.log("p1");
  18023. 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));
  18024. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18025. console.log("p2");
  18026. 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));
  18027. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18028. console.log("p3");
  18029. 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));
  18030. }
  18031. renderExpression(command, function_obj, div_to_render, expression_array);
  18032. }
  18033. });
  18034. }
  18035. function renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, position) {
  18036. var is_last = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
  18037. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18038. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18039. if (types_included.length > 1) {
  18040. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18041. menu_final += getArithmeticOperators();
  18042. menu_final += "</div></div>";
  18043. } else {
  18044. menu_final += getArithmeticOperators();
  18045. }
  18046. }
  18047. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18048. if (types_included.length > 1) {
  18049. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18050. menu_final += getLogicOperators();
  18051. menu_final += "</div></div>";
  18052. } else {
  18053. menu_final += getLogicOperators();
  18054. }
  18055. }
  18056. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18057. if (types_included.length > 1) {
  18058. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18059. menu_final += getRelationalOperators();
  18060. menu_final += "</div></div>";
  18061. } else {
  18062. menu_final += getRelationalOperators();
  18063. }
  18064. }
  18065. menu_final += "</div></div>";
  18066. menu_final = $(menu_final);
  18067. var div_temp = $('<div class="simple_add mouse_distance"></div>');
  18068. var div_higher = $('<div class="higher_element"></div>');
  18069. var button = $('<button class="ui button green add_expression"><i class="plus circle inverted icon"></i></button>');
  18070. div_temp.append(button);
  18071. if (!is_last) {
  18072. div_higher.append(div_temp);
  18073. div_to_render.append(div_higher); //div_temp.append(menu_final);
  18074. div_temp.css("opacity", "0", "!important");
  18075. } else {
  18076. div_temp.removeClass("mouse_distance");
  18077. div_temp.css("opacity", "1", "!important"); //div_temp.append(menu_final);
  18078. div_to_render.append(div_temp);
  18079. }
  18080. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus);
  18081. div_temp.on("click", function () {
  18082. var sera = position;
  18083. if (expression_array[sera] == ")" && expression_array[sera - 1] == "(") {
  18084. 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));
  18085. renderExpression(command, function_obj, div_to_render, expression_array);
  18086. return;
  18087. }
  18088. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18089. 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));
  18090. 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));
  18091. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18092. 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));
  18093. 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));
  18094. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18095. 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));
  18096. 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));
  18097. }
  18098. renderExpression(command, function_obj, div_to_render, expression_array);
  18099. });
  18100. }
  18101. function renderOperatorMenu(command, function_obj, div_to_render, expression_element, types_included, position, expression_array) {
  18102. var menu_final = '<div class="ui dropdown"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18103. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep) >= 0) {
  18104. menu_final += getSeparator();
  18105. }
  18106. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18107. if (types_included.length > 1) {
  18108. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18109. menu_final += getArithmeticOperators();
  18110. menu_final += "</div></div>";
  18111. } else {
  18112. menu_final += getArithmeticOperators();
  18113. }
  18114. }
  18115. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18116. if (types_included.length > 1) {
  18117. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18118. menu_final += getLogicOperators();
  18119. menu_final += "</div></div>";
  18120. } else {
  18121. menu_final += getLogicOperators();
  18122. }
  18123. }
  18124. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18125. if (types_included.length > 1) {
  18126. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18127. menu_final += getRelationalOperators();
  18128. menu_final += "</div></div>";
  18129. } else {
  18130. menu_final += getRelationalOperators();
  18131. }
  18132. }
  18133. menu_final += "</div></div>";
  18134. menu_final = $(menu_final);
  18135. menu_final.find(".ivprog-write-sep").popup({
  18136. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("write_seprator_menu_tooltip"),
  18137. delay: {
  18138. show: 500,
  18139. hide: 0
  18140. }
  18141. });
  18142. var div_temp = $('<div class="single_element_expression not_allowed" data-index="' + position + '"></div>');
  18143. div_temp.append(menu_final);
  18144. div_to_render.append(div_temp);
  18145. menu_final.dropdown({
  18146. onChange: function onChange(_value, _text, $selectedItem) {
  18147. expression_element.item = $selectedItem.data("value");
  18148. expression_element.type_op = $selectedItem.data("type");
  18149. }
  18150. });
  18151. menu_final.dropdown("set selected", expression_element.item);
  18152. }
  18153. function getArithmeticOperators() {
  18154. var arithmetic_operators;
  18155. 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>';
  18156. 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>';
  18157. 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>';
  18158. 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>';
  18159. 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>';
  18160. return arithmetic_operators;
  18161. }
  18162. function getLogicOperators() {
  18163. var logic_operators;
  18164. 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>';
  18165. 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>';
  18166. 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>";
  18167. 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>";
  18168. 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>";
  18169. return logic_operators;
  18170. }
  18171. function getRelationalOperators() {
  18172. var relational_operators;
  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"].greater_than + '">></div>';
  18174. 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>';
  18175. 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>';
  18176. 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>';
  18177. 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>';
  18178. 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>';
  18179. return relational_operators;
  18180. }
  18181. function getSeparator() {
  18182. 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>");
  18183. }
  18184. /***/ }),
  18185. /***/ "./js/visualUI/commands/iftrue.js":
  18186. /*!****************************************!*\
  18187. !*** ./js/visualUI/commands/iftrue.js ***!
  18188. \****************************************/
  18189. /*! exports provided: createFloatingCommand, renderCommand */
  18190. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18191. "use strict";
  18192. __webpack_require__.r(__webpack_exports__);
  18193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18195. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18196. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18197. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  18198. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18199. function createFloatingCommand() {
  18200. return $('<div class="ui iftrue created_element"> <i class="ui icon small random"></i> <span> if (x < 1) { } </span></div>');
  18201. }
  18202. function renderCommand(command, function_obj) {
  18203. var ret = '';
  18204. 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>';
  18205. ret += '<span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_if') + '</span>';
  18206. ret += ' <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
  18207. ret += '<span> </span> ';
  18208. ret += '<div class="ui block_commands commands_if conditional_comands_block" data-if="true">';
  18209. ret += '</div></div>';
  18210. 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>';
  18211. ret += '<div class="ui block_commands commands_else conditional_comands_block" data-else="true">';
  18212. ret += '</div>';
  18213. ret += '<span></span></div>';
  18214. ret += '</div>';
  18215. var el = $(ret);
  18216. el.data('command', command);
  18217. el.find('.block_commands').data('command', command);
  18218. el.find('.data_block_if').data('command', command);
  18219. el.find('.data_block_else').data('command', command);
  18220. el.find('.commands_if').data('command', command);
  18221. addHandlers(command, function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
  18222. _generic_expression__WEBPACK_IMPORTED_MODULE_3__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  18223. if (command.commands_block) {
  18224. for (var j = 0; j < command.commands_block.length; j++) {
  18225. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.commands_if')[0]), 3, function_obj);
  18226. }
  18227. }
  18228. if (command.commands_else) {
  18229. for (var j = 0; j < command.commands_else.length; j++) {
  18230. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_else[j], $(el.find('.commands_else')[0]), 3, function_obj);
  18231. }
  18232. }
  18233. if (command.collapsed) {
  18234. el.children('.data_block_else').toggle();
  18235. $(el.find('.block_commands')[0]).toggle();
  18236. }
  18237. return el;
  18238. }
  18239. function addHandlers(command, function_obj, iftrue_dom) {
  18240. iftrue_dom.find('.button_remove_command').on('click', function () {
  18241. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, iftrue_dom)) {
  18242. iftrue_dom.fadeOut(400, function () {
  18243. iftrue_dom.remove();
  18244. });
  18245. }
  18246. });
  18247. iftrue_dom.find('.minimize_block_button').on('click', function () {
  18248. iftrue_dom.children('.data_block_else').toggle();
  18249. $(iftrue_dom.find('.block_commands')[0]).toggle();
  18250. command.collapsed = !command.collapsed;
  18251. });
  18252. }
  18253. /***/ }),
  18254. /***/ "./js/visualUI/commands/reader.js":
  18255. /*!****************************************!*\
  18256. !*** ./js/visualUI/commands/reader.js ***!
  18257. \****************************************/
  18258. /*! exports provided: createFloatingCommand, renderCommand */
  18259. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18260. "use strict";
  18261. __webpack_require__.r(__webpack_exports__);
  18262. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18263. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18264. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18265. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18266. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18267. function createFloatingCommand() {
  18268. 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>');
  18269. }
  18270. function renderCommand(command, function_obj) {
  18271. 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>';
  18272. el = $(el);
  18273. el.data('command', command);
  18274. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
  18275. addHandlers(command, function_obj, el);
  18276. return el;
  18277. }
  18278. function addHandlers(command, function_obj, reader_dom) {
  18279. reader_dom.find('.button_remove_command').on('click', function () {
  18280. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, reader_dom)) {
  18281. reader_dom.fadeOut(400, function () {
  18282. reader_dom.remove();
  18283. });
  18284. }
  18285. });
  18286. }
  18287. /***/ }),
  18288. /***/ "./js/visualUI/commands/repeatNtimes.js":
  18289. /*!**********************************************!*\
  18290. !*** ./js/visualUI/commands/repeatNtimes.js ***!
  18291. \**********************************************/
  18292. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, manageClearExpressionElements */
  18293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18294. "use strict";
  18295. __webpack_require__.r(__webpack_exports__);
  18296. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18297. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18298. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  18299. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageClearExpressionElements", function() { return manageClearExpressionElements; });
  18300. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18301. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18302. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18303. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  18304. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18305. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18306. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18307. function createFloatingCommand() {
  18308. 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>');
  18309. }
  18310. function renderCommand(command, function_obj) {
  18311. 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<div class=\"ui context_menu\"></div> <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>'");
  18312. ret += '<div class="ui block_commands">';
  18313. ret += '</div>';
  18314. ret += '<span> </span>';
  18315. ret += '</div>';
  18316. var el = $(ret);
  18317. el.data('command', command);
  18318. el.find('.block_commands').data('command', command);
  18319. addHandlers(command, function_obj, el);
  18320. _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  18321. _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'));
  18322. _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);
  18323. //VariableValueMenu.renderMenu(command, command.var_incrementation, el.find('.incrementation_variable'), function_obj);
  18324. //angle double right
  18325. if (!command.expression1) {
  18326. 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);
  18327. }
  18328. el.find('.text_receives').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_from"));
  18329. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, el.find('.var_value_expression'), function_obj);
  18330. if (!command.expression3) {
  18331. 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>');
  18332. el.find('.pass_button').find('button').on('click', function () {
  18333. togglePasso(command);
  18334. });
  18335. /*var exp = new Models.ExpressionElement(Models.EXPRESSION_ELEMENTS.exp_op_exp,
  18336. [command.var_attribution,
  18337. Models.ARITHMETIC_TYPES.plus,
  18338. new Models.VariableValueMenu(VariableValueMenu.VAR_OR_VALUE_TYPES.all, "1", null, null, true)]);
  18339. command.expression3 = exp;
  18340. command.var_incrementation = command.var_attribution;*/
  18341. } else {
  18342. 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>');
  18343. el.find('.pass_button').find('button').on('click', function () {
  18344. togglePasso(command);
  18345. });
  18346. renderOperator(command, function_obj, el.find('.operator'), command.expression3, 1);
  18347. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], el.find('.second_operand'), function_obj);
  18348. }
  18349. if (command.commands_block) {
  18350. for (var j = 0; j < command.commands_block.length; j++) {
  18351. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  18352. }
  18353. }
  18354. return el;
  18355. }
  18356. function togglePasso(command) {
  18357. if (!command.expression3) {
  18358. 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)]);
  18359. command.expression3 = exp;
  18360. command.var_incrementation = command.var_attribution;
  18361. } else {
  18362. command.expression3 = null;
  18363. }
  18364. renderAlgorithm();
  18365. }
  18366. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  18367. if (dom_object.hasClass('variable_attribution')) {
  18368. if (!command.expression3) {
  18369. 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)]);
  18370. command.expression3 = exp;
  18371. command.var_incrementation = command.var_attribution;
  18372. 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);
  18373. command.expression2.expression = cond_exp;
  18374. }
  18375. dom_object.parent().find('.text_receives').text('de');
  18376. 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);
  18377. dom_object.parent().find('.var_value_expression').empty();
  18378. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, dom_object.parent().find('.var_value_expression'), function_obj);
  18379. renderAlgorithm();
  18380. }
  18381. if (dom_object.hasClass('incrementation_variable')) {
  18382. dom_object.parent().find('.text_inc_receives').text('de');
  18383. 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)]);
  18384. command.expression3 = exp;
  18385. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[0], dom_object.parent().find('.first_operand'), function_obj);
  18386. renderOperator(command, function_obj, dom_object.parent().find('.operator'), command.expression3, 1);
  18387. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], dom_object.parent().find('.second_operand'), function_obj);
  18388. }
  18389. }
  18390. function manageClearExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  18391. if (dom_object.hasClass('variable_attribution')) {
  18392. $(dom_object).parent().find('.text_receives').text('');
  18393. command.expression1 = null;
  18394. $(dom_object).parent().find('.var_value_expression').empty();
  18395. }
  18396. if (dom_object.hasClass('incrementation_variable')) {
  18397. $(dom_object).parent().find('.text_inc_receives').text('');
  18398. command.expression3 = null;
  18399. $(dom_object).parent().find('.first_operand').empty();
  18400. $(dom_object).parent().find('.operator').empty();
  18401. $(dom_object).parent().find('.second_operand').empty();
  18402. }
  18403. }
  18404. function addHandlers(command, function_obj, repeatNtimes_dom) {
  18405. repeatNtimes_dom.find('.button_remove_command').on('click', function () {
  18406. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, repeatNtimes_dom)) {
  18407. repeatNtimes_dom.fadeOut(400, function () {
  18408. repeatNtimes_dom.remove();
  18409. });
  18410. }
  18411. });
  18412. }
  18413. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  18414. var menu_operator = $('<div class="ui dropdown"><div class="text"></div></div>');
  18415. menu_operator.dropdown({
  18416. values: [{
  18417. name: '+',
  18418. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus,
  18419. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus
  18420. }, {
  18421. name: '-',
  18422. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus,
  18423. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus
  18424. }],
  18425. onChange: function onChange(value, text, $selectedItem) {
  18426. expression_element.itens[index_op] = value;
  18427. }
  18428. });
  18429. temp_op.append(menu_operator);
  18430. }
  18431. /***/ }),
  18432. /***/ "./js/visualUI/commands/return.js":
  18433. /*!****************************************!*\
  18434. !*** ./js/visualUI/commands/return.js ***!
  18435. \****************************************/
  18436. /*! exports provided: createFloatingCommand, renderCommand */
  18437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18438. "use strict";
  18439. __webpack_require__.r(__webpack_exports__);
  18440. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18441. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18442. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  18443. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18444. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18445. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18446. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18447. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18448. function createFloatingCommand() {
  18449. 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>');
  18450. }
  18451. function renderCommand(command, function_obj) {
  18452. 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></div>');
  18453. el.data('command', command);
  18454. addHandlers(command, function_obj, el);
  18455. if (function_obj.return_type != _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID) {
  18456. if (!command.variable_value_menu) {
  18457. 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)];
  18458. }
  18459. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.variable_value_menu);
  18460. } else {
  18461. el.find('.expression_elements').remove();
  18462. command.variable_value_menu = null;
  18463. }
  18464. return el;
  18465. }
  18466. function addHandlers(command, function_obj, return_dom) {
  18467. return_dom.find('.button_remove_command').on('click', function () {
  18468. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, return_dom)) {
  18469. return_dom.fadeOut(400, function () {
  18470. return_dom.remove();
  18471. });
  18472. }
  18473. });
  18474. }
  18475. /***/ }),
  18476. /***/ "./js/visualUI/commands/switch.js":
  18477. /*!****************************************!*\
  18478. !*** ./js/visualUI/commands/switch.js ***!
  18479. \****************************************/
  18480. /*! exports provided: createFloatingCommand, renderCommand, renderCase */
  18481. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18482. "use strict";
  18483. __webpack_require__.r(__webpack_exports__);
  18484. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18485. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18486. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCase", function() { return renderCase; });
  18487. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18488. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18489. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18490. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18491. function createFloatingCommand() {
  18492. 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>');
  18493. }
  18494. function renderCommand(command, function_obj) {
  18495. var ret = '';
  18496. 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> <div class="ui context_menu"></div> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_code_switch') + ' ( <div class="ui variable_to_switch"></div> ) <div class="ui all_cases_div"></div></span>';
  18497. ret += '</div>';
  18498. var el = $(ret);
  18499. el.data('command', command);
  18500. addHandlers(command, function_obj, el);
  18501. _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  18502. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.variable_to_switch'), function_obj);
  18503. if (command.cases) {
  18504. for (var i = 0; i < command.cases.length; i++) {
  18505. renderCase(command.cases[i], command, function_obj, el.find('.all_cases_div'));
  18506. }
  18507. }
  18508. return el;
  18509. }
  18510. function renderCase(switchcase, command, function_obj, el) {
  18511. 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>');
  18512. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, switchcase.variable_value_menu, casediv.find('.variable_case'), function_obj);
  18513. casediv.data('switchcase', switchcase);
  18514. casediv.find('.case_commands_block').data('switchcase', switchcase);
  18515. el.append(casediv);
  18516. if (switchcase.commands_block) {
  18517. for (var j = 0; j < switchcase.commands_block.length; j++) {
  18518. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](switchcase.commands_block[j], $(casediv.find('.case_commands_block')[0]), 3, function_obj);
  18519. }
  18520. }
  18521. casediv.find('.button_remove_command').on('click', function () {
  18522. for (var i = 0; i < command.cases.length; i++) {
  18523. if (switchcase == command.cases[i]) {
  18524. delete command.cases[i];
  18525. command.cases.splice(i, 1);
  18526. casediv.remove();
  18527. break;
  18528. }
  18529. }
  18530. });
  18531. }
  18532. function addHandlers(command, function_obj, switch_dom) {
  18533. switch_dom.find('.button_remove_command').on('click', function () {
  18534. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, switch_dom)) {
  18535. switch_dom.fadeOut(400, function () {
  18536. switch_dom.remove();
  18537. });
  18538. }
  18539. });
  18540. }
  18541. /***/ }),
  18542. /***/ "./js/visualUI/commands/variable_value_menu.js":
  18543. /*!*****************************************************!*\
  18544. !*** ./js/visualUI/commands/variable_value_menu.js ***!
  18545. \*****************************************************/
  18546. /*! exports provided: VAR_OR_VALUE_TYPES, renderMenu */
  18547. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18548. "use strict";
  18549. __webpack_require__.r(__webpack_exports__);
  18550. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VAR_OR_VALUE_TYPES", function() { return VAR_OR_VALUE_TYPES; });
  18551. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  18552. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18553. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18554. /* harmony import */ var _attribution__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attribution */ "./js/visualUI/commands/attribution.js");
  18555. /* harmony import */ var _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  18556. var VAR_OR_VALUE_TYPES = Object.freeze({
  18557. only_variable: 1,
  18558. only_value: 2,
  18559. only_function: 3,
  18560. variable_and_function: 4,
  18561. variable_and_value_opt: 5,
  18562. value_and_function: 6,
  18563. all: 7
  18564. });
  18565. function renderMenu(command, ref_object, dom_object, function_obj) {
  18566. var size_field = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
  18567. var expression_element = arguments.length > 5 ? arguments[5] : undefined;
  18568. // Verificar se o objeto atual trata-se de uma chamada de função e conferir se possui a quantidade correta de parâmetros
  18569. // Caso não possua, tem que adicionar as variáveis que servirão de parâmetros:
  18570. if (ref_object.function_called) {
  18571. if (ref_object.function_called.parameters_list) {
  18572. while (ref_object.function_called.parameters_list.length != ref_object.parameters_list.length) {
  18573. if (ref_object.parameters_list.length > ref_object.function_called.parameters_list.length) {
  18574. ref_object.parameters_list.pop();
  18575. } else {
  18576. ref_object.parameters_list.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true));
  18577. }
  18578. }
  18579. }
  18580. }
  18581. 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">';
  18582. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_variable) {
  18583. 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">';
  18584. menu_var_or_value += "</div>";
  18585. }
  18586. 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) {
  18587. 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");
  18588. menu_var_or_value += '<div class="menu menu_only_vars">';
  18589. menu_var_or_value += "</div></div>";
  18590. }
  18591. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_value) {
  18592. menu_var_or_value = '<input type="text" class="width-dynamic" size="' + size_field + '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />';
  18593. }
  18594. 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) {
  18595. 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>";
  18596. }
  18597. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_function) {
  18598. 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">';
  18599. menu_var_or_value += "</div>";
  18600. }
  18601. 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) {
  18602. 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");
  18603. menu_var_or_value += '<div class="menu menu_only_functions">';
  18604. menu_var_or_value += "</div></div>";
  18605. /* if (command.type == Models.COMMAND_TYPES.attribution) {
  18606. menu_var_or_value += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18607. menu_var_or_value += '<div class="menu">';
  18608. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18609. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18610. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18611. menu_var_or_value += '</div></div>';
  18612. }*/
  18613. }
  18614. menu_var_or_value += "</div></div>";
  18615. menu_var_or_value = $(menu_var_or_value);
  18616. menu_var_or_value.find('.width-dynamic').on('input', function () {
  18617. var input_field = $(this);
  18618. var inputWidth = input_field.textWidth() + 10;
  18619. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  18620. input_field.css({
  18621. width: inputWidth
  18622. });
  18623. }).trigger('input');
  18624. dom_object.append(menu_var_or_value);
  18625. ref_object.dom_object = menu_var_or_value;
  18626. addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  18627. addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  18628. addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  18629. addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  18630. if (ref_object.content || ref_object.function_called) {
  18631. if (ref_object.content) {
  18632. // Verificar se a variável ainda existe:
  18633. var variable_fun = isVarInProgram(ref_object.content, function_obj);
  18634. if (variable_fun) {
  18635. ref_object.content = variable_fun;
  18636. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  18637. } else {
  18638. if (ref_object.content && ref_object.content.type) {
  18639. ref_object.content = null;
  18640. appendSelectText(ref_object, menu_var_or_value);
  18641. } else {
  18642. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  18643. }
  18644. }
  18645. } else if (ref_object.function_called) {
  18646. // Verificar se a função ainda existe:
  18647. var ret_function = isFunctionInProgram(ref_object.function_called);
  18648. if (ret_function) {
  18649. ref_object.function_called = ret_function;
  18650. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  18651. } else {
  18652. ref_object.content = null;
  18653. ref_object.row = null;
  18654. ref_object.column = null;
  18655. delete ref_object.function_called;
  18656. delete ref_object.parameters_list;
  18657. appendSelectText(ref_object, menu_var_or_value);
  18658. }
  18659. }
  18660. } else {
  18661. appendSelectText(ref_object, menu_var_or_value);
  18662. }
  18663. }
  18664. function appendSelectText(ref_object, menu_var_or_value) {
  18665. switch (ref_object.variable_and_value) {
  18666. case VAR_OR_VALUE_TYPES.only_variable:
  18667. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_var") + "</i>");
  18668. break;
  18669. case VAR_OR_VALUE_TYPES.all:
  18670. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  18671. break;
  18672. case VAR_OR_VALUE_TYPES.variable_and_function:
  18673. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  18674. break;
  18675. case VAR_OR_VALUE_TYPES.only_function:
  18676. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_function") + "</i>");
  18677. break;
  18678. }
  18679. }
  18680. function isFunctionInProgram(function_called_obj) {
  18681. if (function_called_obj.name) {
  18682. if (window.program_obj.functions) {
  18683. for (var i = 0; i < window.program_obj.functions.length; i++) {
  18684. if (window.program_obj.functions[i] == function_called_obj) {
  18685. return window.program_obj.functions[i];
  18686. }
  18687. }
  18688. for (var i = 0; i < window.program_obj.functions.length; i++) {
  18689. if (window.program_obj.functions[i].name == function_called_obj.name) {
  18690. return window.program_obj.functions[i];
  18691. }
  18692. }
  18693. }
  18694. } else if (function_called_obj.identifier) {
  18695. for (var i = 0; i < window.system_functions.length; i++) {
  18696. if (window.system_functions[i].identifier == function_called_obj.identifier) {
  18697. return window.system_functions[i];
  18698. }
  18699. }
  18700. }
  18701. return null;
  18702. }
  18703. function isVarInProgram(var_obj, function_obj) {
  18704. // Verify in locals:
  18705. if (function_obj.variables_list) {
  18706. for (var i = 0; i < function_obj.variables_list.length; i++) {
  18707. if (function_obj.variables_list[i] == var_obj) {
  18708. return function_obj.variables_list[i];
  18709. }
  18710. }
  18711. } // Verify in parameters:
  18712. if (function_obj.parameters_list) {
  18713. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  18714. if (function_obj.parameters_list[i] == var_obj) {
  18715. return function_obj.parameters_list[i];
  18716. }
  18717. }
  18718. } // Verify in globals:
  18719. if (window.program_obj.globals) {
  18720. for (var i = 0; i < window.program_obj.globals.length; i++) {
  18721. if (window.program_obj.globals[i] == var_obj) {
  18722. return window.program_obj.globals[i];
  18723. }
  18724. }
  18725. } // If not found, verify if the reference was lost
  18726. if (var_obj) {
  18727. if (function_obj.variables_list) {
  18728. for (var i = 0; i < function_obj.variables_list.length; i++) {
  18729. if (function_obj.variables_list[i].name == var_obj.name) {
  18730. return function_obj.variables_list[i];
  18731. }
  18732. }
  18733. }
  18734. if (function_obj.parameters_list) {
  18735. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  18736. if (function_obj.parameters_list[i].name == var_obj.name) {
  18737. return function_obj.parameters_list[i];
  18738. }
  18739. }
  18740. }
  18741. if (window.program_obj.globals) {
  18742. for (var i = 0; i < window.program_obj.globals.length; i++) {
  18743. if (window.program_obj.globals[i].name == var_obj.name) {
  18744. return window.program_obj.globals[i];
  18745. }
  18746. }
  18747. }
  18748. }
  18749. return null;
  18750. }
  18751. function renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element) {
  18752. if (ref_object.function_called) {
  18753. menu_var_or_value.remove();
  18754. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  18755. } else if (ref_object.content.type) {
  18756. menu_var_or_value.remove();
  18757. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  18758. } else {
  18759. menu_var_or_value.remove();
  18760. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  18761. }
  18762. }
  18763. function variableValueMenuCode(command, variable_obj, dom_object, function_obj, menu_var_or_value, expression_element) {
  18764. if (variable_obj.content || variable_obj.function_called) {
  18765. // Verificar se a variável ainda existe:
  18766. var var_fun = isVarInProgram(variable_obj.content, function_obj);
  18767. if (var_fun) {
  18768. variable_obj.content = var_fun;
  18769. } else {
  18770. if (variable_obj.content && variable_obj.content.type) {
  18771. variable_obj.content = null;
  18772. appendSelectText(variable_obj, menu_var_or_value);
  18773. }
  18774. }
  18775. } else {
  18776. appendSelectText(variable_obj, menu_var_or_value);
  18777. }
  18778. if (variable_obj.content == null && variable_obj.function_called == null) {
  18779. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18780. return;
  18781. }
  18782. var ret = "";
  18783. if (variable_obj.function_called) {
  18784. if (variable_obj.function_called.parameters_list == null || variable_obj.function_called.length == 0) {
  18785. menu_var_or_value.find(".text").text(" ");
  18786. dom_object.find(".menu_var_or_value_dom").remove();
  18787. var parameters_menu;
  18788. if (variable_obj.function_called.name) {
  18789. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  18790. } else {
  18791. 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>";
  18792. }
  18793. parameters_menu += "<span> ) </span></div>";
  18794. parameters_menu = $(parameters_menu);
  18795. dom_object.append(parameters_menu);
  18796. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18797. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18798. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18799. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18800. context_menu += '<div class="menu">';
  18801. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18802. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18803. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18804. context_menu += '</div></div>';
  18805. }*/
  18806. context_menu += "</div></div>";
  18807. context_menu = $(context_menu);
  18808. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  18809. context_menu.dropdown({
  18810. onChange: function onChange(value, text, $selectedItem) {
  18811. console.log("S1");
  18812. if ($selectedItem.data("clear")) {
  18813. console.log("PP1");
  18814. dom_object.text("");
  18815. variable_obj.content = null;
  18816. variable_obj.row = null;
  18817. variable_obj.column = null;
  18818. delete variable_obj.function_called;
  18819. delete variable_obj.parameters_list;
  18820. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18821. }
  18822. if ($selectedItem.data("exp")) {
  18823. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18824. }
  18825. },
  18826. selectOnKeydown: false
  18827. });
  18828. } else {
  18829. menu_var_or_value.find(".text").text(" ");
  18830. dom_object.find(".menu_var_or_value_dom").remove();
  18831. var parameters_menu;
  18832. if (variable_obj.function_called.name) {
  18833. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  18834. } else {
  18835. 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>";
  18836. }
  18837. for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
  18838. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  18839. if (j + 1 != variable_obj.function_called.parameters_list.length) {
  18840. parameters_menu += " , ";
  18841. }
  18842. }
  18843. parameters_menu += "<span> ) </span></div>";
  18844. parameters_menu = $(parameters_menu);
  18845. dom_object.append(parameters_menu);
  18846. for (var _j = 0; _j < variable_obj.function_called.parameters_list.length; _j++) {
  18847. renderMenu(command, variable_obj.parameters_list[_j], parameters_menu.find(".parameter_" + _j), function_obj, 2, expression_element);
  18848. }
  18849. var _context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18850. _context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18851. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18852. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18853. context_menu += '<div class="menu">';
  18854. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18855. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18856. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18857. context_menu += '</div></div>';
  18858. }*/
  18859. _context_menu += "</div></div>";
  18860. _context_menu = $(_context_menu);
  18861. _context_menu.insertAfter(parameters_menu);
  18862. _context_menu.dropdown({
  18863. onChange: function onChange(value, text, $selectedItem) {
  18864. console.log("S2");
  18865. if ($selectedItem.data("clear")) {
  18866. console.log("PP2");
  18867. dom_object.text("");
  18868. variable_obj.content = null;
  18869. variable_obj.row = null;
  18870. variable_obj.column = null;
  18871. delete variable_obj.function_called;
  18872. delete variable_obj.parameters_list;
  18873. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18874. }
  18875. if ($selectedItem.data("exp")) {
  18876. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18877. }
  18878. },
  18879. selectOnKeydown: false
  18880. });
  18881. }
  18882. } else if (variable_obj.content.type) {
  18883. var variable_render = "";
  18884. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  18885. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  18886. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  18887. variable_render += "</div>";
  18888. variable_render = $(variable_render);
  18889. dom_object.append(variable_render);
  18890. var _context_menu2 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18891. _context_menu2 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18892. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18893. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18894. context_menu += '<div class="menu">';
  18895. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18896. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18897. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18898. context_menu += '</div></div>';
  18899. }*/
  18900. _context_menu2 += "</div></div>";
  18901. _context_menu2 = $(_context_menu2);
  18902. variable_render.append(_context_menu2);
  18903. _context_menu2.dropdown({
  18904. onChange: function onChange(value, text, $selectedItem) {
  18905. console.log("S3");
  18906. if ($selectedItem.data("clear")) {
  18907. console.log("PP3");
  18908. dom_object.text("");
  18909. variable_obj.content = null;
  18910. variable_obj.row = null;
  18911. variable_obj.column = null;
  18912. delete variable_obj.function_called;
  18913. delete variable_obj.parameters_list;
  18914. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18915. }
  18916. if ($selectedItem.data("exp")) {
  18917. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18918. }
  18919. },
  18920. selectOnKeydown: false
  18921. });
  18922. if (!variable_obj.column) {
  18923. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  18924. }
  18925. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  18926. } else if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  18927. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  18928. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span>';
  18929. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ] </span>';
  18930. variable_render += "</div>";
  18931. variable_render = $(variable_render);
  18932. dom_object.append(variable_render);
  18933. var _context_menu3 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18934. _context_menu3 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18935. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18936. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18937. context_menu += '<div class="menu">';
  18938. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18939. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18940. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18941. context_menu += '</div></div>';
  18942. }*/
  18943. _context_menu3 += "</div></div>";
  18944. _context_menu3 = $(_context_menu3);
  18945. variable_render.append(_context_menu3);
  18946. _context_menu3.dropdown({
  18947. onChange: function onChange(value, text, $selectedItem) {
  18948. console.log("S4");
  18949. if ($selectedItem.data("clear")) {
  18950. console.log("PP4");
  18951. dom_object.text("");
  18952. variable_obj.content = null;
  18953. variable_obj.row = null;
  18954. variable_obj.column = null;
  18955. delete variable_obj.function_called;
  18956. delete variable_obj.parameters_list;
  18957. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18958. }
  18959. if ($selectedItem.data("exp")) {
  18960. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18961. }
  18962. },
  18963. selectOnKeydown: false
  18964. });
  18965. if (!variable_obj.column) {
  18966. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  18967. }
  18968. if (!variable_obj.row) {
  18969. variable_obj.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  18970. }
  18971. variableValueMenuCode(command, variable_obj.row, $(variable_render.find(".row_container")), function_obj, menu_var_or_value, expression_element);
  18972. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  18973. } else {
  18974. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  18975. variable_render += "</div>";
  18976. variable_render = $(variable_render);
  18977. dom_object.append(variable_render);
  18978. var _context_menu4 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18979. _context_menu4 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18980. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  18981. console.log('dom_object6');
  18982. console.log(dom_object);
  18983. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18984. context_menu += '<div class="menu">';
  18985. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18986. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18987. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18988. context_menu += '</div></div>';
  18989. }*/
  18990. _context_menu4 += "</div></div>";
  18991. _context_menu4 = $(_context_menu4);
  18992. variable_render.append(_context_menu4);
  18993. _context_menu4.dropdown({
  18994. onChange: function onChange(value, text, $selectedItem) {
  18995. console.log("S5");
  18996. if ($selectedItem.data("clear")) {
  18997. console.log("PP5");
  18998. dom_object.text("");
  18999. variable_obj.content = null;
  19000. variable_obj.row = null;
  19001. variable_obj.column = null;
  19002. delete variable_obj.function_called;
  19003. delete variable_obj.parameters_list;
  19004. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19005. }
  19006. if ($selectedItem.data("exp")) {
  19007. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19008. }
  19009. },
  19010. selectOnKeydown: false
  19011. });
  19012. }
  19013. } else {
  19014. var _variable_render;
  19015. _variable_render = '<div class="variable_rendered"> <span class="var_name">';
  19016. if (isNaN(variable_obj.content)) {
  19017. _variable_render += variable_obj.content.replaceAll(" ", "&nbsp;");
  19018. } else {
  19019. _variable_render += variable_obj.content;
  19020. }
  19021. _variable_render += "</span>";
  19022. _variable_render += "</div>";
  19023. _variable_render = $(_variable_render);
  19024. dom_object.append(_variable_render);
  19025. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19026. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19027. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19028. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19029. context_menu += '<div class="menu">';
  19030. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19031. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19032. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19033. context_menu += '</div></div>';
  19034. }*/
  19035. context_menu += "</div></div>";
  19036. context_menu = $(context_menu);
  19037. if (variable_obj.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19038. context_menu.insertAfter(_variable_render);
  19039. }
  19040. context_menu.dropdown({
  19041. onChange: function onChange(value, text, $selectedItem) {
  19042. console.log("S6");
  19043. if ($selectedItem.data("clear")) {
  19044. console.log("PP6");
  19045. dom_object.text("");
  19046. variable_obj.content = null;
  19047. variable_obj.row = null;
  19048. variable_obj.column = null;
  19049. delete variable_obj.function_called;
  19050. delete variable_obj.parameters_list;
  19051. dom_object.find(".value_rendered").remove();
  19052. dom_object.find(".context_menu_clear").remove();
  19053. dom_object.find(".width-dynamic-minus").remove();
  19054. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19055. }
  19056. if ($selectedItem.data("exp")) {
  19057. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19058. }
  19059. },
  19060. selectOnKeydown: false
  19061. });
  19062. _variable_render.on("click", function (e) {
  19063. _variable_render.remove();
  19064. _variable_render.empty();
  19065. _variable_render.remove();
  19066. dom_object.empty();
  19067. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19068. openInputToValue(command, variable_obj, dom_object, menu_var_or_value, function_obj, expression_element);
  19069. });
  19070. }
  19071. }
  19072. function addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19073. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  19074. sub_menu.append('<div class="divider"></div><div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_header_ivprog_functions") + "</div>");
  19075. 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>');
  19076. 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>');
  19077. 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>');
  19078. 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:
  19079. for (var i = 0; i < window.system_functions.length; i++) {
  19080. var t = $('<div class="item"></div>');
  19081. t.data("function_reference", window.system_functions[i]);
  19082. t.data("option", VAR_OR_VALUE_TYPES.only_function);
  19083. t.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(window.system_functions[i].identifier));
  19084. switch (window.system_functions[i].category) {
  19085. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].math:
  19086. sub_menu.find(".menu_math_functions").append(t);
  19087. break;
  19088. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].text:
  19089. sub_menu.find(".menu_text_functions").append(t);
  19090. break;
  19091. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement:
  19092. sub_menu.find(".menu_arrangement_functions").append(t);
  19093. break;
  19094. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion:
  19095. sub_menu.find(".menu_conversion_functions").append(t);
  19096. break;
  19097. }
  19098. }
  19099. }
  19100. function addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19101. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  19102. sub_menu.text("");
  19103. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19104. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_function + '">' + window.program_obj.functions[i].name + " </div>");
  19105. temp.data("function_reference", window.program_obj.functions[i]);
  19106. sub_menu.append(temp);
  19107. }
  19108. }
  19109. function addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19110. var sub_menu = menu_var_or_value.find(".menu_only_vars");
  19111. sub_menu.text("");
  19112. var is_there = false;
  19113. if (window.program_obj.globals) {
  19114. if (ref_object.include_constant) {
  19115. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19116. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  19117. temp.data("variable_reference", window.program_obj.globals[i]);
  19118. sub_menu.append(temp);
  19119. is_there = true;
  19120. }
  19121. } else {
  19122. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19123. if (!window.program_obj.globals[i].is_constant) {
  19124. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  19125. temp.data("variable_reference", window.program_obj.globals[i]);
  19126. sub_menu.append(temp);
  19127. is_there = true;
  19128. }
  19129. }
  19130. }
  19131. }
  19132. if (function_obj.parameters_list) {
  19133. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  19134. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.parameters_list[i].name + " </div>");
  19135. temp.data("variable_reference", function_obj.parameters_list[i]);
  19136. sub_menu.append(temp);
  19137. is_there = true;
  19138. }
  19139. }
  19140. if (function_obj.variables_list) {
  19141. for (var i = 0; i < function_obj.variables_list.length; i++) {
  19142. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.variables_list[i].name + " </div>");
  19143. temp.data("variable_reference", function_obj.variables_list[i]);
  19144. sub_menu.append(temp);
  19145. is_there = true;
  19146. }
  19147. }
  19148. if (!is_there) {
  19149. sub_menu.append($('<div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable") + "</div>"));
  19150. sub_menu.append($('<div class="item disabled">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable_instruction") + "</div>"));
  19151. }
  19152. }
  19153. function addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  19154. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19155. menu_var_or_value.dropdown({
  19156. onChange: function onChange(value, text, $selectedItem) {
  19157. console.log("S7");
  19158. dom_object.find(".var_name").remove();
  19159. switch ($selectedItem.data("option")) {
  19160. case VAR_OR_VALUE_TYPES.only_function:
  19161. openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("function_reference"), expression_element);
  19162. break;
  19163. case VAR_OR_VALUE_TYPES.only_value:
  19164. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19165. break;
  19166. case VAR_OR_VALUE_TYPES.only_variable:
  19167. openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("variable_reference"), expression_element);
  19168. break;
  19169. }
  19170. if ($selectedItem.data("exp")) {
  19171. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19172. }
  19173. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  19174. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19175. }
  19176. },
  19177. selectOnKeydown: false
  19178. });
  19179. }
  19180. dom_object.find(".width-dynamic").on("input", function () {
  19181. var inputWidth = $(this).textWidth() + 10;
  19182. $(this).focus();
  19183. var tmpStr = $(this).val();
  19184. $(this).val("");
  19185. $(this).val(tmpStr);
  19186. $(this).css({
  19187. width: inputWidth
  19188. });
  19189. }).trigger("input");
  19190. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  19191. dom_object.parent().on("click", function (e) {
  19192. dom_object.find(".value_rendered").remove();
  19193. dom_object.find(".value_rendered").empty();
  19194. dom_object.find(".value_rendered").remove();
  19195. dom_object.empty();
  19196. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19197. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19198. });
  19199. }
  19200. }
  19201. function openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, function_selected, expression_element) {
  19202. ref_object.function_called = function_selected;
  19203. ref_object.parameters_list = [];
  19204. if (function_selected.parameters_list != null && function_selected.parameters_list.length > 0) {
  19205. menu_var_or_value.find(".text").text(" ");
  19206. dom_object.find(".menu_var_or_value_dom").remove();
  19207. var parameters_menu;
  19208. if (function_selected.name) {
  19209. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  19210. } else {
  19211. 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>";
  19212. }
  19213. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  19214. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  19215. if (j + 1 != function_selected.parameters_list.length) {
  19216. parameters_menu += " , ";
  19217. }
  19218. }
  19219. parameters_menu += "<span> ) </span></div>";
  19220. parameters_menu = $(parameters_menu);
  19221. dom_object.append(parameters_menu);
  19222. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  19223. var temp;
  19224. if (function_selected.parameters_list[j].dimensions > 0) {
  19225. 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);
  19226. } else {
  19227. temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19228. }
  19229. ref_object.parameters_list.push(temp);
  19230. renderMenu(command, temp, parameters_menu.find(".parameter_" + j), function_obj, 2, expression_element);
  19231. }
  19232. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19233. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19234. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19235. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19236. context_menu += '<div class="menu">';
  19237. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19238. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19239. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19240. context_menu += '</div></div>';
  19241. }*/
  19242. context_menu += "</div></div>";
  19243. context_menu = $(context_menu);
  19244. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  19245. context_menu.dropdown({
  19246. onChange: function onChange(value, text, $selectedItem) {
  19247. console.log("S8");
  19248. if ($selectedItem.data("clear")) {
  19249. console.log("PP7");
  19250. dom_object.text("");
  19251. ref_object.content = null;
  19252. ref_object.row = null;
  19253. ref_object.column = null;
  19254. delete ref_object.function_called;
  19255. delete ref_object.parameters_list;
  19256. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19257. }
  19258. if ($selectedItem.data("exp")) {
  19259. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19260. }
  19261. },
  19262. selectOnKeydown: false
  19263. });
  19264. } else {
  19265. menu_var_or_value.find(".text").text(" ");
  19266. dom_object.find(".menu_var_or_value_dom").remove();
  19267. var parameters_menu;
  19268. if (function_selected.name) {
  19269. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  19270. } else {
  19271. 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>";
  19272. }
  19273. parameters_menu += "<span> ) </span></div>";
  19274. parameters_menu = $(parameters_menu);
  19275. dom_object.append(parameters_menu);
  19276. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19277. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19278. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19279. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19280. context_menu += '<div class="menu">';
  19281. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19282. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19283. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19284. context_menu += '</div></div>';
  19285. }*/
  19286. context_menu += "</div></div>";
  19287. context_menu = $(context_menu);
  19288. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  19289. context_menu.dropdown({
  19290. onChange: function onChange(value, text, $selectedItem) {
  19291. console.log("S9");
  19292. if ($selectedItem.data("clear")) {
  19293. console.log("PP8");
  19294. dom_object.text("");
  19295. ref_object.content = null;
  19296. ref_object.row = null;
  19297. ref_object.column = null;
  19298. delete ref_object.function_called;
  19299. delete ref_object.parameters_list;
  19300. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19301. }
  19302. if ($selectedItem.data("exp")) {
  19303. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19304. }
  19305. },
  19306. selectOnKeydown: false
  19307. });
  19308. }
  19309. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19310. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  19311. }*/
  19312. }
  19313. function openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected, expression_element) {
  19314. ref_object.content = variable_selected;
  19315. menu_var_or_value.find(".text").text(" ");
  19316. dom_object.find(".menu_var_or_value_dom").remove();
  19317. var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_selected.name + "</span>";
  19318. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  19319. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  19320. }
  19321. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  19322. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span> ';
  19323. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  19324. }
  19325. variable_render += "</div>";
  19326. variable_render = $(variable_render);
  19327. dom_object.append(variable_render);
  19328. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  19329. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19330. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  19331. }
  19332. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  19333. ref_object.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19334. renderMenu(command, ref_object.row, variable_render.find(".row_container"), function_obj, 2, expression_element);
  19335. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19336. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  19337. }
  19338. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19339. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19340. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  19341. console.log("dom_object 10: ");
  19342. console.log(dom_object);
  19343. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19344. context_menu += '<div class="menu">';
  19345. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19346. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19347. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19348. context_menu += '</div></div>';
  19349. }*/
  19350. context_menu += "</div></div>";
  19351. context_menu = $(context_menu);
  19352. context_menu.insertAfter(dom_object.find(".variable_rendered"));
  19353. context_menu.dropdown({
  19354. onChange: function onChange(value, text, $selectedItem) {
  19355. console.log("S10");
  19356. if ($selectedItem.data("clear")) {
  19357. console.log("PP9");
  19358. dom_object.text("");
  19359. ref_object.content = null;
  19360. ref_object.row = null;
  19361. ref_object.column = null;
  19362. delete ref_object.function_called;
  19363. delete ref_object.parameters_list;
  19364. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19365. }
  19366. if ($selectedItem.data("exp")) {
  19367. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19368. }
  19369. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  19370. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageClearExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19371. }
  19372. },
  19373. selectOnKeydown: false
  19374. });
  19375. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19376. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected);
  19377. }*/
  19378. }
  19379. function openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  19380. if (ref_object.content == null) {
  19381. ref_object.content = "";
  19382. }
  19383. menu_var_or_value.find(".text").text(" ");
  19384. var field = $('<input type="text" size="2" class="width-dynamic-minus" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />');
  19385. field.insertBefore(dom_object.find(".menu_var_or_value_dom"));
  19386. field.on('input', function () {
  19387. var input_field = $(this);
  19388. var inputWidth = input_field.textWidth() + 10;
  19389. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  19390. input_field.css({
  19391. width: inputWidth
  19392. });
  19393. }).trigger('input');
  19394. var rendered = $('<div class="value_rendered"></div>');
  19395. rendered.insertBefore(field);
  19396. field.focus();
  19397. field.val(ref_object.content);
  19398. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19399. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19400. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19401. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19402. context_menu += '<div class="menu">';
  19403. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19404. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19405. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19406. context_menu += '</div></div>';
  19407. }*/
  19408. context_menu += "</div></div>";
  19409. context_menu = $(context_menu);
  19410. dom_object.find(".menu_var_or_value_dom").remove();
  19411. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19412. context_menu.insertAfter(field);
  19413. }
  19414. context_menu.dropdown({
  19415. onChange: function onChange(value, text, $selectedItem) {
  19416. if ($selectedItem.data("clear")) {
  19417. dom_object.text("");
  19418. dom_object.find(".value_rendered").remove();
  19419. dom_object.find(".context_menu_clear").remove();
  19420. dom_object.find(".width-dynamic-minus").remove();
  19421. ref_object.content = null;
  19422. ref_object.row = null;
  19423. ref_object.column = null;
  19424. delete ref_object.function_called;
  19425. delete ref_object.parameters_list;
  19426. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19427. }
  19428. if ($selectedItem.data("exp")) {
  19429. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19430. }
  19431. },
  19432. selectOnKeydown: false
  19433. });
  19434. dom_object.find(".width-dynamic-minus").focusout(function () {
  19435. /*if (
  19436. $(this)
  19437. .val()
  19438. .trim()
  19439. ) {
  19440. ref_object.content = $(this)
  19441. .val()
  19442. .trim();
  19443. }*/
  19444. ref_object.content = $(this).val();
  19445. if (isNaN(ref_object.content)) {
  19446. rendered.html(ref_object.content.replaceAll(" ", "&nbsp;"));
  19447. } else {
  19448. rendered.text(ref_object.content);
  19449. }
  19450. $(this).remove();
  19451. });
  19452. dom_object.find(".width-dynamic-minus").on("keydown", function (e) {
  19453. var code = e.keyCode || e.which;
  19454. if (code == 13) {
  19455. /*if (
  19456. $(this)
  19457. .val()
  19458. .trim()
  19459. ) {
  19460. ref_object.content = $(this)
  19461. .val()
  19462. .trim();
  19463. }*/
  19464. ref_object.content = $(this).val();
  19465. if (isNaN(ref_object.content)) {
  19466. rendered.html(ref_object.content.replaceAll(" ", "&nbsp;"));
  19467. } else {
  19468. rendered.text(ref_object.content);
  19469. }
  19470. $(this).remove();
  19471. }
  19472. if (code == 27) {
  19473. if (isNaN(ref_object.content)) {
  19474. rendered.html(ref_object.content.replaceAll(" ", "&nbsp;"));
  19475. } else {
  19476. rendered.text(ref_object.content);
  19477. }
  19478. $(this).remove();
  19479. }
  19480. });
  19481. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  19482. /*rendered.parent().on('click', function(e) {
  19483. rendered.parent().off();
  19484. console.log("TTT14");
  19485. rendered.remove();
  19486. rendered.empty();
  19487. rendered.remove();
  19488. dom_object.empty();
  19489. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19490. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element)
  19491. });*/
  19492. }
  19493. rendered.on("click", function (e) {
  19494. console.log("TTT2");
  19495. rendered.empty();
  19496. rendered.remove();
  19497. dom_object.empty();
  19498. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19499. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19500. });
  19501. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19502. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  19503. }*/
  19504. }
  19505. $.fn.textWidth = function (text, font) {
  19506. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $("<span>").hide().appendTo(document.body);
  19507. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr("placeholder")).css("font", font || this.css("font"));
  19508. return $.fn.textWidth.fakeEl.width();
  19509. };
  19510. /***/ }),
  19511. /***/ "./js/visualUI/commands/whiletrue.js":
  19512. /*!*******************************************!*\
  19513. !*** ./js/visualUI/commands/whiletrue.js ***!
  19514. \*******************************************/
  19515. /*! exports provided: createFloatingCommand, renderCommand */
  19516. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19517. "use strict";
  19518. __webpack_require__.r(__webpack_exports__);
  19519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19520. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19521. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19522. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19523. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  19524. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  19525. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19526. function createFloatingCommand() {
  19527. 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>');
  19528. }
  19529. function renderCommand(command, function_obj) {
  19530. var ret = '';
  19531. 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> <div class="ui context_menu"></div> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_while') + ' </span>';
  19532. ret += '<span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
  19533. ret += ' </span>';
  19534. ret += '<div class="ui block_commands">';
  19535. ret += '</div>';
  19536. ret += '<span> </span>';
  19537. ret += '</div>';
  19538. var el = $(ret);
  19539. el.data('command', command);
  19540. el.find('.block_commands').data('command', command);
  19541. addHandlers(command, function_obj, el);
  19542. _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'));
  19543. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  19544. if (command.commands_block) {
  19545. for (var j = 0; j < command.commands_block.length; j++) {
  19546. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  19547. }
  19548. }
  19549. return el;
  19550. }
  19551. function addHandlers(command, function_obj, whiletrue_dom) {
  19552. whiletrue_dom.find('.button_remove_command').on('click', function () {
  19553. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, whiletrue_dom)) {
  19554. whiletrue_dom.fadeOut(400, function () {
  19555. whiletrue_dom.remove();
  19556. });
  19557. }
  19558. });
  19559. }
  19560. /***/ }),
  19561. /***/ "./js/visualUI/commands/writer.js":
  19562. /*!****************************************!*\
  19563. !*** ./js/visualUI/commands/writer.js ***!
  19564. \****************************************/
  19565. /*! exports provided: createFloatingCommand, renderCommand, addContent */
  19566. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19567. "use strict";
  19568. __webpack_require__.r(__webpack_exports__);
  19569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContent", function() { return addContent; });
  19572. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19573. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19574. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19575. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19576. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19577. function createFloatingCommand() {
  19578. 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>");
  19579. }
  19580. function renderCommand(command, function_obj) {
  19581. 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>\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 </div>");
  19582. var el = $(ret);
  19583. el.data("command", command); //renderExpression (command, function_obj, div_to_render, expression_array)
  19584. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find(".all_elements_write"), command.content);
  19585. /*for (var i = 0; i < command.content.length; i ++) {
  19586. var new_div_item = $( '<div class="var_value_menu_div"></div>' );
  19587. var div_parent_with_handler = $( '<div class="div_parent_handler"></div>' );
  19588. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  19589. div_parent_with_handler.append(new_div_item);
  19590. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  19591. el.find('.all_elements_write').append(div_parent_with_handler);
  19592. VariableValueMenu.renderMenu(command, command.content[i], new_div_item, function_obj);
  19593. addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
  19594. addHandlersManager(command, function_obj, el, div_parent_with_handler, command.content[i]);
  19595. }
  19596. if (command.content.length == 0) {
  19597. addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
  19598. }*/
  19599. addHandlers(command, function_obj, el);
  19600. return el;
  19601. }
  19602. function addHandlersManager(command, _function_obj, _writer_dom, item_div, content_element) {
  19603. item_div.find(".times").on("click", function () {
  19604. for (var i = 0; i < command.content.length; i++) {
  19605. if (command.content[i] == content_element) {
  19606. delete command.content[i];
  19607. command.content.splice(i, 1);
  19608. item_div.children().off();
  19609. item_div.off();
  19610. item_div.fadeOut();
  19611. if (command.content.length > 0) {
  19612. item_div.next(".icon_add_item_to_writer").fadeOut();
  19613. }
  19614. break;
  19615. }
  19616. }
  19617. });
  19618. }
  19619. function addHandlers(command, function_obj, writer_dom) {
  19620. writer_dom.find(".button_remove_command").on("click", function () {
  19621. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, writer_dom)) {
  19622. writer_dom.fadeOut(400, function () {
  19623. writer_dom.remove();
  19624. });
  19625. }
  19626. });
  19627. Sortable.create(writer_dom.find(".all_elements_write")[0], {
  19628. handle: ".ellipsis",
  19629. animation: 100,
  19630. ghostClass: "ghost",
  19631. group: "writer_" + Math.floor(Math.random() * 10000000),
  19632. draggable: ".div_parent_handler",
  19633. onEnd: function onEnd(evt) {
  19634. command.content.splice(evt.newIndex, 0, command.content.splice(evt.oldIndex, 1)[0]);
  19635. writer_dom.empty();
  19636. writer_dom.replaceWith(renderCommand(command, function_obj));
  19637. }
  19638. }); // Attach event handles for the newline button
  19639. var newlineBtn = writer_dom.find(".ivprog_newline_btn");
  19640. newlineBtn.on("click", function () {
  19641. var state = this.dataset.state;
  19642. if (state === "on") {
  19643. this.dataset.state = "off";
  19644. command.newline = false;
  19645. this.setAttribute("src", "img/no_new_line.svg");
  19646. } else {
  19647. this.dataset.state = "on";
  19648. command.newline = true;
  19649. this.setAttribute("src", "img/new_line.svg");
  19650. }
  19651. writer_dom.data("command", command);
  19652. setPopup(newlineBtn, command.newline);
  19653. }); // Attach jquery popup
  19654. setPopup(newlineBtn, command.newline);
  19655. }
  19656. function setPopup(element, state) {
  19657. if (element.popup("exists")) {
  19658. element.popup("destroy");
  19659. }
  19660. 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");
  19661. element.popup({
  19662. content: content,
  19663. delay: {
  19664. show: 750,
  19665. hide: 0
  19666. }
  19667. });
  19668. }
  19669. function _addHandlerIconAdd(dom_object, command, function_obj) {
  19670. var insert_after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  19671. var after_which = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  19672. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  19673. if (!insert_after) {
  19674. dom_object.append(icon_add_item);
  19675. } else {
  19676. icon_add_item.insertAfter(after_which);
  19677. }
  19678. icon_add_item.on("click", function (_event) {
  19679. var div_parent_with_handler = $('<div class="div_parent_handler" style="display:none;"></div>');
  19680. var new_div_item = $('<div class="var_value_menu_div"></div>');
  19681. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  19682. div_parent_with_handler.append(new_div_item);
  19683. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  19684. div_parent_with_handler.insertAfter(icon_add_item);
  19685. 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);
  19686. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  19687. addHandlerIconAdd(dom_object, command, function_obj, true, div_parent_with_handler);
  19688. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  19689. var pos = 1;
  19690. dom_object.find(".icon_add_item_to_writer").each(function () {
  19691. if ($(this).get(0) === icon_add_item.get(0)) {
  19692. command.content.splice(pos, 0, new_related_menu);
  19693. } else {
  19694. pos++;
  19695. }
  19696. });
  19697. if (command.content.length == 1) {
  19698. icon_add_item.remove();
  19699. }
  19700. div_parent_with_handler.fadeIn();
  19701. });
  19702. }
  19703. function addContent(command, _ref_object, dom_object, _menu_var_or_value, function_obj, _ref_object_content) {
  19704. if (dom_object.hasClass("var_value_menu_div")) {
  19705. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  19706. icon_add_item.insertAfter(dom_object);
  19707. icon_add_item.on("click", function (_event) {
  19708. var div_parent_with_handler = $('<div class="div_parent_handler"></div>');
  19709. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  19710. div_parent_with_handler.append(new_div_item);
  19711. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  19712. div_parent_with_handler.insertAfter(icon_add_item);
  19713. 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);
  19714. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  19715. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  19716. command.content.push(new_related_menu);
  19717. if (command.content.length == 1) {
  19718. icon_add_item.remove();
  19719. }
  19720. });
  19721. }
  19722. }
  19723. /***/ }),
  19724. /***/ "./js/visualUI/functions.js":
  19725. /*!**********************************!*\
  19726. !*** ./js/visualUI/functions.js ***!
  19727. \**********************************/
  19728. /*! exports provided: renderFunction, initVisualUI, setTestCases, getTestCases, addFunctionChangeListener, addGlobalChangeListener, removeGlobalListener, removeFunctionListener */
  19729. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19730. "use strict";
  19731. __webpack_require__.r(__webpack_exports__);
  19732. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderFunction", function() { return renderFunction; });
  19733. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return initVisualUI; });
  19734. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestCases", function() { return setTestCases; });
  19735. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return getTestCases; });
  19736. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return addFunctionChangeListener; });
  19737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return addGlobalChangeListener; });
  19738. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return removeGlobalListener; });
  19739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return removeFunctionListener; });
  19740. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  19741. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19742. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19743. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  19744. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variables */ "./js/visualUI/variables.js");
  19745. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands */ "./js/visualUI/commands.js");
  19746. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./code_generator */ "./js/visualUI/code_generator.js");
  19747. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19748. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  19749. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  19750. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  19751. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__);
  19752. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  19753. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  19754. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  19755. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  19756. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  19757. /* harmony import */ var _ima_version_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../.ima_version.json */ "./.ima_version.json");
  19758. var _ima_version_json__WEBPACK_IMPORTED_MODULE_16___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./../../.ima_version.json */ "./.ima_version.json", 1);
  19759. /* harmony import */ var _text_editor__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./text_editor */ "./js/visualUI/text_editor.js");
  19760. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  19761. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../processor/modes */ "./js/processor/modes.ts");
  19762. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_processor_modes__WEBPACK_IMPORTED_MODULE_19__);
  19763. var counter_new_functions = 0;
  19764. var counter_new_parameters = 0;
  19765. var ivprog_version = _ima_version_json__WEBPACK_IMPORTED_MODULE_16__.version;
  19766. var globalChangeListeners = [];
  19767. var functionsChangeListeners = [];
  19768. var proc = null;
  19769. var domConsole = null;
  19770. var _testCases = [];
  19771. var isRunning = false;
  19772. window.studentGrade = null;
  19773. window.LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"];
  19774. var program = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Program"]();
  19775. window.system_functions = []; // Adding math functions:
  19776. 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));
  19777. 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));
  19778. 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));
  19779. 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));
  19780. 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));
  19781. 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));
  19782. 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));
  19783. 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));
  19784. 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));
  19785. 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));
  19786. 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));
  19787. 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:
  19788. 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));
  19789. 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));
  19790. 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));
  19791. 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));
  19792. 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:
  19793. 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));
  19794. 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));
  19795. 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:
  19796. 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));
  19797. 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));
  19798. 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));
  19799. 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));
  19800. 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));
  19801. 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));
  19802. 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));
  19803. 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));
  19804. 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');
  19805. 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);
  19806. mainFunction.function_comment = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Comment"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment_main'));
  19807. program.addFunction(mainFunction);
  19808. window.program_obj = program;
  19809. window.generator = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"];
  19810. window.runCodeAssessment = runCodeAssessment;
  19811. window.renderAlgorithm = _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"];
  19812. window.insertContext = false;
  19813. window.watchW = melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a;
  19814. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.globals, function () {
  19815. if (window.insertContext) {
  19816. setTimeout(function () {
  19817. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19818. globalChangeListeners.forEach(function (x) {
  19819. return x();
  19820. });
  19821. }, 300);
  19822. window.insertContext = false;
  19823. } else {
  19824. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19825. globalChangeListeners.forEach(function (x) {
  19826. return x();
  19827. });
  19828. }
  19829. }, 1);
  19830. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.functions, function () {
  19831. if (window.insertContext) {
  19832. setTimeout(function () {
  19833. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19834. functionsChangeListeners.forEach(function (x) {
  19835. return x();
  19836. });
  19837. }, 300);
  19838. window.insertContext = false;
  19839. } else {
  19840. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19841. functionsChangeListeners.forEach(function (x) {
  19842. return x();
  19843. });
  19844. }
  19845. }, 1);
  19846. function addFunctionHandler() {
  19847. 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')));
  19848. program.addFunction(new_function);
  19849. counter_new_functions++;
  19850. window.insertContext = true;
  19851. 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);
  19852. renderFunction(new_function);
  19853. /*newe.css('display', 'none');
  19854. newe.fadeIn();*/
  19855. }
  19856. function addParameter(function_obj, function_container
  19857. /*, is_from_click = false*/
  19858. ) {
  19859. if (function_obj.parameters_list == null) {
  19860. function_obj.parameters_list = [];
  19861. }
  19862. 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);
  19863. function_obj.parameters_list.push(new_parameter);
  19864. counter_new_parameters++;
  19865. 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);
  19866. renderParameter(function_obj, new_parameter, function_container); // if (is_from_click) {
  19867. // newe.css('display', 'none');
  19868. // newe.fadeIn();
  19869. // }
  19870. }
  19871. function updateReturnType(function_obj, new_type) {
  19872. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  19873. 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);
  19874. function_obj.return_type = new_type;
  19875. function_obj.return_dimensions = new_dimensions;
  19876. }
  19877. function removeFunction(function_obj) {
  19878. var index = program.functions.indexOf(function_obj);
  19879. if (index > -1) {
  19880. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION);
  19881. program.functions.splice(index, 1);
  19882. }
  19883. }
  19884. function minimizeFunction(function_obj) {
  19885. function_obj.is_hidden = !function_obj.is_hidden;
  19886. }
  19887. function addHandlers(function_obj, function_container) {
  19888. function_container.find('.ui.dropdown.function_return').dropdown({
  19889. onChange: function onChange(value, text, $selectedItem) {
  19890. if ($selectedItem.data('dimensions')) {
  19891. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  19892. } else {
  19893. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  19894. }
  19895. },
  19896. selectOnKeydown: false
  19897. });
  19898. function_container.find(".name_function_updated").on('click', function (e) {
  19899. enableNameFunctionUpdate(function_obj, function_container);
  19900. });
  19901. function_container.find(".add_parameter_button").on('click', function (e) {
  19902. window.insertContext = true;
  19903. addParameter(function_obj, function_container, true);
  19904. });
  19905. function_container.find('.menu_commands').dropdown({
  19906. on: 'hover'
  19907. });
  19908. function_container.find('.menu_commands a').on('click', function (evt) {
  19909. if (function_obj.commands == null || function_obj.commands.length == 0) {
  19910. function_obj.commands = [];
  19911. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_5__["genericCreateCommand"]($(this).data('command'));
  19912. function_obj.commands.push(new_cmd);
  19913. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](new_cmd, function_container.find('.commands_list_div'), 3, function_obj);
  19914. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, $(this).data('command'), '/', 0);
  19915. } else {
  19916. _commands__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"](function_obj, function_container, $(this).data('command'), evt);
  19917. }
  19918. });
  19919. function_container.find('.add_var_button_function').on('click', function (e) {
  19920. window.insertContext = true;
  19921. _variables__WEBPACK_IMPORTED_MODULE_4__["addVariable"](function_obj, function_container, true);
  19922. });
  19923. function_container.find('.remove_function_button').on('click', function (e) {
  19924. removeFunction(function_obj);
  19925. function_container.fadeOut();
  19926. });
  19927. function_container.find('.minimize_function_button').on('click', function (e) {
  19928. minimizeFunction(function_obj);
  19929. if (function_obj.is_hidden) {
  19930. function_container.find(".add_var_button_function").toggle();
  19931. function_container.find(".inline_add_command").toggle();
  19932. function_container.find(".function_area").slideToggle();
  19933. } else {
  19934. function_container.find(".function_area").slideToggle(function () {
  19935. function_container.find(".add_var_button_function").toggle();
  19936. function_container.find(".inline_add_command").toggle();
  19937. });
  19938. }
  19939. });
  19940. } // Essa função imprime o tipo de retorno da função e cria o menu do tipo 'select' para alteração
  19941. function renderFunctionReturn(function_obj, function_element) {
  19942. var ret = '<div class="ui dropdown function_return">';
  19943. if (function_obj.return_dimensions == 1) {
  19944. 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()));
  19945. ret += ' [ ] </div>';
  19946. } else if (function_obj.return_dimensions == 2) {
  19947. 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()));
  19948. ret += ' [ ] [ ] </div>';
  19949. } else {
  19950. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase())) + '</div>';
  19951. }
  19952. ret += '<div class="menu">';
  19953. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  19954. 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>';
  19955. }
  19956. 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">';
  19957. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  19958. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  19959. continue;
  19960. }
  19961. 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>';
  19962. }
  19963. ret += '</div></div>';
  19964. 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">';
  19965. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  19966. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  19967. continue;
  19968. }
  19969. 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>';
  19970. }
  19971. ret += '</div></div>';
  19972. ret += '</div></div>';
  19973. ret = $(ret);
  19974. function_element.find('.function_return').append(ret);
  19975. }
  19976. var cont = 0;
  19977. function renderFunction(function_obj) {
  19978. var appender = '<div class="ui secondary segment function_div list-group-item function_cont_' + cont + '">';
  19979. if (function_obj.function_comment) {//appender += renderComment(function_obj.function_comment, sequence, true, -1);
  19980. }
  19981. appender += '<span class="glyphicon glyphicon-move move_function" aria-hidden="true"><i class="icon sort alternate vertical"></i></span>';
  19982. 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>';
  19983. appender += '<div class="function_signature_div">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + ' ';
  19984. if (function_obj.is_main) {
  19985. 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">';
  19986. } else {
  19987. appender += '<div class="ui function_return"></div>';
  19988. 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">';
  19989. }
  19990. appender += '</div> <span class="parethesis_function"> ) </span> </div>' + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ');
  19991. appender += '<div class="ui add_var_context add_var_button_function" style="float: left;"> <div class="ui icon button purple"> ';
  19992. 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>';
  19993. appender += '</div></div>';
  19994. appender += '<div class="ui top attached segment variables_list_div"></div>';
  19995. 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;">';
  19996. 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"> ';
  19997. 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>';
  19998. appender += '</div></div>' + '</div>';
  19999. appender += '</div></div>';
  20000. appender = $(appender);
  20001. $('.all_functions').append(appender);
  20002. appender.data('fun', function_obj);
  20003. appender.find('.commands_list_div').data('fun', function_obj);
  20004. renderFunctionReturn(function_obj, appender);
  20005. addHandlers(function_obj, appender); // Rendering parameters:
  20006. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  20007. renderParameter(function_obj, function_obj.parameters_list[j], appender);
  20008. } // Rendering variables:
  20009. for (var j = 0; j < function_obj.variables_list.length; j++) {
  20010. _variables__WEBPACK_IMPORTED_MODULE_4__["renderVariable"](appender, function_obj.variables_list[j], function_obj);
  20011. } // Rendering commands:
  20012. for (var j = 0; j < function_obj.commands.length; j++) {
  20013. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](function_obj.commands[j], $(appender.find('.commands_list_div')[0]), 3, function_obj);
  20014. }
  20015. $('.minimize_function_button').popup({
  20016. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_hide_function"),
  20017. delay: {
  20018. show: 750,
  20019. hide: 0
  20020. }
  20021. });
  20022. var function_index = program.functions.indexOf(function_obj);
  20023. Sortable.create(appender.find(".variables_list_div")[0], {
  20024. handle: '.ellipsis',
  20025. animation: 100,
  20026. ghostClass: 'ghost',
  20027. group: 'local_vars_drag_' + function_index,
  20028. onEnd: function onEnd(evt) {
  20029. updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
  20030. }
  20031. });
  20032. addSortableHandler(appender.find(".commands_list_div")[0], function_index);
  20033. if (!function_obj.is_main) {
  20034. Sortable.create(appender.find(".container_parameters_list")[0], {
  20035. handle: '.ellipsis',
  20036. animation: 100,
  20037. ghostClass: 'ghost',
  20038. group: 'parameters_drag_' + program.functions.indexOf(function_obj),
  20039. onEnd: function onEnd(evt) {
  20040. updateSequenceParameters(evt.oldIndex, evt.newIndex, function_obj);
  20041. }
  20042. });
  20043. }
  20044. if (function_obj.commands.length > 0) {
  20045. var teste = '.ui.sticky.sticky_cont_' + cont;
  20046. $(teste).sticky({
  20047. context: '.ui.bottom.attached.segment.commands_list_div.commands_cont_' + cont,
  20048. scrollContext: '.ivprog_visual_panel',
  20049. observeChanges: true,
  20050. offset: 40,
  20051. onStick: function onStick(evt) {
  20052. $(teste).css('top', '20px', 'important');
  20053. },
  20054. onBottom: function onBottom(evt) {
  20055. $(teste).css('top', '20px', 'important');
  20056. },
  20057. onUnstick: function onUnstick(evt) {
  20058. $(teste).css('top', '20px', 'important');
  20059. },
  20060. onReposition: function onReposition(evt) {
  20061. $(teste).css('top', '20px', 'important');
  20062. },
  20063. onScroll: function onScroll(evt) {
  20064. $(teste).css('top', '20px', 'important');
  20065. if (!isVisible($(teste), $(teste).parent())) {
  20066. $(teste).removeClass('fixed');
  20067. }
  20068. },
  20069. onTop: function onTop(evt) {
  20070. $(teste).css('top', '20px', 'important');
  20071. }
  20072. });
  20073. }
  20074. cont++;
  20075. return appender;
  20076. }
  20077. function isVisible(element, container) {
  20078. var elementTop = $(element).offset().top,
  20079. elementHeight = $(element).height(),
  20080. containerTop = $(container).offset().top,
  20081. containerHeight = $(container).height() - 30;
  20082. return elementTop - containerTop + elementHeight > 0 && elementTop - containerTop < containerHeight;
  20083. }
  20084. window.evento_drag;
  20085. function updateProgramObjDrag() {
  20086. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20087. var function_index;
  20088. var start_index;
  20089. var function_obj;
  20090. $(evento_drag.item).parentsUntil(".all_functions").each(function (index) {
  20091. var ref = $(this);
  20092. if (ref.hasClass('function_div')) {
  20093. function_index = nodes.indexOf(this);
  20094. start_index = index;
  20095. function_obj = ref;
  20096. }
  20097. });
  20098. var path_target = [];
  20099. $(evento_drag.item).parentsUntil(".all_functions").each(function () {
  20100. if ($(this).hasClass('command_container')) {
  20101. path_target.push(this);
  20102. }
  20103. });
  20104. if (path_target.length == 0) {//console.log('soltou na raiz, na posição: ' + evento_drag.newIndex + ' mas ainda não sei de onde saiu ');
  20105. } else {//console.log('soltou dentro de algum bloco, sequência vem logo abaixo (de baixo pra cima): ');
  20106. //console.log(path_target);
  20107. }
  20108. var index_each = [];
  20109. var path_relative = [];
  20110. for (var i = path_target.length - 1; i >= 0; i--) {
  20111. console.log('da vez', $(path_target[i + 1]));
  20112. if (i == path_target.length - 1) {
  20113. // está na raiz
  20114. var indice_na_raiz = function_obj.find('.command_container').index(path_target[i]);
  20115. console.log('índice na raiz: ', indice_na_raiz);
  20116. } else {
  20117. if ($(path_target[i + 1]).hasClass('iftrue')) {
  20118. if ($(path_target[i]).parent().hasClass('commands_if')) {
  20119. path_relative.push('if');
  20120. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  20121. } else {
  20122. path_relative.push('else');
  20123. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  20124. }
  20125. } else if ($(path_target[i + 1]).hasClass('dowhiletrue')) {
  20126. path_relative.push('dowhiletrue');
  20127. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20128. } else if ($(path_target[i + 1]).hasClass('repeatNtimes')) {
  20129. path_relative.push('repeatNtimes');
  20130. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20131. } else if ($(path_target[i + 1]).hasClass('whiletrue')) {
  20132. path_relative.push('whiletrue');
  20133. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20134. } else if ($(path_target[i + 1]).hasClass('switch')) {
  20135. path_relative.push('switch'); //index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20136. }
  20137. }
  20138. } // var index_in_block = -1;
  20139. 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);
  20140. var is_in_case_switch = $(evento_drag.item).parent().hasClass('case_commands_block'); // var index_case_of_switch = -1;
  20141. // if (is_in_case_switch) {
  20142. // index_case_of_switch = $(evento_drag.item).parent().parent().parent().find('.case_div').index($(evento_drag.item).parent().parent());
  20143. // }
  20144. /*console.log('path_relative:');
  20145. console.log(path_relative);
  20146. console.log('index_each:');
  20147. console.log(index_each);
  20148. console.log('index_in_block:');
  20149. console.log(index_in_block);
  20150. console.log('ele está em algum bloco de senão? ');
  20151. console.log(is_in_else);
  20152. console.log('ele está dentro de um case de switch?');
  20153. console.log(is_in_case_switch);
  20154. console.log('qual é o índice do case: ');
  20155. console.log(index_case_of_switch);*/
  20156. // encontrar o elemento na árvore:
  20157. var command_start_point = window.program_obj.functions[function_index].commands[indice_na_raiz];
  20158. var block_to_insert = command_start_point;
  20159. for (var i = 0; i < index_each.length; i++) {
  20160. if (path_relative[i] == "else") {
  20161. block_to_insert = block_to_insert.commands_else[index_each[i]];
  20162. } else if (path_relative[i] == "switch") {} else {
  20163. block_to_insert = block_to_insert.commands_block[index_each[i]];
  20164. }
  20165. } //console.log('command_start_point', command_start_point);
  20166. //console.log('block_to_insert', block_to_insert);
  20167. // agora tem que alocar o comando na árvore, mas considerar as quatro situações:
  20168. // (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.
  20169. if (path_target.length == 0) {
  20170. // soltou na raiz:
  20171. window.program_obj.functions[function_index].commands.splice(evento_drag.newIndex - 1, 0, command_in_drag);
  20172. } else if (is_in_else) {
  20173. if (block_to_insert.commands_else) {
  20174. block_to_insert.commands_else.splice(evento_drag.newIndex, 0, command_in_drag);
  20175. } else {
  20176. block_to_insert.commands_else = [];
  20177. block_to_insert.commands_else.push(command_in_drag);
  20178. }
  20179. } else if (is_in_case_switch) {} else {
  20180. // verificar se tem alguma coisa no bloco:
  20181. if (block_to_insert.commands_block) {
  20182. console.log("existe alguma coisa dentro do bloco, index: ", evento_drag.newIndex);
  20183. block_to_insert.commands_block.splice(evento_drag.newIndex, 0, command_in_drag);
  20184. } else {
  20185. block_to_insert.commands_block = [];
  20186. block_to_insert.commands_block.push(command_in_drag);
  20187. }
  20188. }
  20189. window.draging = false;
  20190. renderAlgorithm();
  20191. }
  20192. function prepareDragHandler(evt) {
  20193. window.draging = true;
  20194. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20195. var function_index;
  20196. var function_obj;
  20197. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  20198. if ($(this).hasClass('function_div')) {
  20199. function_index = nodes.indexOf(this);
  20200. function_obj = window.program_obj.functions[function_index];
  20201. }
  20202. });
  20203. command_in_drag = $(evt.item).data("command"); //console.log('$(evt.item).parent(): ');
  20204. //console.log($(evt.item).parent());
  20205. // descobrir qual das quatro situações:
  20206. if ($(evt.item).parent().hasClass('commands_list_div')) {
  20207. // está na raiz:
  20208. if (function_obj.commands.indexOf(command_in_drag) > -1) {
  20209. function_obj.commands.splice(function_obj.commands.indexOf(command_in_drag), 1);
  20210. }
  20211. } else if ($(evt.item).parent().hasClass('commands_else')) {
  20212. // está no else:
  20213. if ($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag) > -1) {
  20214. $(evt.item).parent().data('command').commands_else.splice($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag), 1);
  20215. }
  20216. } else if ($(evt.item).parent().hasClass('case_commands_block')) {// está em um switch:
  20217. } else {
  20218. // caso padrão:
  20219. if ($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag) > -1) {
  20220. $(evt.item).parent().data('command').commands_block.splice($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag), 1);
  20221. }
  20222. }
  20223. }
  20224. var command_in_drag;
  20225. function addSortableHandler(element, id_function) {
  20226. var n_group = 'commands_drag_' + id_function;
  20227. Sortable.create(element, {
  20228. handle: '.command_drag',
  20229. ghostClass: 'ghost',
  20230. animation: 300,
  20231. group: {
  20232. name: n_group
  20233. },
  20234. onEnd: function onEnd(evt) {
  20235. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20236. var function_index;
  20237. var function_obj;
  20238. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  20239. if ($(this).hasClass('function_div')) {
  20240. function_index = nodes.indexOf(this);
  20241. function_obj = window.program_obj.functions[function_index];
  20242. }
  20243. });
  20244. 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);
  20245. var itemEl = evt.item; // dragged HTMLElement
  20246. evt.to; // target list
  20247. evt.from; // previous list
  20248. evt.oldIndex; // element's old index within old parent
  20249. evt.newIndex; // element's new index within new parent
  20250. //console.log('::EVT::');
  20251. //console.log(evt);
  20252. window.evento_drag = evt;
  20253. try {
  20254. updateProgramObjDrag();
  20255. } catch (e) {
  20256. console.error(e);
  20257. window.draging = false;
  20258. }
  20259. },
  20260. onStart: function onStart(evt) {
  20261. //console.log("START::EVT::");
  20262. //console.log(evt);
  20263. //console.log("\n\ncommand_in_drag");
  20264. try {
  20265. prepareDragHandler(evt);
  20266. } catch (e) {
  20267. window.draging = false;
  20268. }
  20269. }
  20270. });
  20271. element = $(element);
  20272. element.find(".iftrue").each(function (index) {
  20273. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20274. addSortableHandler($(this).find(".block_commands")[1], id_function);
  20275. });
  20276. element.find(".repeatNtimes").each(function (index) {
  20277. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20278. });
  20279. element.find(".dowhiletrue").each(function (index) {
  20280. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20281. });
  20282. element.find(".whiletrue").each(function (index) {
  20283. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20284. });
  20285. element.find(".switch").each(function (index) {
  20286. $(this).find(".case_div").each(function (index) {
  20287. addSortableHandler($(this).find(".case_commands_block")[0], id_function);
  20288. });
  20289. });
  20290. }
  20291. function initVisualUI() {
  20292. // MUST USE CONST, LET, OR VAR !!!!!!
  20293. // const mainDiv = $('#visual-main-div');
  20294. // fill mainDiv with functions and globals...
  20295. // renderAlgorithm()...
  20296. domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_8__["DOMConsole"]("ivprog-term-div");
  20297. domConsole.hide();
  20298. $(document.getElementById("ivprog-term-div")).draggable();
  20299. $('.add_function_button').on('click', function () {
  20300. addFunctionHandler();
  20301. });
  20302. $('.add_global_button').on('click', function () {
  20303. window.insertContext = true;
  20304. _globals__WEBPACK_IMPORTED_MODULE_3__["addGlobal"](program, true);
  20305. });
  20306. $('#run_button').on('click', function () {
  20307. showStopButton();
  20308. runCode();
  20309. });
  20310. $('#stop_button').on('click', function () {
  20311. showRunButton();
  20312. stopExecution();
  20313. });
  20314. $('.visual_coding_button').on('click', function () {
  20315. toggleVisualCoding();
  20316. });
  20317. $('.textual_coding_button').on('click', function () {
  20318. toggleTextualCoding();
  20319. });
  20320. $('.assessment').on('click', function () {
  20321. is_iassign = true;
  20322. runCodeAssessment();
  20323. });
  20324. $('.div_toggle_console').on('click', function () {
  20325. toggleConsole();
  20326. });
  20327. $('.expand_button').on('click', function () {
  20328. full_screen();
  20329. });
  20330. $('.help_button').on('click', function () {
  20331. window.open('https://www.usp.br/line/ivprog/', '_blank');
  20332. });
  20333. $('.main_title h2').prop('title', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_ivprog_description'));
  20334. var time_show = 750;
  20335. $('.visual_coding_button').popup({
  20336. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_visual"),
  20337. delay: {
  20338. show: time_show,
  20339. hide: 0
  20340. }
  20341. });
  20342. $('.textual_coding_button').popup({
  20343. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_textual"),
  20344. delay: {
  20345. show: time_show,
  20346. hide: 0
  20347. }
  20348. });
  20349. $('.upload_file_button').popup({
  20350. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_upload"),
  20351. delay: {
  20352. show: time_show,
  20353. hide: 0
  20354. }
  20355. });
  20356. $('.download_file_button').popup({
  20357. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_download"),
  20358. delay: {
  20359. show: time_show,
  20360. hide: 0
  20361. }
  20362. });
  20363. $('.undo_button').popup({
  20364. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_undo"),
  20365. delay: {
  20366. show: time_show,
  20367. hide: 0
  20368. }
  20369. });
  20370. $('.redo_button').popup({
  20371. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_redo"),
  20372. delay: {
  20373. show: time_show,
  20374. hide: 0
  20375. }
  20376. });
  20377. $('.run_button').popup({
  20378. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_run"),
  20379. delay: {
  20380. show: time_show,
  20381. hide: 0
  20382. }
  20383. });
  20384. $('.assessment_button').popup({
  20385. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_evaluate"),
  20386. delay: {
  20387. show: time_show,
  20388. hide: 0
  20389. }
  20390. });
  20391. $('.help_button').popup({
  20392. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_help") + ' - ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_ivprog_version") + ' ' + ivprog_version,
  20393. delay: {
  20394. show: time_show,
  20395. hide: 0
  20396. }
  20397. });
  20398. $('.add_global_button').popup({
  20399. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_add_global"),
  20400. delay: {
  20401. show: time_show,
  20402. hide: 0
  20403. }
  20404. });
  20405. $('.div_toggle_console').popup({
  20406. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_console"),
  20407. delay: {
  20408. show: time_show,
  20409. hide: 0
  20410. }
  20411. });
  20412. Sortable.create(listWithHandle, {
  20413. handle: '.glyphicon-move',
  20414. animation: 100,
  20415. ghostClass: 'ghost',
  20416. group: 'functions_divs_drag',
  20417. onEnd: function onEnd(evt) {
  20418. updateSequenceFunction(evt.oldIndex, evt.newIndex);
  20419. }
  20420. });
  20421. var listGlobalsHandle = document.getElementById("listGlobalsHandle");
  20422. Sortable.create(listGlobalsHandle, {
  20423. handle: '.ellipsis',
  20424. animation: 100,
  20425. ghostClass: 'ghost',
  20426. group: 'globals_divs_drag',
  20427. onEnd: function onEnd(evt) {
  20428. updateSequenceGlobals(evt.oldIndex, evt.newIndex);
  20429. }
  20430. });
  20431. }
  20432. function setTestCases(testCases) {
  20433. _testCases = testCases;
  20434. }
  20435. function getTestCases() {
  20436. // Deep clone of test cases to avoid unauthorized modification
  20437. // TODO: It may be not possible to use this once custom test are fully implemented
  20438. return JSON.parse(JSON.stringify(_testCases));
  20439. }
  20440. var is_iassign = false;
  20441. function updateSequenceParameters(oldIndex, newIndex, function_obj) {
  20442. function_obj.parameters_list.splice(newIndex, 0, function_obj.parameters_list.splice(oldIndex, 1)[0]);
  20443. }
  20444. function updateSequenceLocals(oldIndex, newIndex, function_obj) {
  20445. function_obj.variables_list.splice(newIndex, 0, function_obj.variables_list.splice(oldIndex, 1)[0]);
  20446. }
  20447. function updateSequenceGlobals(oldIndex, newIndex) {
  20448. program_obj.globals.splice(newIndex, 0, program_obj.globals.splice(oldIndex, 1)[0]);
  20449. }
  20450. function updateSequenceFunction(oldIndex, newIndex) {
  20451. program_obj.functions.splice(newIndex, 0, program_obj.functions.splice(oldIndex, 1)[0]);
  20452. }
  20453. function runCodeAssessment() {
  20454. if (isRunning) {
  20455. // cannot run assessment or it's already running
  20456. return -1;
  20457. }
  20458. var strCode = null;
  20459. is_iassign = false;
  20460. window.studentGrade = null;
  20461. if (settingsProgrammingTypes == "textual") {
  20462. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  20463. } else {
  20464. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20465. }
  20466. if (strCode == null) {
  20467. // No code, so no assessment
  20468. return -1;
  20469. }
  20470. toggleConsole(true);
  20471. try {
  20472. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  20473. isRunning = true;
  20474. var runner = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__["IVProgAssessment"](data, _testCases, domConsole);
  20475. runner.runTest().then(function (grade) {
  20476. if (!is_iassign) {
  20477. parent.getEvaluationCallback(grade);
  20478. } else {
  20479. is_iassign = false;
  20480. }
  20481. isRunning = false;
  20482. })["catch"](function (err) {
  20483. console.log(err);
  20484. isRunning = false;
  20485. });
  20486. } catch (error) {
  20487. isRunning = false;
  20488. domConsole.err(error.message);
  20489. console.log(error);
  20490. if (!is_iassign) {
  20491. parent.getEvaluationCallback(0);
  20492. } else {
  20493. is_iassign = false;
  20494. }
  20495. }
  20496. return 0;
  20497. }
  20498. function runCode() {
  20499. if (isRunning) {
  20500. return;
  20501. }
  20502. var strCode = null;
  20503. if (settingsProgrammingTypes == "textual") {
  20504. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  20505. } else {
  20506. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20507. }
  20508. if (strCode == null) {
  20509. return;
  20510. }
  20511. toggleConsole(true); // if(domConsole == null)
  20512. // domConsole = new DOMConsole("#ivprog-term");
  20513. //$("#ivprog-term").slideDown(500);
  20514. try {
  20515. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  20516. proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__["IVProgProcessor"](data);
  20517. proc.registerInput(domConsole);
  20518. proc.registerOutput(domConsole);
  20519. $("#ivprog-term").addClass('ivprog-term-active');
  20520. isRunning = true;
  20521. proc.interpretAST().then(function (_) {
  20522. scheduleCall(function () {
  20523. if (domConsole.pending_writes.length == 0) {
  20524. if (proc.mode === _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT) {
  20525. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("aborted_execution"));
  20526. } else {
  20527. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("success_execution"));
  20528. }
  20529. $("#ivprog-term").removeClass('ivprog-term-active');
  20530. isRunning = false;
  20531. proc = null;
  20532. showRunButton();
  20533. return true;
  20534. }
  20535. return false;
  20536. }, 100);
  20537. })["catch"](function (err) {
  20538. scheduleCall(function () {
  20539. if (domConsole.pending_writes.length == 0) {
  20540. if (err instanceof Error) {
  20541. domConsole.err(err.message);
  20542. } else {
  20543. domConsole.err(err);
  20544. }
  20545. $("#ivprog-term").removeClass('ivprog-term-active');
  20546. isRunning = false;
  20547. proc = null;
  20548. showRunButton();
  20549. return true;
  20550. }
  20551. return false;
  20552. }, 100);
  20553. });
  20554. } catch (error) {
  20555. scheduleCall(function () {
  20556. if (domConsole.pending_writes.length == 0) {
  20557. isRunning = false;
  20558. proc = null;
  20559. showRunButton();
  20560. domConsole.err(error.message);
  20561. console.log(error);
  20562. return true;
  20563. }
  20564. return false;
  20565. }, 100);
  20566. }
  20567. }
  20568. function toggleConsole(is_running) {
  20569. if (is_running) {
  20570. $('.ivprog-term-div').css('display', 'block');
  20571. $('#ivprog-term').css('min-height', '160px');
  20572. if (domConsole != null) domConsole.focus(); //$('#ivprog-term').css('margin-top', '-170px');
  20573. return;
  20574. } else {
  20575. domConsole.hide();
  20576. return;
  20577. }
  20578. if ($('#ivprog-term').css('min-height') == '160px') {
  20579. // esconder
  20580. $('.ivprog-term-div').css('display', 'none');
  20581. $('#ivprog-term').css('min-height', '0'); //$('#ivprog-term').css('margin-top', '-30px');
  20582. //$('#ivprog-term').css('padding', '5px');
  20583. } else {
  20584. // mostrar
  20585. $('.ivprog-term-div').css('display', 'block');
  20586. $('#ivprog-term').css('min-height', '160px'); //$('#ivprog-term').css('margin-top', '-170px');
  20587. }
  20588. } // function waitToCloseConsole () {
  20589. // domConsole.info("Aperte qualquer tecla para fechar...");
  20590. // const p = new Promise((resolve, _) => {
  20591. // domConsole.requestInput(resolve, true);
  20592. // });
  20593. // p.then( _ => {
  20594. // domConsole.dispose();
  20595. // domConsole = null;
  20596. // $("#ivprog-term").hide();
  20597. // })
  20598. // }
  20599. function toggleTextualCoding() {
  20600. var code = null;
  20601. if (settingsProgrammingTypes != "textual") {
  20602. code = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20603. if (code == null) {
  20604. return;
  20605. }
  20606. }
  20607. $('.ivprog_visual_panel').css('display', 'none');
  20608. $('.ivprog_textual_panel').css('display', 'block');
  20609. $('.ivprog_textual_panel').removeClass('loading');
  20610. _text_editor__WEBPACK_IMPORTED_MODULE_17__["updateEditor"]();
  20611. if (code != null) _text_editor__WEBPACK_IMPORTED_MODULE_17__["setCode"](code); //$('.ivprog_textual_code').text(code);
  20612. $('.visual_coding_button').removeClass('active');
  20613. $('.textual_coding_button').addClass('active');
  20614. }
  20615. function toggleVisualCoding() {
  20616. $('.ivprog_textual_panel').addClass('loading');
  20617. $('.ivprog_textual_panel').css('display', 'none');
  20618. $('.ivprog_visual_panel').css('display', 'block');
  20619. $('.textual_coding_button').removeClass('active');
  20620. $('.visual_coding_button').addClass('active');
  20621. }
  20622. function removeParameter(function_obj, parameter_obj, parameter_container) {
  20623. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(parameter_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION_PARAM, function_obj.name);
  20624. var index = function_obj.parameters_list.indexOf(parameter_obj);
  20625. if (index > -1) {
  20626. window.insertContext = true;
  20627. function_obj.parameters_list.splice(index, 1);
  20628. }
  20629. $(parameter_container).fadeOut();
  20630. }
  20631. function updateParameterType(parameter_obj, new_type, function_name) {
  20632. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  20633. 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);
  20634. parameter_obj.type = new_type;
  20635. parameter_obj.dimensions = new_dimensions;
  20636. if (new_dimensions > 0) {
  20637. parameter_obj.rows = new_dimensions;
  20638. parameter_obj.columns = 2;
  20639. }
  20640. }
  20641. function renderParameter(function_obj, parameter_obj, function_container) {
  20642. var ret = "";
  20643. ret += '<div class="ui label function_name_parameter pink"><i class="ui icon ellipsis vertical inverted"></i>';
  20644. ret += '<div class="ui dropdown parameter_type">';
  20645. if (parameter_obj.dimensions > 0) {
  20646. 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()));
  20647. if (parameter_obj.dimensions == 1) {
  20648. ret += ' [ ] ';
  20649. } else {
  20650. ret += ' [ ] [ ] ';
  20651. }
  20652. ret += '</div>';
  20653. } else {
  20654. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(parameter_obj.type.toLowerCase())) + '</div>';
  20655. }
  20656. ret += '<div class="menu">';
  20657. for (var _tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20658. if (_tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20659. continue;
  20660. }
  20661. 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>';
  20662. }
  20663. 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">';
  20664. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20665. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20666. continue;
  20667. }
  20668. 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>';
  20669. }
  20670. ret += '</div></div>';
  20671. 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">';
  20672. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20673. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20674. continue;
  20675. }
  20676. 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>';
  20677. }
  20678. ret += '</div></div>';
  20679. ret += '</div></div>';
  20680. ret += '<div class="parameter_div_edit"><span class="span_name_parameter label_enable_name_parameter">' + parameter_obj.name + '</span></div> ';
  20681. ret += ' <i class="yellow inverted icon times remove_parameter"></i></div>';
  20682. ret = $(ret);
  20683. function_container.find('.container_parameters_list').append(ret);
  20684. ret.find('.remove_parameter').on('click', function (e) {
  20685. removeParameter(function_obj, parameter_obj, ret);
  20686. });
  20687. ret.find('.ui.dropdown.parameter_type').dropdown({
  20688. onChange: function onChange(_, __, $selectedItem) {
  20689. if ($selectedItem.data('dimensions')) {
  20690. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  20691. } else {
  20692. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  20693. }
  20694. },
  20695. selectOnKeydown: false
  20696. });
  20697. ret.find('.parameter_div_edit').on('click', function (e) {
  20698. 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);
  20699. enableNameParameterUpdate(parameter_obj, ret, function_obj);
  20700. });
  20701. return ret;
  20702. }
  20703. function updateParameterName(parameter_var, new_name, parameter_obj_dom, function_obj) {
  20704. if (parameter_var.name == new_name) {
  20705. return;
  20706. }
  20707. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  20708. if (variableNameAlreadyExists(new_name, function_obj)) {
  20709. _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]));
  20710. } else {
  20711. 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);
  20712. parameter_var.name = new_name;
  20713. }
  20714. } else {
  20715. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](parameter_obj_dom.find('.parameter_div_edit'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  20716. }
  20717. }
  20718. function variableNameAlreadyExists(name_var, function_obj) {
  20719. if (function_obj.parameters_list) {
  20720. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  20721. if (function_obj.parameters_list[i].name == name_var) {
  20722. return true;
  20723. }
  20724. }
  20725. }
  20726. if (function_obj.variables_list) {
  20727. for (var i = 0; i < function_obj.variables_list.length; i++) {
  20728. if (function_obj.variables_list[i].name == name_var) {
  20729. return true;
  20730. }
  20731. }
  20732. }
  20733. return false;
  20734. }
  20735. function updateFunctionName(function_var, new_name, function_obj_dom) {
  20736. if (function_var.name == new_name) {
  20737. return;
  20738. }
  20739. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  20740. if (functionNameAlreadyExists(new_name)) {
  20741. _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]));
  20742. } else {
  20743. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].RENAME_FUNCTION, new_name);
  20744. function_var.name = new_name;
  20745. }
  20746. } else {
  20747. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](function_obj_dom.find('.function_name_div'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  20748. }
  20749. }
  20750. function functionNameAlreadyExists(function_name) {
  20751. for (var i = 0; i < window.program_obj.functions.length; i++) {
  20752. if (window.program_obj.functions[i].name == function_name) {
  20753. return true;
  20754. }
  20755. }
  20756. return false;
  20757. }
  20758. var opened_name_parameter = false;
  20759. var opened_input_parameter = null;
  20760. function enableNameParameterUpdate(parameter_obj, parent_node, function_obj) {
  20761. if (opened_name_parameter) {
  20762. opened_input_parameter.focus();
  20763. return;
  20764. }
  20765. opened_name_parameter = true;
  20766. parent_node = $(parent_node);
  20767. var input_field;
  20768. parent_node.find('.span_name_parameter').text('');
  20769. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + parameter_obj.name + "' />");
  20770. input_field.insertBefore(parent_node.find('.span_name_parameter'));
  20771. input_field.on('input', function () {
  20772. var inputWidth = input_field.textWidth() + 10;
  20773. opened_input_parameter = input_field;
  20774. input_field.focus();
  20775. var tmpStr = input_field.val();
  20776. input_field.val('');
  20777. input_field.val(tmpStr);
  20778. input_field.css({
  20779. width: inputWidth
  20780. });
  20781. }).trigger('input');
  20782. input_field.focusout(function () {
  20783. /// update array:
  20784. if (input_field.val().trim()) {
  20785. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  20786. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  20787. }
  20788. input_field.off();
  20789. input_field.remove(); /// update elements:
  20790. opened_name_parameter = false;
  20791. opened_input_parameter = false;
  20792. });
  20793. input_field.on('keydown', function (e) {
  20794. var code = e.keyCode || e.which;
  20795. if (code == 13) {
  20796. if (input_field.val().trim()) {
  20797. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  20798. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  20799. }
  20800. input_field.off();
  20801. input_field.remove(); /// update elements:
  20802. opened_name_parameter = false;
  20803. opened_input_parameter = false;
  20804. }
  20805. if (code == 27) {
  20806. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  20807. input_field.off();
  20808. input_field.remove(); /// update elements:
  20809. opened_name_parameter = false;
  20810. opened_input_parameter = false;
  20811. }
  20812. });
  20813. input_field.select();
  20814. }
  20815. var opened_name_function = false;
  20816. var opened_input = null;
  20817. var previousPadding = null;
  20818. function enableNameFunctionUpdate(function_obj, parent_node) {
  20819. if (opened_name_function) {
  20820. opened_input.focus();
  20821. return;
  20822. }
  20823. parent_node = $(parent_node);
  20824. parent_node.find('.span_name_function').text('');
  20825. var input_field;
  20826. if (!previousPadding) {
  20827. previousPadding = parent_node.find('.span_name_function').css('padding-left');
  20828. }
  20829. parent_node.find('.span_name_function').css('padding-left', '0');
  20830. parent_node.find('.span_name_function').css('padding-right', '0');
  20831. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + function_obj.name + "' />");
  20832. input_field.insertBefore(parent_node.find('.span_name_function'));
  20833. input_field.on('input', function () {
  20834. var inputWidth = input_field.textWidth() + 10;
  20835. opened_input = input_field;
  20836. input_field.focus();
  20837. var tmpStr = input_field.val();
  20838. input_field.val('');
  20839. input_field.val(tmpStr);
  20840. input_field.css({
  20841. width: inputWidth
  20842. });
  20843. }).trigger('input');
  20844. input_field.focusout(function () {
  20845. /// update array:
  20846. if (input_field.val().trim()) {
  20847. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  20848. }
  20849. input_field.off();
  20850. input_field.remove();
  20851. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  20852. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  20853. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  20854. opened_name_function = false;
  20855. opened_input = false;
  20856. });
  20857. input_field.on('keydown', function (e) {
  20858. var code = e.keyCode || e.which;
  20859. if (code == 13) {
  20860. if (input_field.val().trim()) {
  20861. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  20862. }
  20863. input_field.off();
  20864. input_field.remove();
  20865. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  20866. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  20867. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  20868. opened_name_function = false;
  20869. opened_input = false;
  20870. }
  20871. if (code == 27) {
  20872. input_field.off();
  20873. input_field.remove();
  20874. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  20875. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  20876. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  20877. opened_name_function = false;
  20878. opened_input = false;
  20879. }
  20880. });
  20881. input_field.select();
  20882. }
  20883. function addFunctionChangeListener(callback) {
  20884. functionsChangeListeners.push(callback);
  20885. return functionsChangeListeners.length - 1;
  20886. }
  20887. function addGlobalChangeListener(callback) {
  20888. globalChangeListeners.push(callback);
  20889. return globalChangeListeners.length - 1;
  20890. }
  20891. function removeGlobalListener(index) {
  20892. globalChangeListeners.splice(index, 1);
  20893. }
  20894. function removeFunctionListener(index) {
  20895. functionsChangeListeners.splice(index);
  20896. }
  20897. function scheduleCall(callback, time) {
  20898. var scheduled_call = function scheduled_call() {
  20899. var id = setInterval(function () {
  20900. if (callback()) {
  20901. clearInterval(id);
  20902. }
  20903. }, time);
  20904. };
  20905. scheduled_call();
  20906. }
  20907. function showRunButton() {
  20908. document.getElementById('run_button').style.display = 'inline';
  20909. document.getElementById('stop_button').style.display = 'none';
  20910. }
  20911. function showStopButton() {
  20912. document.getElementById('run_button').style.display = 'none';
  20913. document.getElementById('stop_button').style.display = 'inline';
  20914. }
  20915. function stopExecution() {
  20916. domConsole.clearPendingWrites();
  20917. domConsole.cancelPendingInputRequests();
  20918. if (!isRunning) {
  20919. return;
  20920. }
  20921. proc.mode = _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT;
  20922. }
  20923. /***/ }),
  20924. /***/ "./js/visualUI/globals.js":
  20925. /*!********************************!*\
  20926. !*** ./js/visualUI/globals.js ***!
  20927. \********************************/
  20928. /*! exports provided: addGlobal, renderGlobal */
  20929. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20930. "use strict";
  20931. __webpack_require__.r(__webpack_exports__);
  20932. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobal", function() { return addGlobal; });
  20933. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderGlobal", function() { return renderGlobal; });
  20934. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  20935. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  20936. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  20937. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  20938. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  20939. var counter_new_globals = 0;
  20940. function addGlobal(program) {
  20941. var is_from_click = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  20942. 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);
  20943. counter_new_globals++;
  20944. program.addGlobal(new_global);
  20945. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(new_global.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].INSERT_GLOBAL_VAR);
  20946. var newe = renderGlobal(new_global);
  20947. if (is_from_click) {
  20948. newe.css('display', 'none');
  20949. newe.fadeIn();
  20950. }
  20951. }
  20952. function toggleConstant(global_var) {
  20953. global_var.is_constant = !global_var.is_constant;
  20954. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].SET_GLOBAL_CONST);
  20955. }
  20956. function updateName(global_var, new_name, global_obj_dom) {
  20957. if (global_var.name == new_name) {
  20958. return;
  20959. }
  20960. if (isValidIdentifier(new_name)) {
  20961. if (globalNameAlreadyExists(new_name)) {
  20962. _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'));
  20963. } else {
  20964. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].RENAME_GLOBAL_VAR, new_name);
  20965. global_var.name = new_name;
  20966. }
  20967. } else {
  20968. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_name'));
  20969. }
  20970. }
  20971. function globalNameAlreadyExists(global_name) {
  20972. for (var i = 0; i < window.program_obj.globals.length; i++) {
  20973. if (window.program_obj.globals[i].name == global_name) {
  20974. return true;
  20975. }
  20976. }
  20977. return false;
  20978. }
  20979. function isValidIdentifier(identifier_str) {
  20980. return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  20981. }
  20982. function updateType(global_var, new_type) {
  20983. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  20984. global_var.type = new_type;
  20985. global_var.dimensions = new_dimensions;
  20986. if (new_dimensions > 0) {
  20987. global_var.rows = new_dimensions;
  20988. global_var.columns = 2;
  20989. }
  20990. 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);
  20991. updateInitialValues(global_var);
  20992. }
  20993. function removeGlobal(global_var, global_container) {
  20994. var index = window.program_obj.globals.indexOf(global_var);
  20995. if (index > -1) {
  20996. window.insertContext = true;
  20997. window.program_obj.globals.splice(index, 1);
  20998. }
  20999. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_GLOBAL_VAR);
  21000. global_container.children().off();
  21001. global_container.off();
  21002. global_container.fadeOut();
  21003. }
  21004. function updateInitialValues(global_var) {
  21005. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21006. if (global_var.dimensions == 0) {
  21007. global_var.value = 0;
  21008. }
  21009. if (global_var.dimensions == 1) {
  21010. global_var.value = [0, 0];
  21011. }
  21012. if (global_var.dimensions == 2) {
  21013. global_var.value = [[0, 0], [0, 0]];
  21014. }
  21015. }
  21016. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21017. if (global_var.dimensions == 0) {
  21018. global_var.value = 0.0;
  21019. }
  21020. if (global_var.dimensions == 1) {
  21021. global_var.value = [0.0, 0.0];
  21022. }
  21023. if (global_var.dimensions == 2) {
  21024. global_var.value = [[0.0, 0.0], [0.0, 0.0]];
  21025. }
  21026. }
  21027. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21028. if (global_var.dimensions == 0) {
  21029. global_var.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  21030. }
  21031. if (global_var.dimensions == 1) {
  21032. 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')];
  21033. }
  21034. if (global_var.dimensions == 2) {
  21035. 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')]];
  21036. }
  21037. }
  21038. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21039. if (global_var.dimensions == 0) {
  21040. global_var.value = true;
  21041. }
  21042. if (global_var.dimensions == 1) {
  21043. global_var.value = [true, true];
  21044. }
  21045. if (global_var.dimensions == 2) {
  21046. global_var.value = [[true, true], [true, true]];
  21047. }
  21048. }
  21049. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21050. if (global_var.dimensions == 0) {
  21051. global_var.value = 'A';
  21052. }
  21053. if (global_var.dimensions == 1) {
  21054. global_var.value = ['A', 'A'];
  21055. }
  21056. if (global_var.dimensions == 2) {
  21057. global_var.value = [['A', 'A'], ['A', 'A']];
  21058. }
  21059. }
  21060. 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);
  21061. }
  21062. function alternateBooleanGlobalValue(global_var, value_container) {
  21063. global_var.value = !global_var.value;
  21064. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value)));
  21065. }
  21066. function alternateBooleanGlobalVectorValue(global_var, index, value_container) {
  21067. global_var.value[index] = !global_var.value[index];
  21068. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[index])));
  21069. }
  21070. function removeGlobalColumnVector(global_var) {
  21071. if (global_var.columns == 0) {
  21072. return;
  21073. }
  21074. global_var.columns--;
  21075. global_var.value.splice(global_var.value.length - 1, 1);
  21076. }
  21077. function addGlobalColumnVector(global_var) {
  21078. global_var.columns++;
  21079. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21080. global_var.value.push(0);
  21081. }
  21082. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21083. global_var.value.push(0.0);
  21084. }
  21085. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21086. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21087. }
  21088. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21089. global_var.value.push(true);
  21090. }
  21091. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21092. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21093. }
  21094. }
  21095. function removeColumnGlobalMatrix(global_var) {
  21096. if (global_var.columns == 0) {
  21097. return;
  21098. }
  21099. global_var.columns--;
  21100. for (var i = 0; i < global_var.rows; i++) {
  21101. global_var.value[i].splice(global_var.value[i].length - 1, 1);
  21102. }
  21103. }
  21104. function addColumnGlobalMatrix(global_var) {
  21105. global_var.columns++;
  21106. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21107. for (var i = 0; i < global_var.rows; i++) {
  21108. global_var.value[i].push(0);
  21109. }
  21110. }
  21111. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21112. for (var i = 0; i < global_var.rows; i++) {
  21113. global_var.value[i].push(0.0);
  21114. }
  21115. }
  21116. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21117. for (var i = 0; i < global_var.rows; i++) {
  21118. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21119. }
  21120. }
  21121. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21122. for (var i = 0; i < global_var.rows; i++) {
  21123. global_var.value[i].push(true);
  21124. }
  21125. }
  21126. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21127. for (var i = 0; i < global_var.rows; i++) {
  21128. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21129. }
  21130. }
  21131. }
  21132. function removeLineGlobalMatrix(global_var) {
  21133. if (global_var.rows == 0) {
  21134. return;
  21135. }
  21136. global_var.rows--;
  21137. global_var.value.splice(global_var.value.length - 1, 1);
  21138. }
  21139. function addLineGlobalMatrix(global_var) {
  21140. global_var.rows++;
  21141. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21142. var n_l = [];
  21143. for (var i = 0; i < global_var.columns; i++) {
  21144. n_l.push(0);
  21145. }
  21146. global_var.value.push(n_l);
  21147. }
  21148. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21149. var n_l = [];
  21150. for (i = 0; i < global_var.columns; i++) {
  21151. n_l.push(0.0);
  21152. }
  21153. global_var.value.push(n_l);
  21154. }
  21155. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21156. var n_l = [];
  21157. for (i = 0; i < global_var.columns; i++) {
  21158. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21159. }
  21160. global_var.value.push(n_l);
  21161. }
  21162. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21163. var n_l = [];
  21164. for (i = 0; i < global_var.columns; i++) {
  21165. n_l.push(true);
  21166. }
  21167. global_var.value.push(n_l);
  21168. }
  21169. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21170. var n_l = [];
  21171. for (i = 0; i < global_var.columns; i++) {
  21172. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21173. }
  21174. global_var.value.push(n_l);
  21175. }
  21176. }
  21177. function alternateBooleanGlobalMatrixValue(global_var, row, index, value_container) {
  21178. global_var.value[row][index] = !global_var.value[row][index];
  21179. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[row][index])));
  21180. }
  21181. function renderValues(global_var, global_container) {
  21182. var ret = "";
  21183. var j = 0;
  21184. if (global_var.dimensions == 0) {
  21185. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21186. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value.toFixed(1) + '</span> </div> ';
  21187. } else {
  21188. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21189. 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> ';
  21190. } else {
  21191. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value + '</span> </div> ';
  21192. }
  21193. }
  21194. } else {
  21195. ret += '<table class="tabela_var">';
  21196. if (global_var.dimensions == 1) {
  21197. ret += '<tr>';
  21198. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21199. for (var k = 0; k < global_var.columns; k++) {
  21200. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k].toFixed(1) + '</span></td>';
  21201. }
  21202. } else {
  21203. for (var k = 0; k < global_var.columns; k++) {
  21204. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21205. 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>';
  21206. } else {
  21207. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k] + '</span>' + '</td>';
  21208. }
  21209. }
  21210. }
  21211. ret += '</tr>';
  21212. ret += '</table>';
  21213. 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>';
  21214. }
  21215. if (global_var.dimensions == 2) {
  21216. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21217. for (var l = 0; l < global_var.rows; l++) {
  21218. ret += '<tr>';
  21219. for (var k = 0; k < global_var.columns; k++) {
  21220. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  21221. }
  21222. ret += '</tr>';
  21223. }
  21224. } else {
  21225. for (var l = 0; l < global_var.rows; l++) {
  21226. ret += '<tr>';
  21227. for (var k = 0; k < global_var.columns; k++) {
  21228. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21229. 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>';
  21230. } else {
  21231. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k] + '</span></td>';
  21232. }
  21233. }
  21234. ret += '</tr>';
  21235. }
  21236. }
  21237. if (global_var.rows == 0) {
  21238. ret += '<tr><td></td></tr>';
  21239. }
  21240. 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>';
  21241. ret += '</table>';
  21242. 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>';
  21243. }
  21244. }
  21245. global_container.find(".div_valor_var").html('');
  21246. ret = $(ret);
  21247. ret.find('.span_value_variable').data('associatedOject', global_var);
  21248. ret.find(".boolean_simple_type").on('click', function (e) {
  21249. alternateBooleanGlobalValue(global_var, this.parentNode);
  21250. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21251. });
  21252. ret.find(".simple_var").on('click', function (e) {
  21253. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21254. enableGlobalValueUpdate(global_var, this.parentNode);
  21255. });
  21256. ret.find(".boolean_vector_var").on('click', function (e) {
  21257. alternateBooleanGlobalVectorValue(global_var, $(this).data('index'), this.parentNode);
  21258. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21259. });
  21260. ret.find(".vector_var").on('click', function (e) {
  21261. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21262. enableGlobalVectorValueUpdate(global_var, $(this).data('index'), this.parentNode);
  21263. });
  21264. ret.find(".remove_global_vector_column").on('click', function (e) {
  21265. removeGlobalColumnVector(global_var);
  21266. global_container.find(".div_valor_var").html('');
  21267. 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);
  21268. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21269. renderValues(global_var, global_container);
  21270. });
  21271. ret.find(".add_global_vector_column").on('click', function (e) {
  21272. addGlobalColumnVector(global_var);
  21273. 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);
  21274. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21275. global_container.find(".div_valor_var").html('');
  21276. renderValues(global_var, global_container);
  21277. });
  21278. ret.find(".remove_global_matrix_column").on('click', function (e) {
  21279. removeColumnGlobalMatrix(global_var);
  21280. 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);
  21281. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21282. global_container.find(".div_valor_var").html('');
  21283. renderValues(global_var, global_container);
  21284. });
  21285. ret.find(".add_global_matrix_column").on('click', function (e) {
  21286. addColumnGlobalMatrix(global_var);
  21287. 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);
  21288. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21289. global_container.find(".div_valor_var").html('');
  21290. renderValues(global_var, global_container);
  21291. });
  21292. ret.find(".remove_global_matrix_line").on('click', function (e) {
  21293. removeLineGlobalMatrix(global_var);
  21294. 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);
  21295. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21296. global_container.find(".div_valor_var").html('');
  21297. renderValues(global_var, global_container);
  21298. });
  21299. ret.find(".add_global_matrix_line").on('click', function (e) {
  21300. addLineGlobalMatrix(global_var);
  21301. 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);
  21302. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21303. global_container.find(".div_valor_var").html('');
  21304. renderValues(global_var, global_container);
  21305. });
  21306. ret.find(".boolean_matrix_var").on('click', function (e) {
  21307. alternateBooleanGlobalMatrixValue(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  21308. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21309. });
  21310. ret.find(".matrix_var").on('click', function (e) {
  21311. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21312. enableGlobalMatrixValueUpdate(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  21313. });
  21314. global_container.find(".div_valor_var").append(ret);
  21315. updateColumnsAndRowsText(global_container, global_var);
  21316. }
  21317. function addHandlers(global_container) {
  21318. var global_var = global_container.data('associatedOject'); // Manage constant option:
  21319. global_container.find(".alternate_constant").on('click', function (e) {
  21320. toggleConstant(global_var);
  21321. $(this).removeClass("on off");
  21322. if (global_var.is_constant) {
  21323. $(this).addClass("on");
  21324. } else {
  21325. $(this).addClass("off");
  21326. }
  21327. }); // Manage global name:
  21328. global_container.find(".editing_name_var").on('click', function (e) {
  21329. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_NAME);
  21330. enableNameUpdate(global_container);
  21331. }); // Menu to change type:
  21332. global_container.find('.ui.dropdown.global_type').dropdown({
  21333. onChange: function onChange(_, __, $selectedItem) {
  21334. if ($selectedItem.data('dimensions')) {
  21335. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  21336. } else {
  21337. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  21338. }
  21339. renderValues(global_var, global_container);
  21340. },
  21341. selectOnKeydown: false
  21342. }); // Remove global:
  21343. global_container.find(".remove_global").on('click', function (e) {
  21344. removeGlobal(global_var, global_container);
  21345. });
  21346. }
  21347. function updateColumnsAndRowsText(global_container, global_var) {
  21348. var prev = global_container.find('.text').text().split('[');
  21349. if (prev.length == 2) {
  21350. var ff = prev[0] + '[ ' + global_var.columns + ' ] ';
  21351. global_container.find('.text').empty();
  21352. global_container.find('.text').text(ff);
  21353. }
  21354. if (prev.length == 3) {
  21355. var ff = prev[0] + '[ ' + global_var.columns + ' ] [ ' + global_var.rows + ' ] ';
  21356. global_container.find('.text').empty();
  21357. global_container.find('.text').text(ff);
  21358. }
  21359. }
  21360. function renderGlobal(global_var) {
  21361. var element = '<div class="ui label global_container pink"><i class="ui icon ellipsis vertical inverted"></i><div class="global_const">const: ';
  21362. element += '<i class="ui icon toggle ' + (global_var.is_constant ? "on" : "off") + ' alternate_constant"></i></div>';
  21363. element += '<div class="ui dropdown global_type">';
  21364. if (global_var.dimensions == 1) {
  21365. 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));
  21366. element += ' [ <span class="dimensions_0"></span> ] ';
  21367. element += '</div>';
  21368. } else if (global_var.dimensions == 2) {
  21369. 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));
  21370. element += ' [ <span class="dimensions_0"></span> ] [ <span class="dimensions_1"></span> ] ';
  21371. element += '</div>';
  21372. } else {
  21373. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type.toLowerCase())) + '</div>';
  21374. }
  21375. element += '<div class="menu">';
  21376. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21377. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21378. continue;
  21379. }
  21380. 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>';
  21381. }
  21382. 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">';
  21383. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21384. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21385. continue;
  21386. }
  21387. 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>';
  21388. }
  21389. element += '</div></div>';
  21390. 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">';
  21391. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21392. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21393. continue;
  21394. }
  21395. 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>';
  21396. }
  21397. element += '</div></div>';
  21398. 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> ';
  21399. element += '<div class="ui div_valor_var">' + global_var.value + '</div>';
  21400. element += ' <i class="yellow inverted icon times remove_global"></i></div>';
  21401. var complete_element = $(element);
  21402. complete_element.data('associatedOject', global_var);
  21403. $('.list_globals').append(complete_element);
  21404. addHandlers(complete_element);
  21405. renderValues(global_var, complete_element);
  21406. if (global_var.dimensions == 1) {
  21407. complete_element.find('.dimensions_0').text(global_var.columns);
  21408. }
  21409. if (global_var.dimensions == 2) {
  21410. complete_element.find('.dimensions_0').text(global_var.columns);
  21411. complete_element.find('.dimensions_1').text(global_var.rows);
  21412. }
  21413. return complete_element;
  21414. }
  21415. var opened_name_value_matrix_global_v = false;
  21416. var opened_input_value_matrix_global_v = null;
  21417. function enableGlobalMatrixValueUpdate(global_var, row, index, parent_node) {
  21418. if (opened_name_value_matrix_global_v) {
  21419. opened_input_value_matrix_global_v.focus();
  21420. return;
  21421. }
  21422. parent_node = $(parent_node);
  21423. opened_name_value_matrix_global_v = true;
  21424. parent_node.find('.span_value_variable').text('');
  21425. var input_field;
  21426. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21427. 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) + "' />");
  21428. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21429. } else {
  21430. 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] + "' />");
  21431. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21432. }
  21433. input_field.on('input', function () {
  21434. var inputWidth = input_field.textWidth() + 10;
  21435. opened_input_value_matrix_global_v = input_field;
  21436. input_field.focus();
  21437. var tmpStr = input_field.val();
  21438. input_field.val('');
  21439. input_field.val(tmpStr);
  21440. input_field.css({
  21441. width: inputWidth
  21442. });
  21443. }).trigger('input');
  21444. input_field.focusout(function () {
  21445. /// update array:
  21446. if (input_field.val().trim()) {
  21447. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21448. global_var.value[row][index] = parseFloat(input_field.val().trim());
  21449. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21450. } else {
  21451. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21452. global_var.value[row][index] = parseInt(input_field.val().trim());
  21453. } else {
  21454. global_var.value[row][index] = input_field.val().trim();
  21455. }
  21456. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21457. }
  21458. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21459. } else {
  21460. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21461. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21462. } else {
  21463. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21464. }
  21465. }
  21466. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21467. global_var.value[row][index] = input_field.val();
  21468. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21469. }
  21470. input_field.off();
  21471. input_field.remove(); /// update elements:
  21472. opened_name_value_matrix_global_v = false;
  21473. opened_input_value_matrix_global_v = false;
  21474. });
  21475. input_field.on('keydown', function (e) {
  21476. var code = e.keyCode || e.which;
  21477. if (code == 13) {
  21478. if (input_field.val().trim()) {
  21479. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21480. global_var.value[row][index] = parseFloat(input_field.val().trim());
  21481. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21482. } else {
  21483. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21484. global_var.value[row][index] = parseInt(input_field.val().trim());
  21485. } else {
  21486. global_var.value[row][index] = input_field.val().trim();
  21487. }
  21488. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21489. }
  21490. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21491. } else {
  21492. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21493. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21494. } else {
  21495. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21496. }
  21497. }
  21498. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21499. global_var.value[row][index] = input_field.val();
  21500. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21501. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21502. }
  21503. input_field.off();
  21504. input_field.remove(); /// update elements:
  21505. opened_name_value_matrix_global_v = false;
  21506. opened_input_value_matrix_global_v = false;
  21507. }
  21508. if (code == 27) {
  21509. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21510. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21511. } else {
  21512. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21513. }
  21514. input_field.off();
  21515. input_field.remove(); /// update elements:
  21516. opened_name_value_matrix_global_v = false;
  21517. opened_input_value_matrix_global_v = false;
  21518. }
  21519. });
  21520. input_field.select();
  21521. }
  21522. var opened_name_value_global_var = false;
  21523. var opened_input_value_global_ar = null;
  21524. function enableGlobalValueUpdate(global_var, parent_node) {
  21525. if (opened_name_value_global_var) {
  21526. opened_input_value_global_ar.focus();
  21527. return;
  21528. }
  21529. parent_node = $(parent_node);
  21530. opened_name_value_global_var = true;
  21531. parent_node.find('.span_value_variable').text('');
  21532. var input_field;
  21533. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21534. 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) + "' />");
  21535. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21536. } else {
  21537. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value + "' />");
  21538. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21539. }
  21540. input_field.on('input', function () {
  21541. var inputWidth = input_field.textWidth() + 10;
  21542. opened_input_value_global_ar = input_field;
  21543. input_field.focus();
  21544. var tmpStr = input_field.val();
  21545. input_field.val('');
  21546. input_field.val(tmpStr);
  21547. input_field.css({
  21548. width: inputWidth
  21549. });
  21550. }).trigger('input');
  21551. input_field.focusout(function () {
  21552. var changed = false; /// update array:
  21553. if (input_field.val().trim()) {
  21554. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21555. global_var.value = parseFloat(input_field.val().trim());
  21556. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21557. } else {
  21558. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21559. global_var.value = parseInt(input_field.val().trim());
  21560. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21561. global_var.value = input_field.val().charAt(0);
  21562. } else {
  21563. global_var.value = input_field.val().trim();
  21564. }
  21565. parent_node.find('.span_value_variable').text(global_var.value);
  21566. }
  21567. changed = true;
  21568. } else {
  21569. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21570. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21571. } else {
  21572. parent_node.find('.span_value_variable').text(global_var.value);
  21573. }
  21574. }
  21575. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21576. global_var.value = input_field.val();
  21577. changed = true;
  21578. parent_node.find('.span_value_variable').text(global_var.value);
  21579. }
  21580. if (changed) {
  21581. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21582. }
  21583. input_field.off();
  21584. input_field.remove(); /// update elements:
  21585. opened_name_value_global_var = false;
  21586. opened_input_value_global_ar = false;
  21587. });
  21588. input_field.on('keydown', function (e) {
  21589. var code = e.keyCode || e.which;
  21590. var changed = true;
  21591. if (code == 13) {
  21592. if (input_field.val().trim()) {
  21593. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21594. global_var.value = parseFloat(input_field.val().trim());
  21595. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21596. } else {
  21597. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21598. global_var.value = parseInt(input_field.val().trim());
  21599. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21600. global_var.value = input_field.val().charAt(0);
  21601. } else {
  21602. global_var.value = input_field.val().trim();
  21603. }
  21604. parent_node.find('.span_value_variable').text(global_var.value);
  21605. }
  21606. changed = true;
  21607. } else {
  21608. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21609. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21610. } else {
  21611. parent_node.find('.span_value_variable').text(global_var.value);
  21612. }
  21613. }
  21614. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21615. global_var.value = input_field.val();
  21616. changed = true;
  21617. parent_node.find('.span_value_variable').text(global_var.value);
  21618. }
  21619. if (changed) {
  21620. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21621. }
  21622. input_field.off();
  21623. input_field.remove(); /// update elements:
  21624. opened_name_value_global_var = false;
  21625. opened_input_value_global_ar = false;
  21626. }
  21627. if (code == 27) {
  21628. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21629. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21630. } else {
  21631. parent_node.find('.span_value_variable').text(global_var.value);
  21632. }
  21633. input_field.off();
  21634. input_field.remove(); /// update elements:
  21635. opened_name_value_global_var = false;
  21636. opened_input_value_global_ar = false;
  21637. }
  21638. });
  21639. input_field.select();
  21640. }
  21641. var opened_name_global = false;
  21642. var opened_input_global = null;
  21643. function enableNameUpdate(global_container) {
  21644. var global_var = global_container.data('associatedOject');
  21645. if (opened_name_global) {
  21646. opened_input_global.focus();
  21647. return;
  21648. }
  21649. opened_name_global = true;
  21650. global_container.find('.span_name_variable').text('');
  21651. var input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.name + "' />");
  21652. input_name.insertBefore(global_container.find('.span_name_variable'));
  21653. input_name.on('input', function () {
  21654. var inputWidth = input_name.textWidth() + 10;
  21655. opened_input_global = input_name;
  21656. opened_input_global.focus();
  21657. opened_input_global.css({
  21658. width: inputWidth
  21659. });
  21660. }).trigger('input');
  21661. input_name.focusout(function () {
  21662. /// update array:
  21663. if (input_name.val().trim().length > 0) {
  21664. updateName(global_var, input_name.val().trim(), global_container);
  21665. global_container.find('.span_name_variable').text(global_var.name);
  21666. } else {
  21667. global_container.find('.span_name_variable').text(global_var.name);
  21668. }
  21669. input_name.off();
  21670. input_name.remove(); /// update elements:
  21671. opened_name_global = false;
  21672. opened_input_global = false;
  21673. });
  21674. input_name.on('keydown', function (e) {
  21675. var code = e.keyCode || e.which;
  21676. if (code == 13) {
  21677. if (input_name.val().trim()) {
  21678. updateName(global_var, input_name.val().trim(), global_container);
  21679. global_container.find('.span_name_variable').text(global_var.name);
  21680. } else {
  21681. global_container.find('.span_name_variable').text(global_var.name);
  21682. }
  21683. input_name.off();
  21684. input_name.remove(); /// update elements:
  21685. opened_name_global = false;
  21686. opened_input_global = false;
  21687. }
  21688. if (code == 27) {
  21689. global_container.find('.span_name_variable').text(global_var.name);
  21690. input_name.off();
  21691. input_name.remove(); /// update elements:
  21692. opened_name_global = false;
  21693. opened_input_global = false;
  21694. }
  21695. });
  21696. input_name.select();
  21697. }
  21698. var opened_name_value_vector_global_ = false;
  21699. var opened_input_value_vector_global_ = null;
  21700. function enableGlobalVectorValueUpdate(global_var, index, parent_node) {
  21701. if (opened_name_value_vector_global_) {
  21702. opened_input_value_vector_global_.focus();
  21703. return;
  21704. }
  21705. parent_node = $(parent_node);
  21706. opened_name_value_vector_global_ = true;
  21707. parent_node.find('.span_value_variable').text('');
  21708. var input_field;
  21709. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21710. 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) + "' />");
  21711. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21712. } else {
  21713. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[index] + "' />");
  21714. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21715. }
  21716. input_field.on('input', function () {
  21717. var inputWidth = input_field.textWidth() + 10;
  21718. opened_input_value_vector_global_ = input_field;
  21719. input_field.focus();
  21720. var tmpStr = input_field.val();
  21721. input_field.val('');
  21722. input_field.val(tmpStr);
  21723. input_field.css({
  21724. width: inputWidth
  21725. });
  21726. }).trigger('input');
  21727. input_field.focusout(function () {
  21728. var changed = false; /// update array:
  21729. if (input_field.val().trim()) {
  21730. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21731. global_var.value[index] = parseFloat(input_field.val().trim());
  21732. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21733. } else {
  21734. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21735. global_var.value[index] = parseInt(input_field.val().trim());
  21736. } else {
  21737. global_var.value[index] = input_field.val().trim();
  21738. }
  21739. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21740. }
  21741. changed = true;
  21742. } else {
  21743. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21744. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21745. } else {
  21746. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21747. }
  21748. }
  21749. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21750. global_var.value[index] = input_field.val();
  21751. changed = true;
  21752. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21753. }
  21754. if (changed) {
  21755. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21756. }
  21757. input_field.off();
  21758. input_field.remove(); /// update elements:
  21759. opened_name_value_vector_global_ = false;
  21760. opened_input_value_vector_global_ = false;
  21761. });
  21762. input_field.on('keydown', function (e) {
  21763. var code = e.keyCode || e.which;
  21764. var changed = false;
  21765. if (code == 13) {
  21766. if (input_field.val().trim()) {
  21767. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21768. global_var.value[index] = parseFloat(input_field.val().trim());
  21769. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21770. } else {
  21771. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21772. global_var.value[index] = parseInt(input_field.val().trim());
  21773. } else {
  21774. global_var.value[index] = input_field.val().trim();
  21775. }
  21776. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21777. }
  21778. changed = true;
  21779. } else {
  21780. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21781. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21782. } else {
  21783. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21784. }
  21785. }
  21786. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21787. global_var.value[index] = input_field.val();
  21788. changed = true;
  21789. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21790. }
  21791. if (changed) {
  21792. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21793. }
  21794. input_field.off();
  21795. input_field.remove(); /// update elements:
  21796. opened_name_value_vector_global_ = false;
  21797. opened_input_value_vector_global_ = false;
  21798. }
  21799. if (code == 27) {
  21800. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21801. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21802. } else {
  21803. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21804. }
  21805. input_field.off();
  21806. input_field.remove(); /// update elements:
  21807. opened_name_value_vector_global_ = false;
  21808. opened_input_value_vector_global_ = false;
  21809. }
  21810. });
  21811. input_field.select();
  21812. }
  21813. $.fn.textWidth = function (text, font) {
  21814. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  21815. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  21816. return $.fn.textWidth.fakeEl.width();
  21817. };
  21818. /***/ }),
  21819. /***/ "./js/visualUI/ivprog_elements.js":
  21820. /*!****************************************!*\
  21821. !*** ./js/visualUI/ivprog_elements.js ***!
  21822. \****************************************/
  21823. /*! 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 */
  21824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21825. "use strict";
  21826. __webpack_require__.r(__webpack_exports__);
  21827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_TYPES", function() { return COMMAND_TYPES; });
  21828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_TYPES", function() { return ARITHMETIC_TYPES; });
  21829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_ELEMENTS", function() { return EXPRESSION_ELEMENTS; });
  21830. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_TYPES", function() { return EXPRESSION_TYPES; });
  21831. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_COMPARISON", function() { return ARITHMETIC_COMPARISON; });
  21832. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOGIC_COMPARISON", function() { return LOGIC_COMPARISON; });
  21833. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYSTEM_FUNCTIONS_CATEGORIES", function() { return SYSTEM_FUNCTIONS_CATEGORIES; });
  21834. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; });
  21835. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  21836. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemFunction", function() { return SystemFunction; });
  21837. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });
  21838. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  21839. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reader", function() { return Reader; });
  21840. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Writer", function() { return Writer; });
  21841. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribution", function() { return Attribution; });
  21842. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionOperator", function() { return ExpressionOperator; });
  21843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionElement", function() { return ExpressionElement; });
  21844. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionalExpression", function() { return ConditionalExpression; });
  21845. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicExpression", function() { return LogicExpression; });
  21846. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArithmeticExpression", function() { return ArithmeticExpression; });
  21847. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfTrue", function() { return IfTrue; });
  21848. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatNTimes", function() { return RepeatNTimes; });
  21849. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WhileTrue", function() { return WhileTrue; });
  21850. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DoWhileTrue", function() { return DoWhileTrue; });
  21851. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  21852. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  21853. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwitchCase", function() { return SwitchCase; });
  21854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  21855. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableValueMenu", function() { return VariableValueMenu; });
  21856. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCallMenu", function() { return FunctionCallMenu; });
  21857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Program", function() { return Program; });
  21858. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  21859. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__);
  21860. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  21861. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  21862. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  21863. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  21864. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__);
  21865. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  21866. var COMMAND_TYPES = Object.freeze({
  21867. "function": "function",
  21868. comment: "comment",
  21869. reader: "reader",
  21870. writer: "writer",
  21871. attribution: "attribution",
  21872. iftrue: "iftrue",
  21873. repeatNtimes: "repeatNtimes",
  21874. whiletrue: "whiletrue",
  21875. dowhiletrue: "dowhiletrue",
  21876. "switch": "switch",
  21877. switchcase: "switchcase",
  21878. functioncall: "functioncall",
  21879. "break": "break",
  21880. "return": "return"
  21881. });
  21882. var ARITHMETIC_TYPES = Object.freeze({
  21883. plus: "plus",
  21884. minus: "minus",
  21885. multiplication: "multiplication",
  21886. division: "division",
  21887. module: "module",
  21888. none: "none"
  21889. });
  21890. var EXPRESSION_ELEMENTS = Object.freeze({
  21891. exp_op_exp: "exp_op_exp",
  21892. op_exp: "op_exp",
  21893. par_exp_par: "par_exp_par",
  21894. start_point: "start_point"
  21895. });
  21896. var EXPRESSION_TYPES = Object.freeze({
  21897. exp_conditional: "exp_conditional",
  21898. exp_logic: "exp_logic",
  21899. exp_arithmetic: "exp_arithmetic",
  21900. write_sep: "write_separator"
  21901. });
  21902. var ARITHMETIC_COMPARISON = Object.freeze({
  21903. greater_than: "greater_than",
  21904. less_than: "less_than",
  21905. equals_to: "equals_to",
  21906. not_equals_to: "not_equals_to",
  21907. greater_than_or_equals_to: "greater_than_or_equals_to",
  21908. less_than_or_equals_to: "less_than_or_equals_to"
  21909. });
  21910. var LOGIC_COMPARISON = Object.freeze({
  21911. equals_to: "equals_to",
  21912. not_equals_to: "not_equals_to",
  21913. and: "and",
  21914. or: "or",
  21915. not: "not"
  21916. });
  21917. var SYSTEM_FUNCTIONS_CATEGORIES = Object.freeze({
  21918. math: "$mathLib",
  21919. text: "$strLib",
  21920. arrangement: "$arrayLib",
  21921. conversion: "$langLib"
  21922. });
  21923. var Variable = function Variable(type, name, value) {
  21924. var dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  21925. var is_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  21926. var rows = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  21927. var columns = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
  21928. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Variable);
  21929. this.type = type;
  21930. this.name = name;
  21931. this.value = value;
  21932. this.dimensions = dimensions;
  21933. this.is_constant = is_constant;
  21934. this.rows = rows;
  21935. this.columns = columns;
  21936. };
  21937. var Function = function Function(name) {
  21938. var return_type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID;
  21939. var return_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  21940. var parameters_list = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  21941. var is_main = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  21942. var is_hidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
  21943. var variables_list = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
  21944. var function_comment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
  21945. var commands = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];
  21946. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Function);
  21947. this.type = COMMAND_TYPES["function"];
  21948. this.name = name;
  21949. this.return_type = return_type;
  21950. this.return_dimensions = return_dimensions;
  21951. this.parameters_list = parameters_list;
  21952. this.is_main = is_main;
  21953. this.is_hidden = is_hidden;
  21954. this.variables_list = variables_list;
  21955. this.function_comment = function_comment;
  21956. this.commands = commands;
  21957. };
  21958. var SystemFunction = function SystemFunction(identifier, return_type, return_dimensions, parameters_list) {
  21959. var function_comment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  21960. var category = arguments.length > 5 ? arguments[5] : undefined;
  21961. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SystemFunction);
  21962. this.type = COMMAND_TYPES["function"];
  21963. this.identifier = identifier;
  21964. this.return_type = return_type;
  21965. this.return_dimensions = return_dimensions;
  21966. this.parameters_list = parameters_list;
  21967. this.function_comment = function_comment;
  21968. this.category = category;
  21969. };
  21970. var Comment = function Comment(comment_text) {
  21971. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Comment);
  21972. this.type = COMMAND_TYPES.comment;
  21973. this.comment_text = comment_text;
  21974. };
  21975. var Break = function Break() {
  21976. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Break);
  21977. this.type = COMMAND_TYPES["break"];
  21978. };
  21979. var Reader = function Reader() {
  21980. var variable_value_menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new VariableValueMenu();
  21981. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Reader);
  21982. this.type = COMMAND_TYPES.reader;
  21983. this.variable_value_menu = variable_value_menu;
  21984. };
  21985. var Writer = function Writer(content) {
  21986. var newline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  21987. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Writer);
  21988. this.type = COMMAND_TYPES.writer;
  21989. this.content = content;
  21990. this.newline = newline;
  21991. };
  21992. var Attribution = function Attribution(variable) {
  21993. var expression = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  21994. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Attribution);
  21995. this.type = COMMAND_TYPES.attribution;
  21996. this.variable = variable;
  21997. this.expression = expression;
  21998. };
  21999. var ExpressionOperator = function ExpressionOperator(type_op, item) {
  22000. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionOperator);
  22001. this.type_op = type_op; // Logic, Arithmetic OR Relational
  22002. this.item = item;
  22003. };
  22004. var ExpressionElement = function ExpressionElement(type_exp) {
  22005. var itens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22006. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionElement);
  22007. this.type_exp = type_exp;
  22008. this.itens = itens;
  22009. };
  22010. var ConditionalExpression = function ConditionalExpression(expression) {
  22011. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ConditionalExpression);
  22012. this.type = EXPRESSION_TYPES.exp_conditional;
  22013. this.expression = expression;
  22014. };
  22015. var LogicExpression = function LogicExpression(has_neg, first_operand, second_operand, operator) {
  22016. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, LogicExpression);
  22017. this.type = EXPRESSION_TYPES.exp_logic;
  22018. this.has_neg = has_neg;
  22019. this.first_operand = first_operand;
  22020. this.second_operand = second_operand;
  22021. this.operator = operator;
  22022. };
  22023. var ArithmeticExpression = function ArithmeticExpression(first_operand, second_operand, operator) {
  22024. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ArithmeticExpression);
  22025. this.type = EXPRESSION_TYPES.exp_arithmetic;
  22026. this.first_operand = first_operand;
  22027. this.second_operand = second_operand;
  22028. this.operator = operator;
  22029. };
  22030. var IfTrue = function IfTrue(expression, commands_block, commands_else) {
  22031. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, IfTrue);
  22032. this.type = COMMAND_TYPES.iftrue;
  22033. this.expression = expression;
  22034. this.commands_block = commands_block;
  22035. this.commands_else = commands_else;
  22036. };
  22037. var RepeatNTimes = function RepeatNTimes(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block) {
  22038. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, RepeatNTimes);
  22039. this.type = COMMAND_TYPES.repeatNtimes;
  22040. this.var_attribution = var_attribution;
  22041. this.var_incrementation = var_incrementation;
  22042. this.expression1 = expression1;
  22043. this.expression2 = expression2;
  22044. this.expression3 = expression3;
  22045. this.commands_block = commands_block;
  22046. };
  22047. var WhileTrue = function WhileTrue(expression, commands_block) {
  22048. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, WhileTrue);
  22049. this.type = COMMAND_TYPES.whiletrue;
  22050. this.expression = expression;
  22051. this.commands_block = commands_block;
  22052. };
  22053. var DoWhileTrue = function DoWhileTrue(expression, commands_block) {
  22054. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, DoWhileTrue);
  22055. this.type = COMMAND_TYPES.dowhiletrue;
  22056. this.expression = expression;
  22057. this.commands_block = commands_block;
  22058. };
  22059. var Switch = function Switch(variable) {
  22060. var cases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22061. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Switch);
  22062. this.type = COMMAND_TYPES["switch"];
  22063. this.variable = variable;
  22064. this.cases = cases;
  22065. };
  22066. var Return = function Return(variable_value_menu) {
  22067. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Return);
  22068. this.type = COMMAND_TYPES["return"];
  22069. this.variable_value_menu = variable_value_menu;
  22070. };
  22071. var SwitchCase = function SwitchCase(variable_value_menu) {
  22072. var commands_block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22073. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SwitchCase);
  22074. this.type = COMMAND_TYPES.switchcase;
  22075. this.variable_value_menu = variable_value_menu;
  22076. this.commands_block = commands_block;
  22077. };
  22078. var FunctionCall = function FunctionCall(function_called, parameters_list) {
  22079. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCall);
  22080. this.type = COMMAND_TYPES.functioncall;
  22081. this.function_called = function_called;
  22082. this.parameters_list = parameters_list;
  22083. };
  22084. var VariableValueMenu = function VariableValueMenu() {
  22085. var variable_and_value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
  22086. var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  22087. var row = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  22088. var column = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  22089. var include_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  22090. var dimensions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  22091. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, VariableValueMenu);
  22092. this.type = "var_value";
  22093. this.variable_and_value = variable_and_value;
  22094. this.content = content;
  22095. this.row = row;
  22096. this.column = column;
  22097. this.include_constant = include_constant;
  22098. this.dimensions = dimensions;
  22099. };
  22100. var FunctionCallMenu = function FunctionCallMenu() {
  22101. var function_called = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  22102. var parameters_list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22103. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCallMenu);
  22104. this.type = "function_call";
  22105. this.function_called = function_called;
  22106. this.parameters_list = parameters_list;
  22107. };
  22108. var Program = /*#__PURE__*/function () {
  22109. function Program() {
  22110. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Program);
  22111. this.functions = [];
  22112. this.globals = [];
  22113. }
  22114. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default()(Program, [{
  22115. key: "addFunction",
  22116. value: function addFunction(function_to_add) {
  22117. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.parameters_list, function () {
  22118. if (window.insertContext) {
  22119. setTimeout(function () {
  22120. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22121. }, 300);
  22122. window.insertContext = false;
  22123. } else {
  22124. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22125. }
  22126. }, 1);
  22127. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.variables_list, function () {
  22128. if (window.insertContext) {
  22129. setTimeout(function () {
  22130. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22131. }, 300);
  22132. window.insertContext = false;
  22133. } else {
  22134. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22135. }
  22136. }, 1);
  22137. this.functions.push(function_to_add);
  22138. }
  22139. }, {
  22140. key: "addVariable",
  22141. value: function addVariable(function_to_receive, variable) {
  22142. if (this.functions[function_to_receive].variable === null) {
  22143. this.functions[function_to_receive].variables_list = [];
  22144. }
  22145. this.functions[function_to_receive].variables_list.push(variable);
  22146. }
  22147. }, {
  22148. key: "addGlobal",
  22149. value: function addGlobal(variable) {
  22150. this.globals.push(variable);
  22151. }
  22152. }]);
  22153. return Program;
  22154. }();
  22155. /***/ }),
  22156. /***/ "./js/visualUI/text_editor.js":
  22157. /*!************************************!*\
  22158. !*** ./js/visualUI/text_editor.js ***!
  22159. \************************************/
  22160. /*! exports provided: initTextEditor, disable, updateEditor, setCode, getCode */
  22161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22162. "use strict";
  22163. __webpack_require__.r(__webpack_exports__);
  22164. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initTextEditor", function() { return initTextEditor; });
  22165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disable", function() { return disable; });
  22166. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateEditor", function() { return updateEditor; });
  22167. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCode", function() { return setCode; });
  22168. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  22169. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! codemirror */ "./node_modules/codemirror/lib/codemirror.js");
  22170. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  22171. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! codemirror/addon/edit/closebrackets */ "./node_modules/codemirror/addon/edit/closebrackets.js");
  22172. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__);
  22173. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! codemirror/addon/edit/matchbrackets */ "./node_modules/codemirror/addon/edit/matchbrackets.js");
  22174. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__);
  22175. /* 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");
  22176. /* 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__);
  22177. /* harmony import */ var _util_editorMode2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../util/editorMode2 */ "./js/util/editorMode2.js");
  22178. // import "codemirror/addon/hint/show-hint";
  22179. // import "codemirror/addon/hint/anyword-hint";
  22180. Object(_util_editorMode2__WEBPACK_IMPORTED_MODULE_4__["CodeEditorMode"])(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  22181. var codeEditor = null;
  22182. function initTextEditor(element) {
  22183. var id = element;
  22184. if (element[0] == '#') {
  22185. id = element.substring(1);
  22186. }
  22187. codeEditor = codemirror__WEBPACK_IMPORTED_MODULE_0__["fromTextArea"](document.getElementById(id), {
  22188. theme: "ttcn",
  22189. value: "",
  22190. mode: "text/x-ivprog",
  22191. indentUnit: 4,
  22192. lineNumbers: true,
  22193. matchBrackets: true,
  22194. autoCloseBrackets: true,
  22195. fixedGutter: true,
  22196. styleActiveLine: true,
  22197. readOnly: true
  22198. });
  22199. }
  22200. function disable(flag) {
  22201. codeEditor.setOption("readOnly", flag);
  22202. updateEditor();
  22203. }
  22204. function updateEditor() {
  22205. codeEditor.refresh();
  22206. }
  22207. function setCode(code) {
  22208. codeEditor.setValue(code);
  22209. }
  22210. function getCode() {
  22211. return codeEditor.getValue();
  22212. }
  22213. /***/ }),
  22214. /***/ "./js/visualUI/types.js":
  22215. /*!******************************!*\
  22216. !*** ./js/visualUI/types.js ***!
  22217. \******************************/
  22218. /*! exports provided: Types */
  22219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22220. "use strict";
  22221. __webpack_require__.r(__webpack_exports__);
  22222. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Types", function() { return Types; });
  22223. var Types = Object.freeze({
  22224. INTEGER: "integer",
  22225. REAL: "real",
  22226. TEXT: "text",
  22227. CHAR: 'char',
  22228. BOOLEAN: "boolean",
  22229. VOID: "void"
  22230. });
  22231. /***/ }),
  22232. /***/ "./js/visualUI/utils.js":
  22233. /*!******************************!*\
  22234. !*** ./js/visualUI/utils.js ***!
  22235. \******************************/
  22236. /*! exports provided: renderErrorMessage */
  22237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22238. "use strict";
  22239. __webpack_require__.r(__webpack_exports__);
  22240. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderErrorMessage", function() { return renderErrorMessage; });
  22241. function renderErrorMessage(dom_obj_target, message_text) {
  22242. dom_obj_target.popup({
  22243. html: '<i class="ui icon inverted exclamation triangle yellow"></i>' + message_text,
  22244. transition: "fade up",
  22245. on: 'click',
  22246. closable: true,
  22247. movePopup: true,
  22248. boundary: window,
  22249. preserve: false,
  22250. target: false,
  22251. className: {
  22252. popup: 'ui popup invalid-identifier'
  22253. },
  22254. onHidden: function onHidden($module) {
  22255. dom_obj_target.popup('destroy');
  22256. }
  22257. }).popup('toggle');
  22258. }
  22259. /***/ }),
  22260. /***/ "./js/visualUI/variables.js":
  22261. /*!**********************************!*\
  22262. !*** ./js/visualUI/variables.js ***!
  22263. \**********************************/
  22264. /*! exports provided: addVariable, renderVariable */
  22265. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22266. "use strict";
  22267. __webpack_require__.r(__webpack_exports__);
  22268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVariable", function() { return addVariable; });
  22269. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderVariable", function() { return renderVariable; });
  22270. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  22271. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  22272. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  22273. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  22274. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  22275. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  22276. var counter_new_variables = 0;
  22277. function addVariable(function_obj, function_container) {
  22278. var is_in_click = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  22279. 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);
  22280. if (function_obj.variables_list == null) {
  22281. function_obj.variables_list = [];
  22282. }
  22283. function_obj.variables_list.push(new_var);
  22284. counter_new_variables++;
  22285. 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);
  22286. var newe = renderVariable(function_container, new_var, function_obj);
  22287. if (is_in_click) {
  22288. newe.css('display', 'none');
  22289. newe.fadeIn();
  22290. }
  22291. }
  22292. function updateName(variable_obj, new_name, variable_obj_dom, function_obj) {
  22293. if (variable_obj.name == new_name) {
  22294. return;
  22295. }
  22296. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_5__["isValidIdentifier"])(new_name)) {
  22297. if (variableNameAlreadyExists(new_name, function_obj)) {
  22298. _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]));
  22299. } else {
  22300. 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);
  22301. variable_obj.name = new_name;
  22302. }
  22303. } else {
  22304. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  22305. }
  22306. }
  22307. function variableNameAlreadyExists(name_var, function_obj) {
  22308. if (function_obj.parameters_list) {
  22309. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  22310. if (function_obj.parameters_list[i].name == name_var) {
  22311. return true;
  22312. }
  22313. }
  22314. }
  22315. if (function_obj.variables_list) {
  22316. for (var i = 0; i < function_obj.variables_list.length; i++) {
  22317. if (function_obj.variables_list[i].name == name_var) {
  22318. return true;
  22319. }
  22320. }
  22321. }
  22322. return false;
  22323. }
  22324. function removeVariable(variable_obj, variable_container, function_name) {
  22325. var function_associated = variable_container.data('associatedFunction');
  22326. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_FUNCTION_VAR, variable_obj.name);
  22327. var index = function_associated.variables_list.indexOf(variable_obj);
  22328. if (index > -1) {
  22329. window.insertContext = true;
  22330. delete function_associated.variables_list[index];
  22331. function_associated.variables_list.splice(index, 1);
  22332. }
  22333. variable_container.children().off();
  22334. variable_container.off();
  22335. variable_container.fadeOut();
  22336. }
  22337. function updateType(variable_obj, new_type, function_name) {
  22338. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  22339. variable_obj.type = new_type;
  22340. variable_obj.dimensions = new_dimensions;
  22341. if (new_dimensions > 0) {
  22342. variable_obj.rows = new_dimensions;
  22343. variable_obj.columns = 2;
  22344. }
  22345. 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);
  22346. updateInitialValues(variable_obj, function_name);
  22347. }
  22348. function addHandlers(variable_obj, variable_container, function_obj) {
  22349. // Manage variable name:
  22350. variable_container.find(".editing_name_var").on('click', function (e) {
  22351. 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);
  22352. enableNameUpdate(variable_obj, variable_container, function_obj);
  22353. }); // Menu to change type:
  22354. variable_container.find('.ui.dropdown.variable_type').dropdown({
  22355. onChange: function onChange(_, __, $selectedItem) {
  22356. if ($selectedItem.data('dimensions')) {
  22357. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  22358. } else {
  22359. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  22360. }
  22361. renderValues(variable_obj, variable_container, function_obj.name);
  22362. },
  22363. selectOnKeydown: false
  22364. }); // Remove variable:
  22365. variable_container.find(".remove_variable").on('click', function (e) {
  22366. removeVariable(variable_obj, variable_container, function_obj.name);
  22367. });
  22368. }
  22369. function renderVariable(function_container, new_var, function_obj) {
  22370. var element = '<div class="ui label variable_container pink"><i class="ui icon ellipsis vertical inverted"></i>';
  22371. element += '<div class="ui dropdown variable_type">';
  22372. if (new_var.dimensions == 1) {
  22373. 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()));
  22374. element += ' [ ] </div>';
  22375. } else if (new_var.dimensions == 2) {
  22376. 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()));
  22377. element += ' [ ] [ ] </div>';
  22378. } else {
  22379. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase())) + '</div>';
  22380. }
  22381. element += '<div class="menu">';
  22382. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22383. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22384. continue;
  22385. }
  22386. 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>';
  22387. }
  22388. 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">';
  22389. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22390. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22391. continue;
  22392. }
  22393. 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>';
  22394. }
  22395. element += '</div></div>';
  22396. 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">';
  22397. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22398. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22399. continue;
  22400. }
  22401. 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>';
  22402. }
  22403. element += '</div></div>';
  22404. element += '</div></div> ';
  22405. element += '<div class="editing_name_var"><span class="span_name_variable enable_edit_name_variable">' + new_var.name + '</span> </div>';
  22406. element += ' <span class="character_equals"> <&#8212; </span> <div class="ui div_valor_var">' + new_var.value + '</div>';
  22407. element += ' <i class="yellow inverted icon times remove_variable"></i></div>';
  22408. element = $(element);
  22409. element.data('associatedFunction', function_obj);
  22410. function_container.find('.variables_list_div').append(element);
  22411. addHandlers(new_var, element, function_obj);
  22412. renderValues(new_var, element, function_obj.name);
  22413. return element;
  22414. }
  22415. function updateColumnsAndRowsText(variable_container, variable_var) {
  22416. var prev = variable_container.find('.text').text().split('[');
  22417. if (prev.length == 2) {
  22418. var ff = prev[0] + '[ ' + variable_var.columns + ' ] ';
  22419. variable_container.find('.text').empty();
  22420. variable_container.find('.text').text(ff);
  22421. }
  22422. if (prev.length == 3) {
  22423. var ff = prev[0] + '[ ' + variable_var.columns + ' ] [ ' + variable_var.rows + ' ] ';
  22424. variable_container.find('.text').empty();
  22425. variable_container.find('.text').text(ff);
  22426. }
  22427. }
  22428. function renderValues(new_var, variable_container, function_name) {
  22429. var ret = "";
  22430. var j = 0;
  22431. if (new_var.dimensions == 0) {
  22432. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22433. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value.toFixed(1) + '</span> </div> ';
  22434. } else {
  22435. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22436. 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> ';
  22437. } else {
  22438. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value + '</span> </div> ';
  22439. }
  22440. }
  22441. } else {
  22442. ret += '<table class="tabela_var">';
  22443. if (new_var.dimensions == 1) {
  22444. ret += '<tr>';
  22445. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22446. for (var k = 0; k < new_var.columns; k++) {
  22447. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k].toFixed(1) + '</span></td>';
  22448. }
  22449. } else {
  22450. for (var k = 0; k < new_var.columns; k++) {
  22451. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22452. 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>';
  22453. } else {
  22454. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k] + '</span>' + '</td>';
  22455. }
  22456. }
  22457. }
  22458. ret += '</tr>';
  22459. ret += '</table>';
  22460. 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>';
  22461. }
  22462. if (new_var.dimensions == 2) {
  22463. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22464. for (var l = 0; l < new_var.rows; l++) {
  22465. ret += '<tr>';
  22466. for (var k = 0; k < new_var.columns; k++) {
  22467. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  22468. }
  22469. ret += '</tr>';
  22470. }
  22471. } else {
  22472. for (var l = 0; l < new_var.rows; l++) {
  22473. ret += '<tr>';
  22474. for (var k = 0; k < new_var.columns; k++) {
  22475. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22476. 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>';
  22477. } else {
  22478. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k] + '</span></td>';
  22479. }
  22480. }
  22481. ret += '</tr>';
  22482. }
  22483. }
  22484. if (new_var.rows == 0) {
  22485. ret += '<tr><td></td></tr>';
  22486. }
  22487. 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>';
  22488. ret += '</table>';
  22489. 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>';
  22490. }
  22491. }
  22492. $(variable_container).find(".div_valor_var").html('');
  22493. ret = $(ret);
  22494. $(ret).find('.span_value_variable').data('associatedOject', new_var);
  22495. $(ret).find(".boolean_simple_type").on('click', function (e) {
  22496. 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);
  22497. alternateBooleanValue(new_var, this.parentNode);
  22498. });
  22499. $(ret).find(".simple_var").on('click', function (e) {
  22500. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  22501. enableValueUpdate(new_var, this.parentNode, function_name);
  22502. });
  22503. $(ret).find(".boolean_vector_var").on('click', function (e) {
  22504. alternateBooleanVectorValue(new_var, $(this).data('index'), this.parentNode);
  22505. 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);
  22506. });
  22507. $(ret).find(".vector_var").on('click', function (e) {
  22508. enableVectorValueUpdate(new_var, $(this).data('index'), this.parentNode, function_name);
  22509. });
  22510. $(ret).find(".remove_global_vector_column").on('click', function (e) {
  22511. removeColumnVector(new_var);
  22512. 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);
  22513. 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);
  22514. $(variable_container).find(".div_valor_var").html('');
  22515. renderValues(new_var, variable_container, function_name);
  22516. });
  22517. $(ret).find(".add_global_vector_column").on('click', function (e) {
  22518. addColumnVector(new_var);
  22519. 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);
  22520. 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);
  22521. $(variable_container).find(".div_valor_var").html('');
  22522. renderValues(new_var, variable_container, function_name);
  22523. });
  22524. $(ret).find(".remove_global_matrix_column").on('click', function (e) {
  22525. removeColumnMatrix(new_var);
  22526. 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);
  22527. 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);
  22528. $(variable_container).find(".div_valor_var").html('');
  22529. renderValues(new_var, variable_container, function_name);
  22530. });
  22531. $(ret).find(".add_global_matrix_column").on('click', function (e) {
  22532. addColumnMatrix(new_var);
  22533. 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);
  22534. 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);
  22535. $(variable_container).find(".div_valor_var").html('');
  22536. renderValues(new_var, variable_container, function_name);
  22537. });
  22538. $(ret).find(".remove_global_matrix_line").on('click', function (e) {
  22539. removeLineMatrix(new_var);
  22540. 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);
  22541. 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);
  22542. $(variable_container).find(".div_valor_var").html('');
  22543. renderValues(new_var, variable_container, function_name);
  22544. });
  22545. $(ret).find(".add_global_matrix_line").on('click', function (e) {
  22546. addLineMatrix(new_var);
  22547. 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);
  22548. 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);
  22549. $(variable_container).find(".div_valor_var").html('');
  22550. renderValues(new_var, variable_container, function_name);
  22551. });
  22552. $(ret).find(".boolean_matrix_var").on('click', function (e) {
  22553. alternateBooleanMatrixValue(new_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  22554. 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);
  22555. });
  22556. $(ret).find(".matrix_var").on('click', function (e) {
  22557. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  22558. enableMatrixValueUpdate(new_var, $(this).data('row'), $(this).data('index'), this.parentNode, function_name);
  22559. });
  22560. $(variable_container).find(".div_valor_var").append(ret);
  22561. updateColumnsAndRowsText(variable_container, new_var);
  22562. }
  22563. function alternateBooleanMatrixValue(var_obj, row, index, value_container) {
  22564. var_obj.value[row][index] = !var_obj.value[row][index];
  22565. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[row][index])));
  22566. }
  22567. function addLineMatrix(var_obj) {
  22568. var_obj.rows++;
  22569. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22570. var n_l = [];
  22571. for (var i = 0; i < var_obj.columns; i++) {
  22572. n_l.push(0);
  22573. }
  22574. var_obj.value.push(n_l);
  22575. }
  22576. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22577. var n_l = [];
  22578. for (i = 0; i < var_obj.columns; i++) {
  22579. n_l.push(0.0);
  22580. }
  22581. var_obj.value.push(n_l);
  22582. }
  22583. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22584. var n_l = [];
  22585. for (i = 0; i < var_obj.columns; i++) {
  22586. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22587. }
  22588. var_obj.value.push(n_l);
  22589. }
  22590. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22591. var n_l = [];
  22592. for (i = 0; i < var_obj.columns; i++) {
  22593. n_l.push(true);
  22594. }
  22595. var_obj.value.push(n_l);
  22596. }
  22597. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22598. var n_l = [];
  22599. for (i = 0; i < var_obj.columns; i++) {
  22600. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22601. }
  22602. var_obj.value.push(n_l);
  22603. }
  22604. }
  22605. function removeLineMatrix(var_obj) {
  22606. if (var_obj.rows == 0) {
  22607. return;
  22608. }
  22609. var_obj.rows--;
  22610. var_obj.value.splice(var_obj.value.length - 1, 1);
  22611. }
  22612. function addColumnMatrix(var_obj) {
  22613. var_obj.columns++;
  22614. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22615. for (var i = 0; i < var_obj.rows; i++) {
  22616. var_obj.value[i].push(0);
  22617. }
  22618. }
  22619. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22620. for (var i = 0; i < var_obj.rows; i++) {
  22621. var_obj.value[i].push(0.0);
  22622. }
  22623. }
  22624. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22625. for (var i = 0; i < var_obj.rows; i++) {
  22626. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22627. }
  22628. }
  22629. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22630. for (var i = 0; i < var_obj.rows; i++) {
  22631. var_obj.value[i].push(true);
  22632. }
  22633. }
  22634. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22635. for (var i = 0; i < var_obj.rows; i++) {
  22636. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22637. }
  22638. }
  22639. }
  22640. function removeColumnMatrix(var_obj) {
  22641. if (var_obj.columns == 0) {
  22642. return;
  22643. }
  22644. var_obj.columns--;
  22645. for (var i = 0; i < var_obj.rows; i++) {
  22646. var_obj.value[i].splice(var_obj.value[i].length - 1, 1);
  22647. }
  22648. }
  22649. function addColumnVector(var_obj) {
  22650. var_obj.columns++;
  22651. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22652. var_obj.value.push(0);
  22653. }
  22654. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22655. var_obj.value.push(0.0);
  22656. }
  22657. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22658. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22659. }
  22660. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22661. var_obj.value.push(true);
  22662. }
  22663. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22664. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22665. }
  22666. }
  22667. function removeColumnVector(var_obj) {
  22668. if (var_obj.columns == 0) {
  22669. return;
  22670. }
  22671. var_obj.columns--;
  22672. var_obj.value.splice(var_obj.value.length - 1, 1);
  22673. }
  22674. function alternateBooleanValue(var_obj, value_container) {
  22675. var_obj.value = !var_obj.value;
  22676. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value)));
  22677. }
  22678. function alternateBooleanVectorValue(var_obj, index, value_container) {
  22679. var_obj.value[index] = !var_obj.value[index];
  22680. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[index])));
  22681. }
  22682. function updateInitialValues(variable_obj, function_name) {
  22683. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22684. if (variable_obj.dimensions == 0) {
  22685. variable_obj.value = 0;
  22686. }
  22687. if (variable_obj.dimensions == 1) {
  22688. variable_obj.value = [0, 0];
  22689. }
  22690. if (variable_obj.dimensions == 2) {
  22691. variable_obj.value = [[0, 0], [0, 0]];
  22692. }
  22693. }
  22694. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22695. if (variable_obj.dimensions == 0) {
  22696. variable_obj.value = 0.0;
  22697. }
  22698. if (variable_obj.dimensions == 1) {
  22699. variable_obj.value = [0.0, 0.0];
  22700. }
  22701. if (variable_obj.dimensions == 2) {
  22702. variable_obj.value = [[0.0, 0.0], [0.0, 0.0]];
  22703. }
  22704. }
  22705. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22706. if (variable_obj.dimensions == 0) {
  22707. variable_obj.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  22708. }
  22709. if (variable_obj.dimensions == 1) {
  22710. 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')];
  22711. }
  22712. if (variable_obj.dimensions == 2) {
  22713. 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')]];
  22714. }
  22715. }
  22716. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22717. if (variable_obj.dimensions == 0) {
  22718. variable_obj.value = true;
  22719. }
  22720. if (variable_obj.dimensions == 1) {
  22721. variable_obj.value = [true, true];
  22722. }
  22723. if (variable_obj.dimensions == 2) {
  22724. variable_obj.value = [[true, true], [true, true]];
  22725. }
  22726. }
  22727. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22728. if (variable_obj.dimensions == 0) {
  22729. variable_obj.value = 'A';
  22730. }
  22731. if (variable_obj.dimensions == 1) {
  22732. variable_obj.value = ['A', 'A'];
  22733. }
  22734. if (variable_obj.dimensions == 2) {
  22735. variable_obj.value = [['A', 'A'], ['A', 'A']];
  22736. }
  22737. }
  22738. 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);
  22739. }
  22740. var opened_name_value_vector_global_ = false;
  22741. var opened_input_value_vector_global_ = null;
  22742. function enableVectorValueUpdate(var_obj, index, parent_node, function_name) {
  22743. if (opened_name_value_vector_global_) {
  22744. opened_input_value_vector_global_.focus();
  22745. return;
  22746. }
  22747. parent_node = $(parent_node);
  22748. opened_name_value_vector_global_ = true;
  22749. parent_node.find('.span_value_variable').text('');
  22750. var input_field;
  22751. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22752. 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) + "' />");
  22753. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22754. } else {
  22755. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[index] + "' />");
  22756. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22757. }
  22758. input_field.on('input', function () {
  22759. var inputWidth = input_field.textWidth() + 10;
  22760. opened_input_value_vector_global_ = input_field;
  22761. input_field.focus();
  22762. var tmpStr = input_field.val();
  22763. input_field.val('');
  22764. input_field.val(tmpStr);
  22765. input_field.css({
  22766. width: inputWidth
  22767. });
  22768. }).trigger('input');
  22769. input_field.focusout(function () {
  22770. var changed = false; /// update array:
  22771. if (input_field.val().trim()) {
  22772. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22773. var_obj.value[index] = parseFloat(input_field.val().trim());
  22774. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22775. } else {
  22776. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22777. var_obj.value[index] = parseInt(input_field.val().trim());
  22778. } else {
  22779. var_obj.value[index] = input_field.val().trim();
  22780. }
  22781. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22782. }
  22783. changed = true;
  22784. } else {
  22785. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22786. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22787. } else {
  22788. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22789. }
  22790. }
  22791. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22792. var_obj.value[index] = input_field.val();
  22793. changed = true;
  22794. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22795. }
  22796. if (changed) {
  22797. 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);
  22798. }
  22799. input_field.off();
  22800. input_field.remove(); /// update elements:
  22801. opened_name_value_vector_global_ = false;
  22802. opened_input_value_vector_global_ = false;
  22803. });
  22804. input_field.on('keydown', function (e) {
  22805. var code = e.keyCode || e.which;
  22806. var changed = false;
  22807. if (code == 13) {
  22808. if (input_field.val().trim()) {
  22809. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22810. var_obj.value[index] = parseFloat(input_field.val().trim());
  22811. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22812. } else {
  22813. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22814. var_obj.value[index] = parseInt(input_field.val().trim());
  22815. } else {
  22816. var_obj.value[index] = input_field.val().trim();
  22817. }
  22818. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22819. }
  22820. changed = true;
  22821. } else {
  22822. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22823. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22824. } else {
  22825. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22826. }
  22827. }
  22828. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22829. var_obj.value[index] = input_field.val();
  22830. changed = true;
  22831. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22832. }
  22833. if (changed) {
  22834. 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);
  22835. }
  22836. input_field.off();
  22837. input_field.remove(); /// update elements:
  22838. opened_name_value_vector_global_ = false;
  22839. opened_input_value_vector_global_ = false;
  22840. }
  22841. if (code == 27) {
  22842. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22843. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22844. } else {
  22845. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22846. }
  22847. input_field.off();
  22848. input_field.remove(); /// update elements:
  22849. opened_name_value_vector_global_ = false;
  22850. opened_input_value_vector_global_ = false;
  22851. }
  22852. });
  22853. input_field.select();
  22854. }
  22855. var opened_name_value_global_var = false;
  22856. var opened_input_value_global_ar = null;
  22857. function enableValueUpdate(var_obj, parent_node, function_name) {
  22858. if (opened_name_value_global_var) {
  22859. opened_input_value_global_ar.focus();
  22860. return;
  22861. }
  22862. parent_node = $(parent_node);
  22863. opened_name_value_global_var = true;
  22864. var input_field;
  22865. parent_node.find('.span_value_variable').text('');
  22866. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22867. 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) + "' />");
  22868. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22869. } else {
  22870. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value + "' />");
  22871. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22872. }
  22873. input_field.on('input', function () {
  22874. var inputWidth = input_field.textWidth() + 10;
  22875. opened_input_value_global_ar = input_field;
  22876. input_field.focus();
  22877. var tmpStr = input_field.val();
  22878. input_field.val('');
  22879. input_field.val(tmpStr);
  22880. input_field.css({
  22881. width: inputWidth
  22882. });
  22883. }).trigger('input');
  22884. input_field.focusout(function () {
  22885. /// update array:
  22886. var changed = false;
  22887. if (input_field.val().trim()) {
  22888. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22889. var_obj.value = parseFloat(input_field.val().trim());
  22890. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22891. } else {
  22892. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22893. var_obj.value = parseInt(input_field.val().trim());
  22894. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22895. var_obj.value = input_field.val().charAt(0);
  22896. } else {
  22897. var_obj.value = input_field.val().trim();
  22898. }
  22899. parent_node.find('.span_value_variable').text(var_obj.value);
  22900. }
  22901. changed = true;
  22902. } else {
  22903. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22904. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22905. } else {
  22906. parent_node.find('.span_value_variable').text(var_obj.value);
  22907. }
  22908. }
  22909. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22910. var_obj.value = input_field.val();
  22911. changed = true;
  22912. parent_node.find('.span_value_variable').text(var_obj.value);
  22913. }
  22914. if (changed) {
  22915. 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);
  22916. }
  22917. input_field.off();
  22918. input_field.remove(); /// update elements:
  22919. opened_name_value_global_var = false;
  22920. opened_input_value_global_ar = false;
  22921. });
  22922. input_field.on('keydown', function (e) {
  22923. var code = e.keyCode || e.which;
  22924. var changed = false;
  22925. if (code == 13) {
  22926. if (input_field.val().trim()) {
  22927. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22928. var_obj.value = parseFloat(input_field.val().trim());
  22929. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22930. } else {
  22931. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22932. var_obj.value = parseInt(input_field.val().trim());
  22933. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22934. var_obj.value = input_field.val().charAt(0);
  22935. } else {
  22936. var_obj.value = input_field.val().trim();
  22937. }
  22938. parent_node.find('.span_value_variable').text(var_obj.value);
  22939. }
  22940. changed = true;
  22941. } else {
  22942. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22943. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22944. } else {
  22945. parent_node.find('.span_value_variable').text(var_obj.value);
  22946. }
  22947. }
  22948. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22949. var_obj.value = input_field.val();
  22950. changed = true;
  22951. parent_node.find('.span_value_variable').text(var_obj.value);
  22952. }
  22953. if (changed) {
  22954. 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);
  22955. }
  22956. input_field.off();
  22957. input_field.remove(); /// update elements:
  22958. opened_name_value_global_var = false;
  22959. opened_input_value_global_ar = false;
  22960. }
  22961. if (code == 27) {
  22962. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22963. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22964. } else {
  22965. parent_node.find('.span_value_variable').text(var_obj.value);
  22966. }
  22967. input_field.off();
  22968. input_field.remove(); /// update elements:
  22969. opened_name_value_global_var = false;
  22970. opened_input_value_global_ar = false;
  22971. }
  22972. });
  22973. input_field.select();
  22974. }
  22975. var opened_name_global = false;
  22976. var opened_input_global = null;
  22977. function enableNameUpdate(variable_obj, variable_container, function_obj) {
  22978. if (opened_name_global) {
  22979. opened_input_global.focus();
  22980. return;
  22981. }
  22982. opened_name_global = true;
  22983. variable_container.find('.span_name_variable').text('');
  22984. var input_name;
  22985. input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + variable_obj.name + "' />");
  22986. input_name.insertBefore(variable_container.find('.span_name_variable'));
  22987. input_name.on('input', function () {
  22988. var inputWidth = input_name.textWidth() + 10;
  22989. opened_input_global = input_name;
  22990. input_name.focus();
  22991. var tmpStr = input_name.val();
  22992. input_name.val('');
  22993. input_name.val(tmpStr);
  22994. input_name.css({
  22995. width: inputWidth
  22996. });
  22997. }).trigger('input');
  22998. input_name.focusout(function () {
  22999. /// update array:
  23000. if (input_name.val().trim().length > 0) {
  23001. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  23002. variable_container.find('.span_name_variable').text(variable_obj.name);
  23003. } else {
  23004. variable_container.find('.span_name_variable').text(variable_obj.name);
  23005. }
  23006. input_name.off();
  23007. input_name.remove(); /// update elements:
  23008. opened_name_global = false;
  23009. opened_input_global = false;
  23010. });
  23011. input_name.on('keydown', function (e) {
  23012. var code = e.keyCode || e.which;
  23013. if (code == 13) {
  23014. if (input_name.val().trim().length > 0) {
  23015. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  23016. variable_container.find('.span_name_variable').text(variable_obj.name);
  23017. } else {
  23018. variable_container.find('.span_name_variable').text(variable_obj.name);
  23019. }
  23020. input_name.off();
  23021. input_name.remove(); /// update elements:
  23022. opened_name_global = false;
  23023. opened_input_global = false;
  23024. }
  23025. if (code == 27) {
  23026. variable_container.find('.span_name_variable').text(variable_obj.name);
  23027. input_name.off();
  23028. input_name.remove(); /// update elements:
  23029. opened_name_global = false;
  23030. opened_input_global = false;
  23031. }
  23032. });
  23033. input_name.select();
  23034. }
  23035. var opened_name_value_matrix_global_v = false;
  23036. var opened_input_value_matrix_global_v = null;
  23037. function enableMatrixValueUpdate(var_obj, row, index, parent_node, function_name) {
  23038. if (opened_name_value_matrix_global_v) {
  23039. opened_input_value_matrix_global_v.focus();
  23040. return;
  23041. }
  23042. parent_node = $(parent_node);
  23043. opened_name_value_matrix_global_v = true;
  23044. parent_node.find('.span_value_variable').text('');
  23045. var input_field;
  23046. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23047. 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) + "' />");
  23048. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23049. } else {
  23050. 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] + "' />");
  23051. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23052. }
  23053. input_field.on('input', function () {
  23054. var inputWidth = input_field.textWidth() + 10;
  23055. opened_input_value_matrix_global_v = input_field;
  23056. input_field.focus();
  23057. var tmpStr = input_field.val();
  23058. input_field.val('');
  23059. input_field.val(tmpStr);
  23060. input_field.css({
  23061. width: inputWidth
  23062. });
  23063. }).trigger('input');
  23064. input_field.focusout(function () {
  23065. var changed = false; /// update array:
  23066. if (input_field.val().trim()) {
  23067. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23068. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  23069. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23070. } else {
  23071. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23072. var_obj.value[row][index] = parseInt(input_field.val().trim());
  23073. } else {
  23074. var_obj.value[row][index] = input_field.val().trim();
  23075. }
  23076. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23077. }
  23078. changed = true;
  23079. } else {
  23080. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23081. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23082. } else {
  23083. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23084. }
  23085. }
  23086. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23087. var_obj.value[row][index] = input_field.val();
  23088. changed = true;
  23089. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23090. }
  23091. if (changed) {
  23092. 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);
  23093. }
  23094. input_field.off();
  23095. input_field.remove(); /// update elements:
  23096. opened_name_value_matrix_global_v = false;
  23097. opened_input_value_matrix_global_v = false;
  23098. });
  23099. input_field.on('keydown', function (e) {
  23100. var code = e.keyCode || e.which;
  23101. var changed = false;
  23102. if (code == 13) {
  23103. if (input_field.val().trim()) {
  23104. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23105. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  23106. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23107. } else {
  23108. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23109. var_obj.value[row][index] = parseInt(input_field.val().trim());
  23110. } else {
  23111. var_obj.value[row][index] = input_field.val().trim();
  23112. }
  23113. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23114. }
  23115. changed = true;
  23116. } else {
  23117. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23118. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23119. } else {
  23120. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23121. }
  23122. }
  23123. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23124. var_obj.value[row][index] = input_field.val();
  23125. changed = true;
  23126. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23127. }
  23128. if (changed) {
  23129. 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);
  23130. }
  23131. input_field.off();
  23132. input_field.remove(); /// update elements:
  23133. opened_name_value_matrix_global_v = false;
  23134. opened_input_value_matrix_global_v = false;
  23135. }
  23136. if (code == 27) {
  23137. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23138. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23139. } else {
  23140. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23141. }
  23142. input_field.off();
  23143. input_field.remove(); /// update elements:
  23144. opened_name_value_matrix_global_v = false;
  23145. opened_input_value_matrix_global_v = false;
  23146. }
  23147. });
  23148. input_field.select();
  23149. }
  23150. /***/ })
  23151. /******/ });
  23152. });
  23153. //# sourceMappingURL=main.308b4036355a0af3793b.js.map