main.178e3d646fb79d7bafa6.js 1.3 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656
  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 14_55\"}");
  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-2474mOd5E2PQ6MQt/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-2474J5WqSkHlkoXa/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. console.log('rendering algorithm');
  14584. $('.all_functions').children().off();
  14585. $('.all_functions').empty();
  14586. $('.list_globals').children().off();
  14587. $('.list_globals').empty();
  14588. for (var i = 0; i < window.program_obj.functions.length; i++) {
  14589. _functions__WEBPACK_IMPORTED_MODULE_1__["renderFunction"](window.program_obj.functions[i]);
  14590. }
  14591. for (var i = 0; i < window.program_obj.globals.length; i++) {
  14592. _globals__WEBPACK_IMPORTED_MODULE_0__["renderGlobal"](window.program_obj.globals[i]);
  14593. }
  14594. setTimeout(function () {
  14595. window.block_render = false;
  14596. }, 100);
  14597. console.log('fim do render');
  14598. if (settingsFilter && settingsFilter[0]) {
  14599. blockAllEditingOptions();
  14600. }
  14601. }
  14602. /***/ }),
  14603. /***/ "./js/visualUI/code_generator.js":
  14604. /*!***************************************!*\
  14605. !*** ./js/visualUI/code_generator.js ***!
  14606. \***************************************/
  14607. /*! exports provided: generate */
  14608. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14609. "use strict";
  14610. __webpack_require__.r(__webpack_exports__);
  14611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
  14612. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  14613. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  14614. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14615. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  14616. /* eslint-disable @typescript-eslint/no-use-before-define */
  14617. /* globals $*/
  14618. function generate() {
  14619. $(".ivprog_visual_panel").find(".error_icon").remove();
  14620. var code = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("program") + " { ";
  14621. code += globalsCode();
  14622. code += "\n";
  14623. var has_error = false;
  14624. for (var i = 0; i < window.program_obj.functions.length; i++) {
  14625. var n_code = functionsCode(window.program_obj.functions[i]);
  14626. if (n_code == null) {
  14627. has_error = true;
  14628. }
  14629. code += n_code;
  14630. code += "\n";
  14631. }
  14632. code += "\n}";
  14633. if (has_error) {
  14634. return null;
  14635. } else {
  14636. return code;
  14637. }
  14638. }
  14639. function functionsCode(function_obj) {
  14640. var ret = "\n\t" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + " ";
  14641. var has_error = false;
  14642. switch (function_obj.return_type) {
  14643. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  14644. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  14645. break;
  14646. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  14647. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  14648. break;
  14649. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  14650. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  14651. break;
  14652. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  14653. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  14654. break;
  14655. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  14656. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  14657. break;
  14658. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID:
  14659. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_void");
  14660. break;
  14661. }
  14662. ret += " ";
  14663. if (function_obj.return_dimensions == 1) {
  14664. ret += "[] ";
  14665. } else if (function_obj.return_dimensions == 2) {
  14666. ret += "[][] ";
  14667. }
  14668. if (function_obj.is_main) {
  14669. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("start");
  14670. } else {
  14671. ret += function_obj.name;
  14672. }
  14673. ret += " ( ";
  14674. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  14675. ret += parametersCode(function_obj.parameters_list[j]);
  14676. if (j + 1 < function_obj.parameters_list.length) {
  14677. ret += ", ";
  14678. }
  14679. }
  14680. ret += " ) {";
  14681. for (var _j = 0; _j < function_obj.variables_list.length; _j++) {
  14682. ret += variablesCode(function_obj.variables_list[_j]);
  14683. }
  14684. for (var _j2 = 0; _j2 < function_obj.commands.length; _j2++) {
  14685. //try {
  14686. ret += commandsCode(function_obj.commands[_j2]);
  14687. /*} catch (err) {
  14688. has_error = true;
  14689. console.error(err.message);
  14690. var todos = $('body').find('.command_container');
  14691. for (var i = 0; i < todos.length; i++) {
  14692. if ($(todos[i]).data('command') == function_obj.commands[j]) {
  14693. $( todos[i] ).prepend( ' <i class="ui icon red exclamation triangle error_icon"></i> ' );
  14694. break;
  14695. }
  14696. }
  14697. }*/
  14698. }
  14699. ret += "\n\t}";
  14700. if (has_error) {
  14701. return null;
  14702. } else {
  14703. return ret;
  14704. }
  14705. }
  14706. function commandsCode(command_obj) {
  14707. var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  14708. switch (command_obj.type) {
  14709. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["break"]:
  14710. return breaksCode(command_obj, indentation);
  14711. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].comment:
  14712. return commentsCode(command_obj, indentation);
  14713. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].reader:
  14714. return readersCode(command_obj, indentation);
  14715. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer:
  14716. return writersCode(command_obj, indentation);
  14717. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].functioncall:
  14718. return functioncallsCode(command_obj, indentation);
  14719. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution:
  14720. return attributionsCode(command_obj, indentation);
  14721. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].whiletrue:
  14722. return whiletruesCode(command_obj, indentation);
  14723. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].dowhiletrue:
  14724. return doWhilesCode(command_obj, indentation);
  14725. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].iftrue:
  14726. return iftruesCode(command_obj, indentation);
  14727. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].repeatNtimes:
  14728. return repeatNtimesCode(command_obj, indentation);
  14729. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["switch"]:
  14730. return switchsCode(command_obj, indentation);
  14731. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["return"]:
  14732. return returnsCode(command_obj, indentation);
  14733. }
  14734. }
  14735. function returnsCode(command_obj, indentation) {
  14736. var ret = "\n";
  14737. for (var i = 0; i < indentation; i++) {
  14738. ret += "\t";
  14739. }
  14740. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_return");
  14741. if (command_obj.variable_value_menu) {
  14742. try {
  14743. ret += " " + elementExpressionCode(command_obj.variable_value_menu); //ret += ' ' + variableValueMenuCode(command_obj.variable_value_menu, true);
  14744. } catch (err) {//Empty block
  14745. }
  14746. }
  14747. return ret;
  14748. }
  14749. function breaksCode(_command_obj, indentation) {
  14750. var ret = "\n";
  14751. for (var i = 0; i < indentation; i++) {
  14752. ret += "\t";
  14753. }
  14754. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_break");
  14755. return ret;
  14756. }
  14757. function switchsCode(command_obj, indentation) {
  14758. var ret = "\n";
  14759. for (var i = 0; i < indentation; i++) {
  14760. ret += "\t";
  14761. }
  14762. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_switch") + " ( ";
  14763. ret += variableValueMenuCode(command_obj.variable);
  14764. ret += " ) { ";
  14765. if (command_obj.cases) {
  14766. for (var _i = 0; _i < command_obj.cases.length; _i++) {
  14767. ret += switchcasesCode(command_obj.cases[_i], indentation + 1);
  14768. }
  14769. }
  14770. ret += "\n";
  14771. for (var _i2 = 0; _i2 < indentation; _i2++) {
  14772. ret += "\t";
  14773. }
  14774. ret += "} ";
  14775. return ret;
  14776. }
  14777. function switchcasesCode(switchcase, indentation) {
  14778. var ret = "\n";
  14779. for (var i = 0; i < indentation; i++) {
  14780. ret += "\t";
  14781. }
  14782. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_case") + " ";
  14783. ret += variableValueMenuCode(switchcase.variable_value_menu);
  14784. ret += " :";
  14785. if (switchcase.commands_block) {
  14786. for (var _i3 = 0; _i3 < switchcase.commands_block.length; _i3++) {
  14787. ret += commandsCode(switchcase.commands_block[_i3], indentation + 1);
  14788. }
  14789. }
  14790. return ret;
  14791. }
  14792. function repeatNtimesCode(command_obj, indentation) {
  14793. var ret = "\n";
  14794. for (var i = 0; i < indentation; i++) {
  14795. ret += "\t";
  14796. }
  14797. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_for") + " ";
  14798. if (command_obj.var_attribution) {
  14799. ret += variableValueMenuCode(command_obj.var_attribution);
  14800. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
  14801. ret += variableValueMenuCode(command_obj.expression1);
  14802. }
  14803. if (command_obj.expression2) {
  14804. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
  14805. ret += variableValueMenuCode(command_obj.expression2);
  14806. }
  14807. if (command_obj.expression3) {
  14808. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
  14809. switch (command_obj.expression3.itens[1]) {
  14810. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  14811. ret += " +";
  14812. break;
  14813. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  14814. ret += " -";
  14815. break;
  14816. }
  14817. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  14818. }
  14819. /*if (command_obj.var_incrementation) {
  14820. ret += variableValueMenuCode(command_obj.var_incrementation);
  14821. ret += ' <- ';
  14822. ret += variableValueMenuCode(command_obj.expression3.itens[0]);
  14823. switch (command_obj.expression3.itens[1]) {
  14824. case Models.ARITHMETIC_TYPES.plus:
  14825. ret += ' + ';
  14826. break;
  14827. case Models.ARITHMETIC_TYPES.minus:
  14828. ret += ' - ';
  14829. break;
  14830. case Models.ARITHMETIC_TYPES.multiplication:
  14831. ret += ' * ';
  14832. break;
  14833. case Models.ARITHMETIC_TYPES.division:
  14834. ret += ' / ';
  14835. break;
  14836. case Models.ARITHMETIC_TYPES.module:
  14837. ret += ' % ';
  14838. break;
  14839. }
  14840. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  14841. }*/
  14842. ret += " { ";
  14843. if (command_obj.commands_block) {
  14844. for (var _i4 = 0; _i4 < command_obj.commands_block.length; _i4++) {
  14845. ret += commandsCode(command_obj.commands_block[_i4], indentation + 1);
  14846. }
  14847. }
  14848. ret += "\n";
  14849. for (var _i5 = 0; _i5 < indentation; _i5++) {
  14850. ret += "\t";
  14851. }
  14852. ret += "}";
  14853. return ret;
  14854. }
  14855. function iftruesCode(command_obj, indentation) {
  14856. var ret = "\n";
  14857. for (var i = 0; i < indentation; i++) {
  14858. ret += "\t";
  14859. }
  14860. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_if");
  14861. if (!command_obj.expression) {
  14862. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  14863. } else {
  14864. ret += " ( ";
  14865. ret += elementExpressionCode(command_obj.expression);
  14866. ret += " ) ";
  14867. }
  14868. /*switch (command_obj.expression.expression.type) {
  14869. case Models.EXPRESSION_TYPES.exp_logic:
  14870. ret += logicExpressionCode(command_obj.expression.expression);
  14871. break;
  14872. case Models.EXPRESSION_TYPES.exp_arithmetic:
  14873. ret += arithmeticExpressionCode(command_obj.expression.expression);
  14874. break;
  14875. }*/
  14876. ret += " { ";
  14877. if (command_obj.commands_block) {
  14878. for (var _i6 = 0; _i6 < command_obj.commands_block.length; _i6++) {
  14879. ret += commandsCode(command_obj.commands_block[_i6], indentation + 1);
  14880. }
  14881. }
  14882. ret += "\n";
  14883. for (var _i7 = 0; _i7 < indentation; _i7++) {
  14884. ret += "\t";
  14885. }
  14886. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_else") + " {";
  14887. if (command_obj.commands_else) {
  14888. for (var _i8 = 0; _i8 < command_obj.commands_else.length; _i8++) {
  14889. ret += commandsCode(command_obj.commands_else[_i8], indentation + 1);
  14890. }
  14891. }
  14892. ret += "\n";
  14893. for (var _i9 = 0; _i9 < indentation; _i9++) {
  14894. ret += "\t";
  14895. }
  14896. ret += "}";
  14897. return ret;
  14898. }
  14899. function doWhilesCode(command_obj, indentation) {
  14900. var ret = "\n";
  14901. for (var i = 0; i < indentation; i++) {
  14902. ret += "\t";
  14903. }
  14904. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do") + " { ";
  14905. if (command_obj.commands_block) {
  14906. for (var _i10 = 0; _i10 < command_obj.commands_block.length; _i10++) {
  14907. ret += commandsCode(command_obj.commands_block[_i10], indentation + 1);
  14908. }
  14909. }
  14910. ret += "\n";
  14911. for (var _i11 = 0; _i11 < indentation; _i11++) {
  14912. ret += "\t";
  14913. }
  14914. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do_until");
  14915. if (!command_obj.expression) {
  14916. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  14917. }
  14918. /*switch (command_obj.expression.expression.type) {
  14919. case Models.EXPRESSION_TYPES.exp_logic:
  14920. ret += logicExpressionCode(command_obj.expression.expression);
  14921. break;
  14922. case Models.EXPRESSION_TYPES.exp_arithmetic:
  14923. ret += arithmeticExpressionCode(command_obj.expression.expression);
  14924. break;
  14925. }*/
  14926. if (command_obj.expression) {
  14927. ret += " ( ";
  14928. ret += elementExpressionCode(command_obj.expression);
  14929. ret += " ) ";
  14930. }
  14931. return ret;
  14932. }
  14933. function whiletruesCode(command_obj, indentation) {
  14934. var ret = "\n";
  14935. for (var i = 0; i < indentation; i++) {
  14936. ret += "\t";
  14937. }
  14938. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_while");
  14939. if (!command_obj.expression) {
  14940. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  14941. }
  14942. /*switch (command_obj.expression.expression.type) {
  14943. case Models.EXPRESSION_TYPES.exp_logic:
  14944. ret += logicExpressionCode(command_obj.expression.expression);
  14945. break;
  14946. case Models.EXPRESSION_TYPES.exp_arithmetic:
  14947. ret += arithmeticExpressionCode(command_obj.expression.expression);
  14948. break;
  14949. }*/
  14950. if (command_obj.expression) {
  14951. ret += " ( ";
  14952. ret += elementExpressionCode(command_obj.expression);
  14953. ret += " ) ";
  14954. }
  14955. ret += " { ";
  14956. if (command_obj.commands_block) {
  14957. for (var _i12 = 0; _i12 < command_obj.commands_block.length; _i12++) {
  14958. ret += commandsCode(command_obj.commands_block[_i12], indentation + 1);
  14959. }
  14960. }
  14961. ret += "\n";
  14962. for (var _i13 = 0; _i13 < indentation; _i13++) {
  14963. ret += "\t";
  14964. }
  14965. ret += "}";
  14966. return ret;
  14967. }
  14968. function logicExpressionCode(expression) {
  14969. var ret = " ( ";
  14970. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  14971. ret += logicExpressionCode(expression.first_operand);
  14972. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  14973. ret += arithmeticExpressionCode(expression.first_operand);
  14974. } else {
  14975. ret += variableValueMenuCode(expression.first_operand);
  14976. }
  14977. if (expression.operator) {
  14978. switch (expression.operator) {
  14979. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  14980. ret += " == ";
  14981. break;
  14982. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  14983. ret += " != ";
  14984. break;
  14985. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  14986. ret += " && ";
  14987. break;
  14988. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  14989. ret += " || ";
  14990. break;
  14991. }
  14992. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  14993. ret += logicExpressionCode(expression.second_operand);
  14994. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  14995. ret += arithmeticExpressionCode(expression.second_operand);
  14996. } else {
  14997. ret += variableValueMenuCode(expression.second_operand);
  14998. }
  14999. }
  15000. ret += " ) ";
  15001. return ret;
  15002. }
  15003. function arithmeticExpressionCode(expression) {
  15004. var ret = " ( ";
  15005. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15006. ret += logicExpressionCode(expression.first_operand);
  15007. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15008. ret += arithmeticExpressionCode(expression.first_operand);
  15009. } else {
  15010. ret += variableValueMenuCode(expression.first_operand);
  15011. }
  15012. switch (expression.operator) {
  15013. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15014. ret += " > ";
  15015. break;
  15016. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15017. ret += " < ";
  15018. break;
  15019. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to:
  15020. ret += " == ";
  15021. break;
  15022. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to:
  15023. ret += " != ";
  15024. break;
  15025. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15026. ret += " >= ";
  15027. break;
  15028. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15029. ret += " <= ";
  15030. break;
  15031. }
  15032. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15033. ret += logicExpressionCode(expression.second_operand);
  15034. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15035. ret += arithmeticExpressionCode(expression.second_operand);
  15036. } else {
  15037. ret += variableValueMenuCode(expression.second_operand);
  15038. }
  15039. ret += " ) ";
  15040. return ret;
  15041. }
  15042. function attributionsCode(command_obj, indentation) {
  15043. var ret = "\n";
  15044. for (var i = 0; i < indentation; i++) {
  15045. ret += "\t";
  15046. }
  15047. ret += variableValueMenuCode(command_obj.variable) + " <- ";
  15048. /*for (var i = 0; i < command_obj.expression.length; i++) {
  15049. ret += elementExpressionCode(command_obj.expression[i]);
  15050. }*/
  15051. ret += elementExpressionCode(command_obj.expression);
  15052. return ret;
  15053. }
  15054. function elementExpressionCode(expression_obj) {
  15055. var ret = "";
  15056. for (var i = 0; i < expression_obj.length; i++) {
  15057. if (expression_obj[i].type) {
  15058. ret += variableValueMenuCode(expression_obj[i]);
  15059. } else if (expression_obj[i].type_op) {
  15060. switch (expression_obj[i].item) {
  15061. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15062. ret += " + ";
  15063. break;
  15064. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15065. ret += " - ";
  15066. break;
  15067. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication:
  15068. ret += " * ";
  15069. break;
  15070. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division:
  15071. ret += " / ";
  15072. break;
  15073. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module:
  15074. ret += " % ";
  15075. break;
  15076. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  15077. ret += " == ";
  15078. break;
  15079. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  15080. ret += " != ";
  15081. break;
  15082. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15083. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + " ";
  15084. break;
  15085. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15086. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_or") + " ";
  15087. break;
  15088. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not:
  15089. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_not") + " ";
  15090. break;
  15091. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15092. ret += " > ";
  15093. break;
  15094. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15095. ret += " < ";
  15096. break;
  15097. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15098. ret += " >= ";
  15099. break;
  15100. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15101. ret += " <= ";
  15102. break;
  15103. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep:
  15104. ret += ", ";
  15105. break;
  15106. }
  15107. } else {
  15108. ret += " " + expression_obj[i] + " ";
  15109. }
  15110. }
  15111. return ret;
  15112. }
  15113. function functioncallsCode(command_obj, indentation) {
  15114. var ret = "\n";
  15115. for (var i = 0; i < indentation; i++) {
  15116. ret += "\t";
  15117. }
  15118. ret += variableValueMenuCode(command_obj.function_called);
  15119. return ret;
  15120. }
  15121. function readersCode(command_obj, indentation) {
  15122. var ret = "\n";
  15123. for (var i = 0; i < indentation; i++) {
  15124. ret += "\t";
  15125. }
  15126. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_read") + " ( ";
  15127. ret += variableValueMenuCode(command_obj.variable_value_menu);
  15128. ret += " ) ";
  15129. return ret;
  15130. }
  15131. function variableValueMenuCode(variable_obj) {
  15132. var is_return = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  15133. var ret = "";
  15134. try {
  15135. if (variable_obj.function_called) {
  15136. if (variable_obj.function_called.name) {
  15137. ret += variable_obj.function_called.name + " ( ";
  15138. } else {
  15139. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + " ( ";
  15140. }
  15141. if (variable_obj.parameters_list) {
  15142. for (var i = 0; i < variable_obj.parameters_list.length; i++) {
  15143. ret += variableValueMenuCode(variable_obj.parameters_list[i]);
  15144. if (i + 1 < variable_obj.parameters_list.length) {
  15145. ret += ", ";
  15146. }
  15147. }
  15148. }
  15149. ret += " )";
  15150. } else if (variable_obj.content.type) {
  15151. ret += variable_obj.content.name;
  15152. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  15153. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15154. }
  15155. if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  15156. ret += " [ " + variableValueMenuCode(variable_obj.row) + " ] ";
  15157. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15158. }
  15159. } else {
  15160. var content = String(variable_obj.content);
  15161. if (isNaN(content)) {
  15162. // console.debug("Content length: ", content.length);
  15163. // console.debug("Char code at 0", content.charCodeAt(0));
  15164. var isBackslash = content.charCodeAt(0) === 92;
  15165. if (content.length === 1 || content.length === 2 && isBackslash) {
  15166. ret += "'".concat(content, "'");
  15167. } else {
  15168. ret += '"' + variable_obj.content + '"';
  15169. }
  15170. } else if (content.length == 0) {
  15171. ret += '""';
  15172. } else if (content.trim().length == 0) {
  15173. ret += '"' + content + '"';
  15174. } else {
  15175. ret += variable_obj.content;
  15176. }
  15177. }
  15178. } catch (err) {
  15179. if (!is_return) {
  15180. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_content"));
  15181. throw err;
  15182. }
  15183. }
  15184. return ret;
  15185. }
  15186. function writersCode(command_obj, indentation) {
  15187. var ret = "\n";
  15188. for (var i = 0; i < indentation; i++) {
  15189. ret += "\t";
  15190. }
  15191. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_write") + " ( ";
  15192. /*for (var i = 0; i < command_obj.content.length; i++) {
  15193. ret += variableValueMenuCode(command_obj.content[i]);
  15194. if ((i + 1) < command_obj.content.length) {
  15195. ret += ' + ';
  15196. }
  15197. }*/
  15198. ret += elementExpressionCode(command_obj.content);
  15199. if (command_obj.newline) {
  15200. ret += ', "\\n"';
  15201. }
  15202. ret += " ) ";
  15203. return ret;
  15204. }
  15205. function commentsCode(command_obj, indentation) {
  15206. var ret = "\n";
  15207. for (var i = 0; i < indentation; i++) {
  15208. ret += "\t";
  15209. }
  15210. ret += "// ";
  15211. ret += command_obj.comment_text.content;
  15212. return ret;
  15213. }
  15214. function parametersCode(parameter_obj) {
  15215. var ret = "";
  15216. switch (parameter_obj.type) {
  15217. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15218. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15219. break;
  15220. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15221. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15222. break;
  15223. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15224. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15225. break;
  15226. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15227. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15228. break;
  15229. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15230. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15231. break;
  15232. }
  15233. ret += parameter_obj.name + "";
  15234. if (parameter_obj.dimensions == 1) {
  15235. ret += " []";
  15236. } else if (parameter_obj.dimensions == 2) {
  15237. ret += " [][]";
  15238. }
  15239. return ret;
  15240. }
  15241. function variablesCode(variable_obj) {
  15242. var ret = "";
  15243. var temp = variable_obj;
  15244. ret += "\n\t\t";
  15245. if (temp.is_constant) {
  15246. ret += "const ";
  15247. }
  15248. switch (temp.type) {
  15249. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15250. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15251. break;
  15252. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15253. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15254. break;
  15255. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15256. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15257. break;
  15258. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15259. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15260. break;
  15261. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15262. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15263. break;
  15264. }
  15265. ret += temp.name + " ";
  15266. if (temp.dimensions == 1) {
  15267. ret += "[" + temp.columns + "] ";
  15268. switch (temp.type) {
  15269. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15270. ret += "<- {";
  15271. for (var j = 0; j < temp.value.length; j++) {
  15272. ret += temp.value[j];
  15273. if (j + 1 < temp.value.length) {
  15274. ret += ", ";
  15275. }
  15276. }
  15277. ret += "}";
  15278. break;
  15279. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15280. ret += "<- {";
  15281. for (var _j3 = 0; _j3 < temp.value.length; _j3++) {
  15282. ret += temp.value[_j3].toFixed(2);
  15283. if (_j3 + 1 < temp.value.length) {
  15284. ret += ", ";
  15285. }
  15286. }
  15287. ret += "}";
  15288. break;
  15289. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15290. ret += "<- {";
  15291. for (var _j4 = 0; _j4 < temp.value.length; _j4++) {
  15292. ret += '"' + temp.value[_j4] + '"';
  15293. if (_j4 + 1 < temp.value.length) {
  15294. ret += ", ";
  15295. }
  15296. }
  15297. ret += "}";
  15298. break;
  15299. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15300. ret += "<- {";
  15301. for (var _j5 = 0; _j5 < temp.value.length; _j5++) {
  15302. if (temp.value[_j5]) {
  15303. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15304. } else {
  15305. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15306. }
  15307. if (_j5 + 1 < temp.value.length) {
  15308. ret += ", ";
  15309. }
  15310. }
  15311. ret += "}";
  15312. break;
  15313. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15314. ret += "<- {";
  15315. for (var _j6 = 0; _j6 < temp.value.length; _j6++) {
  15316. ret += "'" + temp.value[_j6] + "'";
  15317. if (_j6 + 1 < temp.value.length) {
  15318. ret += ", ";
  15319. }
  15320. }
  15321. ret += "}";
  15322. break;
  15323. }
  15324. } else if (temp.dimensions == 2) {
  15325. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  15326. switch (temp.type) {
  15327. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15328. ret += "<- {";
  15329. for (var _j7 = 0; _j7 < temp.rows; _j7++) {
  15330. ret += "{";
  15331. for (var k = 0; k < temp.columns; k++) {
  15332. ret += temp.value[_j7][k];
  15333. if (k + 1 < temp.columns) {
  15334. ret += ", ";
  15335. }
  15336. }
  15337. ret += "}";
  15338. if (_j7 + 1 < temp.rows) {
  15339. ret += ", ";
  15340. }
  15341. }
  15342. ret += "}";
  15343. break;
  15344. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15345. ret += "<- {";
  15346. for (var _j8 = 0; _j8 < temp.rows; _j8++) {
  15347. ret += "{";
  15348. for (var _k = 0; _k < temp.columns; _k++) {
  15349. ret += temp.value[_j8][_k].toFixed(2);
  15350. if (_k + 1 < temp.columns) {
  15351. ret += ", ";
  15352. }
  15353. }
  15354. ret += "}";
  15355. if (_j8 + 1 < temp.rows) {
  15356. ret += ", ";
  15357. }
  15358. }
  15359. ret += "}";
  15360. break;
  15361. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15362. ret += "<- {";
  15363. for (var _j9 = 0; _j9 < temp.rows; _j9++) {
  15364. ret += "{";
  15365. for (var _k2 = 0; _k2 < temp.columns; _k2++) {
  15366. ret += '"' + temp.value[_j9][_k2] + '"';
  15367. if (_k2 + 1 < temp.columns) {
  15368. ret += ", ";
  15369. }
  15370. }
  15371. ret += "}";
  15372. if (_j9 + 1 < temp.rows) {
  15373. ret += ", ";
  15374. }
  15375. }
  15376. ret += "}";
  15377. break;
  15378. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15379. ret += "<- {";
  15380. for (var _j10 = 0; _j10 < temp.rows; _j10++) {
  15381. ret += "{";
  15382. for (var _k3 = 0; _k3 < temp.columns; _k3++) {
  15383. if (temp.value[_j10][_k3]) {
  15384. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15385. } else {
  15386. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15387. }
  15388. if (_k3 + 1 < temp.columns) {
  15389. ret += ", ";
  15390. }
  15391. }
  15392. ret += "}";
  15393. if (_j10 + 1 < temp.rows) {
  15394. ret += ", ";
  15395. }
  15396. }
  15397. ret += "}";
  15398. break;
  15399. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15400. ret += "<- {";
  15401. for (var _j11 = 0; _j11 < temp.rows; _j11++) {
  15402. ret += "{";
  15403. for (var _k4 = 0; _k4 < temp.columns; _k4++) {
  15404. ret += "'" + temp.value[_j11][_k4] + "'";
  15405. if (_k4 + 1 < temp.columns) {
  15406. ret += ", ";
  15407. }
  15408. }
  15409. ret += "}";
  15410. if (_j11 + 1 < temp.rows) {
  15411. ret += ", ";
  15412. }
  15413. }
  15414. ret += "}";
  15415. break;
  15416. }
  15417. } else {
  15418. switch (temp.type) {
  15419. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15420. ret += "<- " + temp.value;
  15421. break;
  15422. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15423. ret += "<- " + temp.value.toFixed(2);
  15424. break;
  15425. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15426. ret += '<- "' + temp.value + '"';
  15427. break;
  15428. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15429. ret += "<- ";
  15430. if (temp.value) {
  15431. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15432. } else {
  15433. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15434. }
  15435. break;
  15436. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15437. ret += "<- '" + temp.value + "'";
  15438. break;
  15439. }
  15440. }
  15441. return ret;
  15442. }
  15443. function globalsCode() {
  15444. var ret = "";
  15445. if (window.program_obj.globals) {
  15446. for (var i = 0; i < window.program_obj.globals.length; i++) {
  15447. var temp = window.program_obj.globals[i];
  15448. ret += "\n\t";
  15449. if (temp.is_constant) {
  15450. ret += "const ";
  15451. }
  15452. switch (temp.type) {
  15453. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15454. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  15455. break;
  15456. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15457. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  15458. break;
  15459. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15460. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  15461. break;
  15462. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15463. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  15464. break;
  15465. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15466. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  15467. break;
  15468. }
  15469. ret += " " + temp.name + " ";
  15470. if (temp.dimensions == 1) {
  15471. ret += "[" + temp.columns + "] ";
  15472. switch (temp.type) {
  15473. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15474. ret += "<- {";
  15475. for (var j = 0; j < temp.value.length; j++) {
  15476. ret += temp.value[j];
  15477. if (j + 1 < temp.value.length) {
  15478. ret += ", ";
  15479. }
  15480. }
  15481. ret += "}";
  15482. break;
  15483. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15484. ret += "<- {";
  15485. for (var _j12 = 0; _j12 < temp.value.length; _j12++) {
  15486. ret += temp.value[_j12].toFixed(2);
  15487. if (_j12 + 1 < temp.value.length) {
  15488. ret += ", ";
  15489. }
  15490. }
  15491. ret += "}";
  15492. break;
  15493. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15494. ret += "<- {";
  15495. for (var _j13 = 0; _j13 < temp.value.length; _j13++) {
  15496. ret += '"' + temp.value[_j13] + '"';
  15497. if (_j13 + 1 < temp.value.length) {
  15498. ret += ", ";
  15499. }
  15500. }
  15501. ret += "}";
  15502. break;
  15503. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15504. ret += "<- {";
  15505. for (var _j14 = 0; _j14 < temp.value.length; _j14++) {
  15506. if (temp.value[_j14]) {
  15507. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15508. } else {
  15509. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15510. }
  15511. if (_j14 + 1 < temp.value.length) {
  15512. ret += ", ";
  15513. }
  15514. }
  15515. ret += "}";
  15516. break;
  15517. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15518. ret += "<- {";
  15519. for (var _j15 = 0; _j15 < temp.value.length; _j15++) {
  15520. ret += "'" + temp.value[_j15] + "'";
  15521. if (_j15 + 1 < temp.value.length) {
  15522. ret += ", ";
  15523. }
  15524. }
  15525. ret += "}";
  15526. break;
  15527. }
  15528. } else if (temp.dimensions == 2) {
  15529. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  15530. switch (temp.type) {
  15531. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15532. ret += "<- {";
  15533. for (var _j16 = 0; _j16 < temp.rows; _j16++) {
  15534. ret += "{";
  15535. for (var k = 0; k < temp.columns; k++) {
  15536. ret += temp.value[_j16][k];
  15537. if (k + 1 < temp.columns) {
  15538. ret += ", ";
  15539. }
  15540. }
  15541. ret += "}";
  15542. if (_j16 + 1 < temp.rows) {
  15543. ret += ", ";
  15544. }
  15545. }
  15546. ret += "}";
  15547. break;
  15548. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15549. ret += "<- {";
  15550. for (var _j17 = 0; _j17 < temp.rows; _j17++) {
  15551. ret += "{";
  15552. for (var _k5 = 0; _k5 < temp.columns; _k5++) {
  15553. ret += temp.value[_j17][_k5].toFixed(2);
  15554. if (_k5 + 1 < temp.columns) {
  15555. ret += ", ";
  15556. }
  15557. }
  15558. ret += "}";
  15559. if (_j17 + 1 < temp.rows) {
  15560. ret += ", ";
  15561. }
  15562. }
  15563. ret += "}";
  15564. break;
  15565. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15566. ret += "<- {";
  15567. for (var _j18 = 0; _j18 < temp.rows; _j18++) {
  15568. ret += "{";
  15569. for (var _k6 = 0; _k6 < temp.columns; _k6++) {
  15570. ret += '"' + temp.value[_j18][_k6] + '"';
  15571. if (_k6 + 1 < temp.columns) {
  15572. ret += ", ";
  15573. }
  15574. }
  15575. ret += "}";
  15576. if (_j18 + 1 < temp.rows) {
  15577. ret += ", ";
  15578. }
  15579. }
  15580. ret += "}";
  15581. break;
  15582. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15583. ret += "<- {";
  15584. for (var _j19 = 0; _j19 < temp.rows; _j19++) {
  15585. ret += "{";
  15586. for (var _k7 = 0; _k7 < temp.columns; _k7++) {
  15587. if (temp.value[_j19][_k7]) {
  15588. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15589. } else {
  15590. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15591. }
  15592. if (_k7 + 1 < temp.columns) {
  15593. ret += ", ";
  15594. }
  15595. }
  15596. ret += "}";
  15597. if (_j19 + 1 < temp.rows) {
  15598. ret += ", ";
  15599. }
  15600. }
  15601. ret += "}";
  15602. break;
  15603. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15604. ret += "<- {";
  15605. for (var _j20 = 0; _j20 < temp.rows; _j20++) {
  15606. ret += "{";
  15607. for (var _k8 = 0; _k8 < temp.columns; _k8++) {
  15608. ret += "'" + temp.value[_j20][_k8] + "'";
  15609. if (_k8 + 1 < temp.columns) {
  15610. ret += ", ";
  15611. }
  15612. }
  15613. ret += "}";
  15614. if (_j20 + 1 < temp.rows) {
  15615. ret += ", ";
  15616. }
  15617. }
  15618. ret += "}";
  15619. break;
  15620. }
  15621. } else {
  15622. switch (temp.type) {
  15623. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15624. ret += "<- " + temp.value;
  15625. break;
  15626. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15627. ret += "<- " + temp.value.toFixed(2);
  15628. break;
  15629. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15630. ret += '<- "' + temp.value + '"';
  15631. break;
  15632. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15633. ret += "<- ";
  15634. if (temp.value) {
  15635. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15636. } else {
  15637. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15638. }
  15639. break;
  15640. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15641. ret += "<- '" + temp.value + "'";
  15642. break;
  15643. }
  15644. }
  15645. }
  15646. }
  15647. return ret;
  15648. }
  15649. /***/ }),
  15650. /***/ "./js/visualUI/commands.js":
  15651. /*!*********************************!*\
  15652. !*** ./js/visualUI/commands.js ***!
  15653. \*********************************/
  15654. /*! exports provided: removeCommand, createFloatingCommand, renderCommand, genericCreateCommand */
  15655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15656. "use strict";
  15657. __webpack_require__.r(__webpack_exports__);
  15658. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCommand", function() { return removeCommand; });
  15659. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  15660. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  15661. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericCreateCommand", function() { return genericCreateCommand; });
  15662. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15663. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15664. /* harmony import */ var _commands_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commands/comment */ "./js/visualUI/commands/comment.js");
  15665. /* harmony import */ var _commands_reader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/reader */ "./js/visualUI/commands/reader.js");
  15666. /* harmony import */ var _commands_writer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/writer */ "./js/visualUI/commands/writer.js");
  15667. /* harmony import */ var _commands_attribution__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/attribution */ "./js/visualUI/commands/attribution.js");
  15668. /* harmony import */ var _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/iftrue */ "./js/visualUI/commands/iftrue.js");
  15669. /* harmony import */ var _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  15670. /* harmony import */ var _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/whiletrue */ "./js/visualUI/commands/whiletrue.js");
  15671. /* harmony import */ var _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/dowhiletrue */ "./js/visualUI/commands/dowhiletrue.js");
  15672. /* harmony import */ var _commands_switch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/switch */ "./js/visualUI/commands/switch.js");
  15673. /* harmony import */ var _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/functioncall */ "./js/visualUI/commands/functioncall.js");
  15674. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  15675. /* harmony import */ var _commands_break__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/break */ "./js/visualUI/commands/break.js");
  15676. /* harmony import */ var _commands_return__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/return */ "./js/visualUI/commands/return.js");
  15677. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  15678. // let has_element_created_draged = false;
  15679. // let which_element_is_draged = null;
  15680. function removeCommand(command, function_obj, dom_obj) {
  15681. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_COMMAND, command.type, '/', 0);
  15682. if (function_obj.commands.indexOf(command) > -1) {
  15683. function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  15684. return true;
  15685. } // Utilize dois parantNode, pois o primeiro é o div de comandos
  15686. try {
  15687. if (dom_obj.parent().parent().data('command').commands_block.indexOf(command) > -1) {
  15688. dom_obj.parent().parent().data('command').commands_block.splice(dom_obj.parent().parent().data('command').commands_block.indexOf(command), 1);
  15689. return true;
  15690. }
  15691. } catch (err) {}
  15692. try {
  15693. if (dom_obj.parent().parent().data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  15694. if (dom_obj.parent().parent().data('command').commands_else.indexOf(command) > -1) {
  15695. dom_obj.parent().parent().data('command').commands_else.splice(dom_obj.parent().parent().data('command').commands_else.indexOf(command), 1);
  15696. return true;
  15697. }
  15698. }
  15699. } catch (err) {}
  15700. if (dom_obj.parent().data('switchcase')) {
  15701. console.log("o que encontrei: ");
  15702. console.log(dom_obj.parent().data('switchcase'));
  15703. dom_obj.parent().data('switchcase').commands_block.splice(dom_obj.parent().data('switchcase').commands_block.indexOf(command), 1);
  15704. return true;
  15705. }
  15706. return false;
  15707. }
  15708. window.function_container_active = null;
  15709. function createFloatingCommand(function_obj, function_container, command_type, mouse_event) {
  15710. var floatingObject;
  15711. switch (command_type) {
  15712. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  15713. floatingObject = _commands_break__WEBPACK_IMPORTED_MODULE_13__["createFloatingCommand"]();
  15714. break;
  15715. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  15716. floatingObject = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"]();
  15717. break;
  15718. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  15719. floatingObject = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["createFloatingCommand"]();
  15720. break;
  15721. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  15722. floatingObject = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["createFloatingCommand"]();
  15723. break;
  15724. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  15725. floatingObject = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"]();
  15726. break;
  15727. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  15728. floatingObject = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["createFloatingCommand"]();
  15729. break;
  15730. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  15731. floatingObject = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["createFloatingCommand"]();
  15732. break;
  15733. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  15734. floatingObject = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["createFloatingCommand"]();
  15735. break;
  15736. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  15737. floatingObject = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["createFloatingCommand"]();
  15738. break;
  15739. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  15740. floatingObject = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["createFloatingCommand"]();
  15741. break;
  15742. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  15743. floatingObject = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["createFloatingCommand"]();
  15744. break;
  15745. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  15746. floatingObject = _commands_return__WEBPACK_IMPORTED_MODULE_14__["createFloatingCommand"]();
  15747. break;
  15748. }
  15749. floatingObject.draggable().appendTo("body");
  15750. $('body').mouseup(function (evt) {
  15751. manageCommand(function_obj, function_container, evt, command_type);
  15752. $('body').off('mouseup');
  15753. $('body').off('mouseover');
  15754. });
  15755. if (!function_container.hasClass('function_div') || function_container.length < 1) {
  15756. window.mouse_event = mouse_event;
  15757. function_container = $(mouse_event.originalEvent.srcElement.closest('.function_div'));
  15758. }
  15759. console.log('function_container', function_container);
  15760. function_container_active = function_container;
  15761. function_container.find('.commands_list_div').on('mousemove', function (evt) {
  15762. addGhostDiv(evt);
  15763. });
  15764. function_container.find('.commands_list_div').find("*").on('mousemove', function (evt) {
  15765. addGhostDiv(evt);
  15766. });
  15767. function_container.on('mouseout', function (event) {
  15768. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  15769. if (el.closest('.commands_list_div').length < 1) {
  15770. window.ghostDiv.remove();
  15771. }
  15772. });
  15773. floatingObject.css("position", "absolute");
  15774. mouse_event.type = "mousedown.draggable";
  15775. mouse_event.target = floatingObject[0];
  15776. floatingObject.css("left", mouse_event.pageX - window.divx);
  15777. floatingObject.css("top", mouse_event.pageY);
  15778. floatingObject.trigger(mouse_event);
  15779. }
  15780. window.divx = 100;
  15781. window.ghostDiv = $('<div class="ghost_div">');
  15782. window.active_container = null;
  15783. function addGhostToEmptyBlock(element, evt) {
  15784. $('.ghost_div').remove();
  15785. var container = element.closest('.command_container');
  15786. if (container.hasClass('switch')) {
  15787. container = $(evt.target).closest('.case_div');
  15788. }
  15789. if (!container.hasClass('dowhiletrue') && !container.hasClass('iftrue') && !container.hasClass('repeatNtimes') && !container.hasClass('case_div') && !container.hasClass('whiletrue')) {
  15790. addGhostToNotEmptyBlock(element, evt);
  15791. return;
  15792. }
  15793. if (window.active_container != null) {
  15794. if (window.active_container.is(container)) {
  15795. console.log('é o mesmo, não mudou!');
  15796. } else {
  15797. if (container.length < 1) {
  15798. container = element.closest('.commands_list_div');
  15799. if (window.active_container.is(container)) {
  15800. console.log('é o mesmo command list');
  15801. } else {
  15802. console.log('mudou para um command list');
  15803. window.active_container = container;
  15804. }
  15805. } else {
  15806. console.log('mudou para um outro container?');
  15807. }
  15808. }
  15809. }
  15810. window.active_container = container;
  15811. if (container.hasClass('iftrue')) {
  15812. var containerIf = container.find('.commands_if').get(0);
  15813. var containerElse = container.find('.commands_else').get(0);
  15814. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  15815. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  15816. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  15817. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  15818. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  15819. $(containerIf).append(window.ghostDiv);
  15820. } else {
  15821. $(containerElse).append(window.ghostDiv);
  15822. }
  15823. } else if (container.hasClass('case_div')) {
  15824. container.find('.case_commands_block').append(window.ghostDiv);
  15825. } else {
  15826. container.find('.block_commands').append(window.ghostDiv);
  15827. }
  15828. }
  15829. function addGhostToNotEmptyBlock(element, evt) {
  15830. $('.ghost_div').remove();
  15831. var container = element.closest('.dowhiletrue, .iftrue, .repeatNtimes, .case_div, .whiletrue'); //console.log("\n\nNOT EMPTY: ", container);
  15832. //if (window.active_container != null) {
  15833. //}
  15834. if (container.length < 1) {
  15835. container = element.closest('.commands_list_div');
  15836. window.active_container = container;
  15837. addGhostToFunctionArea(element, evt);
  15838. } else {//console.log('mudou para um outro container?');
  15839. }
  15840. window.active_container = container; // quem está mais próximo? // Essa regra se aplica somente quando o over está sobre um comando
  15841. var allfilhos;
  15842. console.log('olha o container: ', container);
  15843. if (container.hasClass('iftrue')) {
  15844. if ($(evt.target).closest('.data_block_if').length > 0) {
  15845. allfilhos = container.find('.commands_if').children('.command_container');
  15846. } else if ($(evt.target).closest('.data_block_else').length > 0) {
  15847. allfilhos = container.find('.commands_else').children('.command_container');
  15848. } else {
  15849. var containerIf = container.find('.commands_if').get(0);
  15850. var containerElse = container.find('.commands_else').get(0);
  15851. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  15852. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  15853. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  15854. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  15855. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  15856. allfilhos = $(containerIf).children('.command_container');
  15857. } else {
  15858. allfilhos = $(containerElse).children('.command_container');
  15859. }
  15860. }
  15861. } else if (container.hasClass('case_div')) {
  15862. allfilhos = container.children('.case_commands_block').children('.command_container');
  15863. } else if (container.hasClass('commands_list_div')) {
  15864. allfilhos = container.children('.command_container');
  15865. } else {
  15866. allfilhos = container.children('.block_commands').children('.command_container');
  15867. }
  15868. var topDistances = [];
  15869. var bottomDistances = [];
  15870. for (var i = 0; i < allfilhos.length; i++) {
  15871. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  15872. topDistances.push(topD);
  15873. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  15874. bottomDistances.push(botD);
  15875. }
  15876. console.log('topDistances\n', topDistances, '\nbottomDistances\n', bottomDistances);
  15877. var menorTop = Math.min.apply(null, topDistances);
  15878. var indiceTop = topDistances.indexOf(menorTop);
  15879. var menorBot = Math.min.apply(null, bottomDistances);
  15880. var indiceBot = bottomDistances.indexOf(menorBot);
  15881. if (menorTop < menorBot) {
  15882. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  15883. } else {
  15884. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  15885. }
  15886. console.log('distancias: menorTop ', menorTop, ' menorBot ', menorBot);
  15887. }
  15888. function addGhostToFunctionArea(undermouse, evt) {
  15889. $('.ghost_div').remove();
  15890. var allfilhos = undermouse.closest('.commands_list_div').children('.command_container');
  15891. var topDistances = [];
  15892. var bottomDistances = [];
  15893. for (var i = 0; i < allfilhos.length; i++) {
  15894. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  15895. topDistances.push(topD);
  15896. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  15897. bottomDistances.push(botD);
  15898. }
  15899. var menorTop = Math.min.apply(null, topDistances);
  15900. var indiceTop = topDistances.indexOf(menorTop);
  15901. var menorBot = Math.min.apply(null, bottomDistances);
  15902. var indiceBot = bottomDistances.indexOf(menorBot);
  15903. if (menorTop < menorBot) {
  15904. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  15905. } else {
  15906. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  15907. }
  15908. }
  15909. function addGhostDiv(evt) {
  15910. var undermouse = $(evt.target);
  15911. if (undermouse.hasClass('ghost_div')) {
  15912. return;
  15913. } else if (undermouse.hasClass('commands_list_div')) {
  15914. addGhostToFunctionArea(undermouse, evt);
  15915. return;
  15916. } else if (undermouse.hasClass('block_commands')) {
  15917. if (undermouse.find('.command_container').length > 0) {
  15918. addGhostToNotEmptyBlock(undermouse, evt);
  15919. } else {
  15920. addGhostToEmptyBlock(undermouse, evt);
  15921. }
  15922. } else if (undermouse.hasClass('case_div')) {
  15923. if (undermouse.find('.case_commands_block').find('.command_container').length > 0) {
  15924. addGhostToNotEmptyBlock(undermouse, evt);
  15925. } else {
  15926. addGhostToEmptyBlock(undermouse, evt);
  15927. }
  15928. } else {
  15929. addGhostToNotEmptyBlock(undermouse, evt);
  15930. }
  15931. }
  15932. function borderMouseDragCommand(function_obj, function_container, evt) {
  15933. function_container.find('.over_command_drag').each(function (index) {
  15934. $(this).removeClass('over_command_drag');
  15935. });
  15936. var prev = null;
  15937. function_container.find('.commands_list_div').each(function (index) {
  15938. prev = $(this);
  15939. if (prev) {
  15940. var objLeft = prev.offset().left;
  15941. var objTop = prev.offset().top;
  15942. var objRight = objLeft + prev.width();
  15943. var objBottom = objTop + prev.height();
  15944. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  15945. prev.addClass("over_command_drag");
  15946. }
  15947. }
  15948. });
  15949. function_container.find('.command_container').each(function (index) {
  15950. var obj = $(this);
  15951. var objLeft = obj.offset().left;
  15952. var objTop = obj.offset().top;
  15953. var objRight = objLeft + obj.width();
  15954. var objBottom = objTop + obj.height();
  15955. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  15956. if (prev) {
  15957. prev.removeClass('over_command_drag');
  15958. }
  15959. obj.addClass("over_command_drag");
  15960. return;
  15961. }
  15962. });
  15963. } // before_after_inside: 1 -> before, 2 -> after, 3 -> inside
  15964. function renderCommand(command, element_reference, before_after_inside, function_obj) {
  15965. var createdElement;
  15966. switch (command.type) {
  15967. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  15968. createdElement = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command, function_obj);
  15969. break;
  15970. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  15971. createdElement = _commands_break__WEBPACK_IMPORTED_MODULE_13__["renderCommand"](command, function_obj);
  15972. break;
  15973. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  15974. createdElement = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["renderCommand"](command, function_obj);
  15975. break;
  15976. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  15977. createdElement = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["renderCommand"](command, function_obj);
  15978. break;
  15979. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  15980. createdElement = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](command, function_obj);
  15981. break;
  15982. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  15983. createdElement = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["renderCommand"](command, function_obj);
  15984. break;
  15985. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  15986. createdElement = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["renderCommand"](command, function_obj);
  15987. break;
  15988. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  15989. createdElement = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["renderCommand"](command, function_obj);
  15990. break;
  15991. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  15992. createdElement = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["renderCommand"](command, function_obj);
  15993. break;
  15994. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  15995. createdElement = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["renderCommand"](command, function_obj);
  15996. break;
  15997. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  15998. createdElement = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["renderCommand"](command, function_obj);
  15999. break;
  16000. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16001. createdElement = _commands_return__WEBPACK_IMPORTED_MODULE_14__["renderCommand"](command, function_obj);
  16002. break;
  16003. }
  16004. switch (before_after_inside) {
  16005. case 1:
  16006. createdElement.insertBefore(element_reference);
  16007. break;
  16008. case 2:
  16009. createdElement.insertAfter(element_reference);
  16010. break;
  16011. case 3:
  16012. element_reference.append(createdElement);
  16013. break;
  16014. }
  16015. }
  16016. function genericCreateCommand(command_type) {
  16017. switch (command_type) {
  16018. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16019. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Break"]();
  16020. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16021. 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));
  16022. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16023. 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));
  16024. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16025. 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)]);
  16026. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16027. 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), []);
  16028. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16029. 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);
  16030. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16031. 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)]);
  16032. //(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block)
  16033. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16034. 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);
  16035. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16036. 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);
  16037. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16038. 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);
  16039. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16040. 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))];
  16041. 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);
  16042. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16043. 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)]);
  16044. }
  16045. }
  16046. function dragTrash(event) {
  16047. $('.ghost_div').remove();
  16048. var trash = $('<i class="ui icon trash alternate outline"></i>');
  16049. $('body').append(trash);
  16050. trash.css('position', 'absolute');
  16051. trash.css('top', event.clientY);
  16052. trash.css('left', event.clientX - 20);
  16053. trash.css('font-size', '3em');
  16054. trash.css('display', 'none');
  16055. function_container_active.find('.commands_list_div').off('mousemove');
  16056. function_container_active.find('.commands_list_div').find("*").off('mousemove');
  16057. trash.fadeIn(200, function () {
  16058. trash.fadeOut(200, function () {
  16059. trash.remove();
  16060. });
  16061. });
  16062. }
  16063. function findSingleElement(searching, query) {
  16064. if (!searching || !query) {
  16065. return '';
  16066. }
  16067. 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) {
  16068. if (searching.commands_block) {
  16069. return '' + searching.commands_block.indexOf(query);
  16070. } else {
  16071. return '0';
  16072. }
  16073. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16074. if (searching.commands_block == null) {
  16075. searching.commands_block = [];
  16076. }
  16077. if (searching.commands_else == null) {
  16078. searching.commands_else = [];
  16079. }
  16080. console.log('\n\nveja onde: ', searching.commands_block, ' \n\nquery: ', query);
  16081. if (searching.commands_block.indexOf(query) >= 0) {
  16082. return 'if[' + searching.commands_block.indexOf(query) + ']';
  16083. } else {
  16084. return 'else[' + searching.commands_else.indexOf(query) + ']';
  16085. }
  16086. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16087. for (var i = 0; i < searching.cases.length; i++) {
  16088. if (searching.cases[i].commands_block.indexOf(query) >= 0) {
  16089. return 'case[' + searching.cases[i].commands_block.indexOf(query) + ']';
  16090. }
  16091. }
  16092. }
  16093. }
  16094. function findPathRecursive(starter_index, hierarquia_bottom_up, function_obj) {
  16095. var index_command = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
  16096. var actual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  16097. var full_path = '';
  16098. for (var i = 0; i <= hierarquia_bottom_up.length; i++) {
  16099. console.log('\n\n:: ', i, ':\n', hierarquia_bottom_up[i]);
  16100. full_path += findSingleElement(hierarquia_bottom_up[i], hierarquia_bottom_up[i + 1]) + '-';
  16101. }
  16102. return full_path;
  16103. }
  16104. function manageCommand(function_obj, function_container, event, command_type) {
  16105. $(".created_element").each(function (index) {
  16106. $(this).remove();
  16107. });
  16108. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16109. if (el.hasClass('ghost_div')) {
  16110. if (el.closest('.command_container').length < 1) {
  16111. console.log('\n\nvou tentar!!!!');
  16112. console.log(el.closest('.commands_list_div'), '\n\n');
  16113. el.closest('.commands_list_div').css('height', el.closest('.commands_list_div').css('height') + 30); //$('.ghost_div').remove();
  16114. el = el.closest('.commands_list_div');
  16115. }
  16116. }
  16117. console.log('soltou no: ');
  16118. console.log(el);
  16119. console.log(el.data('fun')); // Primeiro verificar se ele soltou no espaço da função correta:
  16120. var hier = el.parentsUntil(".all_functions");
  16121. var esta_correto = false;
  16122. var esta_na_div_correta = false;
  16123. if (el.hasClass("commands_list_div")) {
  16124. esta_na_div_correta = true;
  16125. }
  16126. for (var i = 0; i < hier.length; i++) {
  16127. var temp = $(hier[i]);
  16128. if (temp.hasClass("commands_list_div")) {
  16129. esta_na_div_correta = true;
  16130. }
  16131. if (temp.data('fun') == function_obj) {
  16132. esta_correto = true;
  16133. break;
  16134. }
  16135. }
  16136. if (!esta_correto) {
  16137. // has_element_created_draged = false;
  16138. // which_element_is_draged = null;
  16139. dragTrash(event);
  16140. return;
  16141. } else {
  16142. if (!esta_na_div_correta) {
  16143. // has_element_created_draged = false;
  16144. // which_element_is_draged = null;
  16145. dragTrash(event);
  16146. return;
  16147. }
  16148. }
  16149. var hierarquia_bottom_up = null; // Agora é descobrir qual o escopo para adicionar o comando:
  16150. console.log('ev0'); // Se o elemento clicado possuir o atributo "fun", então, é direto na div dos comandos:
  16151. if (typeof el.data('fun') !== 'undefined') {
  16152. // Se a lista de comandos estiver vazia, então é o primeiro.
  16153. // Portanto, ele deve soltar o elemento obrigatoriamente no objeto vazio
  16154. if (el.data('fun').commands == null || el.data('fun').commands.length == 0) {
  16155. // pode adicionar
  16156. el.data('fun').commands = [];
  16157. var new_cmd = genericCreateCommand(command_type);
  16158. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', 0);
  16159. el.data('fun').commands.push(new_cmd);
  16160. renderCommand(new_cmd, $(function_container).find('.commands_list_div'), 3, function_obj);
  16161. } else {
  16162. // Entra nesse else, caso já existam outros comandos no bloco:
  16163. findNearbyCommandToAddInFunctionScope(el, event, $(function_container).find('.commands_list_div'), function_obj, command_type);
  16164. }
  16165. } else {
  16166. console.log("soltou em um comando"); // descobrir em qual comando ele soltou:
  16167. var hier_find = el.parentsUntil(".commands_list_div");
  16168. hierarquia_bottom_up = [];
  16169. if (typeof el.data('command') !== 'undefined') {
  16170. hierarquia_bottom_up.push(el.data('command'));
  16171. }
  16172. for (var i = 0; i < hier_find.length; i++) {
  16173. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16174. hierarquia_bottom_up.push($(hier_find[i]).data('command'));
  16175. }
  16176. }
  16177. console.log("comando em que soltou: ");
  16178. console.log(hierarquia_bottom_up[0]);
  16179. console.log("hierarquia de baixo para cima na árvore, de onde ele soltou: ");
  16180. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  16181. console.log(hierarquia_bottom_up[i]);
  16182. } // Se for do tipo break, verificar se está no contexto correto:
  16183. // Caso não esteja no contexto, apenas retorna sem dar continuidade:
  16184. var is_correct_context = false;
  16185. if (command_type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]) {
  16186. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  16187. 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"]) {
  16188. is_correct_context = true;
  16189. break;
  16190. }
  16191. }
  16192. if (!is_correct_context) {
  16193. console.error("Context not allowed to insert BREAK COMMAND!");
  16194. return;
  16195. }
  16196. } // se a hierarquia possuir apenas um elemento, então está na raiz dos comandos:
  16197. if (hierarquia_bottom_up.length == 1) {
  16198. console.log('QQ1');
  16199. var sub_elemento = false;
  16200. for (var i = 0; i < hier_find.length; i++) {
  16201. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16202. console.log('QQ2');
  16203. findBeforeOrAfterCommandToAdd(hier_find[i], event, function_obj, command_type);
  16204. sub_elemento = true;
  16205. break;
  16206. }
  16207. }
  16208. if (!sub_elemento) {
  16209. console.log('QQ3');
  16210. findBeforeOrAfterCommandToAdd(el[0], event, function_obj, command_type);
  16211. }
  16212. } else {
  16213. console.log('QQ4'); // caso exista mais de um elemento na hierarquia:
  16214. if (typeof $(el).data('command') !== 'undefined') {
  16215. console.log('QQ5');
  16216. console.log("PPP1");
  16217. insertCommandInBlockHierar(el[0], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16218. } else {
  16219. console.log('QQ6');
  16220. var sub_elemento = false;
  16221. for (var i = 0; i < hier_find.length; i++) {
  16222. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16223. console.log('QQ7');
  16224. insertCommandInBlockHierar(hier_find[i], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16225. sub_elemento = true;
  16226. break;
  16227. }
  16228. }
  16229. }
  16230. }
  16231. } // has_element_created_draged = false;
  16232. // which_element_is_draged = null;
  16233. if (hierarquia_bottom_up) {
  16234. console.log('\n\n:::índices::\n\n');
  16235. var i = hierarquia_bottom_up.length - 1;
  16236. var starter_index = window.program_obj.functions[window.program_obj.functions.indexOf(function_obj)].commands.indexOf(hierarquia_bottom_up[i]);
  16237. var all_str_path = starter_index + '-' + findPathRecursive(starter_index, hierarquia_bottom_up, function_obj);
  16238. 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);
  16239. console.log('\n\nfull path: \n\n', all_str_path);
  16240. console.log('fim dos índices');
  16241. }
  16242. renderAlgorithm();
  16243. }
  16244. function insertCommandInBlockHierar(el, event, function_obj, command_type, hier_dom, hier_obj) {
  16245. var el_jq = $(el);
  16246. var command_parent = el_jq.data('command');
  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 || el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16248. console.log('QQ17');
  16249. 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) {
  16250. console.log('QQ18'); // Se não tiver outro comando ainda no bloco, só adiciona:
  16251. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16252. command_parent.commands_block = [];
  16253. var recentComand = genericCreateCommand(command_type);
  16254. command_parent.commands_block.push(recentComand);
  16255. 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);
  16256. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  16257. } else {
  16258. // Se já tem algum comando no bloco:
  16259. findNearbyCommandToAddInBlockScope(el, event, el, function_obj, command_type, command_parent);
  16260. }
  16261. } else {
  16262. // QUANDO FOR BLOCO DO TIPO IF OU SWITCH/CASE:
  16263. addCommandToSwitchCase(event, function_obj, command_type);
  16264. }
  16265. } else {
  16266. console.log('QQ19'); // entra neste bloco, se soltou o comando sobre outro comando dentro de um subbloco:
  16267. findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type);
  16268. }
  16269. }
  16270. function findNearbyCommandToAddInBlockScope(el, event, node_list_commands, function_obj, command_type, command_parent) {
  16271. console.log("\n\n\n::COMANDOS:\n\n", el, event, node_list_commands, function_obj, command_type, command_parent);
  16272. var all_sub = $(node_list_commands).find('div.command_container');
  16273. var menor_distancia = 999999999;
  16274. var elemento_menor_distancia = null;
  16275. var antes = true;
  16276. var t_bot;
  16277. var t_top; // Descobrindo o elemento mais próximo:
  16278. for (var i = 0; i < all_sub.length; i++) {
  16279. t_top = all_sub[i].getBoundingClientRect().top;
  16280. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16281. if (t_top - event.clientY < menor_distancia) {
  16282. menor_distancia = event.clientY - t_top;
  16283. elemento_menor_distancia = all_sub[i];
  16284. }
  16285. }
  16286. 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:
  16287. if (borda_inferior - event.clientY < menor_distancia) {
  16288. var recentComand = genericCreateCommand(command_type);
  16289. command_parent.commands_block.push(recentComand); //
  16290. renderCommand(recentComand, node_list_commands, 3, function_obj);
  16291. } else {
  16292. var recentComand = genericCreateCommand(command_type);
  16293. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16294. if (index > -1) {
  16295. command_parent.commands_block.splice(index, 0, recentComand);
  16296. }
  16297. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16298. }
  16299. }
  16300. function findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type) {
  16301. var el_jq = $(el);
  16302. var command_parent = $(el.parentNode.parentNode).data('command');
  16303. var command_target = el_jq.data('command');
  16304. var temp_parent = $(el.parentNode.parentNode);
  16305. var is_in_else = false;
  16306. if (!command_parent) {
  16307. command_parent = el_jq.data('command');
  16308. temp_parent = el_jq;
  16309. var hier = el_jq.parentsUntil(".command_container");
  16310. for (var i = 0; i < hier.length; i++) {
  16311. var temp = $(hier[i]);
  16312. if (typeof temp.data('else') != 'undefined') {
  16313. is_in_else = true;
  16314. }
  16315. if (typeof temp.data('command') != 'undefined') {
  16316. command_parent = temp.data('command');
  16317. temp_parent = temp;
  16318. }
  16319. }
  16320. }
  16321. var hier = el_jq.parentsUntil(".command_container");
  16322. for (var i = 0; i < hier.length; i++) {
  16323. var temp = $(hier[i]);
  16324. if (typeof temp.data('else') != 'undefined') {
  16325. is_in_else = true;
  16326. }
  16327. }
  16328. if (command_parent == command_target) {
  16329. var hier = el_jq.parentsUntil(".command_container");
  16330. for (var i = 0; i < hier.length; i++) {
  16331. var temp = $(hier[i]);
  16332. if (typeof temp.data('else') !== 'undefined') {
  16333. is_in_else = true;
  16334. break;
  16335. }
  16336. }
  16337. }
  16338. 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"]) {
  16339. var hier = temp_parent.parentsUntil(".all_cases_div");
  16340. console.log("vou procurar!!");
  16341. for (var i = 0; i < hier.length; i++) {
  16342. console.log("estou vasculhando...");
  16343. var temp = $(hier[i]);
  16344. if (typeof temp.data('switchcase') !== 'undefined') {
  16345. console.log("encontrei");
  16346. command_parent = temp.data('switchcase');
  16347. is_in_else = false;
  16348. break;
  16349. }
  16350. }
  16351. }
  16352. console.log('debugging:');
  16353. console.log('el_jq');
  16354. console.log(el_jq);
  16355. console.log('command_parent');
  16356. console.log(command_parent);
  16357. console.log('command_target');
  16358. console.log(command_target);
  16359. var menor_distancia = 999999999;
  16360. var antes = true;
  16361. var t_bot;
  16362. var t_top;
  16363. t_top = el.getBoundingClientRect().top;
  16364. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  16365. var d_top = event.clientY - t_top; // distancia topo
  16366. var d_bot = t_bot - event.clientY; // distancia baixo
  16367. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16368. if (d_top < d_bot) {
  16369. var recentComand = genericCreateCommand(command_type);
  16370. console.log('MMM1');
  16371. if (is_in_else) {
  16372. console.log('MMM2');
  16373. if (command_parent == command_target) {
  16374. console.log('MMM3');
  16375. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16376. command_parent.commands_else = [];
  16377. var recentComand = genericCreateCommand(command_type);
  16378. command_parent.commands_else.push(recentComand);
  16379. renderCommand(recentComand, el_jq, 3, function_obj);
  16380. } else {
  16381. // Se já tem algum comando no bloco:
  16382. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16383. }
  16384. return;
  16385. }
  16386. console.log('MMM7');
  16387. var index = command_parent.commands_else.indexOf(command_target);
  16388. if (index > -1) {
  16389. command_parent.commands_else.splice(index, 0, recentComand);
  16390. }
  16391. renderCommand(recentComand, el, 1, function_obj);
  16392. } else {
  16393. console.log('MMM4');
  16394. if (command_parent == command_target) {
  16395. console.log('Nxxxx5');
  16396. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16397. command_parent.commands_block = [];
  16398. console.log('SSS4');
  16399. var recentComand = genericCreateCommand(command_type);
  16400. command_parent.commands_block.push(recentComand);
  16401. renderCommand(recentComand, el_jq, 3, function_obj);
  16402. } else {
  16403. console.log('SSS5');
  16404. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16405. }
  16406. return;
  16407. }
  16408. console.log('MMM6');
  16409. var index = command_parent.commands_block.indexOf(command_target);
  16410. if (index > -1) {
  16411. command_parent.commands_block.splice(index, 0, recentComand);
  16412. }
  16413. renderCommand(recentComand, el, 1, function_obj);
  16414. }
  16415. } else {
  16416. console.log('XXX1');
  16417. var recentComand = genericCreateCommand(command_type);
  16418. if (is_in_else) {
  16419. if (command_parent == command_target) {
  16420. console.log('MMM3');
  16421. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16422. command_parent.commands_else = [];
  16423. console.log('SSS1');
  16424. var recentComand = genericCreateCommand(command_type);
  16425. command_parent.commands_else.push(recentComand);
  16426. renderCommand(recentComand, el_jq, 3, function_obj);
  16427. } else {
  16428. // Se já tem algum comando no bloco:
  16429. console.log('SSS2');
  16430. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16431. }
  16432. return;
  16433. }
  16434. console.log('XXX2');
  16435. var index = command_parent.commands_else.indexOf(command_target);
  16436. if (index > -1) {
  16437. command_parent.commands_else.splice(index + 1, 0, recentComand);
  16438. }
  16439. renderCommand(recentComand, el, 2, function_obj);
  16440. } else {
  16441. if (command_parent == command_target) {
  16442. console.log('Nxxxx78');
  16443. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16444. command_parent.commands_block = [];
  16445. var recentComand = genericCreateCommand(command_type);
  16446. command_parent.commands_block.push(recentComand);
  16447. console.log('SSS6');
  16448. renderCommand(recentComand, el_jq, 3, function_obj);
  16449. } else {
  16450. console.log('SSS7');
  16451. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16452. }
  16453. return;
  16454. }
  16455. console.log('XXX3');
  16456. var index = command_parent.commands_block.indexOf(command_target);
  16457. if (index > -1) {
  16458. command_parent.commands_block.splice(index + 1, 0, recentComand);
  16459. }
  16460. renderCommand(recentComand, el, 2, function_obj);
  16461. }
  16462. }
  16463. }
  16464. function insertCommandInBlock(el, event, function_obj, command_type) {
  16465. var el_jq = $(el);
  16466. var command_parent = el_jq.data('command');
  16467. 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) {
  16468. // Se não tiver outro comando ainda no bloco, só adiciona:
  16469. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16470. command_parent.commands_block = [];
  16471. var recentComand = genericCreateCommand(command_type);
  16472. command_parent.commands_block.push(recentComand);
  16473. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  16474. } else {
  16475. // Se já tem algum comando no bloco:
  16476. findInBlockCorrectPlace(el, event, function_obj, command_type);
  16477. }
  16478. } else if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16479. console.log('QQ9'); // no if ou no else?
  16480. var correct_div = $(document.elementFromPoint(event.pageX, event.pageY));
  16481. var is_in_if = true;
  16482. if (correct_div.data('if')) {
  16483. is_in_if = true;
  16484. } else if (correct_div.data('else')) {
  16485. is_in_if = false;
  16486. } else {
  16487. var hier = correct_div.parentsUntil(".command_container");
  16488. for (var i = 0; i < hier.length; i++) {
  16489. var temp = $(hier[i]);
  16490. if (typeof temp.data('if') !== 'undefined') {
  16491. is_in_if = true;
  16492. break;
  16493. }
  16494. if (typeof temp.data('else') !== 'undefined') {
  16495. is_in_if = false;
  16496. break;
  16497. }
  16498. }
  16499. }
  16500. if (is_in_if) {
  16501. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16502. command_parent.commands_block = [];
  16503. var recentComand = genericCreateCommand(command_type);
  16504. command_parent.commands_block.push(recentComand);
  16505. renderCommand(recentComand, el_jq.find('.commands_if'), 3, function_obj);
  16506. } else {
  16507. // Se já tem algum comando no bloco:
  16508. findInBlockCorrectPlace(el_jq.find('.commands_if'), event, function_obj, command_type);
  16509. }
  16510. } else {
  16511. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16512. command_parent.commands_else = [];
  16513. var recentComand = genericCreateCommand(command_type);
  16514. command_parent.commands_else.push(recentComand);
  16515. renderCommand(recentComand, el_jq.find('.commands_else'), 3, function_obj);
  16516. } else {
  16517. // Se já tem algum comando no bloco:
  16518. findInBlockCorrectPlace(el_jq.find('.commands_else'), event, function_obj, command_type, true);
  16519. }
  16520. }
  16521. } else {
  16522. // é do tipo switch
  16523. console.log("está tentando inserir em um switch que está na raiz!");
  16524. addCommandToSwitchCase(event, function_obj, command_type);
  16525. }
  16526. }
  16527. function addCommandToSwitchCase(event, function_obj, command_type) {
  16528. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16529. var which_case = el.data('switchcase');
  16530. var case_div = el;
  16531. if (!which_case) {
  16532. var hier_find = el.parentsUntil(".all_cases_div");
  16533. for (var i = 0; i < hier_find.length; i++) {
  16534. if (typeof $(hier_find[i]).data('switchcase') !== 'undefined') {
  16535. which_case = $(hier_find[i]).data('switchcase');
  16536. case_div = $(hier_find[i]);
  16537. break;
  16538. }
  16539. }
  16540. }
  16541. if (which_case.commands_block == null || which_case.commands_block.length < 1) {
  16542. which_case.commands_block = [];
  16543. var recentComand = genericCreateCommand(command_type);
  16544. which_case.commands_block.push(recentComand);
  16545. renderCommand(recentComand, case_div.find('.case_commands_block'), 3, function_obj);
  16546. } else {
  16547. findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type);
  16548. }
  16549. }
  16550. function findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type) {
  16551. var all_sub = case_div.find('div.command_container');
  16552. var menor_distancia = 999999999;
  16553. var elemento_menor_distancia = null;
  16554. var antes = true;
  16555. var t_bot;
  16556. var t_top; // Descobrindo o elemento mais próximo:
  16557. for (var i = 0; i < all_sub.length; i++) {
  16558. t_top = all_sub[i].getBoundingClientRect().top;
  16559. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16560. if (t_top - event.clientY < menor_distancia) {
  16561. menor_distancia = event.clientY - t_top;
  16562. elemento_menor_distancia = all_sub[i];
  16563. }
  16564. }
  16565. 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:
  16566. if (borda_inferior - event.clientY < menor_distancia) {
  16567. var recentComand = genericCreateCommand(command_type);
  16568. which_case.commands_block.push(recentComand);
  16569. renderCommand(recentComand, $(case_div.find('.case_commands_block')[0]), 3, function_obj);
  16570. } else {
  16571. var recentComand = genericCreateCommand(command_type);
  16572. var index = which_case.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16573. if (index > -1) {
  16574. which_case.commands_block.splice(index, 0, recentComand);
  16575. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16576. }
  16577. }
  16578. }
  16579. function findInBlockCorrectPlace(el, event, function_obj, command_type) {
  16580. var is_in_else = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  16581. var el_jq = $(el);
  16582. var all_sub = el_jq.find('div.command_container');
  16583. var menor_distancia = 999999999;
  16584. var elemento_menor_distancia = null;
  16585. var antes = true;
  16586. var t_bot;
  16587. var t_top; // Descobrindo o elemento mais próximo:
  16588. for (var i = 0; i < all_sub.length; i++) {
  16589. t_top = all_sub[i].getBoundingClientRect().top;
  16590. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16591. if (t_top - event.clientY < menor_distancia) {
  16592. menor_distancia = event.clientY - t_top;
  16593. elemento_menor_distancia = all_sub[i];
  16594. }
  16595. }
  16596. var borda_inferior = elemento_menor_distancia.parentNode.getBoundingClientRect().top + elemento_menor_distancia.parentNode.getBoundingClientRect().height;
  16597. console.log("menor_distancia: ");
  16598. console.log(elemento_menor_distancia); // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16599. if (borda_inferior - event.clientY < menor_distancia) {
  16600. console.log('QQ11');
  16601. var recentComand = genericCreateCommand(command_type);
  16602. var command_parent = el_jq.data('command');
  16603. if (is_in_else) {
  16604. console.log('QQ15');
  16605. command_parent.commands_else.push(recentComand);
  16606. console.log('el_jq');
  16607. console.log(el_jq);
  16608. console.log("$(el_jq.find('.commands_else')[0]):: ");
  16609. console.log($(el_jq.find('.commands_else')[0]));
  16610. renderCommand(recentComand, el_jq, 3, function_obj);
  16611. } else {
  16612. console.log('QQ16');
  16613. command_parent.commands_block.push(recentComand);
  16614. renderCommand(recentComand, $(el_jq.find('.block_commands')[0]), 3, function_obj);
  16615. }
  16616. } else {
  16617. console.log('QQ12');
  16618. var recentComand = genericCreateCommand(command_type);
  16619. var command_parent = el_jq.data('command');
  16620. if (is_in_else) {
  16621. var index = command_parent.commands_else.indexOf($(elemento_menor_distancia).data('command'));
  16622. if (index > -1) {
  16623. command_parent.commands_else.splice(index, 0, recentComand);
  16624. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16625. }
  16626. } else {
  16627. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16628. if (index > -1) {
  16629. command_parent.commands_block.splice(index, 0, recentComand);
  16630. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16631. }
  16632. }
  16633. }
  16634. }
  16635. function findBeforeOrAfterCommandToAdd(el, event, function_obj, command_type) {
  16636. switch ($(el).data('command').type) {
  16637. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16638. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16639. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16640. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16641. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16642. insertCommandInBlock(el, event, function_obj, command_type);
  16643. return;
  16644. }
  16645. var menor_distancia = 999999999;
  16646. var antes = true;
  16647. var t_bot;
  16648. var t_top;
  16649. t_top = el.getBoundingClientRect().top;
  16650. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  16651. var d_top = event.clientY - t_top; // distancia topo
  16652. var d_bot = t_bot - event.clientY; // distancia baixo
  16653. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16654. if (d_top < d_bot) {
  16655. var recentComand = genericCreateCommand(command_type);
  16656. var index = function_obj.commands.indexOf($(el).data('command'));
  16657. if (index > -1) {
  16658. function_obj.commands.splice(index, 0, recentComand);
  16659. }
  16660. renderCommand(recentComand, el, 1, function_obj);
  16661. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  16662. } else {
  16663. var recentComand = genericCreateCommand(command_type);
  16664. var index = function_obj.commands.indexOf($(el).data('command'));
  16665. if (index > -1) {
  16666. function_obj.commands.splice(index + 1, 0, recentComand);
  16667. }
  16668. renderCommand(recentComand, el, 2, function_obj);
  16669. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  16670. }
  16671. }
  16672. function findNearbyCommandToAddInFunctionScope(el, event, node_list_commands, function_obj, command_type) {
  16673. var all_sub = $(node_list_commands).find('div.command_container');
  16674. var menor_distancia = 999999999;
  16675. var elemento_menor_distancia = null;
  16676. var antes = true;
  16677. var t_bot;
  16678. var t_top; // Descobrindo o elemento mais próximo:
  16679. for (var i = 0; i < all_sub.length; i++) {
  16680. t_top = all_sub[i].getBoundingClientRect().top;
  16681. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16682. if (t_top - event.clientY < menor_distancia) {
  16683. menor_distancia = event.clientY - t_top;
  16684. elemento_menor_distancia = all_sub[i];
  16685. }
  16686. }
  16687. 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:
  16688. if (borda_inferior - event.clientY < menor_distancia) {
  16689. var recentComand = genericCreateCommand(command_type);
  16690. function_obj.commands.push(recentComand); //
  16691. renderCommand(recentComand, node_list_commands, 3, function_obj);
  16692. 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);
  16693. } else {
  16694. var recentComand = genericCreateCommand(command_type);
  16695. var index = function_obj.commands.indexOf($(elemento_menor_distancia).data('command'));
  16696. if (index > -1) {
  16697. function_obj.commands.splice(index, 0, recentComand);
  16698. }
  16699. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16700. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  16701. }
  16702. }
  16703. /***/ }),
  16704. /***/ "./js/visualUI/commands/attribution.js":
  16705. /*!*********************************************!*\
  16706. !*** ./js/visualUI/commands/attribution.js ***!
  16707. \*********************************************/
  16708. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, renderMenuOperations */
  16709. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16710. "use strict";
  16711. __webpack_require__.r(__webpack_exports__);
  16712. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16714. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  16715. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenuOperations", function() { return renderMenuOperations; });
  16716. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  16717. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16718. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16719. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  16720. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  16721. function createFloatingCommand() {
  16722. return $('<div class="ui attribution created_element"> <i class="ui icon small arrow left"></i> <span> x <&#8212; 1 + 1 </span></div>');
  16723. }
  16724. function renderCommand(command, function_obj) {
  16725. 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>');
  16726. el.data('command', command);
  16727. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.var_attributed'), function_obj);
  16728. if (!command.expression || command.expression.length < 1) {
  16729. 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);
  16730. command.expression.push(exp);
  16731. }
  16732. addHandlers(command, function_obj, el);
  16733. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.expression); //renderExpressionElements(command, function_obj, el);
  16734. return el;
  16735. }
  16736. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, selectedItem, expression_element) {
  16737. var index_to_move = expression_element.itens.indexOf(ref_object);
  16738. switch (selectedItem.data('exp')) {
  16739. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  16740. 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)]);
  16741. expression_element.itens[index_to_move] = exp;
  16742. break;
  16743. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  16744. 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]]);
  16745. expression_element.itens[index_to_move] = exp;
  16746. break;
  16747. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  16748. 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]]);
  16749. expression_element.itens[index_to_move] = exp;
  16750. break;
  16751. }
  16752. renderExpressionElements(command, function_obj, dom_object);
  16753. }
  16754. function renderExpressionElements(command, function_obj, el) {
  16755. var expression_div = el.find('.expression_elements');
  16756. var command_container;
  16757. if (el.hasClass("command_container") == false) {
  16758. var hier = el.parentsUntil(".command_container");
  16759. for (var i = 0; i < hier.length; i++) {
  16760. if ($(hier[i]).hasClass("command_container")) {
  16761. command_container = $(hier[i]);
  16762. break;
  16763. }
  16764. if ($(hier[i]).hasClass("expression_elements")) {
  16765. expression_div = $(hier[i]);
  16766. break;
  16767. }
  16768. }
  16769. }
  16770. if (command_container) {
  16771. expression_div = command_container.find('.expression_elements');
  16772. }
  16773. expression_div.text('');
  16774. for (var i = 0; i < command.expression.length; i++) {
  16775. var temp = $('<div class="expression_element"></div>');
  16776. temp.data('ref_element', command.expression[i]);
  16777. temp.data('ref_index', i);
  16778. expression_div.append(temp);
  16779. renderElement(command, function_obj, temp, command.expression[i]);
  16780. }
  16781. }
  16782. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  16783. var context_menu = '<div class="ui dropdown"><div class="text">';
  16784. switch (expression_element.itens[index_op]) {
  16785. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  16786. context_menu += '+';
  16787. break;
  16788. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  16789. context_menu += '-';
  16790. break;
  16791. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  16792. context_menu += '*';
  16793. break;
  16794. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  16795. context_menu += '/';
  16796. break;
  16797. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  16798. context_menu += '%';
  16799. break;
  16800. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none:
  16801. context_menu += '...';
  16802. break;
  16803. }
  16804. context_menu += '</div><div class="menu">';
  16805. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus + '">+</div>';
  16806. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus + '">-</div>';
  16807. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  16808. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division + '">/</div>';
  16809. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module + '">%</div>';
  16810. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none + '" data-text="...">Nenhum</div>';
  16811. context_menu += '</div></div>';
  16812. context_menu = $(context_menu);
  16813. temp_op.append(context_menu);
  16814. context_menu.dropdown({
  16815. onChange: function onChange(value, text, $selectedItem) {
  16816. expression_element.itens[index_op] = value;
  16817. }
  16818. });
  16819. }
  16820. function renderMenuAddExpression(command, function_obj, el, dom_append_menu, expression_append_new_expression) {
  16821. if (el.hasClass("command_container") == false) {
  16822. var hier = el.parentsUntil(".commands_list_div");
  16823. for (var i = 0; i < hier.length; i++) {
  16824. if ($(hier[i]).hasClass("command_container")) {
  16825. el = $(hier[i]);
  16826. break;
  16827. }
  16828. }
  16829. }
  16830. if (dom_append_menu.hasClass("expression_elements") == false) {
  16831. var hier = el.parentsUntil(".commands_list_div");
  16832. for (var i = 0; i < hier.length; i++) {
  16833. if ($(hier[i]).hasClass("expression_elements")) {
  16834. dom_append_menu = $(hier[i]);
  16835. break;
  16836. }
  16837. }
  16838. }
  16839. var context_menu = '<div class="ui dropdown"><div class="text"></div><i class="ui icon arrow alternate circle right outline"></i><div class="menu">';
  16840. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp + '">EXP OP EXP</div>';
  16841. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp + '">OP EXP</div>';
  16842. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par + '">( EXP )</div>';
  16843. context_menu += '</div></div>';
  16844. context_menu = $(context_menu);
  16845. dom_append_menu.append(context_menu);
  16846. context_menu.dropdown({
  16847. onChange: function onChange(value, text, $selectedItem) {
  16848. switch (value) {
  16849. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  16850. 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)]);
  16851. expression_append_new_expression.push(exp);
  16852. break;
  16853. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  16854. 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)]);
  16855. expression_append_new_expression.push(exp);
  16856. break;
  16857. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  16858. 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)]);
  16859. expression_append_new_expression.push(exp);
  16860. break;
  16861. }
  16862. renderExpressionElements(command, function_obj, el);
  16863. }
  16864. });
  16865. }
  16866. function renderElement(command, function_obj, el, expression_element) {
  16867. switch (expression_element.type_exp) {
  16868. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  16869. var temp_op = $('<div class="component_element"></div>');
  16870. var temp_exp_1 = $('<div class="component_element"></div>');
  16871. var temp_exp_2 = $('<div class="component_element"></div>');
  16872. el.append(temp_exp_1);
  16873. el.append(temp_op);
  16874. el.append(temp_exp_2);
  16875. if (expression_element.itens[0].type) {
  16876. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[0], temp_exp_1, function_obj, 2, expression_element);
  16877. } else {
  16878. renderElement(command, function_obj, temp_exp_1, expression_element.itens[0]);
  16879. }
  16880. renderOperator(command, function_obj, temp_op, expression_element, 1);
  16881. if (expression_element.itens[2].type) {
  16882. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[2], temp_exp_2, function_obj, 2, expression_element);
  16883. } else {
  16884. renderElement(command, function_obj, temp_exp_2, expression_element.itens[2]);
  16885. }
  16886. break;
  16887. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  16888. var temp_op = $('<div class="component_element"></div>');
  16889. var temp_exp = $('<div class="component_element"></div>');
  16890. el.append(temp_op);
  16891. el.append(temp_exp);
  16892. renderOperator(command, function_obj, temp_op, expression_element, 0);
  16893. if (expression_element.itens[1].type) {
  16894. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[1], temp_exp, function_obj, 2, expression_element);
  16895. } else {
  16896. renderElement(command, function_obj, temp_exp, expression_element.itens[1]);
  16897. }
  16898. break;
  16899. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  16900. var temp_par_1 = $('<div class="component_element"> ( </div>');
  16901. var temp_exp = $('<div class="component_element"></div>');
  16902. var temp_par_2 = $('<div class="component_element"> ) </div>');
  16903. el.append(temp_par_1);
  16904. el.append(temp_exp);
  16905. for (var j = 0; j < expression_element.itens.length; j++) {
  16906. if (expression_element.itens[j].type) {
  16907. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[j], temp_exp, function_obj, 2, expression_element);
  16908. } else {
  16909. renderElement(command, function_obj, temp_exp, expression_element.itens[j]);
  16910. }
  16911. } //renderMenuAddExpression(command, function_obj, el, el, expression_element.itens);
  16912. el.append(temp_par_2);
  16913. break;
  16914. }
  16915. }
  16916. function renderExpression(command, function_obj, el) {
  16917. var expression_div = el.find('.expression_elements');
  16918. expression_div.text('');
  16919. var menu_add_item = $('<div class="menu_add_item"></div>');
  16920. menu_add_item.data('index_add', 0);
  16921. expression_div.append(menu_add_item);
  16922. for (var i = 0; i < command.expression.length; i++) {
  16923. if (command.expression[i].type) {
  16924. var temp = $('<div class="expression_element"></div>');
  16925. temp.data('ref_element', command.expression[i]);
  16926. temp.data('ref_index', i);
  16927. expression_div.append(temp);
  16928. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.expression[i], temp, function_obj);
  16929. } else if (command.expression[i] == "(" || command.expression[i] == ")") {
  16930. var temp = $('<div class="expression_element">' + command.expression[i] + '</div>');
  16931. temp.data('ref_element', command.expression[i]);
  16932. temp.data('ref_index', i);
  16933. expression_div.append(temp);
  16934. } else {
  16935. var temp = '<div class="expression_element">';
  16936. switch (command.expression[i]) {
  16937. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  16938. temp += '+';
  16939. break;
  16940. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  16941. temp += '-';
  16942. break;
  16943. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  16944. temp += '*';
  16945. break;
  16946. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  16947. temp += '/';
  16948. break;
  16949. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  16950. temp += '%';
  16951. break;
  16952. }
  16953. temp += '</div>';
  16954. temp = $(temp);
  16955. temp.data('ref_element', command.expression[i]);
  16956. temp.data('ref_index', i);
  16957. expression_div.append(temp);
  16958. }
  16959. var menu_add_item_seq = $('<div class="menu_add_item"></div>');
  16960. var index_temp = i + 1;
  16961. menu_add_item_seq.data('index_add', index_temp);
  16962. expression_div.append(menu_add_item_seq);
  16963. }
  16964. addMenuItens(command, function_obj, el);
  16965. }
  16966. function addMenuItens(command, function_obj, expression_div) {
  16967. var divs_expression = expression_div.find('.menu_add_item');
  16968. for (var i = 0; i < divs_expression.length; i++) {
  16969. var temp = $(divs_expression[i]).data('index_add');
  16970. var context_menu = '<div class="ui dropdown context_menu_clear"><i class="ui icon plus square outline"></i><div class="menu">';
  16971. context_menu += '<div class="item" data-option="value" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_value') + '</div>';
  16972. context_menu += '<div class="item" data-option="operator" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_operator') + '</div>';
  16973. context_menu += '<div class="item" data-option="parentheses" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_parentheses') + '</div>';
  16974. context_menu += '</div></div>';
  16975. context_menu = $(context_menu);
  16976. $(divs_expression[i]).append(context_menu);
  16977. context_menu.dropdown({
  16978. on: 'hover',
  16979. onChange: function onChange(value, text, $selectedItem) {
  16980. switch ($selectedItem.data('option')) {
  16981. case "value":
  16982. 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));
  16983. renderExpression(command, function_obj, expression_div);
  16984. break;
  16985. case "operator":
  16986. command.expression.splice($selectedItem.data('index'), 0, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus);
  16987. renderExpression(command, function_obj, expression_div);
  16988. break;
  16989. case "parentheses":
  16990. command.expression.splice($selectedItem.data('index'), 0, "(");
  16991. 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));
  16992. command.expression.splice($selectedItem.data('index') + 2, 0, ")");
  16993. renderExpression(command, function_obj, expression_div);
  16994. break;
  16995. }
  16996. }
  16997. });
  16998. }
  16999. }
  17000. function addHandlers(command, function_obj, attribution_dom) {
  17001. attribution_dom.find('.button_remove_command').on('click', function () {
  17002. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, attribution_dom)) {
  17003. attribution_dom.fadeOut(400, function () {
  17004. attribution_dom.remove();
  17005. });
  17006. }
  17007. });
  17008. attribution_dom.find('.button_refresh_attribution').on('click', function () {
  17009. renderExpressionElements(command, function_obj, attribution_dom);
  17010. });
  17011. }
  17012. function renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected) {
  17013. /*console.log("recebido o seguinte DOM: ");
  17014. console.log(dom_object);
  17015. if (dom_object.hasClass('var_attributed')) {
  17016. return;
  17017. } else {
  17018. var hier = dom_object.parentsUntil(".command_container");
  17019. for (var i = 0; i < hier.length; i++) {
  17020. if ($(hier[i]).hasClass('var_attributed') || $(hier[i]).hasClass('parameters_function_called')) {
  17021. return;
  17022. }
  17023. }
  17024. }
  17025. dom_object.find('.context_menu_clear').remove();
  17026. var menu_operations = '<div class="ui dropdown menu_operations"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17027. for (var tm in Models.ARITHMETIC_TYPES) {
  17028. menu_operations += '<div class="item" data-option="'+tm+'">'+LocalizedStrings.getUI('btn_arithmetic_' + tm)+'</div>';
  17029. }
  17030. menu_operations += '<div class="item" data-option="clear">'+LocalizedStrings.getUI('btn_clear')+'</div>';
  17031. menu_operations += '</div></div>';
  17032. menu_operations = $(menu_operations);
  17033. dom_object.append(menu_operations);
  17034. menu_operations.dropdown({
  17035. onChange: function(value, text, $selectedItem) {
  17036. switch ($($selectedItem).data('option')) {
  17037. case "clear":
  17038. $(dom_object).text('');
  17039. VariableValueMenu.renderMenu(command, ref_object, dom_object, function_obj);
  17040. break;
  17041. default:
  17042. createExpressionAround(command, ref_object, dom_object, function_obj);
  17043. menu_operations.find('.text').text('');
  17044. }
  17045. }
  17046. });*/
  17047. }
  17048. function createExpressionAround(command, ref_object, dom_object, function_obj) {
  17049. $('<span> ( </span>').insertBefore(dom_object);
  17050. $('<span> ) </span>').insertAfter(dom_object);
  17051. _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);
  17052. }
  17053. /***/ }),
  17054. /***/ "./js/visualUI/commands/break.js":
  17055. /*!***************************************!*\
  17056. !*** ./js/visualUI/commands/break.js ***!
  17057. \***************************************/
  17058. /*! exports provided: createFloatingCommand, renderCommand */
  17059. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17060. "use strict";
  17061. __webpack_require__.r(__webpack_exports__);
  17062. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17063. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17064. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17065. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17066. function createFloatingCommand() {
  17067. 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>');
  17068. }
  17069. function renderCommand(command, function_obj) {
  17070. 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>');
  17071. el.data('command', command);
  17072. addHandlers(command, function_obj, el);
  17073. return el;
  17074. }
  17075. function addHandlers(command, function_obj, break_dom) {
  17076. break_dom.find('.button_remove_command').on('click', function () {
  17077. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, break_dom)) {
  17078. break_dom.fadeOut(400, function () {
  17079. break_dom.remove();
  17080. });
  17081. }
  17082. });
  17083. }
  17084. /***/ }),
  17085. /***/ "./js/visualUI/commands/comment.js":
  17086. /*!*****************************************!*\
  17087. !*** ./js/visualUI/commands/comment.js ***!
  17088. \*****************************************/
  17089. /*! exports provided: createFloatingCommand, renderCommand */
  17090. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17091. "use strict";
  17092. __webpack_require__.r(__webpack_exports__);
  17093. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17094. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17095. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17096. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17097. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17098. function createFloatingCommand() {
  17099. 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>');
  17100. }
  17101. function renderCommand(command, function_obj) {
  17102. 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>');
  17103. el.data('command', command);
  17104. addHandlers(command, function_obj, el);
  17105. renderTextComment(command, function_obj, el);
  17106. return el;
  17107. }
  17108. function renderTextComment(command, function_obj, el) {
  17109. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.comment_text, el.find('.var_value_menu_div'), function_obj, 20);
  17110. }
  17111. function addHandlers(command, function_obj, comment_dom) {
  17112. comment_dom.find('.button_remove_command').on('click', function () {
  17113. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, comment_dom)) {
  17114. comment_dom.fadeOut(400, function () {
  17115. comment_dom.remove();
  17116. });
  17117. }
  17118. });
  17119. }
  17120. /***/ }),
  17121. /***/ "./js/visualUI/commands/conditional_expression.js":
  17122. /*!********************************************************!*\
  17123. !*** ./js/visualUI/commands/conditional_expression.js ***!
  17124. \********************************************************/
  17125. /*! exports provided: renderExpression */
  17126. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17127. "use strict";
  17128. __webpack_require__.r(__webpack_exports__);
  17129. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17130. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17131. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17132. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17133. function renderExpression(command, expression, function_obj, initial_el_to_render) {
  17134. expression.dom_object = initial_el_to_render;
  17135. if (expression.expression == null || expression.expression.length < 1) {
  17136. renderStartMenu(command, expression, function_obj, initial_el_to_render);
  17137. } else {
  17138. var main_div = $('<div class="expression_elements"></div>');
  17139. switch (expression.expression.type) {
  17140. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17141. renderLogicExpression(command, expression, expression.expression, function_obj, main_div, initial_el_to_render);
  17142. break;
  17143. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17144. renderArithmeticExpression(command, expression, expression.expression, function_obj, main_div);
  17145. break;
  17146. }
  17147. initial_el_to_render.append(main_div);
  17148. var restartMenu = $('<div class="ui restart_expression"><i class="ui icon undo"></i></div>');
  17149. initial_el_to_render.append(restartMenu);
  17150. restartMenu.on('click', function (e) {
  17151. expression.expression = null;
  17152. initial_el_to_render.empty();
  17153. renderExpression(command, expression, function_obj, initial_el_to_render);
  17154. });
  17155. }
  17156. }
  17157. function renderArithmeticOperator(command, all_expression, expression_arithmetic, arithmetic_operator, function_obj, element_to_append) {
  17158. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17159. menu_operator.dropdown({
  17160. values: [{
  17161. name: '>',
  17162. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than,
  17163. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than
  17164. }, {
  17165. name: '<',
  17166. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than,
  17167. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than
  17168. }, {
  17169. name: '==',
  17170. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to,
  17171. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to
  17172. }, {
  17173. name: '!=',
  17174. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to,
  17175. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to
  17176. }, {
  17177. name: '>=',
  17178. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to,
  17179. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to
  17180. }, {
  17181. name: '<=',
  17182. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to,
  17183. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to
  17184. }],
  17185. onChange: function onChange(value, text, $selectedItem) {
  17186. expression_arithmetic.operator = value;
  17187. }
  17188. });
  17189. element_to_append.append(menu_operator);
  17190. }
  17191. function renderLogicOperator(command, all_expression, expression_logic, logic_operator, function_obj, element_to_append, initial_el_to_render) {
  17192. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17193. menu_operator.dropdown({
  17194. values: [{
  17195. name: '==',
  17196. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to,
  17197. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to
  17198. }, {
  17199. name: '!=',
  17200. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to,
  17201. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to
  17202. }, {
  17203. name: '&&',
  17204. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and,
  17205. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and
  17206. }, {
  17207. name: '||',
  17208. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or,
  17209. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or
  17210. }],
  17211. onChange: function onChange(value, text, $selectedItem) {
  17212. if ($selectedItem) {
  17213. expression_logic.operator = value;
  17214. if (expression_logic.second_operand == null) {
  17215. 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);
  17216. initial_el_to_render.empty();
  17217. renderExpression(command, all_expression, function_obj, initial_el_to_render);
  17218. }
  17219. }
  17220. }
  17221. });
  17222. element_to_append.append(menu_operator);
  17223. }
  17224. function renderLogicExpression(command, all_expression, expression_logic, function_obj, element_to_append, initial_el_to_render) {
  17225. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17226. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17227. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17228. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17229. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17230. if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17231. renderLogicExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17232. } else if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17233. renderArithmeticExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17234. } else {
  17235. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.first_operand, exp_el_expr_el_1, function_obj);
  17236. }
  17237. element_to_append.append(exp_el_par_1);
  17238. element_to_append.append(exp_el_expr_el_1);
  17239. renderLogicOperator(command, all_expression, expression_logic, expression_logic.operator, function_obj, exp_el_expr_operand, initial_el_to_render);
  17240. element_to_append.append(exp_el_expr_operand);
  17241. if (expression_logic.second_operand) {
  17242. if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17243. renderLogicExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17244. } else if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17245. renderArithmeticExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17246. } else {
  17247. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.second_operand, exp_el_expr_el_2, function_obj);
  17248. }
  17249. element_to_append.append(exp_el_expr_el_2);
  17250. }
  17251. element_to_append.append(exp_el_par_2);
  17252. }
  17253. function renderArithmeticExpression(command, all_expression, expression_arithmetic, function_obj, element_to_append) {
  17254. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17255. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17256. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17257. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17258. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17259. if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17260. renderLogicExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17261. } else if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17262. renderArithmeticExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17263. } else {
  17264. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.first_operand, exp_el_expr_el_1, function_obj);
  17265. }
  17266. if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17267. renderLogicExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17268. } else if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17269. renderArithmeticExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17270. } else {
  17271. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.second_operand, exp_el_expr_el_2, function_obj);
  17272. }
  17273. renderArithmeticOperator(command, all_expression, expression_arithmetic, expression_arithmetic.operator, function_obj, exp_el_expr_operand);
  17274. element_to_append.append(exp_el_par_1);
  17275. element_to_append.append(exp_el_expr_el_1);
  17276. element_to_append.append(exp_el_expr_operand);
  17277. element_to_append.append(exp_el_expr_el_2);
  17278. element_to_append.append(exp_el_par_2);
  17279. }
  17280. function renderStartMenu(command, expression, function_obj, initial_el_to_render) {
  17281. var start_menu = '';
  17282. 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">';
  17283. 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>';
  17284. 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>';
  17285. start_menu += '</div></div>';
  17286. start_menu = $(start_menu);
  17287. start_menu.dropdown({
  17288. onChange: function onChange(value, text, $selectedItem) {
  17289. switch ($selectedItem.data('exp')) {
  17290. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17291. 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));
  17292. break;
  17293. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17294. 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);
  17295. break;
  17296. }
  17297. initial_el_to_render.html('');
  17298. renderExpression(command, expression, function_obj, initial_el_to_render);
  17299. },
  17300. selectOnKeydown: false
  17301. });
  17302. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17303. initial_el_to_render.append(start_menu);
  17304. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17305. }
  17306. /***/ }),
  17307. /***/ "./js/visualUI/commands/contextualized_menu.js":
  17308. /*!*****************************************************!*\
  17309. !*** ./js/visualUI/commands/contextualized_menu.js ***!
  17310. \*****************************************************/
  17311. /*! exports provided: renderMenu */
  17312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17313. "use strict";
  17314. __webpack_require__.r(__webpack_exports__);
  17315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  17316. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17317. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17318. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17319. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17320. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./switch */ "./js/visualUI/commands/switch.js");
  17321. function renderMenu(command, dom_where_render, function_obj, dom_command) {
  17322. 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"> ';
  17323. 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) {
  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. } else {
  17326. 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>';
  17327. 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>';
  17328. }
  17329. menu_div += '</div></div>';
  17330. menu_div = $(menu_div);
  17331. dom_where_render.append(menu_div);
  17332. addHandlers(command, dom_where_render, function_obj, dom_command);
  17333. if (command.collapsed) {
  17334. dom_command.children('.ui.block_commands').toggle();
  17335. }
  17336. }
  17337. function addHandlers(command, dom_where_render, function_obj, dom_command) {
  17338. dom_where_render.find('.minimize_block_button').on('click', function (evt) {
  17339. dom_command.children('.ui.block_commands').toggle();
  17340. command.collapsed = !command.collapsed;
  17341. });
  17342. dom_where_render.find('.menu_commands').dropdown({
  17343. on: 'hover'
  17344. });
  17345. dom_where_render.find('.menu_commands a').on('click', function (evt) {
  17346. 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) {
  17347. if (command.commands_block == null || command.commands_block.length == 0) {
  17348. command.commands_block = [];
  17349. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_2__["genericCreateCommand"]($(this).data('command'));
  17350. command.commands_block.push(new_cmd);
  17351. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](new_cmd, dom_command.find('.block_commands'), 3, function_obj);
  17352. } else {
  17353. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  17354. }
  17355. } else {
  17356. switch ($(this).data('command')) {
  17357. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  17358. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  17359. break;
  17360. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase:
  17361. addCaseToSwitch(command, dom_where_render, function_obj, dom_command);
  17362. break;
  17363. }
  17364. }
  17365. });
  17366. }
  17367. function addCaseToSwitch(command, dom_where_render, function_obj, dom_command) {
  17368. if (command.cases == null) {
  17369. command.cases = [];
  17370. }
  17371. 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));
  17372. command.cases.push(sc);
  17373. _switch__WEBPACK_IMPORTED_MODULE_4__["renderCase"](sc, command, function_obj, dom_command.find('.all_cases_div'));
  17374. }
  17375. /***/ }),
  17376. /***/ "./js/visualUI/commands/dowhiletrue.js":
  17377. /*!*********************************************!*\
  17378. !*** ./js/visualUI/commands/dowhiletrue.js ***!
  17379. \*********************************************/
  17380. /*! exports provided: createFloatingCommand, renderCommand */
  17381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17382. "use strict";
  17383. __webpack_require__.r(__webpack_exports__);
  17384. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17386. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17387. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17388. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  17389. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  17390. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  17391. function createFloatingCommand() {
  17392. 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>');
  17393. }
  17394. function renderCommand(command, function_obj) {
  17395. var ret = '';
  17396. 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>';
  17397. ret += '<div class="ui block_commands" data-subblock="" data-idcommand="">';
  17398. ret += '</div>';
  17399. 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>';
  17400. ret += '</div>';
  17401. var el = $(ret);
  17402. el.data('command', command);
  17403. el.find('.block_commands').data('command', command);
  17404. addHandlers(command, function_obj, el);
  17405. _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'));
  17406. if (command.expression) {
  17407. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  17408. }
  17409. if (command.commands_block) {
  17410. for (var j = 0; j < command.commands_block.length; j++) {
  17411. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  17412. }
  17413. }
  17414. return el;
  17415. }
  17416. function addHandlers(command, function_obj, dowhiletrue_dom) {
  17417. dowhiletrue_dom.find('.button_remove_command').on('click', function () {
  17418. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, dowhiletrue_dom)) {
  17419. dowhiletrue_dom.fadeOut(400, function () {
  17420. dowhiletrue_dom.remove();
  17421. });
  17422. }
  17423. });
  17424. }
  17425. /***/ }),
  17426. /***/ "./js/visualUI/commands/functioncall.js":
  17427. /*!**********************************************!*\
  17428. !*** ./js/visualUI/commands/functioncall.js ***!
  17429. \**********************************************/
  17430. /*! exports provided: createFloatingCommand, renderCommand */
  17431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17432. "use strict";
  17433. __webpack_require__.r(__webpack_exports__);
  17434. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17435. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17436. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17437. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17438. function createFloatingCommand() {
  17439. return $('<div class="ui functioncall created_element"> <i class="hand point right icon"></i> <span> funcao() </span></div>');
  17440. }
  17441. function renderCommand(command, function_obj) {
  17442. 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>');
  17443. el.data('command', command);
  17444. _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__["renderMenu"](command, command.function_called, el.find('.var_value_menu_div'), function_obj);
  17445. addHandlers(command, function_obj, el);
  17446. return el;
  17447. }
  17448. function addHandlers(command, function_obj, functioncall_dom) {
  17449. functioncall_dom.find('.button_remove_command').on('click', function () {
  17450. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, functioncall_dom)) {
  17451. functioncall_dom.fadeOut(400, function () {
  17452. functioncall_dom.remove();
  17453. });
  17454. }
  17455. });
  17456. }
  17457. /***/ }),
  17458. /***/ "./js/visualUI/commands/generic_expression.js":
  17459. /*!****************************************************!*\
  17460. !*** ./js/visualUI/commands/generic_expression.js ***!
  17461. \****************************************************/
  17462. /*! exports provided: renderExpression */
  17463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17464. "use strict";
  17465. __webpack_require__.r(__webpack_exports__);
  17466. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17467. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  17468. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17469. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17470. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17471. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../services/userLog */ "./js/services/userLog.js");
  17472. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  17473. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__);
  17474. window.timer = false;
  17475. function renderExpression(command, function_obj, div_to_render, expression_array) {
  17476. div_to_render.empty();
  17477. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command, "expression");
  17478. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command, "expression", function () {
  17479. if (window.timer) return;
  17480. var m = div_to_render.find(".single_element_expression").not(".mouse_distance").not(".add_parentheses");
  17481. var s = "";
  17482. m.each(function (e) {
  17483. if ($(this).hasClass("parentheses_in_expression")) {
  17484. s += $(this).text() + " ";
  17485. } else {
  17486. s += $(this).find(".text").text();
  17487. s += $(this).find(".var_name").text();
  17488. s += $(this).find(".parameters_function_called").text();
  17489. s += $(this).find(".value_rendered").text();
  17490. s += " ";
  17491. }
  17492. });
  17493. if (s) {
  17494. window.timer = true;
  17495. } else {
  17496. return;
  17497. }
  17498. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_COMMAND_EXP, command.type, "/", s);
  17499. setTimeout(function () {
  17500. window.timer = false;
  17501. }, 200);
  17502. }, 20, true);
  17503. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution) {
  17504. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command.variable);
  17505. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command.variable, function () {
  17506. renderExpression(command, function_obj, div_to_render, expression_array);
  17507. }, 0);
  17508. if (command.variable.content) {
  17509. var types_included = [];
  17510. if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER || command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  17511. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17512. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  17513. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  17514. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  17515. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17516. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  17517. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  17518. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  17519. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17520. } else {
  17521. console.log("NÃO RECONHECI! VEJA: ", command.variable.content.type);
  17522. }
  17523. renderElements(command, function_obj, div_to_render, expression_array, types_included);
  17524. } else {
  17525. div_to_render.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("var_menu_select_var").toLowerCase());
  17526. }
  17527. } else {
  17528. var _types_included = [];
  17529. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  17530. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  17531. 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);
  17532. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  17533. renderElements(command, function_obj, div_to_render, expression_array, _types_included);
  17534. }
  17535. div_to_render.children(".mouse_distance").addClass("mouse_distance_hidden");
  17536. div_to_render.children(".higher_element").on("mousemove", function (evt) {
  17537. if (!window.open_or_close) {
  17538. $(this).css("position", "relative", "!important");
  17539. $(this).children(".mouse_distance").css("opacity", "1");
  17540. }
  17541. });
  17542. div_to_render.children(".higher_element").on("mouseout", function (evt) {
  17543. if (!window.open_or_close) {
  17544. $(this).css("position", "absolute", "!important");
  17545. $(this).children(".mouse_distance").css("opacity", "0");
  17546. }
  17547. });
  17548. var lixeira = $('<div class="lixeira" draggable="true"></div>');
  17549. div_to_render.find(".single_element_expression").on("mousedown", function (evt) {
  17550. window.posX = evt.clientX;
  17551. window.posY = evt.clientY;
  17552. });
  17553. Sortable.create(div_to_render[0], {
  17554. animation: 100,
  17555. ghostClass: "ghost",
  17556. group: {
  17557. name: "shared",
  17558. put: false // Do not allow items to be put into this list
  17559. },
  17560. draggable: ".single_element_expression",
  17561. sort: false,
  17562. filter: ".not_allowed",
  17563. onStart: function onStart() {
  17564. $("body").append(lixeira);
  17565. lixeira.css("display", "block");
  17566. lixeira.css("top", window.posY + 70, "!important");
  17567. lixeira.css("left", window.posX - 20, "!important");
  17568. },
  17569. onMove: function onMove() {
  17570. lixeira.addClass("color_test");
  17571. },
  17572. onEnd: function onEnd() {
  17573. lixeira.remove();
  17574. div_to_render.find(".ghost").removeClass("ghost");
  17575. }
  17576. });
  17577. new Sortable(lixeira[0], {
  17578. group: "shared",
  17579. animation: 150,
  17580. onAdd: function onAdd(evt) {
  17581. lixeira.css("display", "none");
  17582. lixeira.find(".single_element_expression").remove();
  17583. lixeira.css("background-color", "");
  17584. lixeira.remove();
  17585. removeElement(evt, expression_array);
  17586. renderExpression(command, function_obj, div_to_render, expression_array);
  17587. }
  17588. });
  17589. }
  17590. function removeElement(event, expression_array) {
  17591. var indice = $(event.item).data("index");
  17592. var first = expression_array[0];
  17593. console.log("indice: ", indice);
  17594. if (expression_array[indice].type) {
  17595. // if is alone in expression:
  17596. if (expression_array.length == 1) {
  17597. //function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  17598. expression_array.splice(0, 1);
  17599. } else if (expression_array.length > 1) {
  17600. if (indice > 0 && expression_array[indice - 1].type_op) {
  17601. if (indice < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice + 1].type_op) {
  17602. expression_array.splice(indice + 1, 1);
  17603. }
  17604. expression_array.splice(indice, 1);
  17605. expression_array.splice(indice - 1, 1);
  17606. if (indice - 2 < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice - 1] == ")") {
  17607. expression_array.splice(indice - 1, 1);
  17608. expression_array.splice(indice - 2, 1);
  17609. if (indice - 3 >= 0 && indice - 3 < expression_array.length && expression_array[indice - 3].type_op) {
  17610. expression_array.splice(indice - 3, 1);
  17611. }
  17612. }
  17613. } else if (indice < expression_array.length - 1 && expression_array[indice + 1].type_op) {
  17614. expression_array.splice(indice + 1, 1);
  17615. expression_array.splice(indice, 1);
  17616. } else if (indice < expression_array.length - 1 && indice > 0 && expression_array[indice - 1] == "(" && expression_array[indice + 1] == ")") {
  17617. if (indice > 1 && expression_array[indice - 2].type_op) {
  17618. expression_array.splice(indice + 1, 1);
  17619. expression_array.splice(indice, 1);
  17620. expression_array.splice(indice - 1, 1);
  17621. expression_array.splice(indice - 2, 1);
  17622. } else if (indice < expression_array.length - 2 && expression_array[indice + 2].type_op) {
  17623. expression_array.splice(indice + 1, 1);
  17624. expression_array.splice(indice, 1);
  17625. expression_array.splice(indice - 1, 1);
  17626. } else {
  17627. expression_array.splice(indice + 1, 1);
  17628. expression_array.splice(indice, 1);
  17629. expression_array.splice(indice - 1, 1);
  17630. }
  17631. }
  17632. }
  17633. } else if (expression_array[indice].type_op) {// iVProg doesn't support operator remove
  17634. } else {
  17635. var opening = -1;
  17636. var closing = -1;
  17637. if (expression_array[indice] == "(") {
  17638. opening = indice;
  17639. for (var i = indice + 1; i < expression_array.length; i++) {
  17640. if (expression_array[i] == ")") {
  17641. closing = i;
  17642. break;
  17643. }
  17644. }
  17645. } else {
  17646. closing = indice;
  17647. for (var i = indice - 1; i >= 0; i--) {
  17648. if (expression_array[i] == "(") {
  17649. opening = i;
  17650. break;
  17651. }
  17652. }
  17653. }
  17654. if (expression_array[opening + 1].type_op) {
  17655. expression_array.splice(closing, 1);
  17656. expression_array.splice(opening + 1, 1);
  17657. expression_array.splice(opening, 1);
  17658. } else {
  17659. expression_array.splice(closing, 1);
  17660. expression_array.splice(opening, 1);
  17661. }
  17662. } // if expression is empty, add a new var value:
  17663. if (expression_array.length == 0) {
  17664. expression_array.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  17665. }
  17666. if (first != expression_array[0] && expression_array[0].type_op) {
  17667. expression_array.splice(0, 1);
  17668. }
  17669. }
  17670. function renderElements(command, function_obj, div_to_render, expression_array, types_included) {
  17671. /*if (expression_array.length > 0) {
  17672. if (!expression_array[0].type_op) {
  17673. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  17674. }
  17675. }*/
  17676. var i = 0;
  17677. for (i = 0; i < expression_array.length; i++) {
  17678. if (expression_array[i].type == "var_value") {
  17679. var div_temp = $('<div class="single_element_expression" data-index="' + i + '"></div>');
  17680. if (i == 0) {
  17681. if (expression_array.length > 0 && !expression_array[0].type_op) {//renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  17682. }
  17683. }
  17684. _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, expression_array[i], div_temp, function_obj);
  17685. div_to_render.append(div_temp);
  17686. } else if (expression_array[i] == "(" || expression_array[i] == ")") {
  17687. if (expression_array[i] == ")") {
  17688. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i);
  17689. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  17690. } else if (expression_array[i] == "(" && !expression_array[i + 1].type_op) {
  17691. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  17692. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, i + 1);
  17693. } else {
  17694. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  17695. }
  17696. } else {
  17697. if (i == 0) {
  17698. console.log("NEGAÇÃO NO PRIMEIRO ELEMENTO");
  17699. } else if (expression_array[i - 1] == "(") {
  17700. console.log("NEGAÇÃO APÓS O PARÊNTESES");
  17701. }
  17702. renderOperatorMenu(command, function_obj, div_to_render, expression_array[i], types_included, i, expression_array);
  17703. }
  17704. }
  17705. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i, true);
  17706. renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included);
  17707. }
  17708. window.parentheses_activate = false;
  17709. window.open_or_close = null;
  17710. function renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included) {
  17711. 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>');
  17712. div_to_render.append(addParentheses);
  17713. addParentheses.popup({
  17714. content: "Adicionar parênteses",
  17715. delay: {
  17716. show: 750,
  17717. hide: 0
  17718. }
  17719. });
  17720. addParentheses.on("click", function (mouse_event) {
  17721. // verificar se já está ativado
  17722. if (window.parentheses_activate) {
  17723. return;
  17724. }
  17725. div_to_render.find(".usepointer").off("click");
  17726. window.parentheses_activate = true;
  17727. window.open_or_close = "open";
  17728. div_to_render.find(".dropdown").addClass("disabled");
  17729. div_to_render.find(".ghost_element").addClass("temp_class");
  17730. div_to_render.find(".ghost_element").removeClass("ghost_element");
  17731. var floatingObject = $('<div class="floating_parenthesis"> ( </div>');
  17732. floatingObject.draggable().appendTo("body");
  17733. floatingObject.css("position", "absolute");
  17734. mouse_event.type = "mousedown.draggable";
  17735. mouse_event.target = floatingObject[0];
  17736. floatingObject.css("left", mouse_event.pageX + 10);
  17737. floatingObject.css("top", mouse_event.pageY + 10);
  17738. floatingObject.trigger(mouse_event);
  17739. div_to_render.on("mousemove", function (evt) {
  17740. var actual_target = null;
  17741. if ($(evt.target).hasClass("single_element_expression")) {
  17742. actual_target = $(evt.target);
  17743. } else {
  17744. actual_target = $(evt.target).closest(".single_element_expression");
  17745. }
  17746. 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")) {
  17747. return;
  17748. }
  17749. renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array);
  17750. });
  17751. div_to_render.on("mouseleave", function () {
  17752. /*window.open_parentheses.remove();
  17753. window.close_parentheses.remove();*/
  17754. });
  17755. var floating;
  17756. $("body").on("mouseup", function (evt) {
  17757. if (window.open_or_close == "open") {
  17758. window.open_or_close = "close";
  17759. floatingObject.remove();
  17760. var comando_que_esta = $(evt.target).closest(".command_container");
  17761. var comando_certo = div_to_render.closest(".command_container");
  17762. if (!comando_que_esta.is(comando_certo)) {
  17763. window.parentheses_activate = false;
  17764. div_to_render.find(".temp_class").addClass("ghost_element");
  17765. div_to_render.find(".temp_class").removeClass("temp_class");
  17766. div_to_render.off("mousemove");
  17767. div_to_render.off("mouseleave");
  17768. $("body").off("mouseup");
  17769. window.open_parentheses.remove();
  17770. window.close_parentheses.remove();
  17771. window.inserir_open = -1;
  17772. window.inserir_close = -1;
  17773. window.open_or_close = null;
  17774. renderExpression(command, function_obj, div_to_render, expression_array);
  17775. return;
  17776. }
  17777. window.open_parentheses.addClass("parentheses_fixed");
  17778. floating = $('<div class="floating_parenthesis"> ) </div>');
  17779. floating.draggable().appendTo("body");
  17780. floating.css("position", "absolute");
  17781. floating.css("left", evt.pageX + 10);
  17782. floating.css("top", evt.pageY + 10);
  17783. $("body").on("mousemove", function (evts) {
  17784. floating.css("left", evts.pageX + 10);
  17785. floating.css("top", evts.pageY + 10);
  17786. });
  17787. } else {
  17788. floating.remove();
  17789. window.open_parentheses.removeClass("parentheses_fixed");
  17790. div_to_render.off("mousemove");
  17791. div_to_render.off("mouseleave");
  17792. $("body").off("mouseup");
  17793. setTimeout(function () {
  17794. window.parentheses_activate = false;
  17795. }, 50);
  17796. var comando_que_esta = $(evt.target).closest(".command_container");
  17797. var comando_certo = div_to_render.closest(".command_container");
  17798. var is_correct = false;
  17799. if (comando_que_esta.is(comando_certo)) {
  17800. is_correct = true;
  17801. }
  17802. if (is_correct) {
  17803. expression_array.splice(window.inserir_open, 0, "(");
  17804. expression_array.splice(window.inserir_close, 0, ")");
  17805. }
  17806. window.inserir_open = -1;
  17807. window.inserir_close = -1;
  17808. window.open_or_close = null;
  17809. renderExpression(command, function_obj, div_to_render, expression_array);
  17810. }
  17811. });
  17812. });
  17813. }
  17814. window.open_parentheses = $('<div class="parentheses_ghost">(</div>');
  17815. window.close_parentheses = $('<div class="parentheses_ghost">)</div>');
  17816. window.inserir_open = -1;
  17817. window.inserir_close = -1;
  17818. function renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array) {
  17819. /*window.open_parentheses.remove();
  17820. window.close_parentheses.remove();*/
  17821. var index_in_array = actual_target.data("index");
  17822. if (expression_array[index_in_array] == "(" || expression_array[index_in_array] == ")") {
  17823. return;
  17824. }
  17825. if (window.open_or_close == "close") {
  17826. if (index_in_array < window.inserir_open) {
  17827. return;
  17828. }
  17829. } // Tratando a situação quando é na primeira posição:
  17830. if (index_in_array == 0) {
  17831. if (expression_array[index_in_array].type == "var_value") {
  17832. if (window.open_or_close == "open") {
  17833. window.open_parentheses.insertBefore(actual_target);
  17834. window.inserir_open = index_in_array;
  17835. }
  17836. /*if (expression_array.length == 1) {
  17837. if (window.open_or_close == "close") {
  17838. window.close_parentheses.insertAfter(actual_target);
  17839. window.inserir_close = index_in_array + 2;
  17840. }*/
  17841. //} else {
  17842. var count_opened = 0;
  17843. var count_closed = 0;
  17844. for (var i = 0; i < expression_array.length; i++) {
  17845. if (expression_array[i] == "(") {
  17846. count_opened++;
  17847. }
  17848. if (expression_array[i] == ")") {
  17849. count_closed++;
  17850. }
  17851. if (count_opened != count_closed) {} else {
  17852. if (count_opened > 0) {
  17853. if (window.open_or_close == "close") {
  17854. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17855. window.inserir_close = i + 2;
  17856. }
  17857. break;
  17858. } else {
  17859. if (expression_array[i].type == "var_value") {
  17860. if (window.open_or_close == "close") {
  17861. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17862. window.inserir_close = i + 2;
  17863. }
  17864. break;
  17865. }
  17866. }
  17867. }
  17868. } //}
  17869. } else if (expression_array[index_in_array].type_op) {
  17870. if (window.open_or_close == "open") {
  17871. window.open_parentheses.insertBefore(actual_target);
  17872. window.inserir_open = index_in_array;
  17873. }
  17874. var count_opened = 0;
  17875. var count_closed = 0;
  17876. for (var i = 1; i < expression_array.length; i++) {
  17877. // $('.slide-link[data-slide="0"]')
  17878. if (expression_array[i] == "(") {
  17879. count_opened++;
  17880. }
  17881. if (expression_array[i] == ")") {
  17882. count_closed++;
  17883. }
  17884. if (count_opened != count_closed) {} else {
  17885. if (count_opened > 0) {
  17886. if (expression_array[i].type == "var_value") {
  17887. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17888. window.inserir_close = i + 2;
  17889. }
  17890. break;
  17891. } else {
  17892. if (expression_array[i].type == "var_value") {
  17893. if (expression_array[i].type == "var_value") {
  17894. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  17895. window.inserir_close = i + 2;
  17896. }
  17897. break;
  17898. }
  17899. }
  17900. }
  17901. }
  17902. }
  17903. return;
  17904. } // Tratando quando não é no índice 0:
  17905. if (expression_array[index_in_array].type == "var_value") {
  17906. if (window.open_or_close == "open") {
  17907. window.open_parentheses.insertBefore(actual_target);
  17908. window.inserir_open = index_in_array;
  17909. }
  17910. if (window.open_or_close == "close") {
  17911. window.close_parentheses.insertAfter(actual_target);
  17912. window.inserir_close = index_in_array + 2;
  17913. }
  17914. return;
  17915. }
  17916. if (expression_array[index_in_array].type_op) {
  17917. // buscar para a esquerda primeiro:
  17918. if (expression_array[index_in_array - 1] == "(") {
  17919. if (window.open_or_close == "open") {
  17920. window.open_parentheses.insertBefore(actual_target);
  17921. window.inserir_open = index_in_array;
  17922. }
  17923. } else if (expression_array[index_in_array - 1] == ")") {
  17924. // buscar a abertura
  17925. var count_opened = 0;
  17926. var count_closed = 0;
  17927. for (var j = index_in_array - 1; j >= 0; j--) {
  17928. if (expression_array[j] == "(") {
  17929. count_opened++;
  17930. }
  17931. if (expression_array[j] == ")") {
  17932. count_closed++;
  17933. }
  17934. if (count_opened != count_closed) {} else {
  17935. if (count_closed > 0) {
  17936. if (window.open_or_close == "open") {
  17937. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  17938. window.inserir_open = j;
  17939. }
  17940. break;
  17941. }
  17942. }
  17943. }
  17944. } else if (expression_array[index_in_array - 1].type == "var_value") {
  17945. if (window.open_or_close == "open") {
  17946. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + (index_in_array - 1) + '"]'));
  17947. window.inserir_open = index_in_array - 1;
  17948. }
  17949. } // buscar para a direita agora:
  17950. if (expression_array[index_in_array + 1] == "(") {
  17951. // buscar o fechamento:
  17952. var count_opened = 0;
  17953. var count_closed = 0;
  17954. for (var j = index_in_array + 1; j < expression_array.length; j++) {
  17955. if (expression_array[j] == "(") {
  17956. count_opened++;
  17957. }
  17958. if (expression_array[j] == ")") {
  17959. count_closed++;
  17960. }
  17961. if (count_opened != count_closed) {} else {
  17962. if (count_opened > 0) {
  17963. if (window.open_or_close == "close") {
  17964. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  17965. window.inserir_close = j + 2;
  17966. }
  17967. break;
  17968. }
  17969. }
  17970. }
  17971. } else if (expression_array[index_in_array + 1].type == "var_value") {
  17972. if (window.open_or_close == "close") {
  17973. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + (index_in_array + 1) + '"]'));
  17974. window.inserir_close = index_in_array + 3;
  17975. }
  17976. }
  17977. }
  17978. }
  17979. function renderParenthesis(div_to_render, expression_content, command, function_obj, position, expression_array) {
  17980. var ghost_parenthesis = $('<div class="single_element_expression parentheses_in_expression" data-index="' + position + '">' + expression_content + "</div>");
  17981. div_to_render.append(ghost_parenthesis);
  17982. }
  17983. function renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, position) {
  17984. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  17985. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  17986. if (types_included.length > 1) {
  17987. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  17988. menu_final += getArithmeticOperators();
  17989. menu_final += "</div></div>";
  17990. } else {
  17991. menu_final += getArithmeticOperators();
  17992. }
  17993. }
  17994. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  17995. if (types_included.length > 1) {
  17996. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  17997. menu_final += getLogicOperators();
  17998. menu_final += "</div></div>";
  17999. } else {
  18000. menu_final += getLogicOperators();
  18001. }
  18002. }
  18003. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18004. if (types_included.length > 1) {
  18005. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18006. menu_final += getRelationalOperators();
  18007. menu_final += "</div></div>";
  18008. } else {
  18009. menu_final += getRelationalOperators();
  18010. }
  18011. }
  18012. menu_final += "</div></div>";
  18013. menu_final = $(menu_final);
  18014. var div_temp = $('<div class="single_element_expression ghost_element mouse_distance"></div>');
  18015. div_temp.append(menu_final);
  18016. var div_higher = $('<div class="higher_element"></div>');
  18017. div_higher.append(div_temp);
  18018. div_to_render.append(div_higher);
  18019. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus);
  18020. div_temp.on("click", function () {
  18021. if (!window.open_or_close) {
  18022. var sera = position;
  18023. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18024. console.log("p1");
  18025. 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));
  18026. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18027. console.log("p2");
  18028. 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));
  18029. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18030. console.log("p3");
  18031. 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));
  18032. }
  18033. renderExpression(command, function_obj, div_to_render, expression_array);
  18034. }
  18035. });
  18036. }
  18037. function renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, position) {
  18038. var is_last = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
  18039. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18040. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18041. if (types_included.length > 1) {
  18042. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18043. menu_final += getArithmeticOperators();
  18044. menu_final += "</div></div>";
  18045. } else {
  18046. menu_final += getArithmeticOperators();
  18047. }
  18048. }
  18049. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18050. if (types_included.length > 1) {
  18051. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18052. menu_final += getLogicOperators();
  18053. menu_final += "</div></div>";
  18054. } else {
  18055. menu_final += getLogicOperators();
  18056. }
  18057. }
  18058. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18059. if (types_included.length > 1) {
  18060. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18061. menu_final += getRelationalOperators();
  18062. menu_final += "</div></div>";
  18063. } else {
  18064. menu_final += getRelationalOperators();
  18065. }
  18066. }
  18067. menu_final += "</div></div>";
  18068. menu_final = $(menu_final);
  18069. var div_temp = $('<div class="simple_add mouse_distance"></div>');
  18070. var div_higher = $('<div class="higher_element"></div>');
  18071. var button = $('<button class="ui button green add_expression"><i class="plus circle inverted icon"></i></button>');
  18072. div_temp.append(button);
  18073. if (!is_last) {
  18074. div_higher.append(div_temp);
  18075. div_to_render.append(div_higher); //div_temp.append(menu_final);
  18076. div_temp.css("opacity", "0", "!important");
  18077. } else {
  18078. div_temp.removeClass("mouse_distance");
  18079. div_temp.css("opacity", "1", "!important"); //div_temp.append(menu_final);
  18080. div_to_render.append(div_temp);
  18081. }
  18082. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus);
  18083. div_temp.on("click", function () {
  18084. var sera = position;
  18085. if (expression_array[sera] == ")" && expression_array[sera - 1] == "(") {
  18086. 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));
  18087. renderExpression(command, function_obj, div_to_render, expression_array);
  18088. return;
  18089. }
  18090. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18091. 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));
  18092. 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));
  18093. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18094. 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));
  18095. 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));
  18096. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18097. 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));
  18098. 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));
  18099. }
  18100. renderExpression(command, function_obj, div_to_render, expression_array);
  18101. });
  18102. }
  18103. function renderOperatorMenu(command, function_obj, div_to_render, expression_element, types_included, position, expression_array) {
  18104. var menu_final = '<div class="ui dropdown"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18105. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep) >= 0) {
  18106. menu_final += getSeparator();
  18107. }
  18108. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18109. if (types_included.length > 1) {
  18110. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18111. menu_final += getArithmeticOperators();
  18112. menu_final += "</div></div>";
  18113. } else {
  18114. menu_final += getArithmeticOperators();
  18115. }
  18116. }
  18117. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18118. if (types_included.length > 1) {
  18119. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18120. menu_final += getLogicOperators();
  18121. menu_final += "</div></div>";
  18122. } else {
  18123. menu_final += getLogicOperators();
  18124. }
  18125. }
  18126. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18127. if (types_included.length > 1) {
  18128. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18129. menu_final += getRelationalOperators();
  18130. menu_final += "</div></div>";
  18131. } else {
  18132. menu_final += getRelationalOperators();
  18133. }
  18134. }
  18135. menu_final += "</div></div>";
  18136. menu_final = $(menu_final);
  18137. menu_final.find(".ivprog-write-sep").popup({
  18138. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("write_seprator_menu_tooltip"),
  18139. delay: {
  18140. show: 500,
  18141. hide: 0
  18142. }
  18143. });
  18144. var div_temp = $('<div class="single_element_expression not_allowed" data-index="' + position + '"></div>');
  18145. div_temp.append(menu_final);
  18146. div_to_render.append(div_temp);
  18147. menu_final.dropdown({
  18148. onChange: function onChange(_value, _text, $selectedItem) {
  18149. expression_element.item = $selectedItem.data("value");
  18150. expression_element.type_op = $selectedItem.data("type");
  18151. }
  18152. });
  18153. menu_final.dropdown("set selected", expression_element.item);
  18154. }
  18155. function getArithmeticOperators() {
  18156. var arithmetic_operators;
  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"].plus + '">+</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"].minus + '">-</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"].multiplication + '">*</div>';
  18160. 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>';
  18161. 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>';
  18162. return arithmetic_operators;
  18163. }
  18164. function getLogicOperators() {
  18165. var logic_operators;
  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"].equals_to + '">==</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"].not_equals_to + '">!=</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"].and + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + "</div>";
  18169. 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>";
  18170. 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>";
  18171. return logic_operators;
  18172. }
  18173. function getRelationalOperators() {
  18174. var relational_operators;
  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"].greater_than + '">></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"].less_than + '"><</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"].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"].not_equals_to + '">!=</div>';
  18179. 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>';
  18180. 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>';
  18181. return relational_operators;
  18182. }
  18183. function getSeparator() {
  18184. 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>");
  18185. }
  18186. /***/ }),
  18187. /***/ "./js/visualUI/commands/iftrue.js":
  18188. /*!****************************************!*\
  18189. !*** ./js/visualUI/commands/iftrue.js ***!
  18190. \****************************************/
  18191. /*! exports provided: createFloatingCommand, renderCommand */
  18192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18193. "use strict";
  18194. __webpack_require__.r(__webpack_exports__);
  18195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18197. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18198. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18199. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  18200. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18201. function createFloatingCommand() {
  18202. return $('<div class="ui iftrue created_element"> <i class="ui icon small random"></i> <span> if (x < 1) { } </span></div>');
  18203. }
  18204. function renderCommand(command, function_obj) {
  18205. var ret = '';
  18206. 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>';
  18207. ret += '<span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_if') + '</span>';
  18208. ret += ' <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
  18209. ret += '<span> </span> ';
  18210. ret += '<div class="ui block_commands commands_if conditional_comands_block" data-if="true">';
  18211. ret += '</div></div>';
  18212. 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>';
  18213. ret += '<div class="ui block_commands commands_else conditional_comands_block" data-else="true">';
  18214. ret += '</div>';
  18215. ret += '<span></span></div>';
  18216. ret += '</div>';
  18217. var el = $(ret);
  18218. el.data('command', command);
  18219. el.find('.block_commands').data('command', command);
  18220. el.find('.data_block_if').data('command', command);
  18221. el.find('.data_block_else').data('command', command);
  18222. el.find('.commands_if').data('command', command);
  18223. addHandlers(command, function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
  18224. _generic_expression__WEBPACK_IMPORTED_MODULE_3__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  18225. if (command.commands_block) {
  18226. for (var j = 0; j < command.commands_block.length; j++) {
  18227. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.commands_if')[0]), 3, function_obj);
  18228. }
  18229. }
  18230. if (command.commands_else) {
  18231. for (var j = 0; j < command.commands_else.length; j++) {
  18232. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_else[j], $(el.find('.commands_else')[0]), 3, function_obj);
  18233. }
  18234. }
  18235. if (command.collapsed) {
  18236. el.children('.data_block_else').toggle();
  18237. $(el.find('.block_commands')[0]).toggle();
  18238. }
  18239. return el;
  18240. }
  18241. function addHandlers(command, function_obj, iftrue_dom) {
  18242. iftrue_dom.find('.button_remove_command').on('click', function () {
  18243. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, iftrue_dom)) {
  18244. iftrue_dom.fadeOut(400, function () {
  18245. iftrue_dom.remove();
  18246. });
  18247. }
  18248. });
  18249. iftrue_dom.find('.minimize_block_button').on('click', function () {
  18250. iftrue_dom.children('.data_block_else').toggle();
  18251. $(iftrue_dom.find('.block_commands')[0]).toggle();
  18252. command.collapsed = !command.collapsed;
  18253. });
  18254. }
  18255. /***/ }),
  18256. /***/ "./js/visualUI/commands/reader.js":
  18257. /*!****************************************!*\
  18258. !*** ./js/visualUI/commands/reader.js ***!
  18259. \****************************************/
  18260. /*! exports provided: createFloatingCommand, renderCommand */
  18261. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18262. "use strict";
  18263. __webpack_require__.r(__webpack_exports__);
  18264. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18266. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18267. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18268. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18269. function createFloatingCommand() {
  18270. 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>');
  18271. }
  18272. function renderCommand(command, function_obj) {
  18273. 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>';
  18274. el = $(el);
  18275. el.data('command', command);
  18276. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
  18277. addHandlers(command, function_obj, el);
  18278. return el;
  18279. }
  18280. function addHandlers(command, function_obj, reader_dom) {
  18281. reader_dom.find('.button_remove_command').on('click', function () {
  18282. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, reader_dom)) {
  18283. reader_dom.fadeOut(400, function () {
  18284. reader_dom.remove();
  18285. });
  18286. }
  18287. });
  18288. }
  18289. /***/ }),
  18290. /***/ "./js/visualUI/commands/repeatNtimes.js":
  18291. /*!**********************************************!*\
  18292. !*** ./js/visualUI/commands/repeatNtimes.js ***!
  18293. \**********************************************/
  18294. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, manageClearExpressionElements */
  18295. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18296. "use strict";
  18297. __webpack_require__.r(__webpack_exports__);
  18298. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18299. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18300. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  18301. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageClearExpressionElements", function() { return manageClearExpressionElements; });
  18302. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18303. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18304. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18305. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  18306. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18307. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18308. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18309. function createFloatingCommand() {
  18310. 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>');
  18311. }
  18312. function renderCommand(command, function_obj) {
  18313. 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>'");
  18314. ret += '<div class="ui block_commands">';
  18315. ret += '</div>';
  18316. ret += '<span> </span>';
  18317. ret += '</div>';
  18318. var el = $(ret);
  18319. el.data('command', command);
  18320. el.find('.block_commands').data('command', command);
  18321. addHandlers(command, function_obj, el);
  18322. _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  18323. _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'));
  18324. _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);
  18325. //VariableValueMenu.renderMenu(command, command.var_incrementation, el.find('.incrementation_variable'), function_obj);
  18326. //angle double right
  18327. if (!command.expression1) {
  18328. 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);
  18329. }
  18330. el.find('.text_receives').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_from"));
  18331. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, el.find('.var_value_expression'), function_obj);
  18332. if (!command.expression3) {
  18333. 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>');
  18334. el.find('.pass_button').find('button').on('click', function () {
  18335. togglePasso(command);
  18336. });
  18337. /*var exp = new Models.ExpressionElement(Models.EXPRESSION_ELEMENTS.exp_op_exp,
  18338. [command.var_attribution,
  18339. Models.ARITHMETIC_TYPES.plus,
  18340. new Models.VariableValueMenu(VariableValueMenu.VAR_OR_VALUE_TYPES.all, "1", null, null, true)]);
  18341. command.expression3 = exp;
  18342. command.var_incrementation = command.var_attribution;*/
  18343. } else {
  18344. 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>');
  18345. el.find('.pass_button').find('button').on('click', function () {
  18346. togglePasso(command);
  18347. });
  18348. renderOperator(command, function_obj, el.find('.operator'), command.expression3, 1);
  18349. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], el.find('.second_operand'), function_obj);
  18350. }
  18351. if (command.commands_block) {
  18352. for (var j = 0; j < command.commands_block.length; j++) {
  18353. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  18354. }
  18355. }
  18356. return el;
  18357. }
  18358. function togglePasso(command) {
  18359. if (!command.expression3) {
  18360. 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)]);
  18361. command.expression3 = exp;
  18362. command.var_incrementation = command.var_attribution;
  18363. } else {
  18364. command.expression3 = null;
  18365. }
  18366. renderAlgorithm();
  18367. }
  18368. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  18369. if (dom_object.hasClass('variable_attribution')) {
  18370. if (!command.expression3) {
  18371. 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)]);
  18372. command.expression3 = exp;
  18373. command.var_incrementation = command.var_attribution;
  18374. 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);
  18375. command.expression2.expression = cond_exp;
  18376. }
  18377. dom_object.parent().find('.text_receives').text('de');
  18378. 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);
  18379. dom_object.parent().find('.var_value_expression').empty();
  18380. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, dom_object.parent().find('.var_value_expression'), function_obj);
  18381. renderAlgorithm();
  18382. }
  18383. if (dom_object.hasClass('incrementation_variable')) {
  18384. dom_object.parent().find('.text_inc_receives').text('de');
  18385. 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)]);
  18386. command.expression3 = exp;
  18387. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[0], dom_object.parent().find('.first_operand'), function_obj);
  18388. renderOperator(command, function_obj, dom_object.parent().find('.operator'), command.expression3, 1);
  18389. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], dom_object.parent().find('.second_operand'), function_obj);
  18390. }
  18391. }
  18392. function manageClearExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  18393. if (dom_object.hasClass('variable_attribution')) {
  18394. $(dom_object).parent().find('.text_receives').text('');
  18395. command.expression1 = null;
  18396. $(dom_object).parent().find('.var_value_expression').empty();
  18397. }
  18398. if (dom_object.hasClass('incrementation_variable')) {
  18399. $(dom_object).parent().find('.text_inc_receives').text('');
  18400. command.expression3 = null;
  18401. $(dom_object).parent().find('.first_operand').empty();
  18402. $(dom_object).parent().find('.operator').empty();
  18403. $(dom_object).parent().find('.second_operand').empty();
  18404. }
  18405. }
  18406. function addHandlers(command, function_obj, repeatNtimes_dom) {
  18407. repeatNtimes_dom.find('.button_remove_command').on('click', function () {
  18408. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, repeatNtimes_dom)) {
  18409. repeatNtimes_dom.fadeOut(400, function () {
  18410. repeatNtimes_dom.remove();
  18411. });
  18412. }
  18413. });
  18414. }
  18415. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  18416. var menu_operator = $('<div class="ui dropdown"><div class="text"></div></div>');
  18417. menu_operator.dropdown({
  18418. values: [{
  18419. name: '+',
  18420. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus,
  18421. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus
  18422. }, {
  18423. name: '-',
  18424. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus,
  18425. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus
  18426. }],
  18427. onChange: function onChange(value, text, $selectedItem) {
  18428. expression_element.itens[index_op] = value;
  18429. }
  18430. });
  18431. temp_op.append(menu_operator);
  18432. }
  18433. /***/ }),
  18434. /***/ "./js/visualUI/commands/return.js":
  18435. /*!****************************************!*\
  18436. !*** ./js/visualUI/commands/return.js ***!
  18437. \****************************************/
  18438. /*! exports provided: createFloatingCommand, renderCommand */
  18439. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18440. "use strict";
  18441. __webpack_require__.r(__webpack_exports__);
  18442. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18443. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18444. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  18445. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18446. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18447. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18448. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18449. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18450. function createFloatingCommand() {
  18451. 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>');
  18452. }
  18453. function renderCommand(command, function_obj) {
  18454. 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>');
  18455. el.data('command', command);
  18456. addHandlers(command, function_obj, el);
  18457. if (function_obj.return_type != _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID) {
  18458. if (!command.variable_value_menu) {
  18459. 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)];
  18460. }
  18461. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.variable_value_menu);
  18462. } else {
  18463. el.find('.expression_elements').remove();
  18464. command.variable_value_menu = null;
  18465. }
  18466. return el;
  18467. }
  18468. function addHandlers(command, function_obj, return_dom) {
  18469. return_dom.find('.button_remove_command').on('click', function () {
  18470. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, return_dom)) {
  18471. return_dom.fadeOut(400, function () {
  18472. return_dom.remove();
  18473. });
  18474. }
  18475. });
  18476. }
  18477. /***/ }),
  18478. /***/ "./js/visualUI/commands/switch.js":
  18479. /*!****************************************!*\
  18480. !*** ./js/visualUI/commands/switch.js ***!
  18481. \****************************************/
  18482. /*! exports provided: createFloatingCommand, renderCommand, renderCase */
  18483. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18484. "use strict";
  18485. __webpack_require__.r(__webpack_exports__);
  18486. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18487. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18488. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCase", function() { return renderCase; });
  18489. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18490. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18491. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18492. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18493. function createFloatingCommand() {
  18494. 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>');
  18495. }
  18496. function renderCommand(command, function_obj) {
  18497. var ret = '';
  18498. 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>';
  18499. ret += '</div>';
  18500. var el = $(ret);
  18501. el.data('command', command);
  18502. addHandlers(command, function_obj, el);
  18503. _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  18504. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.variable_to_switch'), function_obj);
  18505. if (command.cases) {
  18506. for (var i = 0; i < command.cases.length; i++) {
  18507. renderCase(command.cases[i], command, function_obj, el.find('.all_cases_div'));
  18508. }
  18509. }
  18510. return el;
  18511. }
  18512. function renderCase(switchcase, command, function_obj, el) {
  18513. 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>');
  18514. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, switchcase.variable_value_menu, casediv.find('.variable_case'), function_obj);
  18515. casediv.data('switchcase', switchcase);
  18516. casediv.find('.case_commands_block').data('switchcase', switchcase);
  18517. el.append(casediv);
  18518. if (switchcase.commands_block) {
  18519. for (var j = 0; j < switchcase.commands_block.length; j++) {
  18520. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](switchcase.commands_block[j], $(casediv.find('.case_commands_block')[0]), 3, function_obj);
  18521. }
  18522. }
  18523. casediv.find('.button_remove_command').on('click', function () {
  18524. for (var i = 0; i < command.cases.length; i++) {
  18525. if (switchcase == command.cases[i]) {
  18526. delete command.cases[i];
  18527. command.cases.splice(i, 1);
  18528. casediv.remove();
  18529. break;
  18530. }
  18531. }
  18532. });
  18533. }
  18534. function addHandlers(command, function_obj, switch_dom) {
  18535. switch_dom.find('.button_remove_command').on('click', function () {
  18536. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, switch_dom)) {
  18537. switch_dom.fadeOut(400, function () {
  18538. switch_dom.remove();
  18539. });
  18540. }
  18541. });
  18542. }
  18543. /***/ }),
  18544. /***/ "./js/visualUI/commands/variable_value_menu.js":
  18545. /*!*****************************************************!*\
  18546. !*** ./js/visualUI/commands/variable_value_menu.js ***!
  18547. \*****************************************************/
  18548. /*! exports provided: VAR_OR_VALUE_TYPES, renderMenu */
  18549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18550. "use strict";
  18551. __webpack_require__.r(__webpack_exports__);
  18552. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VAR_OR_VALUE_TYPES", function() { return VAR_OR_VALUE_TYPES; });
  18553. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  18554. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18555. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18556. /* harmony import */ var _attribution__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attribution */ "./js/visualUI/commands/attribution.js");
  18557. /* harmony import */ var _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  18558. var VAR_OR_VALUE_TYPES = Object.freeze({
  18559. only_variable: 1,
  18560. only_value: 2,
  18561. only_function: 3,
  18562. variable_and_function: 4,
  18563. variable_and_value_opt: 5,
  18564. value_and_function: 6,
  18565. all: 7
  18566. });
  18567. function renderMenu(command, ref_object, dom_object, function_obj) {
  18568. var size_field = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
  18569. var expression_element = arguments.length > 5 ? arguments[5] : undefined;
  18570. // Verificar se o objeto atual trata-se de uma chamada de função e conferir se possui a quantidade correta de parâmetros
  18571. // Caso não possua, tem que adicionar as variáveis que servirão de parâmetros:
  18572. if (ref_object.function_called) {
  18573. if (ref_object.function_called.parameters_list) {
  18574. while (ref_object.function_called.parameters_list.length != ref_object.parameters_list.length) {
  18575. if (ref_object.parameters_list.length > ref_object.function_called.parameters_list.length) {
  18576. ref_object.parameters_list.pop();
  18577. } else {
  18578. ref_object.parameters_list.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true));
  18579. }
  18580. }
  18581. }
  18582. }
  18583. 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">';
  18584. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_variable) {
  18585. 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">';
  18586. menu_var_or_value += "</div>";
  18587. }
  18588. 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) {
  18589. 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");
  18590. menu_var_or_value += '<div class="menu menu_only_vars">';
  18591. menu_var_or_value += "</div></div>";
  18592. }
  18593. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_value) {
  18594. menu_var_or_value = '<input type="text" class="width-dynamic" size="' + size_field + '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />';
  18595. }
  18596. 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) {
  18597. 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>";
  18598. }
  18599. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_function) {
  18600. 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">';
  18601. menu_var_or_value += "</div>";
  18602. }
  18603. 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) {
  18604. 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");
  18605. menu_var_or_value += '<div class="menu menu_only_functions">';
  18606. menu_var_or_value += "</div></div>";
  18607. /* if (command.type == Models.COMMAND_TYPES.attribution) {
  18608. menu_var_or_value += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18609. menu_var_or_value += '<div class="menu">';
  18610. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18611. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18612. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18613. menu_var_or_value += '</div></div>';
  18614. }*/
  18615. }
  18616. menu_var_or_value += "</div></div>";
  18617. menu_var_or_value = $(menu_var_or_value);
  18618. menu_var_or_value.find('.width-dynamic').on('input', function () {
  18619. var input_field = $(this);
  18620. var inputWidth = input_field.textWidth() + 10;
  18621. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  18622. input_field.css({
  18623. width: inputWidth
  18624. });
  18625. }).trigger('input');
  18626. dom_object.append(menu_var_or_value);
  18627. ref_object.dom_object = menu_var_or_value;
  18628. addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  18629. addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  18630. addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  18631. addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  18632. if (ref_object.content || ref_object.function_called) {
  18633. if (ref_object.content) {
  18634. // Verificar se a variável ainda existe:
  18635. var variable_fun = isVarInProgram(ref_object.content, function_obj);
  18636. if (variable_fun) {
  18637. ref_object.content = variable_fun;
  18638. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  18639. } else {
  18640. if (ref_object.content && ref_object.content.type) {
  18641. ref_object.content = null;
  18642. appendSelectText(ref_object, menu_var_or_value);
  18643. } else {
  18644. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  18645. }
  18646. }
  18647. } else if (ref_object.function_called) {
  18648. // Verificar se a função ainda existe:
  18649. var ret_function = isFunctionInProgram(ref_object.function_called);
  18650. if (ret_function) {
  18651. ref_object.function_called = ret_function;
  18652. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  18653. } else {
  18654. ref_object.content = null;
  18655. ref_object.row = null;
  18656. ref_object.column = null;
  18657. delete ref_object.function_called;
  18658. delete ref_object.parameters_list;
  18659. appendSelectText(ref_object, menu_var_or_value);
  18660. }
  18661. }
  18662. } else {
  18663. appendSelectText(ref_object, menu_var_or_value);
  18664. }
  18665. }
  18666. function appendSelectText(ref_object, menu_var_or_value) {
  18667. switch (ref_object.variable_and_value) {
  18668. case VAR_OR_VALUE_TYPES.only_variable:
  18669. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_var") + "</i>");
  18670. break;
  18671. case VAR_OR_VALUE_TYPES.all:
  18672. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  18673. break;
  18674. case VAR_OR_VALUE_TYPES.variable_and_function:
  18675. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  18676. break;
  18677. case VAR_OR_VALUE_TYPES.only_function:
  18678. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_function") + "</i>");
  18679. break;
  18680. }
  18681. }
  18682. function isFunctionInProgram(function_called_obj) {
  18683. if (function_called_obj.name) {
  18684. if (window.program_obj.functions) {
  18685. for (var i = 0; i < window.program_obj.functions.length; i++) {
  18686. if (window.program_obj.functions[i] == function_called_obj) {
  18687. return window.program_obj.functions[i];
  18688. }
  18689. }
  18690. for (var i = 0; i < window.program_obj.functions.length; i++) {
  18691. if (window.program_obj.functions[i].name == function_called_obj.name) {
  18692. return window.program_obj.functions[i];
  18693. }
  18694. }
  18695. }
  18696. } else if (function_called_obj.identifier) {
  18697. for (var i = 0; i < window.system_functions.length; i++) {
  18698. if (window.system_functions[i].identifier == function_called_obj.identifier) {
  18699. return window.system_functions[i];
  18700. }
  18701. }
  18702. }
  18703. return null;
  18704. }
  18705. function isVarInProgram(var_obj, function_obj) {
  18706. // Verify in locals:
  18707. if (function_obj.variables_list) {
  18708. for (var i = 0; i < function_obj.variables_list.length; i++) {
  18709. if (function_obj.variables_list[i] == var_obj) {
  18710. return function_obj.variables_list[i];
  18711. }
  18712. }
  18713. } // Verify in parameters:
  18714. if (function_obj.parameters_list) {
  18715. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  18716. if (function_obj.parameters_list[i] == var_obj) {
  18717. return function_obj.parameters_list[i];
  18718. }
  18719. }
  18720. } // Verify in globals:
  18721. if (window.program_obj.globals) {
  18722. for (var i = 0; i < window.program_obj.globals.length; i++) {
  18723. if (window.program_obj.globals[i] == var_obj) {
  18724. return window.program_obj.globals[i];
  18725. }
  18726. }
  18727. } // If not found, verify if the reference was lost
  18728. if (var_obj) {
  18729. if (function_obj.variables_list) {
  18730. for (var i = 0; i < function_obj.variables_list.length; i++) {
  18731. if (function_obj.variables_list[i].name == var_obj.name) {
  18732. return function_obj.variables_list[i];
  18733. }
  18734. }
  18735. }
  18736. if (function_obj.parameters_list) {
  18737. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  18738. if (function_obj.parameters_list[i].name == var_obj.name) {
  18739. return function_obj.parameters_list[i];
  18740. }
  18741. }
  18742. }
  18743. if (window.program_obj.globals) {
  18744. for (var i = 0; i < window.program_obj.globals.length; i++) {
  18745. if (window.program_obj.globals[i].name == var_obj.name) {
  18746. return window.program_obj.globals[i];
  18747. }
  18748. }
  18749. }
  18750. }
  18751. return null;
  18752. }
  18753. function renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element) {
  18754. if (ref_object.function_called) {
  18755. menu_var_or_value.remove();
  18756. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  18757. } else if (ref_object.content.type) {
  18758. menu_var_or_value.remove();
  18759. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  18760. } else {
  18761. menu_var_or_value.remove();
  18762. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  18763. }
  18764. }
  18765. function variableValueMenuCode(command, variable_obj, dom_object, function_obj, menu_var_or_value, expression_element) {
  18766. if (variable_obj.content || variable_obj.function_called) {
  18767. // Verificar se a variável ainda existe:
  18768. var var_fun = isVarInProgram(variable_obj.content, function_obj);
  18769. if (var_fun) {
  18770. variable_obj.content = var_fun;
  18771. } else {
  18772. if (variable_obj.content && variable_obj.content.type) {
  18773. variable_obj.content = null;
  18774. appendSelectText(variable_obj, menu_var_or_value);
  18775. }
  18776. }
  18777. } else {
  18778. appendSelectText(variable_obj, menu_var_or_value);
  18779. }
  18780. if (variable_obj.content == null && variable_obj.function_called == null) {
  18781. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18782. return;
  18783. }
  18784. var ret = "";
  18785. if (variable_obj.function_called) {
  18786. if (variable_obj.function_called.parameters_list == null || variable_obj.function_called.length == 0) {
  18787. menu_var_or_value.find(".text").text(" ");
  18788. dom_object.find(".menu_var_or_value_dom").remove();
  18789. var parameters_menu;
  18790. if (variable_obj.function_called.name) {
  18791. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  18792. } else {
  18793. 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>";
  18794. }
  18795. parameters_menu += "<span> ) </span></div>";
  18796. parameters_menu = $(parameters_menu);
  18797. dom_object.append(parameters_menu);
  18798. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18799. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18800. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18801. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18802. context_menu += '<div class="menu">';
  18803. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18804. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18805. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18806. context_menu += '</div></div>';
  18807. }*/
  18808. context_menu += "</div></div>";
  18809. context_menu = $(context_menu);
  18810. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  18811. context_menu.dropdown({
  18812. onChange: function onChange(value, text, $selectedItem) {
  18813. console.log("S1");
  18814. if ($selectedItem.data("clear")) {
  18815. console.log("PP1");
  18816. dom_object.text("");
  18817. variable_obj.content = null;
  18818. variable_obj.row = null;
  18819. variable_obj.column = null;
  18820. delete variable_obj.function_called;
  18821. delete variable_obj.parameters_list;
  18822. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18823. }
  18824. if ($selectedItem.data("exp")) {
  18825. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18826. }
  18827. },
  18828. selectOnKeydown: false
  18829. });
  18830. } else {
  18831. menu_var_or_value.find(".text").text(" ");
  18832. dom_object.find(".menu_var_or_value_dom").remove();
  18833. var parameters_menu;
  18834. if (variable_obj.function_called.name) {
  18835. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  18836. } else {
  18837. 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>";
  18838. }
  18839. for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
  18840. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  18841. if (j + 1 != variable_obj.function_called.parameters_list.length) {
  18842. parameters_menu += " , ";
  18843. }
  18844. }
  18845. parameters_menu += "<span> ) </span></div>";
  18846. parameters_menu = $(parameters_menu);
  18847. dom_object.append(parameters_menu);
  18848. for (var _j = 0; _j < variable_obj.function_called.parameters_list.length; _j++) {
  18849. renderMenu(command, variable_obj.parameters_list[_j], parameters_menu.find(".parameter_" + _j), function_obj, 2, expression_element);
  18850. }
  18851. var _context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18852. _context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18853. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18854. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18855. context_menu += '<div class="menu">';
  18856. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18857. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18858. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18859. context_menu += '</div></div>';
  18860. }*/
  18861. _context_menu += "</div></div>";
  18862. _context_menu = $(_context_menu);
  18863. _context_menu.insertAfter(parameters_menu);
  18864. _context_menu.dropdown({
  18865. onChange: function onChange(value, text, $selectedItem) {
  18866. console.log("S2");
  18867. if ($selectedItem.data("clear")) {
  18868. console.log("PP2");
  18869. dom_object.text("");
  18870. variable_obj.content = null;
  18871. variable_obj.row = null;
  18872. variable_obj.column = null;
  18873. delete variable_obj.function_called;
  18874. delete variable_obj.parameters_list;
  18875. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18876. }
  18877. if ($selectedItem.data("exp")) {
  18878. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18879. }
  18880. },
  18881. selectOnKeydown: false
  18882. });
  18883. }
  18884. } else if (variable_obj.content.type) {
  18885. var variable_render = "";
  18886. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  18887. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  18888. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  18889. variable_render += "</div>";
  18890. variable_render = $(variable_render);
  18891. dom_object.append(variable_render);
  18892. var _context_menu2 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18893. _context_menu2 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18894. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18895. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18896. context_menu += '<div class="menu">';
  18897. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18898. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18899. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18900. context_menu += '</div></div>';
  18901. }*/
  18902. _context_menu2 += "</div></div>";
  18903. _context_menu2 = $(_context_menu2);
  18904. variable_render.append(_context_menu2);
  18905. _context_menu2.dropdown({
  18906. onChange: function onChange(value, text, $selectedItem) {
  18907. console.log("S3");
  18908. if ($selectedItem.data("clear")) {
  18909. console.log("PP3");
  18910. dom_object.text("");
  18911. variable_obj.content = null;
  18912. variable_obj.row = null;
  18913. variable_obj.column = null;
  18914. delete variable_obj.function_called;
  18915. delete variable_obj.parameters_list;
  18916. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18917. }
  18918. if ($selectedItem.data("exp")) {
  18919. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18920. }
  18921. },
  18922. selectOnKeydown: false
  18923. });
  18924. if (!variable_obj.column) {
  18925. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  18926. }
  18927. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  18928. } else if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  18929. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  18930. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span>';
  18931. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ] </span>';
  18932. variable_render += "</div>";
  18933. variable_render = $(variable_render);
  18934. dom_object.append(variable_render);
  18935. var _context_menu3 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18936. _context_menu3 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18937. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  18938. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18939. context_menu += '<div class="menu">';
  18940. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18941. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18942. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18943. context_menu += '</div></div>';
  18944. }*/
  18945. _context_menu3 += "</div></div>";
  18946. _context_menu3 = $(_context_menu3);
  18947. variable_render.append(_context_menu3);
  18948. _context_menu3.dropdown({
  18949. onChange: function onChange(value, text, $selectedItem) {
  18950. console.log("S4");
  18951. if ($selectedItem.data("clear")) {
  18952. console.log("PP4");
  18953. dom_object.text("");
  18954. variable_obj.content = null;
  18955. variable_obj.row = null;
  18956. variable_obj.column = null;
  18957. delete variable_obj.function_called;
  18958. delete variable_obj.parameters_list;
  18959. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  18960. }
  18961. if ($selectedItem.data("exp")) {
  18962. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  18963. }
  18964. },
  18965. selectOnKeydown: false
  18966. });
  18967. if (!variable_obj.column) {
  18968. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  18969. }
  18970. if (!variable_obj.row) {
  18971. variable_obj.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  18972. }
  18973. variableValueMenuCode(command, variable_obj.row, $(variable_render.find(".row_container")), function_obj, menu_var_or_value, expression_element);
  18974. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  18975. } else {
  18976. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  18977. variable_render += "</div>";
  18978. variable_render = $(variable_render);
  18979. dom_object.append(variable_render);
  18980. var _context_menu4 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  18981. _context_menu4 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  18982. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  18983. console.log('dom_object6');
  18984. console.log(dom_object);
  18985. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  18986. context_menu += '<div class="menu">';
  18987. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  18988. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  18989. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  18990. context_menu += '</div></div>';
  18991. }*/
  18992. _context_menu4 += "</div></div>";
  18993. _context_menu4 = $(_context_menu4);
  18994. variable_render.append(_context_menu4);
  18995. _context_menu4.dropdown({
  18996. onChange: function onChange(value, text, $selectedItem) {
  18997. console.log("S5");
  18998. if ($selectedItem.data("clear")) {
  18999. console.log("PP5");
  19000. dom_object.text("");
  19001. variable_obj.content = null;
  19002. variable_obj.row = null;
  19003. variable_obj.column = null;
  19004. delete variable_obj.function_called;
  19005. delete variable_obj.parameters_list;
  19006. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19007. }
  19008. if ($selectedItem.data("exp")) {
  19009. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19010. }
  19011. },
  19012. selectOnKeydown: false
  19013. });
  19014. }
  19015. } else {
  19016. var _variable_render;
  19017. _variable_render = '<div class="variable_rendered"> <span class="var_name">';
  19018. if (isNaN(variable_obj.content)) {
  19019. _variable_render += variable_obj.content.replaceAll(" ", "&nbsp;");
  19020. } else {
  19021. _variable_render += variable_obj.content;
  19022. }
  19023. _variable_render += "</span>";
  19024. _variable_render += "</div>";
  19025. _variable_render = $(_variable_render);
  19026. dom_object.append(_variable_render);
  19027. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19028. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19029. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19030. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19031. context_menu += '<div class="menu">';
  19032. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19033. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19034. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19035. context_menu += '</div></div>';
  19036. }*/
  19037. context_menu += "</div></div>";
  19038. context_menu = $(context_menu);
  19039. if (variable_obj.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19040. context_menu.insertAfter(_variable_render);
  19041. }
  19042. context_menu.dropdown({
  19043. onChange: function onChange(value, text, $selectedItem) {
  19044. console.log("S6");
  19045. if ($selectedItem.data("clear")) {
  19046. console.log("PP6");
  19047. dom_object.text("");
  19048. variable_obj.content = null;
  19049. variable_obj.row = null;
  19050. variable_obj.column = null;
  19051. delete variable_obj.function_called;
  19052. delete variable_obj.parameters_list;
  19053. dom_object.find(".value_rendered").remove();
  19054. dom_object.find(".context_menu_clear").remove();
  19055. dom_object.find(".width-dynamic-minus").remove();
  19056. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19057. }
  19058. if ($selectedItem.data("exp")) {
  19059. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19060. }
  19061. },
  19062. selectOnKeydown: false
  19063. });
  19064. _variable_render.on("click", function (e) {
  19065. _variable_render.remove();
  19066. _variable_render.empty();
  19067. _variable_render.remove();
  19068. dom_object.empty();
  19069. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19070. openInputToValue(command, variable_obj, dom_object, menu_var_or_value, function_obj, expression_element);
  19071. });
  19072. }
  19073. }
  19074. function addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19075. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  19076. sub_menu.append('<div class="divider"></div><div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_header_ivprog_functions") + "</div>");
  19077. 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>');
  19078. 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>');
  19079. 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>');
  19080. 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:
  19081. for (var i = 0; i < window.system_functions.length; i++) {
  19082. var t = $('<div class="item"></div>');
  19083. t.data("function_reference", window.system_functions[i]);
  19084. t.data("option", VAR_OR_VALUE_TYPES.only_function);
  19085. t.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(window.system_functions[i].identifier));
  19086. switch (window.system_functions[i].category) {
  19087. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].math:
  19088. sub_menu.find(".menu_math_functions").append(t);
  19089. break;
  19090. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].text:
  19091. sub_menu.find(".menu_text_functions").append(t);
  19092. break;
  19093. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement:
  19094. sub_menu.find(".menu_arrangement_functions").append(t);
  19095. break;
  19096. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion:
  19097. sub_menu.find(".menu_conversion_functions").append(t);
  19098. break;
  19099. }
  19100. }
  19101. }
  19102. function addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19103. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  19104. sub_menu.text("");
  19105. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19106. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_function + '">' + window.program_obj.functions[i].name + " </div>");
  19107. temp.data("function_reference", window.program_obj.functions[i]);
  19108. sub_menu.append(temp);
  19109. }
  19110. }
  19111. function addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19112. var sub_menu = menu_var_or_value.find(".menu_only_vars");
  19113. sub_menu.text("");
  19114. var is_there = false;
  19115. if (window.program_obj.globals) {
  19116. if (ref_object.include_constant) {
  19117. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19118. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  19119. temp.data("variable_reference", window.program_obj.globals[i]);
  19120. sub_menu.append(temp);
  19121. is_there = true;
  19122. }
  19123. } else {
  19124. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19125. if (!window.program_obj.globals[i].is_constant) {
  19126. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  19127. temp.data("variable_reference", window.program_obj.globals[i]);
  19128. sub_menu.append(temp);
  19129. is_there = true;
  19130. }
  19131. }
  19132. }
  19133. }
  19134. if (function_obj.parameters_list) {
  19135. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  19136. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.parameters_list[i].name + " </div>");
  19137. temp.data("variable_reference", function_obj.parameters_list[i]);
  19138. sub_menu.append(temp);
  19139. is_there = true;
  19140. }
  19141. }
  19142. if (function_obj.variables_list) {
  19143. for (var i = 0; i < function_obj.variables_list.length; i++) {
  19144. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.variables_list[i].name + " </div>");
  19145. temp.data("variable_reference", function_obj.variables_list[i]);
  19146. sub_menu.append(temp);
  19147. is_there = true;
  19148. }
  19149. }
  19150. if (!is_there) {
  19151. sub_menu.append($('<div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable") + "</div>"));
  19152. sub_menu.append($('<div class="item disabled">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable_instruction") + "</div>"));
  19153. }
  19154. }
  19155. function addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  19156. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19157. menu_var_or_value.dropdown({
  19158. onChange: function onChange(value, text, $selectedItem) {
  19159. console.log("S7");
  19160. dom_object.find(".var_name").remove();
  19161. switch ($selectedItem.data("option")) {
  19162. case VAR_OR_VALUE_TYPES.only_function:
  19163. openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("function_reference"), expression_element);
  19164. break;
  19165. case VAR_OR_VALUE_TYPES.only_value:
  19166. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19167. break;
  19168. case VAR_OR_VALUE_TYPES.only_variable:
  19169. openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("variable_reference"), expression_element);
  19170. break;
  19171. }
  19172. if ($selectedItem.data("exp")) {
  19173. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19174. }
  19175. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  19176. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19177. }
  19178. },
  19179. selectOnKeydown: false
  19180. });
  19181. }
  19182. dom_object.find(".width-dynamic").on("input", function () {
  19183. var inputWidth = $(this).textWidth() + 10;
  19184. $(this).focus();
  19185. var tmpStr = $(this).val();
  19186. $(this).val("");
  19187. $(this).val(tmpStr);
  19188. $(this).css({
  19189. width: inputWidth
  19190. });
  19191. }).trigger("input");
  19192. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  19193. dom_object.parent().on("click", function (e) {
  19194. dom_object.find(".value_rendered").remove();
  19195. dom_object.find(".value_rendered").empty();
  19196. dom_object.find(".value_rendered").remove();
  19197. dom_object.empty();
  19198. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19199. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19200. });
  19201. }
  19202. }
  19203. function openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, function_selected, expression_element) {
  19204. ref_object.function_called = function_selected;
  19205. ref_object.parameters_list = [];
  19206. if (function_selected.parameters_list != null && function_selected.parameters_list.length > 0) {
  19207. menu_var_or_value.find(".text").text(" ");
  19208. dom_object.find(".menu_var_or_value_dom").remove();
  19209. var parameters_menu;
  19210. if (function_selected.name) {
  19211. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  19212. } else {
  19213. 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>";
  19214. }
  19215. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  19216. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  19217. if (j + 1 != function_selected.parameters_list.length) {
  19218. parameters_menu += " , ";
  19219. }
  19220. }
  19221. parameters_menu += "<span> ) </span></div>";
  19222. parameters_menu = $(parameters_menu);
  19223. dom_object.append(parameters_menu);
  19224. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  19225. var temp;
  19226. if (function_selected.parameters_list[j].dimensions > 0) {
  19227. 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);
  19228. } else {
  19229. temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19230. }
  19231. ref_object.parameters_list.push(temp);
  19232. renderMenu(command, temp, parameters_menu.find(".parameter_" + j), function_obj, 2, expression_element);
  19233. }
  19234. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19235. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19236. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19237. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19238. context_menu += '<div class="menu">';
  19239. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19240. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19241. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19242. context_menu += '</div></div>';
  19243. }*/
  19244. context_menu += "</div></div>";
  19245. context_menu = $(context_menu);
  19246. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  19247. context_menu.dropdown({
  19248. onChange: function onChange(value, text, $selectedItem) {
  19249. console.log("S8");
  19250. if ($selectedItem.data("clear")) {
  19251. console.log("PP7");
  19252. dom_object.text("");
  19253. ref_object.content = null;
  19254. ref_object.row = null;
  19255. ref_object.column = null;
  19256. delete ref_object.function_called;
  19257. delete ref_object.parameters_list;
  19258. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19259. }
  19260. if ($selectedItem.data("exp")) {
  19261. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19262. }
  19263. },
  19264. selectOnKeydown: false
  19265. });
  19266. } else {
  19267. menu_var_or_value.find(".text").text(" ");
  19268. dom_object.find(".menu_var_or_value_dom").remove();
  19269. var parameters_menu;
  19270. if (function_selected.name) {
  19271. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  19272. } else {
  19273. 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>";
  19274. }
  19275. parameters_menu += "<span> ) </span></div>";
  19276. parameters_menu = $(parameters_menu);
  19277. dom_object.append(parameters_menu);
  19278. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19279. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19280. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19281. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19282. context_menu += '<div class="menu">';
  19283. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19284. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19285. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19286. context_menu += '</div></div>';
  19287. }*/
  19288. context_menu += "</div></div>";
  19289. context_menu = $(context_menu);
  19290. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  19291. context_menu.dropdown({
  19292. onChange: function onChange(value, text, $selectedItem) {
  19293. console.log("S9");
  19294. if ($selectedItem.data("clear")) {
  19295. console.log("PP8");
  19296. dom_object.text("");
  19297. ref_object.content = null;
  19298. ref_object.row = null;
  19299. ref_object.column = null;
  19300. delete ref_object.function_called;
  19301. delete ref_object.parameters_list;
  19302. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19303. }
  19304. if ($selectedItem.data("exp")) {
  19305. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19306. }
  19307. },
  19308. selectOnKeydown: false
  19309. });
  19310. }
  19311. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19312. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  19313. }*/
  19314. }
  19315. function openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected, expression_element) {
  19316. ref_object.content = variable_selected;
  19317. menu_var_or_value.find(".text").text(" ");
  19318. dom_object.find(".menu_var_or_value_dom").remove();
  19319. var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_selected.name + "</span>";
  19320. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  19321. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  19322. }
  19323. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  19324. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span> ';
  19325. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  19326. }
  19327. variable_render += "</div>";
  19328. variable_render = $(variable_render);
  19329. dom_object.append(variable_render);
  19330. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  19331. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19332. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  19333. }
  19334. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  19335. ref_object.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19336. renderMenu(command, ref_object.row, variable_render.find(".row_container"), function_obj, 2, expression_element);
  19337. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19338. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  19339. }
  19340. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19341. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19342. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  19343. console.log("dom_object 10: ");
  19344. console.log(dom_object);
  19345. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19346. context_menu += '<div class="menu">';
  19347. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19348. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19349. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19350. context_menu += '</div></div>';
  19351. }*/
  19352. context_menu += "</div></div>";
  19353. context_menu = $(context_menu);
  19354. context_menu.insertAfter(dom_object.find(".variable_rendered"));
  19355. context_menu.dropdown({
  19356. onChange: function onChange(value, text, $selectedItem) {
  19357. console.log("S10");
  19358. if ($selectedItem.data("clear")) {
  19359. console.log("PP9");
  19360. dom_object.text("");
  19361. ref_object.content = null;
  19362. ref_object.row = null;
  19363. ref_object.column = null;
  19364. delete ref_object.function_called;
  19365. delete ref_object.parameters_list;
  19366. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19367. }
  19368. if ($selectedItem.data("exp")) {
  19369. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19370. }
  19371. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  19372. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageClearExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19373. }
  19374. },
  19375. selectOnKeydown: false
  19376. });
  19377. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19378. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected);
  19379. }*/
  19380. }
  19381. function openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  19382. if (ref_object.content == null) {
  19383. ref_object.content = "";
  19384. }
  19385. menu_var_or_value.find(".text").text(" ");
  19386. var field = $('<input type="text" size="2" class="width-dynamic-minus" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />');
  19387. field.insertBefore(dom_object.find(".menu_var_or_value_dom"));
  19388. field.on('input', function () {
  19389. var input_field = $(this);
  19390. var inputWidth = input_field.textWidth() + 10;
  19391. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  19392. input_field.css({
  19393. width: inputWidth
  19394. });
  19395. }).trigger('input');
  19396. var rendered = $('<div class="value_rendered"></div>');
  19397. rendered.insertBefore(field);
  19398. field.focus();
  19399. field.val(ref_object.content);
  19400. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19401. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  19402. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19403. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19404. context_menu += '<div class="menu">';
  19405. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19406. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19407. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19408. context_menu += '</div></div>';
  19409. }*/
  19410. context_menu += "</div></div>";
  19411. context_menu = $(context_menu);
  19412. dom_object.find(".menu_var_or_value_dom").remove();
  19413. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19414. context_menu.insertAfter(field);
  19415. }
  19416. context_menu.dropdown({
  19417. onChange: function onChange(value, text, $selectedItem) {
  19418. if ($selectedItem.data("clear")) {
  19419. dom_object.text("");
  19420. dom_object.find(".value_rendered").remove();
  19421. dom_object.find(".context_menu_clear").remove();
  19422. dom_object.find(".width-dynamic-minus").remove();
  19423. ref_object.content = null;
  19424. ref_object.row = null;
  19425. ref_object.column = null;
  19426. delete ref_object.function_called;
  19427. delete ref_object.parameters_list;
  19428. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19429. }
  19430. if ($selectedItem.data("exp")) {
  19431. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19432. }
  19433. },
  19434. selectOnKeydown: false
  19435. });
  19436. dom_object.find(".width-dynamic-minus").focusout(function () {
  19437. /*if (
  19438. $(this)
  19439. .val()
  19440. .trim()
  19441. ) {
  19442. ref_object.content = $(this)
  19443. .val()
  19444. .trim();
  19445. }*/
  19446. ref_object.content = $(this).val();
  19447. if (isNaN(ref_object.content)) {
  19448. rendered.html(ref_object.content.replaceAll(" ", "&nbsp;"));
  19449. } else {
  19450. rendered.text(ref_object.content);
  19451. }
  19452. $(this).remove();
  19453. });
  19454. dom_object.find(".width-dynamic-minus").on("keydown", function (e) {
  19455. var code = e.keyCode || e.which;
  19456. if (code == 13) {
  19457. /*if (
  19458. $(this)
  19459. .val()
  19460. .trim()
  19461. ) {
  19462. ref_object.content = $(this)
  19463. .val()
  19464. .trim();
  19465. }*/
  19466. ref_object.content = $(this).val();
  19467. if (isNaN(ref_object.content)) {
  19468. rendered.html(ref_object.content.replaceAll(" ", "&nbsp;"));
  19469. } else {
  19470. rendered.text(ref_object.content);
  19471. }
  19472. $(this).remove();
  19473. }
  19474. if (code == 27) {
  19475. if (isNaN(ref_object.content)) {
  19476. rendered.html(ref_object.content.replaceAll(" ", "&nbsp;"));
  19477. } else {
  19478. rendered.text(ref_object.content);
  19479. }
  19480. $(this).remove();
  19481. }
  19482. });
  19483. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  19484. /*rendered.parent().on('click', function(e) {
  19485. rendered.parent().off();
  19486. console.log("TTT14");
  19487. rendered.remove();
  19488. rendered.empty();
  19489. rendered.remove();
  19490. dom_object.empty();
  19491. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19492. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element)
  19493. });*/
  19494. }
  19495. rendered.on("click", function (e) {
  19496. console.log("TTT2");
  19497. rendered.empty();
  19498. rendered.remove();
  19499. dom_object.empty();
  19500. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19501. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19502. });
  19503. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19504. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  19505. }*/
  19506. }
  19507. $.fn.textWidth = function (text, font) {
  19508. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $("<span>").hide().appendTo(document.body);
  19509. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr("placeholder")).css("font", font || this.css("font"));
  19510. return $.fn.textWidth.fakeEl.width();
  19511. };
  19512. /***/ }),
  19513. /***/ "./js/visualUI/commands/whiletrue.js":
  19514. /*!*******************************************!*\
  19515. !*** ./js/visualUI/commands/whiletrue.js ***!
  19516. \*******************************************/
  19517. /*! exports provided: createFloatingCommand, renderCommand */
  19518. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19519. "use strict";
  19520. __webpack_require__.r(__webpack_exports__);
  19521. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19522. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19523. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19524. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19525. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  19526. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  19527. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19528. function createFloatingCommand() {
  19529. 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>');
  19530. }
  19531. function renderCommand(command, function_obj) {
  19532. var ret = '';
  19533. 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>';
  19534. ret += '<span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
  19535. ret += ' </span>';
  19536. ret += '<div class="ui block_commands">';
  19537. ret += '</div>';
  19538. ret += '<span> </span>';
  19539. ret += '</div>';
  19540. var el = $(ret);
  19541. el.data('command', command);
  19542. el.find('.block_commands').data('command', command);
  19543. addHandlers(command, function_obj, el);
  19544. _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'));
  19545. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  19546. if (command.commands_block) {
  19547. for (var j = 0; j < command.commands_block.length; j++) {
  19548. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  19549. }
  19550. }
  19551. return el;
  19552. }
  19553. function addHandlers(command, function_obj, whiletrue_dom) {
  19554. whiletrue_dom.find('.button_remove_command').on('click', function () {
  19555. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, whiletrue_dom)) {
  19556. whiletrue_dom.fadeOut(400, function () {
  19557. whiletrue_dom.remove();
  19558. });
  19559. }
  19560. });
  19561. }
  19562. /***/ }),
  19563. /***/ "./js/visualUI/commands/writer.js":
  19564. /*!****************************************!*\
  19565. !*** ./js/visualUI/commands/writer.js ***!
  19566. \****************************************/
  19567. /*! exports provided: createFloatingCommand, renderCommand, addContent */
  19568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19569. "use strict";
  19570. __webpack_require__.r(__webpack_exports__);
  19571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContent", function() { return addContent; });
  19574. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19575. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19576. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19577. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19578. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19579. function createFloatingCommand() {
  19580. 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>");
  19581. }
  19582. function renderCommand(command, function_obj) {
  19583. 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>");
  19584. var el = $(ret);
  19585. el.data("command", command); //renderExpression (command, function_obj, div_to_render, expression_array)
  19586. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find(".all_elements_write"), command.content);
  19587. /*for (var i = 0; i < command.content.length; i ++) {
  19588. var new_div_item = $( '<div class="var_value_menu_div"></div>' );
  19589. var div_parent_with_handler = $( '<div class="div_parent_handler"></div>' );
  19590. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  19591. div_parent_with_handler.append(new_div_item);
  19592. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  19593. el.find('.all_elements_write').append(div_parent_with_handler);
  19594. VariableValueMenu.renderMenu(command, command.content[i], new_div_item, function_obj);
  19595. addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
  19596. addHandlersManager(command, function_obj, el, div_parent_with_handler, command.content[i]);
  19597. }
  19598. if (command.content.length == 0) {
  19599. addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
  19600. }*/
  19601. addHandlers(command, function_obj, el);
  19602. return el;
  19603. }
  19604. function addHandlersManager(command, _function_obj, _writer_dom, item_div, content_element) {
  19605. item_div.find(".times").on("click", function () {
  19606. for (var i = 0; i < command.content.length; i++) {
  19607. if (command.content[i] == content_element) {
  19608. delete command.content[i];
  19609. command.content.splice(i, 1);
  19610. item_div.children().off();
  19611. item_div.off();
  19612. item_div.fadeOut();
  19613. if (command.content.length > 0) {
  19614. item_div.next(".icon_add_item_to_writer").fadeOut();
  19615. }
  19616. break;
  19617. }
  19618. }
  19619. });
  19620. }
  19621. function addHandlers(command, function_obj, writer_dom) {
  19622. writer_dom.find(".button_remove_command").on("click", function () {
  19623. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, writer_dom)) {
  19624. writer_dom.fadeOut(400, function () {
  19625. writer_dom.remove();
  19626. });
  19627. }
  19628. });
  19629. Sortable.create(writer_dom.find(".all_elements_write")[0], {
  19630. handle: ".ellipsis",
  19631. animation: 100,
  19632. ghostClass: "ghost",
  19633. group: "writer_" + Math.floor(Math.random() * 10000000),
  19634. draggable: ".div_parent_handler",
  19635. onEnd: function onEnd(evt) {
  19636. command.content.splice(evt.newIndex, 0, command.content.splice(evt.oldIndex, 1)[0]);
  19637. writer_dom.empty();
  19638. writer_dom.replaceWith(renderCommand(command, function_obj));
  19639. }
  19640. }); // Attach event handles for the newline button
  19641. var newlineBtn = writer_dom.find(".ivprog_newline_btn");
  19642. newlineBtn.on("click", function () {
  19643. var state = this.dataset.state;
  19644. if (state === "on") {
  19645. this.dataset.state = "off";
  19646. command.newline = false;
  19647. this.setAttribute("src", "img/no_new_line.svg");
  19648. } else {
  19649. this.dataset.state = "on";
  19650. command.newline = true;
  19651. this.setAttribute("src", "img/new_line.svg");
  19652. }
  19653. writer_dom.data("command", command);
  19654. setPopup(newlineBtn, command.newline);
  19655. }); // Attach jquery popup
  19656. setPopup(newlineBtn, command.newline);
  19657. }
  19658. function setPopup(element, state) {
  19659. if (element.popup("exists")) {
  19660. element.popup("destroy");
  19661. }
  19662. 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");
  19663. element.popup({
  19664. content: content,
  19665. delay: {
  19666. show: 750,
  19667. hide: 0
  19668. }
  19669. });
  19670. }
  19671. function _addHandlerIconAdd(dom_object, command, function_obj) {
  19672. var insert_after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  19673. var after_which = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  19674. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  19675. if (!insert_after) {
  19676. dom_object.append(icon_add_item);
  19677. } else {
  19678. icon_add_item.insertAfter(after_which);
  19679. }
  19680. icon_add_item.on("click", function (_event) {
  19681. var div_parent_with_handler = $('<div class="div_parent_handler" style="display:none;"></div>');
  19682. var new_div_item = $('<div class="var_value_menu_div"></div>');
  19683. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  19684. div_parent_with_handler.append(new_div_item);
  19685. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  19686. div_parent_with_handler.insertAfter(icon_add_item);
  19687. 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);
  19688. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  19689. addHandlerIconAdd(dom_object, command, function_obj, true, div_parent_with_handler);
  19690. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  19691. var pos = 1;
  19692. dom_object.find(".icon_add_item_to_writer").each(function () {
  19693. if ($(this).get(0) === icon_add_item.get(0)) {
  19694. command.content.splice(pos, 0, new_related_menu);
  19695. } else {
  19696. pos++;
  19697. }
  19698. });
  19699. if (command.content.length == 1) {
  19700. icon_add_item.remove();
  19701. }
  19702. div_parent_with_handler.fadeIn();
  19703. });
  19704. }
  19705. function addContent(command, _ref_object, dom_object, _menu_var_or_value, function_obj, _ref_object_content) {
  19706. if (dom_object.hasClass("var_value_menu_div")) {
  19707. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  19708. icon_add_item.insertAfter(dom_object);
  19709. icon_add_item.on("click", function (_event) {
  19710. var div_parent_with_handler = $('<div class="div_parent_handler"></div>');
  19711. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  19712. div_parent_with_handler.append(new_div_item);
  19713. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  19714. div_parent_with_handler.insertAfter(icon_add_item);
  19715. 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);
  19716. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  19717. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  19718. command.content.push(new_related_menu);
  19719. if (command.content.length == 1) {
  19720. icon_add_item.remove();
  19721. }
  19722. });
  19723. }
  19724. }
  19725. /***/ }),
  19726. /***/ "./js/visualUI/functions.js":
  19727. /*!**********************************!*\
  19728. !*** ./js/visualUI/functions.js ***!
  19729. \**********************************/
  19730. /*! exports provided: renderFunction, initVisualUI, setTestCases, getTestCases, addFunctionChangeListener, addGlobalChangeListener, removeGlobalListener, removeFunctionListener */
  19731. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19732. "use strict";
  19733. __webpack_require__.r(__webpack_exports__);
  19734. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderFunction", function() { return renderFunction; });
  19735. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return initVisualUI; });
  19736. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestCases", function() { return setTestCases; });
  19737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return getTestCases; });
  19738. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return addFunctionChangeListener; });
  19739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return addGlobalChangeListener; });
  19740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return removeGlobalListener; });
  19741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return removeFunctionListener; });
  19742. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  19743. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19744. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19745. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  19746. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variables */ "./js/visualUI/variables.js");
  19747. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands */ "./js/visualUI/commands.js");
  19748. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./code_generator */ "./js/visualUI/code_generator.js");
  19749. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19750. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  19751. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  19752. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  19753. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__);
  19754. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  19755. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  19756. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  19757. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  19758. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  19759. /* harmony import */ var _ima_version_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../.ima_version.json */ "./.ima_version.json");
  19760. var _ima_version_json__WEBPACK_IMPORTED_MODULE_16___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./../../.ima_version.json */ "./.ima_version.json", 1);
  19761. /* harmony import */ var _text_editor__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./text_editor */ "./js/visualUI/text_editor.js");
  19762. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  19763. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../processor/modes */ "./js/processor/modes.ts");
  19764. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_processor_modes__WEBPACK_IMPORTED_MODULE_19__);
  19765. var counter_new_functions = 0;
  19766. var counter_new_parameters = 0;
  19767. var ivprog_version = _ima_version_json__WEBPACK_IMPORTED_MODULE_16__.version;
  19768. var globalChangeListeners = [];
  19769. var functionsChangeListeners = [];
  19770. var proc = null;
  19771. var domConsole = null;
  19772. var _testCases = [];
  19773. var isRunning = false;
  19774. window.studentGrade = null;
  19775. window.LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"];
  19776. var program = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Program"]();
  19777. window.system_functions = []; // Adding math functions:
  19778. 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));
  19779. 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));
  19780. 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));
  19781. 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));
  19782. 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));
  19783. 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));
  19784. 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));
  19785. 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));
  19786. 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));
  19787. 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));
  19788. 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));
  19789. 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:
  19790. 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));
  19791. 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));
  19792. 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));
  19793. 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));
  19794. 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:
  19795. 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));
  19796. 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));
  19797. 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:
  19798. 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));
  19799. 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));
  19800. 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));
  19801. 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));
  19802. 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));
  19803. 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));
  19804. 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));
  19805. 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));
  19806. 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');
  19807. 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);
  19808. mainFunction.function_comment = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Comment"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment_main'));
  19809. program.addFunction(mainFunction);
  19810. window.program_obj = program;
  19811. window.generator = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"];
  19812. window.runCodeAssessment = runCodeAssessment;
  19813. window.renderAlgorithm = _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"];
  19814. window.insertContext = false;
  19815. window.watchW = melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a;
  19816. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.globals, function () {
  19817. if (window.insertContext) {
  19818. setTimeout(function () {
  19819. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19820. globalChangeListeners.forEach(function (x) {
  19821. return x();
  19822. });
  19823. }, 300);
  19824. window.insertContext = false;
  19825. } else {
  19826. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19827. globalChangeListeners.forEach(function (x) {
  19828. return x();
  19829. });
  19830. }
  19831. }, 1);
  19832. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.functions, function () {
  19833. if (window.insertContext) {
  19834. setTimeout(function () {
  19835. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19836. functionsChangeListeners.forEach(function (x) {
  19837. return x();
  19838. });
  19839. }, 300);
  19840. window.insertContext = false;
  19841. } else {
  19842. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  19843. functionsChangeListeners.forEach(function (x) {
  19844. return x();
  19845. });
  19846. }
  19847. }, 1);
  19848. function addFunctionHandler() {
  19849. 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')));
  19850. program.addFunction(new_function);
  19851. counter_new_functions++;
  19852. window.insertContext = true;
  19853. 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);
  19854. renderFunction(new_function);
  19855. /*newe.css('display', 'none');
  19856. newe.fadeIn();*/
  19857. }
  19858. function addParameter(function_obj, function_container
  19859. /*, is_from_click = false*/
  19860. ) {
  19861. if (function_obj.parameters_list == null) {
  19862. function_obj.parameters_list = [];
  19863. }
  19864. 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);
  19865. function_obj.parameters_list.push(new_parameter);
  19866. counter_new_parameters++;
  19867. 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);
  19868. renderParameter(function_obj, new_parameter, function_container); // if (is_from_click) {
  19869. // newe.css('display', 'none');
  19870. // newe.fadeIn();
  19871. // }
  19872. }
  19873. function updateReturnType(function_obj, new_type) {
  19874. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  19875. 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);
  19876. function_obj.return_type = new_type;
  19877. function_obj.return_dimensions = new_dimensions;
  19878. }
  19879. function removeFunction(function_obj) {
  19880. var index = program.functions.indexOf(function_obj);
  19881. if (index > -1) {
  19882. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION);
  19883. program.functions.splice(index, 1);
  19884. }
  19885. }
  19886. function minimizeFunction(function_obj) {
  19887. function_obj.is_hidden = !function_obj.is_hidden;
  19888. }
  19889. function addHandlers(function_obj, function_container) {
  19890. function_container.find('.ui.dropdown.function_return').dropdown({
  19891. onChange: function onChange(value, text, $selectedItem) {
  19892. if ($selectedItem.data('dimensions')) {
  19893. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  19894. } else {
  19895. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  19896. }
  19897. },
  19898. selectOnKeydown: false
  19899. });
  19900. function_container.find(".name_function_updated").on('click', function (e) {
  19901. enableNameFunctionUpdate(function_obj, function_container);
  19902. });
  19903. function_container.find(".add_parameter_button").on('click', function (e) {
  19904. window.insertContext = true;
  19905. addParameter(function_obj, function_container, true);
  19906. });
  19907. function_container.find('.menu_commands').dropdown({
  19908. on: 'hover'
  19909. });
  19910. function_container.find('.menu_commands a').on('click', function (evt) {
  19911. if (function_obj.commands == null || function_obj.commands.length == 0) {
  19912. function_obj.commands = [];
  19913. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_5__["genericCreateCommand"]($(this).data('command'));
  19914. function_obj.commands.push(new_cmd);
  19915. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](new_cmd, function_container.find('.commands_list_div'), 3, function_obj);
  19916. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, $(this).data('command'), '/', 0);
  19917. } else {
  19918. _commands__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"](function_obj, function_container, $(this).data('command'), evt);
  19919. }
  19920. });
  19921. function_container.find('.add_var_button_function').on('click', function (e) {
  19922. window.insertContext = true;
  19923. _variables__WEBPACK_IMPORTED_MODULE_4__["addVariable"](function_obj, function_container, true);
  19924. });
  19925. function_container.find('.remove_function_button').on('click', function (e) {
  19926. removeFunction(function_obj);
  19927. function_container.fadeOut();
  19928. });
  19929. function_container.find('.minimize_function_button').on('click', function (e) {
  19930. minimizeFunction(function_obj);
  19931. if (function_obj.is_hidden) {
  19932. function_container.find(".add_var_button_function").toggle();
  19933. function_container.find(".inline_add_command").toggle();
  19934. function_container.find(".function_area").slideToggle();
  19935. } else {
  19936. function_container.find(".function_area").slideToggle(function () {
  19937. function_container.find(".add_var_button_function").toggle();
  19938. function_container.find(".inline_add_command").toggle();
  19939. });
  19940. }
  19941. });
  19942. } // Essa função imprime o tipo de retorno da função e cria o menu do tipo 'select' para alteração
  19943. function renderFunctionReturn(function_obj, function_element) {
  19944. var ret = '<div class="ui dropdown function_return">';
  19945. if (function_obj.return_dimensions == 1) {
  19946. 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()));
  19947. ret += ' [ ] </div>';
  19948. } else if (function_obj.return_dimensions == 2) {
  19949. 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()));
  19950. ret += ' [ ] [ ] </div>';
  19951. } else {
  19952. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase())) + '</div>';
  19953. }
  19954. ret += '<div class="menu">';
  19955. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  19956. 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>';
  19957. }
  19958. 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">';
  19959. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  19960. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  19961. continue;
  19962. }
  19963. 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>';
  19964. }
  19965. ret += '</div></div>';
  19966. 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">';
  19967. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  19968. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  19969. continue;
  19970. }
  19971. 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>';
  19972. }
  19973. ret += '</div></div>';
  19974. ret += '</div></div>';
  19975. ret = $(ret);
  19976. function_element.find('.function_return').append(ret);
  19977. }
  19978. var cont = 0;
  19979. function renderFunction(function_obj) {
  19980. var appender = '<div class="ui secondary segment function_div list-group-item function_cont_' + cont + '">';
  19981. if (function_obj.function_comment) {//appender += renderComment(function_obj.function_comment, sequence, true, -1);
  19982. }
  19983. appender += '<span class="glyphicon glyphicon-move move_function" aria-hidden="true"><i class="icon sort alternate vertical"></i></span>';
  19984. 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>';
  19985. appender += '<div class="function_signature_div">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + ' ';
  19986. if (function_obj.is_main) {
  19987. 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">';
  19988. } else {
  19989. appender += '<div class="ui function_return"></div>';
  19990. 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">';
  19991. }
  19992. appender += '</div> <span class="parethesis_function"> ) </span> </div>' + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ');
  19993. appender += '<div class="ui add_var_context add_var_button_function" style="float: left;"> <div class="ui icon button purple"> ';
  19994. 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>';
  19995. appender += '</div></div>';
  19996. appender += '<div class="ui top attached segment variables_list_div"></div>';
  19997. 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;">';
  19998. 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"> ';
  19999. 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>';
  20000. appender += '</div></div>' + '</div>';
  20001. appender += '</div></div>';
  20002. appender = $(appender);
  20003. $('.all_functions').append(appender);
  20004. appender.data('fun', function_obj);
  20005. appender.find('.commands_list_div').data('fun', function_obj);
  20006. renderFunctionReturn(function_obj, appender);
  20007. addHandlers(function_obj, appender); // Rendering parameters:
  20008. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  20009. renderParameter(function_obj, function_obj.parameters_list[j], appender);
  20010. } // Rendering variables:
  20011. for (var j = 0; j < function_obj.variables_list.length; j++) {
  20012. _variables__WEBPACK_IMPORTED_MODULE_4__["renderVariable"](appender, function_obj.variables_list[j], function_obj);
  20013. } // Rendering commands:
  20014. for (var j = 0; j < function_obj.commands.length; j++) {
  20015. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](function_obj.commands[j], $(appender.find('.commands_list_div')[0]), 3, function_obj);
  20016. }
  20017. $('.minimize_function_button').popup({
  20018. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_hide_function"),
  20019. delay: {
  20020. show: 750,
  20021. hide: 0
  20022. }
  20023. });
  20024. var function_index = program.functions.indexOf(function_obj);
  20025. Sortable.create(appender.find(".variables_list_div")[0], {
  20026. handle: '.ellipsis',
  20027. animation: 100,
  20028. ghostClass: 'ghost',
  20029. group: 'local_vars_drag_' + function_index,
  20030. onEnd: function onEnd(evt) {
  20031. updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
  20032. }
  20033. });
  20034. addSortableHandler(appender.find(".commands_list_div")[0], function_index);
  20035. if (!function_obj.is_main) {
  20036. Sortable.create(appender.find(".container_parameters_list")[0], {
  20037. handle: '.ellipsis',
  20038. animation: 100,
  20039. ghostClass: 'ghost',
  20040. group: 'parameters_drag_' + program.functions.indexOf(function_obj),
  20041. onEnd: function onEnd(evt) {
  20042. updateSequenceParameters(evt.oldIndex, evt.newIndex, function_obj);
  20043. }
  20044. });
  20045. }
  20046. if (function_obj.commands.length > 0) {
  20047. var teste = '.ui.sticky.sticky_cont_' + cont;
  20048. $(teste).sticky({
  20049. context: '.ui.bottom.attached.segment.commands_list_div.commands_cont_' + cont,
  20050. scrollContext: '.ivprog_visual_panel',
  20051. observeChanges: true,
  20052. offset: 40,
  20053. onStick: function onStick(evt) {
  20054. $(teste).css('top', '20px', 'important');
  20055. },
  20056. onBottom: function onBottom(evt) {
  20057. $(teste).css('top', '20px', 'important');
  20058. },
  20059. onUnstick: function onUnstick(evt) {
  20060. $(teste).css('top', '20px', 'important');
  20061. },
  20062. onReposition: function onReposition(evt) {
  20063. $(teste).css('top', '20px', 'important');
  20064. },
  20065. onScroll: function onScroll(evt) {
  20066. $(teste).css('top', '20px', 'important');
  20067. if (!isVisible($(teste), $(teste).parent())) {
  20068. $(teste).removeClass('fixed');
  20069. }
  20070. },
  20071. onTop: function onTop(evt) {
  20072. $(teste).css('top', '20px', 'important');
  20073. }
  20074. });
  20075. }
  20076. cont++;
  20077. return appender;
  20078. }
  20079. function isVisible(element, container) {
  20080. var elementTop = $(element).offset().top,
  20081. elementHeight = $(element).height(),
  20082. containerTop = $(container).offset().top,
  20083. containerHeight = $(container).height() - 30;
  20084. return elementTop - containerTop + elementHeight > 0 && elementTop - containerTop < containerHeight;
  20085. }
  20086. window.evento_drag;
  20087. function updateProgramObjDrag() {
  20088. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20089. var function_index;
  20090. var start_index;
  20091. var function_obj;
  20092. $(evento_drag.item).parentsUntil(".all_functions").each(function (index) {
  20093. var ref = $(this);
  20094. if (ref.hasClass('function_div')) {
  20095. function_index = nodes.indexOf(this);
  20096. start_index = index;
  20097. function_obj = ref;
  20098. }
  20099. });
  20100. var path_target = [];
  20101. $(evento_drag.item).parentsUntil(".all_functions").each(function () {
  20102. if ($(this).hasClass('command_container')) {
  20103. path_target.push(this);
  20104. }
  20105. });
  20106. if (path_target.length == 0) {//console.log('soltou na raiz, na posição: ' + evento_drag.newIndex + ' mas ainda não sei de onde saiu ');
  20107. } else {//console.log('soltou dentro de algum bloco, sequência vem logo abaixo (de baixo pra cima): ');
  20108. //console.log(path_target);
  20109. }
  20110. var index_each = [];
  20111. var path_relative = [];
  20112. for (var i = path_target.length - 1; i >= 0; i--) {
  20113. console.log('da vez', $(path_target[i + 1]));
  20114. if (i == path_target.length - 1) {
  20115. // está na raiz
  20116. var indice_na_raiz = function_obj.find('.command_container').index(path_target[i]);
  20117. console.log('índice na raiz: ', indice_na_raiz);
  20118. } else {
  20119. if ($(path_target[i + 1]).hasClass('iftrue')) {
  20120. if ($(path_target[i]).parent().hasClass('commands_if')) {
  20121. path_relative.push('if');
  20122. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  20123. } else {
  20124. path_relative.push('else');
  20125. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  20126. }
  20127. } else if ($(path_target[i + 1]).hasClass('dowhiletrue')) {
  20128. path_relative.push('dowhiletrue');
  20129. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20130. } else if ($(path_target[i + 1]).hasClass('repeatNtimes')) {
  20131. path_relative.push('repeatNtimes');
  20132. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20133. } else if ($(path_target[i + 1]).hasClass('whiletrue')) {
  20134. path_relative.push('whiletrue');
  20135. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20136. } else if ($(path_target[i + 1]).hasClass('switch')) {
  20137. path_relative.push('switch'); //index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20138. }
  20139. }
  20140. } // var index_in_block = -1;
  20141. 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);
  20142. var is_in_case_switch = $(evento_drag.item).parent().hasClass('case_commands_block'); // var index_case_of_switch = -1;
  20143. // if (is_in_case_switch) {
  20144. // index_case_of_switch = $(evento_drag.item).parent().parent().parent().find('.case_div').index($(evento_drag.item).parent().parent());
  20145. // }
  20146. /*console.log('path_relative:');
  20147. console.log(path_relative);
  20148. console.log('index_each:');
  20149. console.log(index_each);
  20150. console.log('index_in_block:');
  20151. console.log(index_in_block);
  20152. console.log('ele está em algum bloco de senão? ');
  20153. console.log(is_in_else);
  20154. console.log('ele está dentro de um case de switch?');
  20155. console.log(is_in_case_switch);
  20156. console.log('qual é o índice do case: ');
  20157. console.log(index_case_of_switch);*/
  20158. // encontrar o elemento na árvore:
  20159. var command_start_point = window.program_obj.functions[function_index].commands[indice_na_raiz];
  20160. var block_to_insert = command_start_point;
  20161. for (var i = 0; i < index_each.length; i++) {
  20162. if (path_relative[i] == "else") {
  20163. block_to_insert = block_to_insert.commands_else[index_each[i]];
  20164. } else if (path_relative[i] == "switch") {} else {
  20165. block_to_insert = block_to_insert.commands_block[index_each[i]];
  20166. }
  20167. } //console.log('command_start_point', command_start_point);
  20168. //console.log('block_to_insert', block_to_insert);
  20169. // agora tem que alocar o comando na árvore, mas considerar as quatro situações:
  20170. // (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.
  20171. if (path_target.length == 0) {
  20172. // soltou na raiz:
  20173. window.program_obj.functions[function_index].commands.splice(evento_drag.newIndex - 1, 0, command_in_drag);
  20174. } else if (is_in_else) {
  20175. if (block_to_insert.commands_else) {
  20176. block_to_insert.commands_else.splice(evento_drag.newIndex, 0, command_in_drag);
  20177. } else {
  20178. block_to_insert.commands_else = [];
  20179. block_to_insert.commands_else.push(command_in_drag);
  20180. }
  20181. } else if (is_in_case_switch) {} else {
  20182. // verificar se tem alguma coisa no bloco:
  20183. if (block_to_insert.commands_block) {
  20184. console.log("existe alguma coisa dentro do bloco, index: ", evento_drag.newIndex);
  20185. block_to_insert.commands_block.splice(evento_drag.newIndex, 0, command_in_drag);
  20186. } else {
  20187. block_to_insert.commands_block = [];
  20188. block_to_insert.commands_block.push(command_in_drag);
  20189. }
  20190. }
  20191. window.draging = false;
  20192. renderAlgorithm();
  20193. }
  20194. function prepareDragHandler(evt) {
  20195. window.draging = true;
  20196. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20197. var function_index;
  20198. var function_obj;
  20199. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  20200. if ($(this).hasClass('function_div')) {
  20201. function_index = nodes.indexOf(this);
  20202. function_obj = window.program_obj.functions[function_index];
  20203. }
  20204. });
  20205. command_in_drag = $(evt.item).data("command"); //console.log('$(evt.item).parent(): ');
  20206. //console.log($(evt.item).parent());
  20207. // descobrir qual das quatro situações:
  20208. if ($(evt.item).parent().hasClass('commands_list_div')) {
  20209. // está na raiz:
  20210. if (function_obj.commands.indexOf(command_in_drag) > -1) {
  20211. function_obj.commands.splice(function_obj.commands.indexOf(command_in_drag), 1);
  20212. }
  20213. } else if ($(evt.item).parent().hasClass('commands_else')) {
  20214. // está no else:
  20215. if ($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag) > -1) {
  20216. $(evt.item).parent().data('command').commands_else.splice($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag), 1);
  20217. }
  20218. } else if ($(evt.item).parent().hasClass('case_commands_block')) {// está em um switch:
  20219. } else {
  20220. // caso padrão:
  20221. if ($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag) > -1) {
  20222. $(evt.item).parent().data('command').commands_block.splice($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag), 1);
  20223. }
  20224. }
  20225. }
  20226. var command_in_drag;
  20227. function addSortableHandler(element, id_function) {
  20228. var n_group = 'commands_drag_' + id_function;
  20229. Sortable.create(element, {
  20230. handle: '.command_drag',
  20231. ghostClass: 'ghost',
  20232. animation: 300,
  20233. group: {
  20234. name: n_group
  20235. },
  20236. onEnd: function onEnd(evt) {
  20237. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20238. var function_index;
  20239. var function_obj;
  20240. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  20241. if ($(this).hasClass('function_div')) {
  20242. function_index = nodes.indexOf(this);
  20243. function_obj = window.program_obj.functions[function_index];
  20244. }
  20245. });
  20246. 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);
  20247. var itemEl = evt.item; // dragged HTMLElement
  20248. evt.to; // target list
  20249. evt.from; // previous list
  20250. evt.oldIndex; // element's old index within old parent
  20251. evt.newIndex; // element's new index within new parent
  20252. //console.log('::EVT::');
  20253. //console.log(evt);
  20254. window.evento_drag = evt;
  20255. try {
  20256. updateProgramObjDrag();
  20257. } catch (e) {
  20258. console.error(e);
  20259. window.draging = false;
  20260. }
  20261. },
  20262. onStart: function onStart(evt) {
  20263. //console.log("START::EVT::");
  20264. //console.log(evt);
  20265. //console.log("\n\ncommand_in_drag");
  20266. try {
  20267. prepareDragHandler(evt);
  20268. } catch (e) {
  20269. window.draging = false;
  20270. }
  20271. }
  20272. });
  20273. element = $(element);
  20274. element.find(".iftrue").each(function (index) {
  20275. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20276. addSortableHandler($(this).find(".block_commands")[1], id_function);
  20277. });
  20278. element.find(".repeatNtimes").each(function (index) {
  20279. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20280. });
  20281. element.find(".dowhiletrue").each(function (index) {
  20282. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20283. });
  20284. element.find(".whiletrue").each(function (index) {
  20285. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20286. });
  20287. element.find(".switch").each(function (index) {
  20288. $(this).find(".case_div").each(function (index) {
  20289. addSortableHandler($(this).find(".case_commands_block")[0], id_function);
  20290. });
  20291. });
  20292. }
  20293. function initVisualUI() {
  20294. // MUST USE CONST, LET, OR VAR !!!!!!
  20295. // const mainDiv = $('#visual-main-div');
  20296. // fill mainDiv with functions and globals...
  20297. // renderAlgorithm()...
  20298. domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_8__["DOMConsole"]("ivprog-term-div");
  20299. domConsole.hide();
  20300. $(document.getElementById("ivprog-term-div")).draggable();
  20301. $('.add_function_button').on('click', function () {
  20302. addFunctionHandler();
  20303. });
  20304. $('.add_global_button').on('click', function () {
  20305. window.insertContext = true;
  20306. _globals__WEBPACK_IMPORTED_MODULE_3__["addGlobal"](program, true);
  20307. });
  20308. $('#run_button').on('click', function () {
  20309. showStopButton();
  20310. runCode();
  20311. });
  20312. $('#stop_button').on('click', function () {
  20313. showRunButton();
  20314. stopExecution();
  20315. });
  20316. $('.visual_coding_button').on('click', function () {
  20317. toggleVisualCoding();
  20318. });
  20319. $('.textual_coding_button').on('click', function () {
  20320. toggleTextualCoding();
  20321. });
  20322. $('.assessment').on('click', function () {
  20323. is_iassign = true;
  20324. runCodeAssessment();
  20325. });
  20326. $('.div_toggle_console').on('click', function () {
  20327. toggleConsole();
  20328. });
  20329. $('.expand_button').on('click', function () {
  20330. full_screen();
  20331. });
  20332. $('.help_button').on('click', function () {
  20333. window.open('https://www.usp.br/line/ivprog/', '_blank');
  20334. });
  20335. $('.main_title h2').prop('title', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_ivprog_description'));
  20336. var time_show = 750;
  20337. $('.visual_coding_button').popup({
  20338. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_visual"),
  20339. delay: {
  20340. show: time_show,
  20341. hide: 0
  20342. }
  20343. });
  20344. $('.textual_coding_button').popup({
  20345. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_textual"),
  20346. delay: {
  20347. show: time_show,
  20348. hide: 0
  20349. }
  20350. });
  20351. $('.upload_file_button').popup({
  20352. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_upload"),
  20353. delay: {
  20354. show: time_show,
  20355. hide: 0
  20356. }
  20357. });
  20358. $('.download_file_button').popup({
  20359. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_download"),
  20360. delay: {
  20361. show: time_show,
  20362. hide: 0
  20363. }
  20364. });
  20365. $('.undo_button').popup({
  20366. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_undo"),
  20367. delay: {
  20368. show: time_show,
  20369. hide: 0
  20370. }
  20371. });
  20372. $('.redo_button').popup({
  20373. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_redo"),
  20374. delay: {
  20375. show: time_show,
  20376. hide: 0
  20377. }
  20378. });
  20379. $('.run_button').popup({
  20380. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_run"),
  20381. delay: {
  20382. show: time_show,
  20383. hide: 0
  20384. }
  20385. });
  20386. $('.assessment_button').popup({
  20387. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_evaluate"),
  20388. delay: {
  20389. show: time_show,
  20390. hide: 0
  20391. }
  20392. });
  20393. $('.help_button').popup({
  20394. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_help") + ' - ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_ivprog_version") + ' ' + ivprog_version,
  20395. delay: {
  20396. show: time_show,
  20397. hide: 0
  20398. }
  20399. });
  20400. $('.add_global_button').popup({
  20401. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_add_global"),
  20402. delay: {
  20403. show: time_show,
  20404. hide: 0
  20405. }
  20406. });
  20407. $('.div_toggle_console').popup({
  20408. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_console"),
  20409. delay: {
  20410. show: time_show,
  20411. hide: 0
  20412. }
  20413. });
  20414. Sortable.create(listWithHandle, {
  20415. handle: '.glyphicon-move',
  20416. animation: 100,
  20417. ghostClass: 'ghost',
  20418. group: 'functions_divs_drag',
  20419. onEnd: function onEnd(evt) {
  20420. updateSequenceFunction(evt.oldIndex, evt.newIndex);
  20421. }
  20422. });
  20423. var listGlobalsHandle = document.getElementById("listGlobalsHandle");
  20424. Sortable.create(listGlobalsHandle, {
  20425. handle: '.ellipsis',
  20426. animation: 100,
  20427. ghostClass: 'ghost',
  20428. group: 'globals_divs_drag',
  20429. onEnd: function onEnd(evt) {
  20430. updateSequenceGlobals(evt.oldIndex, evt.newIndex);
  20431. }
  20432. });
  20433. }
  20434. function setTestCases(testCases) {
  20435. _testCases = testCases;
  20436. }
  20437. function getTestCases() {
  20438. // Deep clone of test cases to avoid unauthorized modification
  20439. // TODO: It may be not possible to use this once custom test are fully implemented
  20440. return JSON.parse(JSON.stringify(_testCases));
  20441. }
  20442. var is_iassign = false;
  20443. function updateSequenceParameters(oldIndex, newIndex, function_obj) {
  20444. function_obj.parameters_list.splice(newIndex, 0, function_obj.parameters_list.splice(oldIndex, 1)[0]);
  20445. }
  20446. function updateSequenceLocals(oldIndex, newIndex, function_obj) {
  20447. function_obj.variables_list.splice(newIndex, 0, function_obj.variables_list.splice(oldIndex, 1)[0]);
  20448. }
  20449. function updateSequenceGlobals(oldIndex, newIndex) {
  20450. program_obj.globals.splice(newIndex, 0, program_obj.globals.splice(oldIndex, 1)[0]);
  20451. }
  20452. function updateSequenceFunction(oldIndex, newIndex) {
  20453. program_obj.functions.splice(newIndex, 0, program_obj.functions.splice(oldIndex, 1)[0]);
  20454. }
  20455. function runCodeAssessment() {
  20456. if (isRunning) {
  20457. // cannot run assessment or it's already running
  20458. return -1;
  20459. }
  20460. var strCode = null;
  20461. is_iassign = false;
  20462. window.studentGrade = null;
  20463. if (settingsProgrammingTypes == "textual") {
  20464. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  20465. } else {
  20466. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20467. }
  20468. if (strCode == null) {
  20469. // No code, so no assessment
  20470. return -1;
  20471. }
  20472. toggleConsole(true);
  20473. try {
  20474. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  20475. isRunning = true;
  20476. var runner = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__["IVProgAssessment"](data, _testCases, domConsole);
  20477. runner.runTest().then(function (grade) {
  20478. if (!is_iassign) {
  20479. parent.getEvaluationCallback(grade);
  20480. } else {
  20481. is_iassign = false;
  20482. }
  20483. isRunning = false;
  20484. })["catch"](function (err) {
  20485. console.log(err);
  20486. isRunning = false;
  20487. });
  20488. } catch (error) {
  20489. isRunning = false;
  20490. domConsole.err(error.message);
  20491. console.log(error);
  20492. if (!is_iassign) {
  20493. parent.getEvaluationCallback(0);
  20494. } else {
  20495. is_iassign = false;
  20496. }
  20497. }
  20498. return 0;
  20499. }
  20500. function runCode() {
  20501. if (isRunning) {
  20502. return;
  20503. }
  20504. var strCode = null;
  20505. if (settingsProgrammingTypes == "textual") {
  20506. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  20507. } else {
  20508. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20509. }
  20510. if (strCode == null) {
  20511. return;
  20512. }
  20513. toggleConsole(true); // if(domConsole == null)
  20514. // domConsole = new DOMConsole("#ivprog-term");
  20515. //$("#ivprog-term").slideDown(500);
  20516. try {
  20517. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  20518. proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__["IVProgProcessor"](data);
  20519. proc.registerInput(domConsole);
  20520. proc.registerOutput(domConsole);
  20521. $("#ivprog-term").addClass('ivprog-term-active');
  20522. isRunning = true;
  20523. proc.interpretAST().then(function (_) {
  20524. scheduleCall(function () {
  20525. if (domConsole.pending_writes.length == 0) {
  20526. if (proc.mode === _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT) {
  20527. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("aborted_execution"));
  20528. } else {
  20529. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("success_execution"));
  20530. }
  20531. $("#ivprog-term").removeClass('ivprog-term-active');
  20532. isRunning = false;
  20533. proc = null;
  20534. showRunButton();
  20535. return true;
  20536. }
  20537. return false;
  20538. }, 100);
  20539. })["catch"](function (err) {
  20540. scheduleCall(function () {
  20541. if (domConsole.pending_writes.length == 0) {
  20542. if (err instanceof Error) {
  20543. domConsole.err(err.message);
  20544. } else {
  20545. domConsole.err(err);
  20546. }
  20547. $("#ivprog-term").removeClass('ivprog-term-active');
  20548. isRunning = false;
  20549. proc = null;
  20550. showRunButton();
  20551. return true;
  20552. }
  20553. return false;
  20554. }, 100);
  20555. });
  20556. } catch (error) {
  20557. scheduleCall(function () {
  20558. if (domConsole.pending_writes.length == 0) {
  20559. isRunning = false;
  20560. proc = null;
  20561. showRunButton();
  20562. domConsole.err(error.message);
  20563. console.log(error);
  20564. return true;
  20565. }
  20566. return false;
  20567. }, 100);
  20568. }
  20569. }
  20570. function toggleConsole(is_running) {
  20571. if (is_running) {
  20572. $('.ivprog-term-div').css('display', 'block');
  20573. $('#ivprog-term').css('min-height', '160px');
  20574. if (domConsole != null) domConsole.focus(); //$('#ivprog-term').css('margin-top', '-170px');
  20575. return;
  20576. } else {
  20577. domConsole.hide();
  20578. return;
  20579. }
  20580. if ($('#ivprog-term').css('min-height') == '160px') {
  20581. // esconder
  20582. $('.ivprog-term-div').css('display', 'none');
  20583. $('#ivprog-term').css('min-height', '0'); //$('#ivprog-term').css('margin-top', '-30px');
  20584. //$('#ivprog-term').css('padding', '5px');
  20585. } else {
  20586. // mostrar
  20587. $('.ivprog-term-div').css('display', 'block');
  20588. $('#ivprog-term').css('min-height', '160px'); //$('#ivprog-term').css('margin-top', '-170px');
  20589. }
  20590. } // function waitToCloseConsole () {
  20591. // domConsole.info("Aperte qualquer tecla para fechar...");
  20592. // const p = new Promise((resolve, _) => {
  20593. // domConsole.requestInput(resolve, true);
  20594. // });
  20595. // p.then( _ => {
  20596. // domConsole.dispose();
  20597. // domConsole = null;
  20598. // $("#ivprog-term").hide();
  20599. // })
  20600. // }
  20601. function toggleTextualCoding() {
  20602. var code = null;
  20603. if (settingsProgrammingTypes != "textual") {
  20604. code = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20605. if (code == null) {
  20606. return;
  20607. }
  20608. }
  20609. $('.ivprog_visual_panel').css('display', 'none');
  20610. $('.ivprog_textual_panel').css('display', 'block');
  20611. $('.ivprog_textual_panel').removeClass('loading');
  20612. _text_editor__WEBPACK_IMPORTED_MODULE_17__["updateEditor"]();
  20613. if (code != null) _text_editor__WEBPACK_IMPORTED_MODULE_17__["setCode"](code); //$('.ivprog_textual_code').text(code);
  20614. $('.visual_coding_button').removeClass('active');
  20615. $('.textual_coding_button').addClass('active');
  20616. }
  20617. function toggleVisualCoding() {
  20618. $('.ivprog_textual_panel').addClass('loading');
  20619. $('.ivprog_textual_panel').css('display', 'none');
  20620. $('.ivprog_visual_panel').css('display', 'block');
  20621. $('.textual_coding_button').removeClass('active');
  20622. $('.visual_coding_button').addClass('active');
  20623. }
  20624. function removeParameter(function_obj, parameter_obj, parameter_container) {
  20625. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(parameter_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION_PARAM, function_obj.name);
  20626. var index = function_obj.parameters_list.indexOf(parameter_obj);
  20627. if (index > -1) {
  20628. window.insertContext = true;
  20629. function_obj.parameters_list.splice(index, 1);
  20630. }
  20631. $(parameter_container).fadeOut();
  20632. }
  20633. function updateParameterType(parameter_obj, new_type, function_name) {
  20634. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  20635. 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);
  20636. parameter_obj.type = new_type;
  20637. parameter_obj.dimensions = new_dimensions;
  20638. if (new_dimensions > 0) {
  20639. parameter_obj.rows = new_dimensions;
  20640. parameter_obj.columns = 2;
  20641. }
  20642. }
  20643. function renderParameter(function_obj, parameter_obj, function_container) {
  20644. var ret = "";
  20645. ret += '<div class="ui label function_name_parameter pink"><i class="ui icon ellipsis vertical inverted"></i>';
  20646. ret += '<div class="ui dropdown parameter_type">';
  20647. if (parameter_obj.dimensions > 0) {
  20648. 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()));
  20649. if (parameter_obj.dimensions == 1) {
  20650. ret += ' [ ] ';
  20651. } else {
  20652. ret += ' [ ] [ ] ';
  20653. }
  20654. ret += '</div>';
  20655. } else {
  20656. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(parameter_obj.type.toLowerCase())) + '</div>';
  20657. }
  20658. ret += '<div class="menu">';
  20659. for (var _tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20660. if (_tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20661. continue;
  20662. }
  20663. 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>';
  20664. }
  20665. 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">';
  20666. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20667. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20668. continue;
  20669. }
  20670. 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>';
  20671. }
  20672. ret += '</div></div>';
  20673. 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">';
  20674. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20675. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20676. continue;
  20677. }
  20678. 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>';
  20679. }
  20680. ret += '</div></div>';
  20681. ret += '</div></div>';
  20682. ret += '<div class="parameter_div_edit"><span class="span_name_parameter label_enable_name_parameter">' + parameter_obj.name + '</span></div> ';
  20683. ret += ' <i class="yellow inverted icon times remove_parameter"></i></div>';
  20684. ret = $(ret);
  20685. function_container.find('.container_parameters_list').append(ret);
  20686. ret.find('.remove_parameter').on('click', function (e) {
  20687. removeParameter(function_obj, parameter_obj, ret);
  20688. });
  20689. ret.find('.ui.dropdown.parameter_type').dropdown({
  20690. onChange: function onChange(_, __, $selectedItem) {
  20691. if ($selectedItem.data('dimensions')) {
  20692. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  20693. } else {
  20694. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  20695. }
  20696. },
  20697. selectOnKeydown: false
  20698. });
  20699. ret.find('.parameter_div_edit').on('click', function (e) {
  20700. 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);
  20701. enableNameParameterUpdate(parameter_obj, ret, function_obj);
  20702. });
  20703. return ret;
  20704. }
  20705. function updateParameterName(parameter_var, new_name, parameter_obj_dom, function_obj) {
  20706. if (parameter_var.name == new_name) {
  20707. return;
  20708. }
  20709. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  20710. if (variableNameAlreadyExists(new_name, function_obj)) {
  20711. _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]));
  20712. } else {
  20713. 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);
  20714. parameter_var.name = new_name;
  20715. }
  20716. } else {
  20717. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](parameter_obj_dom.find('.parameter_div_edit'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  20718. }
  20719. }
  20720. function variableNameAlreadyExists(name_var, function_obj) {
  20721. if (function_obj.parameters_list) {
  20722. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  20723. if (function_obj.parameters_list[i].name == name_var) {
  20724. return true;
  20725. }
  20726. }
  20727. }
  20728. if (function_obj.variables_list) {
  20729. for (var i = 0; i < function_obj.variables_list.length; i++) {
  20730. if (function_obj.variables_list[i].name == name_var) {
  20731. return true;
  20732. }
  20733. }
  20734. }
  20735. return false;
  20736. }
  20737. function updateFunctionName(function_var, new_name, function_obj_dom) {
  20738. if (function_var.name == new_name) {
  20739. return;
  20740. }
  20741. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  20742. if (functionNameAlreadyExists(new_name)) {
  20743. _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]));
  20744. } else {
  20745. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].RENAME_FUNCTION, new_name);
  20746. function_var.name = new_name;
  20747. }
  20748. } else {
  20749. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](function_obj_dom.find('.function_name_div'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  20750. }
  20751. }
  20752. function functionNameAlreadyExists(function_name) {
  20753. for (var i = 0; i < window.program_obj.functions.length; i++) {
  20754. if (window.program_obj.functions[i].name == function_name) {
  20755. return true;
  20756. }
  20757. }
  20758. return false;
  20759. }
  20760. var opened_name_parameter = false;
  20761. var opened_input_parameter = null;
  20762. function enableNameParameterUpdate(parameter_obj, parent_node, function_obj) {
  20763. if (opened_name_parameter) {
  20764. opened_input_parameter.focus();
  20765. return;
  20766. }
  20767. opened_name_parameter = true;
  20768. parent_node = $(parent_node);
  20769. var input_field;
  20770. parent_node.find('.span_name_parameter').text('');
  20771. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + parameter_obj.name + "' />");
  20772. input_field.insertBefore(parent_node.find('.span_name_parameter'));
  20773. input_field.on('input', function () {
  20774. var inputWidth = input_field.textWidth() + 10;
  20775. opened_input_parameter = input_field;
  20776. input_field.focus();
  20777. var tmpStr = input_field.val();
  20778. input_field.val('');
  20779. input_field.val(tmpStr);
  20780. input_field.css({
  20781. width: inputWidth
  20782. });
  20783. }).trigger('input');
  20784. input_field.focusout(function () {
  20785. /// update array:
  20786. if (input_field.val().trim()) {
  20787. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  20788. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  20789. }
  20790. input_field.off();
  20791. input_field.remove(); /// update elements:
  20792. opened_name_parameter = false;
  20793. opened_input_parameter = false;
  20794. });
  20795. input_field.on('keydown', function (e) {
  20796. var code = e.keyCode || e.which;
  20797. if (code == 13) {
  20798. if (input_field.val().trim()) {
  20799. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  20800. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  20801. }
  20802. input_field.off();
  20803. input_field.remove(); /// update elements:
  20804. opened_name_parameter = false;
  20805. opened_input_parameter = false;
  20806. }
  20807. if (code == 27) {
  20808. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  20809. input_field.off();
  20810. input_field.remove(); /// update elements:
  20811. opened_name_parameter = false;
  20812. opened_input_parameter = false;
  20813. }
  20814. });
  20815. input_field.select();
  20816. }
  20817. var opened_name_function = false;
  20818. var opened_input = null;
  20819. var previousPadding = null;
  20820. function enableNameFunctionUpdate(function_obj, parent_node) {
  20821. if (opened_name_function) {
  20822. opened_input.focus();
  20823. return;
  20824. }
  20825. parent_node = $(parent_node);
  20826. parent_node.find('.span_name_function').text('');
  20827. var input_field;
  20828. if (!previousPadding) {
  20829. previousPadding = parent_node.find('.span_name_function').css('padding-left');
  20830. }
  20831. parent_node.find('.span_name_function').css('padding-left', '0');
  20832. parent_node.find('.span_name_function').css('padding-right', '0');
  20833. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + function_obj.name + "' />");
  20834. input_field.insertBefore(parent_node.find('.span_name_function'));
  20835. input_field.on('input', function () {
  20836. var inputWidth = input_field.textWidth() + 10;
  20837. opened_input = input_field;
  20838. input_field.focus();
  20839. var tmpStr = input_field.val();
  20840. input_field.val('');
  20841. input_field.val(tmpStr);
  20842. input_field.css({
  20843. width: inputWidth
  20844. });
  20845. }).trigger('input');
  20846. input_field.focusout(function () {
  20847. /// update array:
  20848. if (input_field.val().trim()) {
  20849. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  20850. }
  20851. input_field.off();
  20852. input_field.remove();
  20853. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  20854. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  20855. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  20856. opened_name_function = false;
  20857. opened_input = false;
  20858. });
  20859. input_field.on('keydown', function (e) {
  20860. var code = e.keyCode || e.which;
  20861. if (code == 13) {
  20862. if (input_field.val().trim()) {
  20863. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  20864. }
  20865. input_field.off();
  20866. input_field.remove();
  20867. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  20868. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  20869. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  20870. opened_name_function = false;
  20871. opened_input = false;
  20872. }
  20873. if (code == 27) {
  20874. input_field.off();
  20875. input_field.remove();
  20876. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  20877. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  20878. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  20879. opened_name_function = false;
  20880. opened_input = false;
  20881. }
  20882. });
  20883. input_field.select();
  20884. }
  20885. function addFunctionChangeListener(callback) {
  20886. functionsChangeListeners.push(callback);
  20887. return functionsChangeListeners.length - 1;
  20888. }
  20889. function addGlobalChangeListener(callback) {
  20890. globalChangeListeners.push(callback);
  20891. return globalChangeListeners.length - 1;
  20892. }
  20893. function removeGlobalListener(index) {
  20894. globalChangeListeners.splice(index, 1);
  20895. }
  20896. function removeFunctionListener(index) {
  20897. functionsChangeListeners.splice(index);
  20898. }
  20899. function scheduleCall(callback, time) {
  20900. var scheduled_call = function scheduled_call() {
  20901. var id = setInterval(function () {
  20902. if (callback()) {
  20903. clearInterval(id);
  20904. }
  20905. }, time);
  20906. };
  20907. scheduled_call();
  20908. }
  20909. function showRunButton() {
  20910. document.getElementById('run_button').style.display = 'inline';
  20911. document.getElementById('stop_button').style.display = 'none';
  20912. }
  20913. function showStopButton() {
  20914. document.getElementById('run_button').style.display = 'none';
  20915. document.getElementById('stop_button').style.display = 'inline';
  20916. }
  20917. function stopExecution() {
  20918. domConsole.clearPendingWrites();
  20919. domConsole.cancelPendingInputRequests();
  20920. if (!isRunning) {
  20921. return;
  20922. }
  20923. proc.mode = _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT;
  20924. }
  20925. /***/ }),
  20926. /***/ "./js/visualUI/globals.js":
  20927. /*!********************************!*\
  20928. !*** ./js/visualUI/globals.js ***!
  20929. \********************************/
  20930. /*! exports provided: addGlobal, renderGlobal */
  20931. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20932. "use strict";
  20933. __webpack_require__.r(__webpack_exports__);
  20934. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobal", function() { return addGlobal; });
  20935. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderGlobal", function() { return renderGlobal; });
  20936. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  20937. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  20938. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  20939. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  20940. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  20941. var counter_new_globals = 0;
  20942. function addGlobal(program) {
  20943. var is_from_click = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  20944. 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);
  20945. counter_new_globals++;
  20946. program.addGlobal(new_global);
  20947. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(new_global.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].INSERT_GLOBAL_VAR);
  20948. var newe = renderGlobal(new_global);
  20949. if (is_from_click) {
  20950. newe.css('display', 'none');
  20951. newe.fadeIn();
  20952. }
  20953. }
  20954. function toggleConstant(global_var) {
  20955. global_var.is_constant = !global_var.is_constant;
  20956. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].SET_GLOBAL_CONST);
  20957. }
  20958. function updateName(global_var, new_name, global_obj_dom) {
  20959. if (global_var.name == new_name) {
  20960. return;
  20961. }
  20962. if (isValidIdentifier(new_name)) {
  20963. if (globalNameAlreadyExists(new_name)) {
  20964. _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'));
  20965. } else {
  20966. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].RENAME_GLOBAL_VAR, new_name);
  20967. global_var.name = new_name;
  20968. }
  20969. } else {
  20970. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_name'));
  20971. }
  20972. }
  20973. function globalNameAlreadyExists(global_name) {
  20974. for (var i = 0; i < window.program_obj.globals.length; i++) {
  20975. if (window.program_obj.globals[i].name == global_name) {
  20976. return true;
  20977. }
  20978. }
  20979. return false;
  20980. }
  20981. function isValidIdentifier(identifier_str) {
  20982. return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  20983. }
  20984. function updateType(global_var, new_type) {
  20985. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  20986. global_var.type = new_type;
  20987. global_var.dimensions = new_dimensions;
  20988. if (new_dimensions > 0) {
  20989. global_var.rows = new_dimensions;
  20990. global_var.columns = 2;
  20991. }
  20992. 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);
  20993. updateInitialValues(global_var);
  20994. }
  20995. function removeGlobal(global_var, global_container) {
  20996. var index = window.program_obj.globals.indexOf(global_var);
  20997. if (index > -1) {
  20998. window.insertContext = true;
  20999. window.program_obj.globals.splice(index, 1);
  21000. }
  21001. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_GLOBAL_VAR);
  21002. global_container.children().off();
  21003. global_container.off();
  21004. global_container.fadeOut();
  21005. }
  21006. function updateInitialValues(global_var) {
  21007. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21008. if (global_var.dimensions == 0) {
  21009. global_var.value = 0;
  21010. }
  21011. if (global_var.dimensions == 1) {
  21012. global_var.value = [0, 0];
  21013. }
  21014. if (global_var.dimensions == 2) {
  21015. global_var.value = [[0, 0], [0, 0]];
  21016. }
  21017. }
  21018. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21019. if (global_var.dimensions == 0) {
  21020. global_var.value = 0.0;
  21021. }
  21022. if (global_var.dimensions == 1) {
  21023. global_var.value = [0.0, 0.0];
  21024. }
  21025. if (global_var.dimensions == 2) {
  21026. global_var.value = [[0.0, 0.0], [0.0, 0.0]];
  21027. }
  21028. }
  21029. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21030. if (global_var.dimensions == 0) {
  21031. global_var.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  21032. }
  21033. if (global_var.dimensions == 1) {
  21034. 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')];
  21035. }
  21036. if (global_var.dimensions == 2) {
  21037. 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')]];
  21038. }
  21039. }
  21040. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21041. if (global_var.dimensions == 0) {
  21042. global_var.value = true;
  21043. }
  21044. if (global_var.dimensions == 1) {
  21045. global_var.value = [true, true];
  21046. }
  21047. if (global_var.dimensions == 2) {
  21048. global_var.value = [[true, true], [true, true]];
  21049. }
  21050. }
  21051. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21052. if (global_var.dimensions == 0) {
  21053. global_var.value = 'A';
  21054. }
  21055. if (global_var.dimensions == 1) {
  21056. global_var.value = ['A', 'A'];
  21057. }
  21058. if (global_var.dimensions == 2) {
  21059. global_var.value = [['A', 'A'], ['A', 'A']];
  21060. }
  21061. }
  21062. 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);
  21063. }
  21064. function alternateBooleanGlobalValue(global_var, value_container) {
  21065. global_var.value = !global_var.value;
  21066. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value)));
  21067. }
  21068. function alternateBooleanGlobalVectorValue(global_var, index, value_container) {
  21069. global_var.value[index] = !global_var.value[index];
  21070. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[index])));
  21071. }
  21072. function removeGlobalColumnVector(global_var) {
  21073. if (global_var.columns == 0) {
  21074. return;
  21075. }
  21076. global_var.columns--;
  21077. global_var.value.splice(global_var.value.length - 1, 1);
  21078. }
  21079. function addGlobalColumnVector(global_var) {
  21080. global_var.columns++;
  21081. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21082. global_var.value.push(0);
  21083. }
  21084. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21085. global_var.value.push(0.0);
  21086. }
  21087. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21088. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21089. }
  21090. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21091. global_var.value.push(true);
  21092. }
  21093. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21094. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21095. }
  21096. }
  21097. function removeColumnGlobalMatrix(global_var) {
  21098. if (global_var.columns == 0) {
  21099. return;
  21100. }
  21101. global_var.columns--;
  21102. for (var i = 0; i < global_var.rows; i++) {
  21103. global_var.value[i].splice(global_var.value[i].length - 1, 1);
  21104. }
  21105. }
  21106. function addColumnGlobalMatrix(global_var) {
  21107. global_var.columns++;
  21108. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21109. for (var i = 0; i < global_var.rows; i++) {
  21110. global_var.value[i].push(0);
  21111. }
  21112. }
  21113. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21114. for (var i = 0; i < global_var.rows; i++) {
  21115. global_var.value[i].push(0.0);
  21116. }
  21117. }
  21118. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21119. for (var i = 0; i < global_var.rows; i++) {
  21120. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21121. }
  21122. }
  21123. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21124. for (var i = 0; i < global_var.rows; i++) {
  21125. global_var.value[i].push(true);
  21126. }
  21127. }
  21128. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21129. for (var i = 0; i < global_var.rows; i++) {
  21130. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21131. }
  21132. }
  21133. }
  21134. function removeLineGlobalMatrix(global_var) {
  21135. if (global_var.rows == 0) {
  21136. return;
  21137. }
  21138. global_var.rows--;
  21139. global_var.value.splice(global_var.value.length - 1, 1);
  21140. }
  21141. function addLineGlobalMatrix(global_var) {
  21142. global_var.rows++;
  21143. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21144. var n_l = [];
  21145. for (var i = 0; i < global_var.columns; i++) {
  21146. n_l.push(0);
  21147. }
  21148. global_var.value.push(n_l);
  21149. }
  21150. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21151. var n_l = [];
  21152. for (i = 0; i < global_var.columns; i++) {
  21153. n_l.push(0.0);
  21154. }
  21155. global_var.value.push(n_l);
  21156. }
  21157. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21158. var n_l = [];
  21159. for (i = 0; i < global_var.columns; i++) {
  21160. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21161. }
  21162. global_var.value.push(n_l);
  21163. }
  21164. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21165. var n_l = [];
  21166. for (i = 0; i < global_var.columns; i++) {
  21167. n_l.push(true);
  21168. }
  21169. global_var.value.push(n_l);
  21170. }
  21171. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21172. var n_l = [];
  21173. for (i = 0; i < global_var.columns; i++) {
  21174. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21175. }
  21176. global_var.value.push(n_l);
  21177. }
  21178. }
  21179. function alternateBooleanGlobalMatrixValue(global_var, row, index, value_container) {
  21180. global_var.value[row][index] = !global_var.value[row][index];
  21181. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[row][index])));
  21182. }
  21183. function renderValues(global_var, global_container) {
  21184. var ret = "";
  21185. var j = 0;
  21186. if (global_var.dimensions == 0) {
  21187. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21188. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value.toFixed(1) + '</span> </div> ';
  21189. } else {
  21190. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21191. 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> ';
  21192. } else {
  21193. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value + '</span> </div> ';
  21194. }
  21195. }
  21196. } else {
  21197. ret += '<table class="tabela_var">';
  21198. if (global_var.dimensions == 1) {
  21199. ret += '<tr>';
  21200. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21201. for (var k = 0; k < global_var.columns; k++) {
  21202. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k].toFixed(1) + '</span></td>';
  21203. }
  21204. } else {
  21205. for (var k = 0; k < global_var.columns; k++) {
  21206. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21207. 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>';
  21208. } else {
  21209. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k] + '</span>' + '</td>';
  21210. }
  21211. }
  21212. }
  21213. ret += '</tr>';
  21214. ret += '</table>';
  21215. 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>';
  21216. }
  21217. if (global_var.dimensions == 2) {
  21218. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21219. for (var l = 0; l < global_var.rows; l++) {
  21220. ret += '<tr>';
  21221. for (var k = 0; k < global_var.columns; k++) {
  21222. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  21223. }
  21224. ret += '</tr>';
  21225. }
  21226. } else {
  21227. for (var l = 0; l < global_var.rows; l++) {
  21228. ret += '<tr>';
  21229. for (var k = 0; k < global_var.columns; k++) {
  21230. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21231. 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>';
  21232. } else {
  21233. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k] + '</span></td>';
  21234. }
  21235. }
  21236. ret += '</tr>';
  21237. }
  21238. }
  21239. if (global_var.rows == 0) {
  21240. ret += '<tr><td></td></tr>';
  21241. }
  21242. 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>';
  21243. ret += '</table>';
  21244. 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>';
  21245. }
  21246. }
  21247. global_container.find(".div_valor_var").html('');
  21248. ret = $(ret);
  21249. ret.find('.span_value_variable').data('associatedOject', global_var);
  21250. ret.find(".boolean_simple_type").on('click', function (e) {
  21251. alternateBooleanGlobalValue(global_var, this.parentNode);
  21252. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21253. });
  21254. ret.find(".simple_var").on('click', function (e) {
  21255. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21256. enableGlobalValueUpdate(global_var, this.parentNode);
  21257. });
  21258. ret.find(".boolean_vector_var").on('click', function (e) {
  21259. alternateBooleanGlobalVectorValue(global_var, $(this).data('index'), this.parentNode);
  21260. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21261. });
  21262. ret.find(".vector_var").on('click', function (e) {
  21263. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21264. enableGlobalVectorValueUpdate(global_var, $(this).data('index'), this.parentNode);
  21265. });
  21266. ret.find(".remove_global_vector_column").on('click', function (e) {
  21267. removeGlobalColumnVector(global_var);
  21268. global_container.find(".div_valor_var").html('');
  21269. 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);
  21270. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21271. renderValues(global_var, global_container);
  21272. });
  21273. ret.find(".add_global_vector_column").on('click', function (e) {
  21274. addGlobalColumnVector(global_var);
  21275. 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);
  21276. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21277. global_container.find(".div_valor_var").html('');
  21278. renderValues(global_var, global_container);
  21279. });
  21280. ret.find(".remove_global_matrix_column").on('click', function (e) {
  21281. removeColumnGlobalMatrix(global_var);
  21282. 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);
  21283. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21284. global_container.find(".div_valor_var").html('');
  21285. renderValues(global_var, global_container);
  21286. });
  21287. ret.find(".add_global_matrix_column").on('click', function (e) {
  21288. addColumnGlobalMatrix(global_var);
  21289. 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);
  21290. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21291. global_container.find(".div_valor_var").html('');
  21292. renderValues(global_var, global_container);
  21293. });
  21294. ret.find(".remove_global_matrix_line").on('click', function (e) {
  21295. removeLineGlobalMatrix(global_var);
  21296. 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);
  21297. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21298. global_container.find(".div_valor_var").html('');
  21299. renderValues(global_var, global_container);
  21300. });
  21301. ret.find(".add_global_matrix_line").on('click', function (e) {
  21302. addLineGlobalMatrix(global_var);
  21303. 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);
  21304. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21305. global_container.find(".div_valor_var").html('');
  21306. renderValues(global_var, global_container);
  21307. });
  21308. ret.find(".boolean_matrix_var").on('click', function (e) {
  21309. alternateBooleanGlobalMatrixValue(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  21310. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21311. });
  21312. ret.find(".matrix_var").on('click', function (e) {
  21313. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21314. enableGlobalMatrixValueUpdate(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  21315. });
  21316. global_container.find(".div_valor_var").append(ret);
  21317. updateColumnsAndRowsText(global_container, global_var);
  21318. }
  21319. function addHandlers(global_container) {
  21320. var global_var = global_container.data('associatedOject'); // Manage constant option:
  21321. global_container.find(".alternate_constant").on('click', function (e) {
  21322. toggleConstant(global_var);
  21323. $(this).removeClass("on off");
  21324. if (global_var.is_constant) {
  21325. $(this).addClass("on");
  21326. } else {
  21327. $(this).addClass("off");
  21328. }
  21329. }); // Manage global name:
  21330. global_container.find(".editing_name_var").on('click', function (e) {
  21331. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_NAME);
  21332. enableNameUpdate(global_container);
  21333. }); // Menu to change type:
  21334. global_container.find('.ui.dropdown.global_type').dropdown({
  21335. onChange: function onChange(_, __, $selectedItem) {
  21336. if ($selectedItem.data('dimensions')) {
  21337. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  21338. } else {
  21339. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  21340. }
  21341. renderValues(global_var, global_container);
  21342. },
  21343. selectOnKeydown: false
  21344. }); // Remove global:
  21345. global_container.find(".remove_global").on('click', function (e) {
  21346. removeGlobal(global_var, global_container);
  21347. });
  21348. }
  21349. function updateColumnsAndRowsText(global_container, global_var) {
  21350. var prev = global_container.find('.text').text().split('[');
  21351. if (prev.length == 2) {
  21352. var ff = prev[0] + '[ ' + global_var.columns + ' ] ';
  21353. global_container.find('.text').empty();
  21354. global_container.find('.text').text(ff);
  21355. }
  21356. if (prev.length == 3) {
  21357. var ff = prev[0] + '[ ' + global_var.columns + ' ] [ ' + global_var.rows + ' ] ';
  21358. global_container.find('.text').empty();
  21359. global_container.find('.text').text(ff);
  21360. }
  21361. }
  21362. function renderGlobal(global_var) {
  21363. var element = '<div class="ui label global_container pink"><i class="ui icon ellipsis vertical inverted"></i><div class="global_const">const: ';
  21364. element += '<i class="ui icon toggle ' + (global_var.is_constant ? "on" : "off") + ' alternate_constant"></i></div>';
  21365. element += '<div class="ui dropdown global_type">';
  21366. if (global_var.dimensions == 1) {
  21367. 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));
  21368. element += ' [ <span class="dimensions_0"></span> ] ';
  21369. element += '</div>';
  21370. } else if (global_var.dimensions == 2) {
  21371. 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));
  21372. element += ' [ <span class="dimensions_0"></span> ] [ <span class="dimensions_1"></span> ] ';
  21373. element += '</div>';
  21374. } else {
  21375. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type.toLowerCase())) + '</div>';
  21376. }
  21377. element += '<div class="menu">';
  21378. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21379. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21380. continue;
  21381. }
  21382. 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>';
  21383. }
  21384. 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">';
  21385. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21386. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21387. continue;
  21388. }
  21389. 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>';
  21390. }
  21391. element += '</div></div>';
  21392. 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">';
  21393. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21394. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21395. continue;
  21396. }
  21397. 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>';
  21398. }
  21399. element += '</div></div>';
  21400. 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> ';
  21401. element += '<div class="ui div_valor_var">' + global_var.value + '</div>';
  21402. element += ' <i class="yellow inverted icon times remove_global"></i></div>';
  21403. var complete_element = $(element);
  21404. complete_element.data('associatedOject', global_var);
  21405. $('.list_globals').append(complete_element);
  21406. addHandlers(complete_element);
  21407. renderValues(global_var, complete_element);
  21408. if (global_var.dimensions == 1) {
  21409. complete_element.find('.dimensions_0').text(global_var.columns);
  21410. }
  21411. if (global_var.dimensions == 2) {
  21412. complete_element.find('.dimensions_0').text(global_var.columns);
  21413. complete_element.find('.dimensions_1').text(global_var.rows);
  21414. }
  21415. return complete_element;
  21416. }
  21417. var opened_name_value_matrix_global_v = false;
  21418. var opened_input_value_matrix_global_v = null;
  21419. function enableGlobalMatrixValueUpdate(global_var, row, index, parent_node) {
  21420. if (opened_name_value_matrix_global_v) {
  21421. opened_input_value_matrix_global_v.focus();
  21422. return;
  21423. }
  21424. parent_node = $(parent_node);
  21425. opened_name_value_matrix_global_v = true;
  21426. parent_node.find('.span_value_variable').text('');
  21427. var input_field;
  21428. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21429. 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) + "' />");
  21430. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21431. } else {
  21432. 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] + "' />");
  21433. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21434. }
  21435. input_field.on('input', function () {
  21436. var inputWidth = input_field.textWidth() + 10;
  21437. opened_input_value_matrix_global_v = input_field;
  21438. input_field.focus();
  21439. var tmpStr = input_field.val();
  21440. input_field.val('');
  21441. input_field.val(tmpStr);
  21442. input_field.css({
  21443. width: inputWidth
  21444. });
  21445. }).trigger('input');
  21446. input_field.focusout(function () {
  21447. /// update array:
  21448. if (input_field.val().trim()) {
  21449. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21450. global_var.value[row][index] = parseFloat(input_field.val().trim());
  21451. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21452. } else {
  21453. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21454. global_var.value[row][index] = parseInt(input_field.val().trim());
  21455. } else {
  21456. global_var.value[row][index] = input_field.val().trim();
  21457. }
  21458. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21459. }
  21460. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21461. } else {
  21462. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21463. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21464. } else {
  21465. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21466. }
  21467. }
  21468. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21469. global_var.value[row][index] = input_field.val();
  21470. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21471. }
  21472. input_field.off();
  21473. input_field.remove(); /// update elements:
  21474. opened_name_value_matrix_global_v = false;
  21475. opened_input_value_matrix_global_v = false;
  21476. });
  21477. input_field.on('keydown', function (e) {
  21478. var code = e.keyCode || e.which;
  21479. if (code == 13) {
  21480. if (input_field.val().trim()) {
  21481. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21482. global_var.value[row][index] = parseFloat(input_field.val().trim());
  21483. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21484. } else {
  21485. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21486. global_var.value[row][index] = parseInt(input_field.val().trim());
  21487. } else {
  21488. global_var.value[row][index] = input_field.val().trim();
  21489. }
  21490. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21491. }
  21492. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21493. } else {
  21494. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21495. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21496. } else {
  21497. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21498. }
  21499. }
  21500. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21501. global_var.value[row][index] = input_field.val();
  21502. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21503. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21504. }
  21505. input_field.off();
  21506. input_field.remove(); /// update elements:
  21507. opened_name_value_matrix_global_v = false;
  21508. opened_input_value_matrix_global_v = false;
  21509. }
  21510. if (code == 27) {
  21511. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21512. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21513. } else {
  21514. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21515. }
  21516. input_field.off();
  21517. input_field.remove(); /// update elements:
  21518. opened_name_value_matrix_global_v = false;
  21519. opened_input_value_matrix_global_v = false;
  21520. }
  21521. });
  21522. input_field.select();
  21523. }
  21524. var opened_name_value_global_var = false;
  21525. var opened_input_value_global_ar = null;
  21526. function enableGlobalValueUpdate(global_var, parent_node) {
  21527. if (opened_name_value_global_var) {
  21528. opened_input_value_global_ar.focus();
  21529. return;
  21530. }
  21531. parent_node = $(parent_node);
  21532. opened_name_value_global_var = true;
  21533. parent_node.find('.span_value_variable').text('');
  21534. var input_field;
  21535. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21536. 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) + "' />");
  21537. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21538. } else {
  21539. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value + "' />");
  21540. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21541. }
  21542. input_field.on('input', function () {
  21543. var inputWidth = input_field.textWidth() + 10;
  21544. opened_input_value_global_ar = input_field;
  21545. input_field.focus();
  21546. var tmpStr = input_field.val();
  21547. input_field.val('');
  21548. input_field.val(tmpStr);
  21549. input_field.css({
  21550. width: inputWidth
  21551. });
  21552. }).trigger('input');
  21553. input_field.focusout(function () {
  21554. var changed = false; /// update array:
  21555. if (input_field.val().trim()) {
  21556. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21557. global_var.value = parseFloat(input_field.val().trim());
  21558. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21559. } else {
  21560. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21561. global_var.value = parseInt(input_field.val().trim());
  21562. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21563. global_var.value = input_field.val().charAt(0);
  21564. } else {
  21565. global_var.value = input_field.val().trim();
  21566. }
  21567. parent_node.find('.span_value_variable').text(global_var.value);
  21568. }
  21569. changed = true;
  21570. } else {
  21571. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21572. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21573. } else {
  21574. parent_node.find('.span_value_variable').text(global_var.value);
  21575. }
  21576. }
  21577. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21578. global_var.value = input_field.val();
  21579. changed = true;
  21580. parent_node.find('.span_value_variable').text(global_var.value);
  21581. }
  21582. if (changed) {
  21583. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21584. }
  21585. input_field.off();
  21586. input_field.remove(); /// update elements:
  21587. opened_name_value_global_var = false;
  21588. opened_input_value_global_ar = false;
  21589. });
  21590. input_field.on('keydown', function (e) {
  21591. var code = e.keyCode || e.which;
  21592. var changed = true;
  21593. if (code == 13) {
  21594. if (input_field.val().trim()) {
  21595. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21596. global_var.value = parseFloat(input_field.val().trim());
  21597. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21598. } else {
  21599. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21600. global_var.value = parseInt(input_field.val().trim());
  21601. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21602. global_var.value = input_field.val().charAt(0);
  21603. } else {
  21604. global_var.value = input_field.val().trim();
  21605. }
  21606. parent_node.find('.span_value_variable').text(global_var.value);
  21607. }
  21608. changed = true;
  21609. } else {
  21610. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21611. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21612. } else {
  21613. parent_node.find('.span_value_variable').text(global_var.value);
  21614. }
  21615. }
  21616. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21617. global_var.value = input_field.val();
  21618. changed = true;
  21619. parent_node.find('.span_value_variable').text(global_var.value);
  21620. }
  21621. if (changed) {
  21622. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21623. }
  21624. input_field.off();
  21625. input_field.remove(); /// update elements:
  21626. opened_name_value_global_var = false;
  21627. opened_input_value_global_ar = false;
  21628. }
  21629. if (code == 27) {
  21630. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21631. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  21632. } else {
  21633. parent_node.find('.span_value_variable').text(global_var.value);
  21634. }
  21635. input_field.off();
  21636. input_field.remove(); /// update elements:
  21637. opened_name_value_global_var = false;
  21638. opened_input_value_global_ar = false;
  21639. }
  21640. });
  21641. input_field.select();
  21642. }
  21643. var opened_name_global = false;
  21644. var opened_input_global = null;
  21645. function enableNameUpdate(global_container) {
  21646. var global_var = global_container.data('associatedOject');
  21647. if (opened_name_global) {
  21648. opened_input_global.focus();
  21649. return;
  21650. }
  21651. opened_name_global = true;
  21652. global_container.find('.span_name_variable').text('');
  21653. var input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.name + "' />");
  21654. input_name.insertBefore(global_container.find('.span_name_variable'));
  21655. input_name.on('input', function () {
  21656. var inputWidth = input_name.textWidth() + 10;
  21657. opened_input_global = input_name;
  21658. opened_input_global.focus();
  21659. opened_input_global.css({
  21660. width: inputWidth
  21661. });
  21662. }).trigger('input');
  21663. input_name.focusout(function () {
  21664. /// update array:
  21665. if (input_name.val().trim().length > 0) {
  21666. updateName(global_var, input_name.val().trim(), global_container);
  21667. global_container.find('.span_name_variable').text(global_var.name);
  21668. } else {
  21669. global_container.find('.span_name_variable').text(global_var.name);
  21670. }
  21671. input_name.off();
  21672. input_name.remove(); /// update elements:
  21673. opened_name_global = false;
  21674. opened_input_global = false;
  21675. });
  21676. input_name.on('keydown', function (e) {
  21677. var code = e.keyCode || e.which;
  21678. if (code == 13) {
  21679. if (input_name.val().trim()) {
  21680. updateName(global_var, input_name.val().trim(), global_container);
  21681. global_container.find('.span_name_variable').text(global_var.name);
  21682. } else {
  21683. global_container.find('.span_name_variable').text(global_var.name);
  21684. }
  21685. input_name.off();
  21686. input_name.remove(); /// update elements:
  21687. opened_name_global = false;
  21688. opened_input_global = false;
  21689. }
  21690. if (code == 27) {
  21691. global_container.find('.span_name_variable').text(global_var.name);
  21692. input_name.off();
  21693. input_name.remove(); /// update elements:
  21694. opened_name_global = false;
  21695. opened_input_global = false;
  21696. }
  21697. });
  21698. input_name.select();
  21699. }
  21700. var opened_name_value_vector_global_ = false;
  21701. var opened_input_value_vector_global_ = null;
  21702. function enableGlobalVectorValueUpdate(global_var, index, parent_node) {
  21703. if (opened_name_value_vector_global_) {
  21704. opened_input_value_vector_global_.focus();
  21705. return;
  21706. }
  21707. parent_node = $(parent_node);
  21708. opened_name_value_vector_global_ = true;
  21709. parent_node.find('.span_value_variable').text('');
  21710. var input_field;
  21711. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21712. 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) + "' />");
  21713. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21714. } else {
  21715. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[index] + "' />");
  21716. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21717. }
  21718. input_field.on('input', function () {
  21719. var inputWidth = input_field.textWidth() + 10;
  21720. opened_input_value_vector_global_ = input_field;
  21721. input_field.focus();
  21722. var tmpStr = input_field.val();
  21723. input_field.val('');
  21724. input_field.val(tmpStr);
  21725. input_field.css({
  21726. width: inputWidth
  21727. });
  21728. }).trigger('input');
  21729. input_field.focusout(function () {
  21730. var changed = false; /// update array:
  21731. if (input_field.val().trim()) {
  21732. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21733. global_var.value[index] = parseFloat(input_field.val().trim());
  21734. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21735. } else {
  21736. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21737. global_var.value[index] = parseInt(input_field.val().trim());
  21738. } else {
  21739. global_var.value[index] = input_field.val().trim();
  21740. }
  21741. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21742. }
  21743. changed = true;
  21744. } else {
  21745. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21746. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21747. } else {
  21748. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21749. }
  21750. }
  21751. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21752. global_var.value[index] = input_field.val();
  21753. changed = true;
  21754. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21755. }
  21756. if (changed) {
  21757. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21758. }
  21759. input_field.off();
  21760. input_field.remove(); /// update elements:
  21761. opened_name_value_vector_global_ = false;
  21762. opened_input_value_vector_global_ = false;
  21763. });
  21764. input_field.on('keydown', function (e) {
  21765. var code = e.keyCode || e.which;
  21766. var changed = false;
  21767. if (code == 13) {
  21768. if (input_field.val().trim()) {
  21769. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21770. global_var.value[index] = parseFloat(input_field.val().trim());
  21771. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21772. } else {
  21773. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21774. global_var.value[index] = parseInt(input_field.val().trim());
  21775. } else {
  21776. global_var.value[index] = input_field.val().trim();
  21777. }
  21778. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21779. }
  21780. changed = true;
  21781. } else {
  21782. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21783. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21784. } else {
  21785. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21786. }
  21787. }
  21788. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21789. global_var.value[index] = input_field.val();
  21790. changed = true;
  21791. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21792. }
  21793. if (changed) {
  21794. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21795. }
  21796. input_field.off();
  21797. input_field.remove(); /// update elements:
  21798. opened_name_value_vector_global_ = false;
  21799. opened_input_value_vector_global_ = false;
  21800. }
  21801. if (code == 27) {
  21802. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21803. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  21804. } else {
  21805. parent_node.find('.span_value_variable').text(global_var.value[index]);
  21806. }
  21807. input_field.off();
  21808. input_field.remove(); /// update elements:
  21809. opened_name_value_vector_global_ = false;
  21810. opened_input_value_vector_global_ = false;
  21811. }
  21812. });
  21813. input_field.select();
  21814. }
  21815. $.fn.textWidth = function (text, font) {
  21816. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  21817. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  21818. return $.fn.textWidth.fakeEl.width();
  21819. };
  21820. /***/ }),
  21821. /***/ "./js/visualUI/ivprog_elements.js":
  21822. /*!****************************************!*\
  21823. !*** ./js/visualUI/ivprog_elements.js ***!
  21824. \****************************************/
  21825. /*! 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 */
  21826. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21827. "use strict";
  21828. __webpack_require__.r(__webpack_exports__);
  21829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_TYPES", function() { return COMMAND_TYPES; });
  21830. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_TYPES", function() { return ARITHMETIC_TYPES; });
  21831. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_ELEMENTS", function() { return EXPRESSION_ELEMENTS; });
  21832. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_TYPES", function() { return EXPRESSION_TYPES; });
  21833. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_COMPARISON", function() { return ARITHMETIC_COMPARISON; });
  21834. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOGIC_COMPARISON", function() { return LOGIC_COMPARISON; });
  21835. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYSTEM_FUNCTIONS_CATEGORIES", function() { return SYSTEM_FUNCTIONS_CATEGORIES; });
  21836. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; });
  21837. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  21838. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemFunction", function() { return SystemFunction; });
  21839. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });
  21840. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  21841. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reader", function() { return Reader; });
  21842. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Writer", function() { return Writer; });
  21843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribution", function() { return Attribution; });
  21844. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionOperator", function() { return ExpressionOperator; });
  21845. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionElement", function() { return ExpressionElement; });
  21846. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionalExpression", function() { return ConditionalExpression; });
  21847. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicExpression", function() { return LogicExpression; });
  21848. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArithmeticExpression", function() { return ArithmeticExpression; });
  21849. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfTrue", function() { return IfTrue; });
  21850. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatNTimes", function() { return RepeatNTimes; });
  21851. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WhileTrue", function() { return WhileTrue; });
  21852. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DoWhileTrue", function() { return DoWhileTrue; });
  21853. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  21854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  21855. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwitchCase", function() { return SwitchCase; });
  21856. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  21857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableValueMenu", function() { return VariableValueMenu; });
  21858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCallMenu", function() { return FunctionCallMenu; });
  21859. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Program", function() { return Program; });
  21860. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  21861. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__);
  21862. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  21863. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  21864. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  21865. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  21866. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__);
  21867. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  21868. var COMMAND_TYPES = Object.freeze({
  21869. "function": "function",
  21870. comment: "comment",
  21871. reader: "reader",
  21872. writer: "writer",
  21873. attribution: "attribution",
  21874. iftrue: "iftrue",
  21875. repeatNtimes: "repeatNtimes",
  21876. whiletrue: "whiletrue",
  21877. dowhiletrue: "dowhiletrue",
  21878. "switch": "switch",
  21879. switchcase: "switchcase",
  21880. functioncall: "functioncall",
  21881. "break": "break",
  21882. "return": "return"
  21883. });
  21884. var ARITHMETIC_TYPES = Object.freeze({
  21885. plus: "plus",
  21886. minus: "minus",
  21887. multiplication: "multiplication",
  21888. division: "division",
  21889. module: "module",
  21890. none: "none"
  21891. });
  21892. var EXPRESSION_ELEMENTS = Object.freeze({
  21893. exp_op_exp: "exp_op_exp",
  21894. op_exp: "op_exp",
  21895. par_exp_par: "par_exp_par",
  21896. start_point: "start_point"
  21897. });
  21898. var EXPRESSION_TYPES = Object.freeze({
  21899. exp_conditional: "exp_conditional",
  21900. exp_logic: "exp_logic",
  21901. exp_arithmetic: "exp_arithmetic",
  21902. write_sep: "write_separator"
  21903. });
  21904. var ARITHMETIC_COMPARISON = Object.freeze({
  21905. greater_than: "greater_than",
  21906. less_than: "less_than",
  21907. equals_to: "equals_to",
  21908. not_equals_to: "not_equals_to",
  21909. greater_than_or_equals_to: "greater_than_or_equals_to",
  21910. less_than_or_equals_to: "less_than_or_equals_to"
  21911. });
  21912. var LOGIC_COMPARISON = Object.freeze({
  21913. equals_to: "equals_to",
  21914. not_equals_to: "not_equals_to",
  21915. and: "and",
  21916. or: "or",
  21917. not: "not"
  21918. });
  21919. var SYSTEM_FUNCTIONS_CATEGORIES = Object.freeze({
  21920. math: "$mathLib",
  21921. text: "$strLib",
  21922. arrangement: "$arrayLib",
  21923. conversion: "$langLib"
  21924. });
  21925. var Variable = function Variable(type, name, value) {
  21926. var dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  21927. var is_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  21928. var rows = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  21929. var columns = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
  21930. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Variable);
  21931. this.type = type;
  21932. this.name = name;
  21933. this.value = value;
  21934. this.dimensions = dimensions;
  21935. this.is_constant = is_constant;
  21936. this.rows = rows;
  21937. this.columns = columns;
  21938. };
  21939. var Function = function Function(name) {
  21940. var return_type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID;
  21941. var return_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  21942. var parameters_list = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  21943. var is_main = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  21944. var is_hidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
  21945. var variables_list = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
  21946. var function_comment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
  21947. var commands = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];
  21948. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Function);
  21949. this.type = COMMAND_TYPES["function"];
  21950. this.name = name;
  21951. this.return_type = return_type;
  21952. this.return_dimensions = return_dimensions;
  21953. this.parameters_list = parameters_list;
  21954. this.is_main = is_main;
  21955. this.is_hidden = is_hidden;
  21956. this.variables_list = variables_list;
  21957. this.function_comment = function_comment;
  21958. this.commands = commands;
  21959. };
  21960. var SystemFunction = function SystemFunction(identifier, return_type, return_dimensions, parameters_list) {
  21961. var function_comment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  21962. var category = arguments.length > 5 ? arguments[5] : undefined;
  21963. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SystemFunction);
  21964. this.type = COMMAND_TYPES["function"];
  21965. this.identifier = identifier;
  21966. this.return_type = return_type;
  21967. this.return_dimensions = return_dimensions;
  21968. this.parameters_list = parameters_list;
  21969. this.function_comment = function_comment;
  21970. this.category = category;
  21971. };
  21972. var Comment = function Comment(comment_text) {
  21973. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Comment);
  21974. this.type = COMMAND_TYPES.comment;
  21975. this.comment_text = comment_text;
  21976. };
  21977. var Break = function Break() {
  21978. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Break);
  21979. this.type = COMMAND_TYPES["break"];
  21980. };
  21981. var Reader = function Reader() {
  21982. var variable_value_menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new VariableValueMenu();
  21983. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Reader);
  21984. this.type = COMMAND_TYPES.reader;
  21985. this.variable_value_menu = variable_value_menu;
  21986. };
  21987. var Writer = function Writer(content) {
  21988. var newline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  21989. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Writer);
  21990. this.type = COMMAND_TYPES.writer;
  21991. this.content = content;
  21992. this.newline = newline;
  21993. };
  21994. var Attribution = function Attribution(variable) {
  21995. var expression = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  21996. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Attribution);
  21997. this.type = COMMAND_TYPES.attribution;
  21998. this.variable = variable;
  21999. this.expression = expression;
  22000. };
  22001. var ExpressionOperator = function ExpressionOperator(type_op, item) {
  22002. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionOperator);
  22003. this.type_op = type_op; // Logic, Arithmetic OR Relational
  22004. this.item = item;
  22005. };
  22006. var ExpressionElement = function ExpressionElement(type_exp) {
  22007. var itens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22008. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionElement);
  22009. this.type_exp = type_exp;
  22010. this.itens = itens;
  22011. };
  22012. var ConditionalExpression = function ConditionalExpression(expression) {
  22013. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ConditionalExpression);
  22014. this.type = EXPRESSION_TYPES.exp_conditional;
  22015. this.expression = expression;
  22016. };
  22017. var LogicExpression = function LogicExpression(has_neg, first_operand, second_operand, operator) {
  22018. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, LogicExpression);
  22019. this.type = EXPRESSION_TYPES.exp_logic;
  22020. this.has_neg = has_neg;
  22021. this.first_operand = first_operand;
  22022. this.second_operand = second_operand;
  22023. this.operator = operator;
  22024. };
  22025. var ArithmeticExpression = function ArithmeticExpression(first_operand, second_operand, operator) {
  22026. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ArithmeticExpression);
  22027. this.type = EXPRESSION_TYPES.exp_arithmetic;
  22028. this.first_operand = first_operand;
  22029. this.second_operand = second_operand;
  22030. this.operator = operator;
  22031. };
  22032. var IfTrue = function IfTrue(expression, commands_block, commands_else) {
  22033. var collapsed = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  22034. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, IfTrue);
  22035. this.type = COMMAND_TYPES.iftrue;
  22036. this.expression = expression;
  22037. this.commands_block = commands_block;
  22038. this.commands_else = commands_else;
  22039. this.collapsed = collapsed;
  22040. };
  22041. var RepeatNTimes = function RepeatNTimes(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block) {
  22042. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, RepeatNTimes);
  22043. this.type = COMMAND_TYPES.repeatNtimes;
  22044. this.var_attribution = var_attribution;
  22045. this.var_incrementation = var_incrementation;
  22046. this.expression1 = expression1;
  22047. this.expression2 = expression2;
  22048. this.expression3 = expression3;
  22049. this.commands_block = commands_block;
  22050. };
  22051. var WhileTrue = function WhileTrue(expression, commands_block) {
  22052. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, WhileTrue);
  22053. this.type = COMMAND_TYPES.whiletrue;
  22054. this.expression = expression;
  22055. this.commands_block = commands_block;
  22056. };
  22057. var DoWhileTrue = function DoWhileTrue(expression, commands_block) {
  22058. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, DoWhileTrue);
  22059. this.type = COMMAND_TYPES.dowhiletrue;
  22060. this.expression = expression;
  22061. this.commands_block = commands_block;
  22062. };
  22063. var Switch = function Switch(variable) {
  22064. var cases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22065. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Switch);
  22066. this.type = COMMAND_TYPES["switch"];
  22067. this.variable = variable;
  22068. this.cases = cases;
  22069. };
  22070. var Return = function Return(variable_value_menu) {
  22071. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Return);
  22072. this.type = COMMAND_TYPES["return"];
  22073. this.variable_value_menu = variable_value_menu;
  22074. };
  22075. var SwitchCase = function SwitchCase(variable_value_menu) {
  22076. var commands_block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22077. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SwitchCase);
  22078. this.type = COMMAND_TYPES.switchcase;
  22079. this.variable_value_menu = variable_value_menu;
  22080. this.commands_block = commands_block;
  22081. };
  22082. var FunctionCall = function FunctionCall(function_called, parameters_list) {
  22083. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCall);
  22084. this.type = COMMAND_TYPES.functioncall;
  22085. this.function_called = function_called;
  22086. this.parameters_list = parameters_list;
  22087. };
  22088. var VariableValueMenu = function VariableValueMenu() {
  22089. var variable_and_value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
  22090. var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  22091. var row = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  22092. var column = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  22093. var include_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  22094. var dimensions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  22095. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, VariableValueMenu);
  22096. this.type = "var_value";
  22097. this.variable_and_value = variable_and_value;
  22098. this.content = content;
  22099. this.row = row;
  22100. this.column = column;
  22101. this.include_constant = include_constant;
  22102. this.dimensions = dimensions;
  22103. };
  22104. var FunctionCallMenu = function FunctionCallMenu() {
  22105. var function_called = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  22106. var parameters_list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22107. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCallMenu);
  22108. this.type = "function_call";
  22109. this.function_called = function_called;
  22110. this.parameters_list = parameters_list;
  22111. };
  22112. var Program = /*#__PURE__*/function () {
  22113. function Program() {
  22114. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Program);
  22115. this.functions = [];
  22116. this.globals = [];
  22117. }
  22118. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default()(Program, [{
  22119. key: "addFunction",
  22120. value: function addFunction(function_to_add) {
  22121. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.parameters_list, function () {
  22122. if (window.insertContext) {
  22123. setTimeout(function () {
  22124. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22125. }, 300);
  22126. window.insertContext = false;
  22127. } else {
  22128. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22129. }
  22130. }, 1);
  22131. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.variables_list, function () {
  22132. if (window.insertContext) {
  22133. setTimeout(function () {
  22134. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22135. }, 300);
  22136. window.insertContext = false;
  22137. } else {
  22138. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22139. }
  22140. }, 1);
  22141. this.functions.push(function_to_add);
  22142. }
  22143. }, {
  22144. key: "addVariable",
  22145. value: function addVariable(function_to_receive, variable) {
  22146. if (this.functions[function_to_receive].variable === null) {
  22147. this.functions[function_to_receive].variables_list = [];
  22148. }
  22149. this.functions[function_to_receive].variables_list.push(variable);
  22150. }
  22151. }, {
  22152. key: "addGlobal",
  22153. value: function addGlobal(variable) {
  22154. this.globals.push(variable);
  22155. }
  22156. }]);
  22157. return Program;
  22158. }();
  22159. /***/ }),
  22160. /***/ "./js/visualUI/text_editor.js":
  22161. /*!************************************!*\
  22162. !*** ./js/visualUI/text_editor.js ***!
  22163. \************************************/
  22164. /*! exports provided: initTextEditor, disable, updateEditor, setCode, getCode */
  22165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22166. "use strict";
  22167. __webpack_require__.r(__webpack_exports__);
  22168. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initTextEditor", function() { return initTextEditor; });
  22169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disable", function() { return disable; });
  22170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateEditor", function() { return updateEditor; });
  22171. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCode", function() { return setCode; });
  22172. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  22173. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! codemirror */ "./node_modules/codemirror/lib/codemirror.js");
  22174. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  22175. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! codemirror/addon/edit/closebrackets */ "./node_modules/codemirror/addon/edit/closebrackets.js");
  22176. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__);
  22177. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! codemirror/addon/edit/matchbrackets */ "./node_modules/codemirror/addon/edit/matchbrackets.js");
  22178. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__);
  22179. /* 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");
  22180. /* 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__);
  22181. /* harmony import */ var _util_editorMode2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../util/editorMode2 */ "./js/util/editorMode2.js");
  22182. // import "codemirror/addon/hint/show-hint";
  22183. // import "codemirror/addon/hint/anyword-hint";
  22184. Object(_util_editorMode2__WEBPACK_IMPORTED_MODULE_4__["CodeEditorMode"])(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  22185. var codeEditor = null;
  22186. function initTextEditor(element) {
  22187. var id = element;
  22188. if (element[0] == '#') {
  22189. id = element.substring(1);
  22190. }
  22191. codeEditor = codemirror__WEBPACK_IMPORTED_MODULE_0__["fromTextArea"](document.getElementById(id), {
  22192. theme: "ttcn",
  22193. value: "",
  22194. mode: "text/x-ivprog",
  22195. indentUnit: 4,
  22196. lineNumbers: true,
  22197. matchBrackets: true,
  22198. autoCloseBrackets: true,
  22199. fixedGutter: true,
  22200. styleActiveLine: true,
  22201. readOnly: true
  22202. });
  22203. }
  22204. function disable(flag) {
  22205. codeEditor.setOption("readOnly", flag);
  22206. updateEditor();
  22207. }
  22208. function updateEditor() {
  22209. codeEditor.refresh();
  22210. }
  22211. function setCode(code) {
  22212. codeEditor.setValue(code);
  22213. }
  22214. function getCode() {
  22215. return codeEditor.getValue();
  22216. }
  22217. /***/ }),
  22218. /***/ "./js/visualUI/types.js":
  22219. /*!******************************!*\
  22220. !*** ./js/visualUI/types.js ***!
  22221. \******************************/
  22222. /*! exports provided: Types */
  22223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22224. "use strict";
  22225. __webpack_require__.r(__webpack_exports__);
  22226. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Types", function() { return Types; });
  22227. var Types = Object.freeze({
  22228. INTEGER: "integer",
  22229. REAL: "real",
  22230. TEXT: "text",
  22231. CHAR: 'char',
  22232. BOOLEAN: "boolean",
  22233. VOID: "void"
  22234. });
  22235. /***/ }),
  22236. /***/ "./js/visualUI/utils.js":
  22237. /*!******************************!*\
  22238. !*** ./js/visualUI/utils.js ***!
  22239. \******************************/
  22240. /*! exports provided: renderErrorMessage */
  22241. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22242. "use strict";
  22243. __webpack_require__.r(__webpack_exports__);
  22244. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderErrorMessage", function() { return renderErrorMessage; });
  22245. function renderErrorMessage(dom_obj_target, message_text) {
  22246. dom_obj_target.popup({
  22247. html: '<i class="ui icon inverted exclamation triangle yellow"></i>' + message_text,
  22248. transition: "fade up",
  22249. on: 'click',
  22250. closable: true,
  22251. movePopup: true,
  22252. boundary: window,
  22253. preserve: false,
  22254. target: false,
  22255. className: {
  22256. popup: 'ui popup invalid-identifier'
  22257. },
  22258. onHidden: function onHidden($module) {
  22259. dom_obj_target.popup('destroy');
  22260. }
  22261. }).popup('toggle');
  22262. }
  22263. /***/ }),
  22264. /***/ "./js/visualUI/variables.js":
  22265. /*!**********************************!*\
  22266. !*** ./js/visualUI/variables.js ***!
  22267. \**********************************/
  22268. /*! exports provided: addVariable, renderVariable */
  22269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22270. "use strict";
  22271. __webpack_require__.r(__webpack_exports__);
  22272. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVariable", function() { return addVariable; });
  22273. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderVariable", function() { return renderVariable; });
  22274. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  22275. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  22276. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  22277. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  22278. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  22279. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  22280. var counter_new_variables = 0;
  22281. function addVariable(function_obj, function_container) {
  22282. var is_in_click = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  22283. 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);
  22284. if (function_obj.variables_list == null) {
  22285. function_obj.variables_list = [];
  22286. }
  22287. function_obj.variables_list.push(new_var);
  22288. counter_new_variables++;
  22289. 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);
  22290. var newe = renderVariable(function_container, new_var, function_obj);
  22291. if (is_in_click) {
  22292. newe.css('display', 'none');
  22293. newe.fadeIn();
  22294. }
  22295. }
  22296. function updateName(variable_obj, new_name, variable_obj_dom, function_obj) {
  22297. if (variable_obj.name == new_name) {
  22298. return;
  22299. }
  22300. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_5__["isValidIdentifier"])(new_name)) {
  22301. if (variableNameAlreadyExists(new_name, function_obj)) {
  22302. _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]));
  22303. } else {
  22304. 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);
  22305. variable_obj.name = new_name;
  22306. }
  22307. } else {
  22308. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  22309. }
  22310. }
  22311. function variableNameAlreadyExists(name_var, function_obj) {
  22312. if (function_obj.parameters_list) {
  22313. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  22314. if (function_obj.parameters_list[i].name == name_var) {
  22315. return true;
  22316. }
  22317. }
  22318. }
  22319. if (function_obj.variables_list) {
  22320. for (var i = 0; i < function_obj.variables_list.length; i++) {
  22321. if (function_obj.variables_list[i].name == name_var) {
  22322. return true;
  22323. }
  22324. }
  22325. }
  22326. return false;
  22327. }
  22328. function removeVariable(variable_obj, variable_container, function_name) {
  22329. var function_associated = variable_container.data('associatedFunction');
  22330. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_FUNCTION_VAR, variable_obj.name);
  22331. var index = function_associated.variables_list.indexOf(variable_obj);
  22332. if (index > -1) {
  22333. window.insertContext = true;
  22334. delete function_associated.variables_list[index];
  22335. function_associated.variables_list.splice(index, 1);
  22336. }
  22337. variable_container.children().off();
  22338. variable_container.off();
  22339. variable_container.fadeOut();
  22340. }
  22341. function updateType(variable_obj, new_type, function_name) {
  22342. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  22343. variable_obj.type = new_type;
  22344. variable_obj.dimensions = new_dimensions;
  22345. if (new_dimensions > 0) {
  22346. variable_obj.rows = new_dimensions;
  22347. variable_obj.columns = 2;
  22348. }
  22349. 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);
  22350. updateInitialValues(variable_obj, function_name);
  22351. }
  22352. function addHandlers(variable_obj, variable_container, function_obj) {
  22353. // Manage variable name:
  22354. variable_container.find(".editing_name_var").on('click', function (e) {
  22355. 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);
  22356. enableNameUpdate(variable_obj, variable_container, function_obj);
  22357. }); // Menu to change type:
  22358. variable_container.find('.ui.dropdown.variable_type').dropdown({
  22359. onChange: function onChange(_, __, $selectedItem) {
  22360. if ($selectedItem.data('dimensions')) {
  22361. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  22362. } else {
  22363. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  22364. }
  22365. renderValues(variable_obj, variable_container, function_obj.name);
  22366. },
  22367. selectOnKeydown: false
  22368. }); // Remove variable:
  22369. variable_container.find(".remove_variable").on('click', function (e) {
  22370. removeVariable(variable_obj, variable_container, function_obj.name);
  22371. });
  22372. }
  22373. function renderVariable(function_container, new_var, function_obj) {
  22374. var element = '<div class="ui label variable_container pink"><i class="ui icon ellipsis vertical inverted"></i>';
  22375. element += '<div class="ui dropdown variable_type">';
  22376. if (new_var.dimensions == 1) {
  22377. 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()));
  22378. element += ' [ ] </div>';
  22379. } else if (new_var.dimensions == 2) {
  22380. 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()));
  22381. element += ' [ ] [ ] </div>';
  22382. } else {
  22383. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase())) + '</div>';
  22384. }
  22385. element += '<div class="menu">';
  22386. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22387. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22388. continue;
  22389. }
  22390. 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>';
  22391. }
  22392. 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">';
  22393. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22394. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22395. continue;
  22396. }
  22397. 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>';
  22398. }
  22399. element += '</div></div>';
  22400. 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">';
  22401. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22402. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22403. continue;
  22404. }
  22405. 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>';
  22406. }
  22407. element += '</div></div>';
  22408. element += '</div></div> ';
  22409. element += '<div class="editing_name_var"><span class="span_name_variable enable_edit_name_variable">' + new_var.name + '</span> </div>';
  22410. element += ' <span class="character_equals"> <&#8212; </span> <div class="ui div_valor_var">' + new_var.value + '</div>';
  22411. element += ' <i class="yellow inverted icon times remove_variable"></i></div>';
  22412. element = $(element);
  22413. element.data('associatedFunction', function_obj);
  22414. function_container.find('.variables_list_div').append(element);
  22415. addHandlers(new_var, element, function_obj);
  22416. renderValues(new_var, element, function_obj.name);
  22417. return element;
  22418. }
  22419. function updateColumnsAndRowsText(variable_container, variable_var) {
  22420. var prev = variable_container.find('.text').text().split('[');
  22421. if (prev.length == 2) {
  22422. var ff = prev[0] + '[ ' + variable_var.columns + ' ] ';
  22423. variable_container.find('.text').empty();
  22424. variable_container.find('.text').text(ff);
  22425. }
  22426. if (prev.length == 3) {
  22427. var ff = prev[0] + '[ ' + variable_var.columns + ' ] [ ' + variable_var.rows + ' ] ';
  22428. variable_container.find('.text').empty();
  22429. variable_container.find('.text').text(ff);
  22430. }
  22431. }
  22432. function renderValues(new_var, variable_container, function_name) {
  22433. var ret = "";
  22434. var j = 0;
  22435. if (new_var.dimensions == 0) {
  22436. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22437. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value.toFixed(1) + '</span> </div> ';
  22438. } else {
  22439. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22440. 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> ';
  22441. } else {
  22442. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value + '</span> </div> ';
  22443. }
  22444. }
  22445. } else {
  22446. ret += '<table class="tabela_var">';
  22447. if (new_var.dimensions == 1) {
  22448. ret += '<tr>';
  22449. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22450. for (var k = 0; k < new_var.columns; k++) {
  22451. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k].toFixed(1) + '</span></td>';
  22452. }
  22453. } else {
  22454. for (var k = 0; k < new_var.columns; k++) {
  22455. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22456. 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>';
  22457. } else {
  22458. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k] + '</span>' + '</td>';
  22459. }
  22460. }
  22461. }
  22462. ret += '</tr>';
  22463. ret += '</table>';
  22464. 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>';
  22465. }
  22466. if (new_var.dimensions == 2) {
  22467. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22468. for (var l = 0; l < new_var.rows; l++) {
  22469. ret += '<tr>';
  22470. for (var k = 0; k < new_var.columns; k++) {
  22471. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  22472. }
  22473. ret += '</tr>';
  22474. }
  22475. } else {
  22476. for (var l = 0; l < new_var.rows; l++) {
  22477. ret += '<tr>';
  22478. for (var k = 0; k < new_var.columns; k++) {
  22479. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22480. 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>';
  22481. } else {
  22482. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k] + '</span></td>';
  22483. }
  22484. }
  22485. ret += '</tr>';
  22486. }
  22487. }
  22488. if (new_var.rows == 0) {
  22489. ret += '<tr><td></td></tr>';
  22490. }
  22491. 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>';
  22492. ret += '</table>';
  22493. 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>';
  22494. }
  22495. }
  22496. $(variable_container).find(".div_valor_var").html('');
  22497. ret = $(ret);
  22498. $(ret).find('.span_value_variable').data('associatedOject', new_var);
  22499. $(ret).find(".boolean_simple_type").on('click', function (e) {
  22500. 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);
  22501. alternateBooleanValue(new_var, this.parentNode);
  22502. });
  22503. $(ret).find(".simple_var").on('click', function (e) {
  22504. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  22505. enableValueUpdate(new_var, this.parentNode, function_name);
  22506. });
  22507. $(ret).find(".boolean_vector_var").on('click', function (e) {
  22508. alternateBooleanVectorValue(new_var, $(this).data('index'), this.parentNode);
  22509. 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);
  22510. });
  22511. $(ret).find(".vector_var").on('click', function (e) {
  22512. enableVectorValueUpdate(new_var, $(this).data('index'), this.parentNode, function_name);
  22513. });
  22514. $(ret).find(".remove_global_vector_column").on('click', function (e) {
  22515. removeColumnVector(new_var);
  22516. 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);
  22517. 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);
  22518. $(variable_container).find(".div_valor_var").html('');
  22519. renderValues(new_var, variable_container, function_name);
  22520. });
  22521. $(ret).find(".add_global_vector_column").on('click', function (e) {
  22522. addColumnVector(new_var);
  22523. 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);
  22524. 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);
  22525. $(variable_container).find(".div_valor_var").html('');
  22526. renderValues(new_var, variable_container, function_name);
  22527. });
  22528. $(ret).find(".remove_global_matrix_column").on('click', function (e) {
  22529. removeColumnMatrix(new_var);
  22530. 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);
  22531. 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);
  22532. $(variable_container).find(".div_valor_var").html('');
  22533. renderValues(new_var, variable_container, function_name);
  22534. });
  22535. $(ret).find(".add_global_matrix_column").on('click', function (e) {
  22536. addColumnMatrix(new_var);
  22537. 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);
  22538. 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);
  22539. $(variable_container).find(".div_valor_var").html('');
  22540. renderValues(new_var, variable_container, function_name);
  22541. });
  22542. $(ret).find(".remove_global_matrix_line").on('click', function (e) {
  22543. removeLineMatrix(new_var);
  22544. 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);
  22545. 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);
  22546. $(variable_container).find(".div_valor_var").html('');
  22547. renderValues(new_var, variable_container, function_name);
  22548. });
  22549. $(ret).find(".add_global_matrix_line").on('click', function (e) {
  22550. addLineMatrix(new_var);
  22551. 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);
  22552. 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);
  22553. $(variable_container).find(".div_valor_var").html('');
  22554. renderValues(new_var, variable_container, function_name);
  22555. });
  22556. $(ret).find(".boolean_matrix_var").on('click', function (e) {
  22557. alternateBooleanMatrixValue(new_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  22558. 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);
  22559. });
  22560. $(ret).find(".matrix_var").on('click', function (e) {
  22561. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  22562. enableMatrixValueUpdate(new_var, $(this).data('row'), $(this).data('index'), this.parentNode, function_name);
  22563. });
  22564. $(variable_container).find(".div_valor_var").append(ret);
  22565. updateColumnsAndRowsText(variable_container, new_var);
  22566. }
  22567. function alternateBooleanMatrixValue(var_obj, row, index, value_container) {
  22568. var_obj.value[row][index] = !var_obj.value[row][index];
  22569. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[row][index])));
  22570. }
  22571. function addLineMatrix(var_obj) {
  22572. var_obj.rows++;
  22573. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22574. var n_l = [];
  22575. for (var i = 0; i < var_obj.columns; i++) {
  22576. n_l.push(0);
  22577. }
  22578. var_obj.value.push(n_l);
  22579. }
  22580. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22581. var n_l = [];
  22582. for (i = 0; i < var_obj.columns; i++) {
  22583. n_l.push(0.0);
  22584. }
  22585. var_obj.value.push(n_l);
  22586. }
  22587. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22588. var n_l = [];
  22589. for (i = 0; i < var_obj.columns; i++) {
  22590. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22591. }
  22592. var_obj.value.push(n_l);
  22593. }
  22594. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22595. var n_l = [];
  22596. for (i = 0; i < var_obj.columns; i++) {
  22597. n_l.push(true);
  22598. }
  22599. var_obj.value.push(n_l);
  22600. }
  22601. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22602. var n_l = [];
  22603. for (i = 0; i < var_obj.columns; i++) {
  22604. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22605. }
  22606. var_obj.value.push(n_l);
  22607. }
  22608. }
  22609. function removeLineMatrix(var_obj) {
  22610. if (var_obj.rows == 0) {
  22611. return;
  22612. }
  22613. var_obj.rows--;
  22614. var_obj.value.splice(var_obj.value.length - 1, 1);
  22615. }
  22616. function addColumnMatrix(var_obj) {
  22617. var_obj.columns++;
  22618. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22619. for (var i = 0; i < var_obj.rows; i++) {
  22620. var_obj.value[i].push(0);
  22621. }
  22622. }
  22623. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22624. for (var i = 0; i < var_obj.rows; i++) {
  22625. var_obj.value[i].push(0.0);
  22626. }
  22627. }
  22628. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22629. for (var i = 0; i < var_obj.rows; i++) {
  22630. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22631. }
  22632. }
  22633. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22634. for (var i = 0; i < var_obj.rows; i++) {
  22635. var_obj.value[i].push(true);
  22636. }
  22637. }
  22638. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22639. for (var i = 0; i < var_obj.rows; i++) {
  22640. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22641. }
  22642. }
  22643. }
  22644. function removeColumnMatrix(var_obj) {
  22645. if (var_obj.columns == 0) {
  22646. return;
  22647. }
  22648. var_obj.columns--;
  22649. for (var i = 0; i < var_obj.rows; i++) {
  22650. var_obj.value[i].splice(var_obj.value[i].length - 1, 1);
  22651. }
  22652. }
  22653. function addColumnVector(var_obj) {
  22654. var_obj.columns++;
  22655. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22656. var_obj.value.push(0);
  22657. }
  22658. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22659. var_obj.value.push(0.0);
  22660. }
  22661. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22662. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22663. }
  22664. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22665. var_obj.value.push(true);
  22666. }
  22667. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22668. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22669. }
  22670. }
  22671. function removeColumnVector(var_obj) {
  22672. if (var_obj.columns == 0) {
  22673. return;
  22674. }
  22675. var_obj.columns--;
  22676. var_obj.value.splice(var_obj.value.length - 1, 1);
  22677. }
  22678. function alternateBooleanValue(var_obj, value_container) {
  22679. var_obj.value = !var_obj.value;
  22680. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value)));
  22681. }
  22682. function alternateBooleanVectorValue(var_obj, index, value_container) {
  22683. var_obj.value[index] = !var_obj.value[index];
  22684. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[index])));
  22685. }
  22686. function updateInitialValues(variable_obj, function_name) {
  22687. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22688. if (variable_obj.dimensions == 0) {
  22689. variable_obj.value = 0;
  22690. }
  22691. if (variable_obj.dimensions == 1) {
  22692. variable_obj.value = [0, 0];
  22693. }
  22694. if (variable_obj.dimensions == 2) {
  22695. variable_obj.value = [[0, 0], [0, 0]];
  22696. }
  22697. }
  22698. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22699. if (variable_obj.dimensions == 0) {
  22700. variable_obj.value = 0.0;
  22701. }
  22702. if (variable_obj.dimensions == 1) {
  22703. variable_obj.value = [0.0, 0.0];
  22704. }
  22705. if (variable_obj.dimensions == 2) {
  22706. variable_obj.value = [[0.0, 0.0], [0.0, 0.0]];
  22707. }
  22708. }
  22709. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22710. if (variable_obj.dimensions == 0) {
  22711. variable_obj.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  22712. }
  22713. if (variable_obj.dimensions == 1) {
  22714. 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')];
  22715. }
  22716. if (variable_obj.dimensions == 2) {
  22717. 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')]];
  22718. }
  22719. }
  22720. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22721. if (variable_obj.dimensions == 0) {
  22722. variable_obj.value = true;
  22723. }
  22724. if (variable_obj.dimensions == 1) {
  22725. variable_obj.value = [true, true];
  22726. }
  22727. if (variable_obj.dimensions == 2) {
  22728. variable_obj.value = [[true, true], [true, true]];
  22729. }
  22730. }
  22731. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22732. if (variable_obj.dimensions == 0) {
  22733. variable_obj.value = 'A';
  22734. }
  22735. if (variable_obj.dimensions == 1) {
  22736. variable_obj.value = ['A', 'A'];
  22737. }
  22738. if (variable_obj.dimensions == 2) {
  22739. variable_obj.value = [['A', 'A'], ['A', 'A']];
  22740. }
  22741. }
  22742. 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);
  22743. }
  22744. var opened_name_value_vector_global_ = false;
  22745. var opened_input_value_vector_global_ = null;
  22746. function enableVectorValueUpdate(var_obj, index, parent_node, function_name) {
  22747. if (opened_name_value_vector_global_) {
  22748. opened_input_value_vector_global_.focus();
  22749. return;
  22750. }
  22751. parent_node = $(parent_node);
  22752. opened_name_value_vector_global_ = true;
  22753. parent_node.find('.span_value_variable').text('');
  22754. var input_field;
  22755. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22756. 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) + "' />");
  22757. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22758. } else {
  22759. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[index] + "' />");
  22760. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22761. }
  22762. input_field.on('input', function () {
  22763. var inputWidth = input_field.textWidth() + 10;
  22764. opened_input_value_vector_global_ = input_field;
  22765. input_field.focus();
  22766. var tmpStr = input_field.val();
  22767. input_field.val('');
  22768. input_field.val(tmpStr);
  22769. input_field.css({
  22770. width: inputWidth
  22771. });
  22772. }).trigger('input');
  22773. input_field.focusout(function () {
  22774. var changed = false; /// update array:
  22775. if (input_field.val().trim()) {
  22776. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22777. var_obj.value[index] = parseFloat(input_field.val().trim());
  22778. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22779. } else {
  22780. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22781. var_obj.value[index] = parseInt(input_field.val().trim());
  22782. } else {
  22783. var_obj.value[index] = input_field.val().trim();
  22784. }
  22785. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22786. }
  22787. changed = true;
  22788. } else {
  22789. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22790. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22791. } else {
  22792. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22793. }
  22794. }
  22795. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22796. var_obj.value[index] = input_field.val();
  22797. changed = true;
  22798. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22799. }
  22800. if (changed) {
  22801. 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);
  22802. }
  22803. input_field.off();
  22804. input_field.remove(); /// update elements:
  22805. opened_name_value_vector_global_ = false;
  22806. opened_input_value_vector_global_ = false;
  22807. });
  22808. input_field.on('keydown', function (e) {
  22809. var code = e.keyCode || e.which;
  22810. var changed = false;
  22811. if (code == 13) {
  22812. if (input_field.val().trim()) {
  22813. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22814. var_obj.value[index] = parseFloat(input_field.val().trim());
  22815. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22816. } else {
  22817. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22818. var_obj.value[index] = parseInt(input_field.val().trim());
  22819. } else {
  22820. var_obj.value[index] = input_field.val().trim();
  22821. }
  22822. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22823. }
  22824. changed = true;
  22825. } else {
  22826. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22827. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22828. } else {
  22829. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22830. }
  22831. }
  22832. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22833. var_obj.value[index] = input_field.val();
  22834. changed = true;
  22835. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22836. }
  22837. if (changed) {
  22838. 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);
  22839. }
  22840. input_field.off();
  22841. input_field.remove(); /// update elements:
  22842. opened_name_value_vector_global_ = false;
  22843. opened_input_value_vector_global_ = false;
  22844. }
  22845. if (code == 27) {
  22846. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22847. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  22848. } else {
  22849. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  22850. }
  22851. input_field.off();
  22852. input_field.remove(); /// update elements:
  22853. opened_name_value_vector_global_ = false;
  22854. opened_input_value_vector_global_ = false;
  22855. }
  22856. });
  22857. input_field.select();
  22858. }
  22859. var opened_name_value_global_var = false;
  22860. var opened_input_value_global_ar = null;
  22861. function enableValueUpdate(var_obj, parent_node, function_name) {
  22862. if (opened_name_value_global_var) {
  22863. opened_input_value_global_ar.focus();
  22864. return;
  22865. }
  22866. parent_node = $(parent_node);
  22867. opened_name_value_global_var = true;
  22868. var input_field;
  22869. parent_node.find('.span_value_variable').text('');
  22870. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22871. 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) + "' />");
  22872. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22873. } else {
  22874. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value + "' />");
  22875. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22876. }
  22877. input_field.on('input', function () {
  22878. var inputWidth = input_field.textWidth() + 10;
  22879. opened_input_value_global_ar = input_field;
  22880. input_field.focus();
  22881. var tmpStr = input_field.val();
  22882. input_field.val('');
  22883. input_field.val(tmpStr);
  22884. input_field.css({
  22885. width: inputWidth
  22886. });
  22887. }).trigger('input');
  22888. input_field.focusout(function () {
  22889. /// update array:
  22890. var changed = false;
  22891. if (input_field.val().trim()) {
  22892. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22893. var_obj.value = parseFloat(input_field.val().trim());
  22894. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22895. } else {
  22896. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22897. var_obj.value = parseInt(input_field.val().trim());
  22898. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22899. var_obj.value = input_field.val().charAt(0);
  22900. } else {
  22901. var_obj.value = input_field.val().trim();
  22902. }
  22903. parent_node.find('.span_value_variable').text(var_obj.value);
  22904. }
  22905. changed = true;
  22906. } else {
  22907. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22908. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22909. } else {
  22910. parent_node.find('.span_value_variable').text(var_obj.value);
  22911. }
  22912. }
  22913. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22914. var_obj.value = input_field.val();
  22915. changed = true;
  22916. parent_node.find('.span_value_variable').text(var_obj.value);
  22917. }
  22918. if (changed) {
  22919. 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);
  22920. }
  22921. input_field.off();
  22922. input_field.remove(); /// update elements:
  22923. opened_name_value_global_var = false;
  22924. opened_input_value_global_ar = false;
  22925. });
  22926. input_field.on('keydown', function (e) {
  22927. var code = e.keyCode || e.which;
  22928. var changed = false;
  22929. if (code == 13) {
  22930. if (input_field.val().trim()) {
  22931. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22932. var_obj.value = parseFloat(input_field.val().trim());
  22933. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22934. } else {
  22935. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22936. var_obj.value = parseInt(input_field.val().trim());
  22937. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22938. var_obj.value = input_field.val().charAt(0);
  22939. } else {
  22940. var_obj.value = input_field.val().trim();
  22941. }
  22942. parent_node.find('.span_value_variable').text(var_obj.value);
  22943. }
  22944. changed = true;
  22945. } else {
  22946. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22947. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22948. } else {
  22949. parent_node.find('.span_value_variable').text(var_obj.value);
  22950. }
  22951. }
  22952. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22953. var_obj.value = input_field.val();
  22954. changed = true;
  22955. parent_node.find('.span_value_variable').text(var_obj.value);
  22956. }
  22957. if (changed) {
  22958. 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);
  22959. }
  22960. input_field.off();
  22961. input_field.remove(); /// update elements:
  22962. opened_name_value_global_var = false;
  22963. opened_input_value_global_ar = false;
  22964. }
  22965. if (code == 27) {
  22966. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22967. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  22968. } else {
  22969. parent_node.find('.span_value_variable').text(var_obj.value);
  22970. }
  22971. input_field.off();
  22972. input_field.remove(); /// update elements:
  22973. opened_name_value_global_var = false;
  22974. opened_input_value_global_ar = false;
  22975. }
  22976. });
  22977. input_field.select();
  22978. }
  22979. var opened_name_global = false;
  22980. var opened_input_global = null;
  22981. function enableNameUpdate(variable_obj, variable_container, function_obj) {
  22982. if (opened_name_global) {
  22983. opened_input_global.focus();
  22984. return;
  22985. }
  22986. opened_name_global = true;
  22987. variable_container.find('.span_name_variable').text('');
  22988. var input_name;
  22989. input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + variable_obj.name + "' />");
  22990. input_name.insertBefore(variable_container.find('.span_name_variable'));
  22991. input_name.on('input', function () {
  22992. var inputWidth = input_name.textWidth() + 10;
  22993. opened_input_global = input_name;
  22994. input_name.focus();
  22995. var tmpStr = input_name.val();
  22996. input_name.val('');
  22997. input_name.val(tmpStr);
  22998. input_name.css({
  22999. width: inputWidth
  23000. });
  23001. }).trigger('input');
  23002. input_name.focusout(function () {
  23003. /// update array:
  23004. if (input_name.val().trim().length > 0) {
  23005. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  23006. variable_container.find('.span_name_variable').text(variable_obj.name);
  23007. } else {
  23008. variable_container.find('.span_name_variable').text(variable_obj.name);
  23009. }
  23010. input_name.off();
  23011. input_name.remove(); /// update elements:
  23012. opened_name_global = false;
  23013. opened_input_global = false;
  23014. });
  23015. input_name.on('keydown', function (e) {
  23016. var code = e.keyCode || e.which;
  23017. if (code == 13) {
  23018. if (input_name.val().trim().length > 0) {
  23019. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  23020. variable_container.find('.span_name_variable').text(variable_obj.name);
  23021. } else {
  23022. variable_container.find('.span_name_variable').text(variable_obj.name);
  23023. }
  23024. input_name.off();
  23025. input_name.remove(); /// update elements:
  23026. opened_name_global = false;
  23027. opened_input_global = false;
  23028. }
  23029. if (code == 27) {
  23030. variable_container.find('.span_name_variable').text(variable_obj.name);
  23031. input_name.off();
  23032. input_name.remove(); /// update elements:
  23033. opened_name_global = false;
  23034. opened_input_global = false;
  23035. }
  23036. });
  23037. input_name.select();
  23038. }
  23039. var opened_name_value_matrix_global_v = false;
  23040. var opened_input_value_matrix_global_v = null;
  23041. function enableMatrixValueUpdate(var_obj, row, index, parent_node, function_name) {
  23042. if (opened_name_value_matrix_global_v) {
  23043. opened_input_value_matrix_global_v.focus();
  23044. return;
  23045. }
  23046. parent_node = $(parent_node);
  23047. opened_name_value_matrix_global_v = true;
  23048. parent_node.find('.span_value_variable').text('');
  23049. var input_field;
  23050. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23051. 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) + "' />");
  23052. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23053. } else {
  23054. 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] + "' />");
  23055. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23056. }
  23057. input_field.on('input', function () {
  23058. var inputWidth = input_field.textWidth() + 10;
  23059. opened_input_value_matrix_global_v = input_field;
  23060. input_field.focus();
  23061. var tmpStr = input_field.val();
  23062. input_field.val('');
  23063. input_field.val(tmpStr);
  23064. input_field.css({
  23065. width: inputWidth
  23066. });
  23067. }).trigger('input');
  23068. input_field.focusout(function () {
  23069. var changed = false; /// update array:
  23070. if (input_field.val().trim()) {
  23071. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23072. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  23073. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23074. } else {
  23075. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23076. var_obj.value[row][index] = parseInt(input_field.val().trim());
  23077. } else {
  23078. var_obj.value[row][index] = input_field.val().trim();
  23079. }
  23080. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23081. }
  23082. changed = true;
  23083. } else {
  23084. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23085. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23086. } else {
  23087. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23088. }
  23089. }
  23090. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23091. var_obj.value[row][index] = input_field.val();
  23092. changed = true;
  23093. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23094. }
  23095. if (changed) {
  23096. 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);
  23097. }
  23098. input_field.off();
  23099. input_field.remove(); /// update elements:
  23100. opened_name_value_matrix_global_v = false;
  23101. opened_input_value_matrix_global_v = false;
  23102. });
  23103. input_field.on('keydown', function (e) {
  23104. var code = e.keyCode || e.which;
  23105. var changed = false;
  23106. if (code == 13) {
  23107. if (input_field.val().trim()) {
  23108. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23109. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  23110. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23111. } else {
  23112. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23113. var_obj.value[row][index] = parseInt(input_field.val().trim());
  23114. } else {
  23115. var_obj.value[row][index] = input_field.val().trim();
  23116. }
  23117. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23118. }
  23119. changed = true;
  23120. } else {
  23121. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23122. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23123. } else {
  23124. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23125. }
  23126. }
  23127. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23128. var_obj.value[row][index] = input_field.val();
  23129. changed = true;
  23130. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23131. }
  23132. if (changed) {
  23133. 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);
  23134. }
  23135. input_field.off();
  23136. input_field.remove(); /// update elements:
  23137. opened_name_value_matrix_global_v = false;
  23138. opened_input_value_matrix_global_v = false;
  23139. }
  23140. if (code == 27) {
  23141. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23142. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23143. } else {
  23144. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23145. }
  23146. input_field.off();
  23147. input_field.remove(); /// update elements:
  23148. opened_name_value_matrix_global_v = false;
  23149. opened_input_value_matrix_global_v = false;
  23150. }
  23151. });
  23152. input_field.select();
  23153. }
  23154. /***/ })
  23155. /******/ });
  23156. });
  23157. //# sourceMappingURL=main.178e3d646fb79d7bafa6.js.map