main.057ebe8ca55b355184cd.js 1.4 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584
  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\":\"2021_12_09 22_41\"}");
  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-2990HElHdCH6Vbze/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-2990uk8ialyLKrrD/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","btn_add_var":"Adicionar variável","btn_drag_and_drop_function":"Mover função","btn_delete_function":"Excluir função","expression_invalid":"Expressão inválida. Verifique a sintáxe antes de continuar.","expression_undelcared_variable":"Variáveis não declaradas:","expression_undeclared_function":"Funções não definidas:","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_lock_expression":"Bloquear expressão","text_unlock_expression":"Desbloquear expressão","text_edit_expression":"Editar expressão manualmente","text_edit_expression_confirm":"Confirmar edição","text_edit_expression_cancel":"Cancelar edição","text_add_function":"Adicionar uma nova função ao programa","text_move_command":"Mover comando","text_add_parameters":"Adicionar um novo parâmetro","text_parameter_reference":"Definir parâmetro como passagem por referência","text_parameter_copy":"Definir parâmetro como passagem por cópia","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 condição senão","text_message_error_activity_file":"Aconteceu um erro ao processar a atividade. <br> Recarregue a página para tentar novamente.","text_message_error_upload_file":"Não foi possível carregar o arquivo.<br>Verifique o conteúdo do arquivo e tente novamente.","text_message_error_upload_close":"Fechar","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","tooltip_menu_read":"Comando para receber dados pelo teclado","tooltip_menu_write":"Comando para apresentar conteúdo ao usuário","tooltip_menu_comments":"Bloco para comentários internos do programador","tooltip_menu_attribution":"Comando para atribuir uma expressão a uma variável","tooltip_menu_call_function":"Comando para realizar a chamada de uma função","tooltip_menu_if_else":"Estrutura para que os comandos só sejam executados de acordo com as condições estabelecidas","tooltip_menu_repeat_n_times":"Estrutura para executar um bloco de comandos repetidamente","tooltip_menu_repeat_whiletrue":"Estrutura para repetir um bloco de comandos enquanto a condição for verdadeira","tooltip_menu_repeat_dowhiletrue":"Estrutura que executa um bloco e o repete enquanto a condição for verdadeira","tooltip_menu_repeat_switch":"Estrutura de escolha do bloco a ser executado","tooltip_menu_repeat_return":"Comando para devolver o resultado e finalizar a função","tooltip_move_var":"Mover variável","tooltip_remove_var":"Excluir variável","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","btn_add_var":"Add a variable","btn_drag_and_drop_function":"Move function","btn_delete_function":"Delete function","expression_invalid":"Invalid expression. Check the syntax before proceeding.","expression_undelcared_variable":"Undeclared variables:","expression_undeclared_function":"Undefined functions:","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_lock_expression":"Block expression","text_unlock_expression":"Unlock expression","text_edit_expression":"Edit expression manually","text_edit_expression_confirm":"Confirm edition","text_edit_expression_cancel":"Cancel edition","text_add_function":"Add a new function to the program","text_move_command":"Move command","text_add_parameters":"Add a new parameter","text_parameter_reference":"Define parameter passed by reference","text_parameter_copy":"Define parameter passed by copy","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 condition else","text_message_error_activity_file":"There was an error processing the activity.<br> Reload the page to try again.","text_message_error_upload_file":"It was not possible upload the file.<br>Verify the file's content and try again.","text_message_error_upload_close":"Close","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","tooltip_menu_read":"Command to input data from keyboard","tooltip_menu_write":"Command to present content to user","tooltip_menu_comments":"Block to comments from developer","tooltip_menu_attribution":"Command to assign an expression to a variable","tooltip_menu_call_function":"Command to execute a function call","tooltip_menu_if_else":"Structure in which command only run when the conditions are satisfied","tooltip_menu_repeat_n_times":"Structure to execute a block of commands repeatedly","tooltip_menu_repeat_whiletrue":"Structure to execute a block repeatdly while condition is true","tooltip_menu_repeat_dowhiletrue":"Structure that executes a block and repeat while the condition is true","tooltip_menu_repeat_switch":"Structure that choices the block to be executed","tooltip_menu_repeat_return":"Command to return the result and finish the function","tooltip_move_var":"Move variable","tooltip_remove_var":"Delete variable","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","btn_add_var":"Add a variable","btn_drag_and_drop_function":"Mover función ","btn_delete_function":"Borrar función ","expression_invalid":"Expresión no válida. Verifique la sintaxis antes de continuar.","expression_undelcared_variable":"Variables no declaradas:","expression_undeclared_function":"Funcíon no declaradas:","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_lock_expression":"Expresión de bloque ","text_unlock_expression":"Desbloquear expresión ","text_edit_expression":"Editar expresión manualmente ","text_edit_expression_confirm":"Confirmar edición","text_edit_expression_cancel":"Cancelar edición","text_add_function":"Agregar una nueva función al programa","text_move_command":"Mover comando","text_add_parameters":"Agregar un nuevo parámetro","text_parameter_reference":"Define parameter passed by reference","text_parameter_copy":"Define parameter passed by copy","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 condicion sino","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_upload_file":"text_message_error_upload_file","text_message_error_upload_close":"Close","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","tooltip_menu_read":"Command to input data from keyboard","tooltip_menu_write":"Command to present content to user","tooltip_menu_comments":"Block to comments from developer","tooltip_menu_attribution":"Command to assign an expression to a variable","tooltip_menu_call_function":"Command to execute a function call","tooltip_menu_if_else":"Structure in which command only run when the conditions are satisfied","tooltip_menu_repeat_n_times":"Structure to execute a block of commands repeatedly","tooltip_menu_repeat_whiletrue":"Structure to execute a block repeatdly while condition is true","tooltip_menu_repeat_dowhiletrue":"Structure that executes a block and repeat while the condition is true","tooltip_menu_repeat_switch":"Structure that choices the block to be executed","tooltip_menu_repeat_return":"Command to return the result and finish the function","tooltip_move_var":"Move variable","tooltip_remove_var":"Delete variable","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_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2790. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2791. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  2792. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__);
  2793. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2794. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);
  2795. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2796. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);
  2797. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2798. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);
  2799. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  2800. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6__);
  2801. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, result); }; }
  2802. 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; } }
  2803. var SyntaxError = /*#__PURE__*/function (_Error) {
  2804. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(SyntaxError, _Error);
  2805. var _super = _createSuper(SyntaxError);
  2806. function SyntaxError(msg, id) {
  2807. var _this;
  2808. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SyntaxError);
  2809. _this = _super.call(this, msg);
  2810. _this.id = id;
  2811. _this._context = {};
  2812. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), SyntaxError);
  2813. return _this;
  2814. }
  2815. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SyntaxError, [{
  2816. key: "context",
  2817. get: function get() {
  2818. return this._context;
  2819. },
  2820. set: function set(contextObj) {
  2821. this._context = contextObj;
  2822. }
  2823. }]);
  2824. return SyntaxError;
  2825. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6___default()(Error));
  2826. /***/ }),
  2827. /***/ "./js/ast/error/syntaxErrorFactory.js":
  2828. /*!********************************************!*\
  2829. !*** ./js/ast/error/syntaxErrorFactory.js ***!
  2830. \********************************************/
  2831. /*! exports provided: SyntaxErrorFactory */
  2832. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2833. "use strict";
  2834. __webpack_require__.r(__webpack_exports__);
  2835. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxErrorFactory", function() { return SyntaxErrorFactory; });
  2836. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  2837. /* harmony import */ var _syntaxError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./syntaxError */ "./js/ast/error/syntaxError.js");
  2838. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["getInstance"]();
  2839. function createError(message_id) {
  2840. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2841. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError(message_id, context), message_id);
  2842. }
  2843. var SyntaxErrorFactory = Object.freeze({
  2844. extra_lines: function extra_lines() {
  2845. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError("extra_lines"));
  2846. },
  2847. token_missing_one: function token_missing_one(expected, token) {
  2848. var context = [expected, token.text, token.line, token.column];
  2849. var error = createError("token_missing_one", context);
  2850. error.context = {
  2851. line: token.line,
  2852. column: token.column
  2853. };
  2854. return error;
  2855. },
  2856. token_missing_list: function token_missing_list(expectedList, token) {
  2857. var line = expectedList.join(LocalizedStrings.getOR());
  2858. var error = SyntaxErrorFactory.token_missing_one(line, token);
  2859. error.context = {
  2860. line: token.line,
  2861. column: token.column
  2862. };
  2863. return error;
  2864. },
  2865. id_missing: function id_missing(token) {
  2866. var context = [token.text, token.line, token.column];
  2867. var error = createError("id_missing", context);
  2868. error.context = {
  2869. line: token.line,
  2870. column: token.column
  2871. };
  2872. return error;
  2873. },
  2874. eos_missing: function eos_missing(token) {
  2875. var context = [token.line, token.column];
  2876. var error = createError("eos_missing", context);
  2877. error.context = {
  2878. line: token.line,
  2879. column: token.column
  2880. };
  2881. return error;
  2882. },
  2883. invalid_array_dimension: function invalid_array_dimension(typeName, token) {
  2884. var context = [token.line, token.column, typeName];
  2885. var error = createError("invalid_array_dimension", context);
  2886. error.context = {
  2887. line: token.line,
  2888. column: token.column
  2889. };
  2890. return error;
  2891. },
  2892. invalid_array_size: function invalid_array_size(token) {
  2893. var context = [token.line];
  2894. var error = createError("invalid_array_size", context);
  2895. error.context = {
  2896. line: token.line,
  2897. column: token.column
  2898. };
  2899. return error;
  2900. },
  2901. invalid_main_return: function invalid_main_return(name, typeName, token) {
  2902. var context = [name, typeName, token.line];
  2903. var error = createError("invalid_main_return", context);
  2904. error.context = {
  2905. line: token.line,
  2906. column: token.column
  2907. };
  2908. return error;
  2909. },
  2910. invalid_var_declaration: function invalid_var_declaration(token) {
  2911. var context = [token.line];
  2912. var error = createError("invalid_var_declaration", context);
  2913. error.context = {
  2914. line: token.line,
  2915. column: token.column
  2916. };
  2917. return error;
  2918. },
  2919. invalid_break_command: function invalid_break_command(cmdName, token) {
  2920. var context = [token.line, cmdName];
  2921. var error = createError("invalid_break_command", context);
  2922. error.context = {
  2923. line: token.line,
  2924. column: token.column
  2925. };
  2926. return error;
  2927. },
  2928. invalid_terminal: function invalid_terminal(token) {
  2929. var context = [token.text, token.line, token.column];
  2930. var error = createError("invalid_terminal", context);
  2931. error.context = {
  2932. line: token.line,
  2933. column: token.column
  2934. };
  2935. return error;
  2936. },
  2937. invalid_type: function invalid_type(list, token) {
  2938. var line = list.join(LocalizedStrings.getOR());
  2939. var context = [token.text, token.line, token.column, line];
  2940. var error = createError("invalid_type", context);
  2941. error.context = {
  2942. line: token.line,
  2943. column: token.column
  2944. };
  2945. return error;
  2946. },
  2947. const_not_init: function const_not_init(token) {
  2948. var context = [token.line, token.column];
  2949. var error = createError("const_not_init", context);
  2950. error.context = {
  2951. line: token.line,
  2952. column: token.column
  2953. };
  2954. return error;
  2955. },
  2956. invalid_id_format: function invalid_id_format(token) {
  2957. var context = [token.text, token.line, token.column];
  2958. var error = createError("invalid_id_format", context);
  2959. error.context = {
  2960. line: token.line,
  2961. column: token.column
  2962. };
  2963. return error;
  2964. },
  2965. duplicate_function: function duplicate_function(token) {
  2966. var context = [token.text, token.line, token.column];
  2967. var error = createError("duplicate_function", context);
  2968. error.context = {
  2969. line: token.line,
  2970. column: token.column
  2971. };
  2972. return error;
  2973. },
  2974. main_parameters: function main_parameters() {
  2975. return createError("main_parameters");
  2976. },
  2977. duplicate_variable: function duplicate_variable(token) {
  2978. var context = [token.text, token.line, token.column];
  2979. var error = createError("duplicate_variable", context);
  2980. error.context = {
  2981. line: token.line,
  2982. column: token.column
  2983. };
  2984. return error;
  2985. },
  2986. invalid_character: function invalid_character(text, line, column) {
  2987. var context = [text, line];
  2988. var error = createError("invalid_character", context);
  2989. error.context = {
  2990. line: line,
  2991. column: column
  2992. };
  2993. return error;
  2994. },
  2995. annonymous_array_literal: function annonymous_array_literal(token) {
  2996. var context = [token.line];
  2997. var error = createError("annonymous_array_literal", context);
  2998. error.context = {
  2999. line: token.line,
  3000. column: token.column
  3001. };
  3002. return error;
  3003. },
  3004. invalid_matrix_literal_line: function invalid_matrix_literal_line(exp, sourceInfo) {
  3005. var context = [exp, sourceInfo.line];
  3006. var error = createError("invalid_matrix_literal_line", context);
  3007. error.context = {
  3008. line: sourceInfo.line,
  3009. column: sourceInfo.column
  3010. };
  3011. return error;
  3012. },
  3013. cannot_infer_matrix_line: function cannot_infer_matrix_line(name, sourceInfo) {
  3014. var context = [name, sourceInfo.line];
  3015. var error = createError("cannot_infer_matrix_line", context);
  3016. error.context = {
  3017. line: sourceInfo.line,
  3018. column: sourceInfo.column
  3019. };
  3020. return error;
  3021. },
  3022. cannot_infer_matrix_column: function cannot_infer_matrix_column(name, sourceInfo) {
  3023. var context = [name, sourceInfo.line];
  3024. var error = createError("cannot_infer_matrix_column", context);
  3025. error.context = {
  3026. line: sourceInfo.line,
  3027. column: sourceInfo.column
  3028. };
  3029. return error;
  3030. },
  3031. cannot_infer_vector_size: function cannot_infer_vector_size(name, sourceInfo) {
  3032. var context = [name, sourceInfo.line];
  3033. var error = createError("cannot_infer_vector_size", context);
  3034. error.context = {
  3035. line: sourceInfo.line,
  3036. column: sourceInfo.column
  3037. };
  3038. return error;
  3039. },
  3040. matrix_to_vector_literal_attr: function matrix_to_vector_literal_attr(name, exp, sourceInfo) {
  3041. var context = [sourceInfo.line, exp, name];
  3042. var error = createError("matrix_to_vector_literal_attr", context);
  3043. error.context = {
  3044. line: sourceInfo.line,
  3045. column: sourceInfo.column
  3046. };
  3047. return error;
  3048. },
  3049. vector_to_matrix_literal_attr: function vector_to_matrix_literal_attr(name, exp, sourceInfo) {
  3050. var context = [sourceInfo.line, exp, name];
  3051. var error = createError("vector_to_matrix_literal_attr", context);
  3052. error.context = {
  3053. line: sourceInfo.line,
  3054. column: sourceInfo.column
  3055. };
  3056. return error;
  3057. },
  3058. array_init_not_literal: function array_init_not_literal(sourceInfo) {
  3059. var context = [sourceInfo.line];
  3060. var error = createError("array_init_not_literal", context);
  3061. error.context = {
  3062. line: sourceInfo.line,
  3063. column: sourceInfo.column
  3064. };
  3065. return error;
  3066. },
  3067. array_exceeds_2d: function array_exceeds_2d(sourceInfo) {
  3068. var context = [sourceInfo.line];
  3069. var error = createError("array_exceeds_2d", context);
  3070. error.context = {
  3071. line: sourceInfo.line,
  3072. column: sourceInfo.column
  3073. };
  3074. return error;
  3075. },
  3076. invalid_matrix_id_dimension: function invalid_matrix_id_dimension(sourceInfo) {
  3077. var context = [sourceInfo.line];
  3078. var error = createError("invalid_matrix_id_dimension", context);
  3079. error.context = {
  3080. line: sourceInfo.line,
  3081. column: sourceInfo.column
  3082. };
  3083. return error;
  3084. },
  3085. invalid_vector_init: function invalid_vector_init(sourceInfo) {
  3086. var context = [sourceInfo.line];
  3087. var error = createError("invalid_vector_init", context);
  3088. error.context = {
  3089. line: sourceInfo.line,
  3090. column: sourceInfo.column
  3091. };
  3092. return error;
  3093. },
  3094. invalid_matrix_init: function invalid_matrix_init(sourceInfo) {
  3095. var context = [sourceInfo.line];
  3096. var error = createError("invalid_matrix_init", context);
  3097. error.context = {
  3098. line: sourceInfo.line,
  3099. column: sourceInfo.column
  3100. };
  3101. return error;
  3102. }
  3103. });
  3104. /***/ }),
  3105. /***/ "./js/ast/expressions/arrayAccess.js":
  3106. /*!*******************************************!*\
  3107. !*** ./js/ast/expressions/arrayAccess.js ***!
  3108. \*******************************************/
  3109. /*! exports provided: ArrayAccess */
  3110. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3111. "use strict";
  3112. __webpack_require__.r(__webpack_exports__);
  3113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return ArrayAccess; });
  3114. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3115. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3116. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3117. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3118. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3119. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3120. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3121. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3122. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3123. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3124. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3125. 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); }; }
  3126. 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; } }
  3127. var ArrayAccess = /*#__PURE__*/function (_Expression) {
  3128. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayAccess, _Expression);
  3129. var _super = _createSuper(ArrayAccess);
  3130. function ArrayAccess(id, line, column) {
  3131. var _this;
  3132. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayAccess);
  3133. _this = _super.call(this);
  3134. _this.id = id;
  3135. _this.line = line;
  3136. _this.column = column;
  3137. return _this;
  3138. }
  3139. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayAccess, [{
  3140. key: "toString",
  3141. value: function toString() {
  3142. var strLine = this.line.toString();
  3143. var strColumn = null;
  3144. if (this.column) {
  3145. strColumn = this.column.toString();
  3146. }
  3147. var text = null;
  3148. if (strColumn) {
  3149. text = "".concat(this.id, "[").concat(strLine, "][").concat(strColumn, "]");
  3150. } else {
  3151. text = "".concat(this.id, "[").concat(strLine, "]");
  3152. }
  3153. if (this.parenthesis) {
  3154. return "(".concat(text, ")");
  3155. } else {
  3156. return text;
  3157. }
  3158. }
  3159. }]);
  3160. return ArrayAccess;
  3161. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3162. /***/ }),
  3163. /***/ "./js/ast/expressions/arrayLiteral.js":
  3164. /*!********************************************!*\
  3165. !*** ./js/ast/expressions/arrayLiteral.js ***!
  3166. \********************************************/
  3167. /*! exports provided: ArrayLiteral */
  3168. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3169. "use strict";
  3170. __webpack_require__.r(__webpack_exports__);
  3171. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return ArrayLiteral; });
  3172. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3173. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3174. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3175. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3176. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3177. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3178. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3179. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3180. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3181. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3182. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3183. 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); }; }
  3184. 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; } }
  3185. var ArrayLiteral = /*#__PURE__*/function (_Literal) {
  3186. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayLiteral, _Literal);
  3187. var _super = _createSuper(ArrayLiteral);
  3188. /**
  3189. *
  3190. * @param {import('../../typeSystem/itype').IType} type
  3191. * @param {import('./expression').Expression[]} value
  3192. */
  3193. function ArrayLiteral(type, value) {
  3194. var _this;
  3195. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayLiteral);
  3196. _this = _super.call(this, type);
  3197. _this.value = value;
  3198. return _this;
  3199. }
  3200. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayLiteral, [{
  3201. key: "validateType",
  3202. value: function validateType() {
  3203. var valid = true; // const subtype = this.subtype;
  3204. // if(this.columns !== null) {
  3205. // const len = this.lines;
  3206. // const len2 = this.columns;
  3207. // for (let i = len - 1; i >= 0 && valid; --i) {
  3208. // for (let j = len2 - 1; j >= 0 && valid; --j) {
  3209. // if(!this.value[i].value[j].type.isCompatilbe(subtype)) {
  3210. // valid = false;
  3211. // break;
  3212. // }
  3213. // }
  3214. // }
  3215. // } else {
  3216. // const len = this.lines;
  3217. // for (var i = len - 1; i >= 0 && valid; i--) {
  3218. // if(!this.value[i].type.isCompatilbe(subtype)) {
  3219. // valid = false;
  3220. // break;
  3221. // }
  3222. // }
  3223. // }
  3224. // Cannot validate type since no information on variables literals are available
  3225. return valid;
  3226. }
  3227. }, {
  3228. key: "validateSize",
  3229. value: function validateSize() {
  3230. var valid = true; // if(this.columns !== null) {
  3231. // const equalityTest = this.value.map(v => v.value.length)
  3232. // .reduce((old, next) => {
  3233. // console.log(next);
  3234. // if (old == null) {
  3235. // return next;
  3236. // } else if (old === next) {
  3237. // return old
  3238. // } else {
  3239. // return -1;
  3240. // }
  3241. // }, null);
  3242. // valid = equalityTest !== -1;
  3243. // }
  3244. // check is now made inside IVProgParser.parseVectorList(...)
  3245. return valid;
  3246. }
  3247. }, {
  3248. key: "toString",
  3249. value: function toString() {
  3250. var strList = this.value.map(function (arrayLiteral) {
  3251. return arrayLiteral.toString();
  3252. });
  3253. var text = "{" + strList.join(',') + "}";
  3254. if (this.parenthesis) {
  3255. return "(".concat(text, ")");
  3256. } else {
  3257. return text;
  3258. }
  3259. }
  3260. }, {
  3261. key: "subtype",
  3262. get: function get() {
  3263. var element = this.value[0];
  3264. if (element instanceof ArrayLiteral) {
  3265. return element.value[0].type;
  3266. } else {
  3267. return element.type;
  3268. }
  3269. }
  3270. }, {
  3271. key: "lines",
  3272. get: function get() {
  3273. return this.value.length;
  3274. }
  3275. }, {
  3276. key: "columns",
  3277. get: function get() {
  3278. var element = this.value[0];
  3279. if (!(element instanceof ArrayLiteral)) {
  3280. return null;
  3281. } else {
  3282. return element.value.length;
  3283. }
  3284. }
  3285. }, {
  3286. key: "isVector",
  3287. get: function get() {
  3288. return this.columns === null;
  3289. }
  3290. }, {
  3291. key: "isValid",
  3292. get: function get() {
  3293. return this.validateSize() && this.validateType();
  3294. }
  3295. }]);
  3296. return ArrayLiteral;
  3297. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3298. /***/ }),
  3299. /***/ "./js/ast/expressions/boolLiteral.js":
  3300. /*!*******************************************!*\
  3301. !*** ./js/ast/expressions/boolLiteral.js ***!
  3302. \*******************************************/
  3303. /*! exports provided: BoolLiteral */
  3304. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3305. "use strict";
  3306. __webpack_require__.r(__webpack_exports__);
  3307. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return BoolLiteral; });
  3308. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3309. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3310. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3311. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3312. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3313. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3314. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3315. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3316. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3317. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3318. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3319. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3320. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3321. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3322. 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); }; }
  3323. 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; } }
  3324. var BoolLiteral = /*#__PURE__*/function (_Literal) {
  3325. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(BoolLiteral, _Literal);
  3326. var _super = _createSuper(BoolLiteral);
  3327. function BoolLiteral(value) {
  3328. var _this;
  3329. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, BoolLiteral);
  3330. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].BOOLEAN);
  3331. _this.value = value;
  3332. return _this;
  3333. }
  3334. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(BoolLiteral, [{
  3335. key: "toString",
  3336. value: function toString() {
  3337. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertBoolToString"])(this.value);
  3338. if (this.parenthesis) {
  3339. return "(".concat(text, ")");
  3340. } else {
  3341. return text;
  3342. }
  3343. }
  3344. }]);
  3345. return BoolLiteral;
  3346. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3347. /***/ }),
  3348. /***/ "./js/ast/expressions/charLiteral.js":
  3349. /*!*******************************************!*\
  3350. !*** ./js/ast/expressions/charLiteral.js ***!
  3351. \*******************************************/
  3352. /*! exports provided: CharLiteral */
  3353. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3354. "use strict";
  3355. __webpack_require__.r(__webpack_exports__);
  3356. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return CharLiteral; });
  3357. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3358. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3359. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3360. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3361. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3362. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3363. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3364. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3365. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3366. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3367. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3368. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3369. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3370. 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); }; }
  3371. 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; } }
  3372. var CharLiteral = /*#__PURE__*/function (_Literal) {
  3373. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(CharLiteral, _Literal);
  3374. var _super = _createSuper(CharLiteral);
  3375. function CharLiteral(value) {
  3376. var _this;
  3377. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CharLiteral);
  3378. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].CHAR);
  3379. _this.value = value;
  3380. return _this;
  3381. }
  3382. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(CharLiteral, [{
  3383. key: "toString",
  3384. value: function toString() {
  3385. var text = "'".concat(this.value, "'");
  3386. if (this.parenthesis) {
  3387. return "(".concat(text, ")");
  3388. } else {
  3389. return text;
  3390. }
  3391. }
  3392. }]);
  3393. return CharLiteral;
  3394. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3395. /***/ }),
  3396. /***/ "./js/ast/expressions/expression.js":
  3397. /*!******************************************!*\
  3398. !*** ./js/ast/expressions/expression.js ***!
  3399. \******************************************/
  3400. /*! exports provided: Expression */
  3401. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3402. "use strict";
  3403. __webpack_require__.r(__webpack_exports__);
  3404. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Expression", function() { return Expression; });
  3405. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3406. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3407. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3408. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3409. var Expression = /*#__PURE__*/function () {
  3410. function Expression() {
  3411. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Expression);
  3412. this._sourceInfo = null;
  3413. this._parenthesis = false;
  3414. }
  3415. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Expression, [{
  3416. key: "sourceInfo",
  3417. set: function set(sourceInfo) {
  3418. this._sourceInfo = sourceInfo;
  3419. },
  3420. get: function get() {
  3421. return this._sourceInfo;
  3422. }
  3423. }, {
  3424. key: "parenthesis",
  3425. set: function set(flag) {
  3426. this._parenthesis = flag;
  3427. },
  3428. get: function get() {
  3429. return this._parenthesis;
  3430. }
  3431. }]);
  3432. return Expression;
  3433. }();
  3434. /***/ }),
  3435. /***/ "./js/ast/expressions/functionCall.js":
  3436. /*!********************************************!*\
  3437. !*** ./js/ast/expressions/functionCall.js ***!
  3438. \********************************************/
  3439. /*! exports provided: FunctionCall */
  3440. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3441. "use strict";
  3442. __webpack_require__.r(__webpack_exports__);
  3443. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  3444. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3445. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3446. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3447. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3448. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3449. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3450. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3451. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3452. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3453. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3454. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3455. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  3456. 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); }; }
  3457. 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; } }
  3458. var FunctionCall = /*#__PURE__*/function (_Expression) {
  3459. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(FunctionCall, _Expression);
  3460. var _super = _createSuper(FunctionCall);
  3461. /**
  3462. *
  3463. * @param {string} id
  3464. * @param {Expression[]} actualParameters
  3465. */
  3466. function FunctionCall(id, actualParameters) {
  3467. var _this;
  3468. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FunctionCall);
  3469. _this = _super.call(this);
  3470. _this.id = id;
  3471. _this.actualParameters = actualParameters;
  3472. return _this;
  3473. }
  3474. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(FunctionCall, [{
  3475. key: "toString",
  3476. value: function toString() {
  3477. var name = null;
  3478. if (this.isMainCall) {
  3479. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getMainFunctionName();
  3480. } else {
  3481. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getLocalName(this.id);
  3482. }
  3483. var params = null;
  3484. if (this.actualParameters.length == 0) {
  3485. params = "()";
  3486. } else {
  3487. var strParams = this.actualParameters.map(function (v) {
  3488. return v.toString();
  3489. });
  3490. params = "(" + strParams.join(",") + ")";
  3491. }
  3492. if (this.parenthesis) {
  3493. return "(".concat(name + params, ")");
  3494. } else {
  3495. return name + params;
  3496. }
  3497. }
  3498. }, {
  3499. key: "isMainCall",
  3500. get: function get() {
  3501. return this.id === null;
  3502. }
  3503. }, {
  3504. key: "parametersSize",
  3505. get: function get() {
  3506. return this.actualParameters.length;
  3507. }
  3508. }]);
  3509. return FunctionCall;
  3510. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3511. /***/ }),
  3512. /***/ "./js/ast/expressions/index.js":
  3513. /*!*************************************!*\
  3514. !*** ./js/ast/expressions/index.js ***!
  3515. \*************************************/
  3516. /*! exports provided: ArrayAccess, FunctionCall, IntLiteral, RealLiteral, BoolLiteral, CharLiteral, StringLiteral, ArrayLiteral, VariableLiteral, InfixApp, UnaryApp */
  3517. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3518. "use strict";
  3519. __webpack_require__.r(__webpack_exports__);
  3520. /* harmony import */ var _arrayAccess__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayAccess */ "./js/ast/expressions/arrayAccess.js");
  3521. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return _arrayAccess__WEBPACK_IMPORTED_MODULE_0__["ArrayAccess"]; });
  3522. /* harmony import */ var _functionCall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functionCall */ "./js/ast/expressions/functionCall.js");
  3523. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _functionCall__WEBPACK_IMPORTED_MODULE_1__["FunctionCall"]; });
  3524. /* harmony import */ var _intLiteral__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intLiteral */ "./js/ast/expressions/intLiteral.js");
  3525. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return _intLiteral__WEBPACK_IMPORTED_MODULE_2__["IntLiteral"]; });
  3526. /* harmony import */ var _realLiteral__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./realLiteral */ "./js/ast/expressions/realLiteral.js");
  3527. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return _realLiteral__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"]; });
  3528. /* harmony import */ var _boolLiteral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./boolLiteral */ "./js/ast/expressions/boolLiteral.js");
  3529. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return _boolLiteral__WEBPACK_IMPORTED_MODULE_4__["BoolLiteral"]; });
  3530. /* harmony import */ var _charLiteral__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./charLiteral */ "./js/ast/expressions/charLiteral.js");
  3531. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return _charLiteral__WEBPACK_IMPORTED_MODULE_5__["CharLiteral"]; });
  3532. /* harmony import */ var _stringLiteral__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stringLiteral */ "./js/ast/expressions/stringLiteral.js");
  3533. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return _stringLiteral__WEBPACK_IMPORTED_MODULE_6__["StringLiteral"]; });
  3534. /* harmony import */ var _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./arrayLiteral */ "./js/ast/expressions/arrayLiteral.js");
  3535. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__["ArrayLiteral"]; });
  3536. /* harmony import */ var _variableLiteral__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./variableLiteral */ "./js/ast/expressions/variableLiteral.js");
  3537. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return _variableLiteral__WEBPACK_IMPORTED_MODULE_8__["VariableLiteral"]; });
  3538. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  3539. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return _infixApp__WEBPACK_IMPORTED_MODULE_9__["InfixApp"]; });
  3540. /* harmony import */ var _unaryApp__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./unaryApp */ "./js/ast/expressions/unaryApp.js");
  3541. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return _unaryApp__WEBPACK_IMPORTED_MODULE_10__["UnaryApp"]; });
  3542. /***/ }),
  3543. /***/ "./js/ast/expressions/infixApp.js":
  3544. /*!****************************************!*\
  3545. !*** ./js/ast/expressions/infixApp.js ***!
  3546. \****************************************/
  3547. /*! exports provided: InfixApp */
  3548. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3549. "use strict";
  3550. __webpack_require__.r(__webpack_exports__);
  3551. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return InfixApp; });
  3552. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3553. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3554. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3555. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3556. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3557. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3558. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3559. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3560. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3561. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3562. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3563. 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); }; }
  3564. 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; } }
  3565. var InfixApp = /*#__PURE__*/function (_Expression) {
  3566. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InfixApp, _Expression);
  3567. var _super = _createSuper(InfixApp);
  3568. function InfixApp(op, left, right) {
  3569. var _this;
  3570. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InfixApp);
  3571. _this = _super.call(this);
  3572. _this.op = op;
  3573. _this.left = left;
  3574. _this.right = right;
  3575. return _this;
  3576. }
  3577. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InfixApp, [{
  3578. key: "toString",
  3579. value: function toString() {
  3580. var l = this.left.toString();
  3581. var op = this.op.value;
  3582. var r = this.right.toString();
  3583. if (this.parenthesis) {
  3584. return "(".concat(l + op + r, ")");
  3585. } else {
  3586. return l + op + r;
  3587. }
  3588. }
  3589. }]);
  3590. return InfixApp;
  3591. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3592. /***/ }),
  3593. /***/ "./js/ast/expressions/intLiteral.js":
  3594. /*!******************************************!*\
  3595. !*** ./js/ast/expressions/intLiteral.js ***!
  3596. \******************************************/
  3597. /*! exports provided: IntLiteral */
  3598. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3599. "use strict";
  3600. __webpack_require__.r(__webpack_exports__);
  3601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return IntLiteral; });
  3602. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3603. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3604. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3605. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3606. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3607. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3608. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3609. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3610. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3611. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3612. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3613. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3614. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3615. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3616. 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); }; }
  3617. 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; } }
  3618. var IntLiteral = /*#__PURE__*/function (_Literal) {
  3619. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IntLiteral, _Literal);
  3620. var _super = _createSuper(IntLiteral);
  3621. function IntLiteral(value) {
  3622. var _this;
  3623. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IntLiteral);
  3624. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].INTEGER);
  3625. _this.value = value;
  3626. return _this;
  3627. }
  3628. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IntLiteral, [{
  3629. key: "toString",
  3630. value: function toString() {
  3631. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
  3632. if (this.parenthesis) {
  3633. return "(".concat(text, ")");
  3634. } else {
  3635. return text;
  3636. }
  3637. }
  3638. }]);
  3639. return IntLiteral;
  3640. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3641. /***/ }),
  3642. /***/ "./js/ast/expressions/literal.js":
  3643. /*!***************************************!*\
  3644. !*** ./js/ast/expressions/literal.js ***!
  3645. \***************************************/
  3646. /*! exports provided: Literal */
  3647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3648. "use strict";
  3649. __webpack_require__.r(__webpack_exports__);
  3650. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Literal", function() { return Literal; });
  3651. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3652. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3653. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3654. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  3655. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3656. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  3657. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3658. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  3659. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3660. 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); }; }
  3661. 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; } }
  3662. var Literal = /*#__PURE__*/function (_Expression) {
  3663. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Literal, _Expression);
  3664. var _super = _createSuper(Literal);
  3665. function Literal(type) {
  3666. var _this;
  3667. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Literal);
  3668. _this = _super.call(this);
  3669. _this.type = type;
  3670. return _this;
  3671. }
  3672. return Literal;
  3673. }(_expression__WEBPACK_IMPORTED_MODULE_4__["Expression"]);
  3674. /***/ }),
  3675. /***/ "./js/ast/expressions/realLiteral.js":
  3676. /*!*******************************************!*\
  3677. !*** ./js/ast/expressions/realLiteral.js ***!
  3678. \*******************************************/
  3679. /*! exports provided: RealLiteral */
  3680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3681. "use strict";
  3682. __webpack_require__.r(__webpack_exports__);
  3683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return RealLiteral; });
  3684. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3685. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3686. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3687. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3688. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3689. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3690. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3691. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3692. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3693. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3694. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3695. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3696. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3697. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3698. 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); }; }
  3699. 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; } }
  3700. var RealLiteral = /*#__PURE__*/function (_Literal) {
  3701. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RealLiteral, _Literal);
  3702. var _super = _createSuper(RealLiteral);
  3703. function RealLiteral(value) {
  3704. var _this;
  3705. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RealLiteral);
  3706. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].REAL);
  3707. _this.value = value;
  3708. return _this;
  3709. }
  3710. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RealLiteral, [{
  3711. key: "toString",
  3712. value: function toString() {
  3713. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
  3714. if (this.parenthesis) {
  3715. return "(".concat(text, ")");
  3716. } else {
  3717. return text;
  3718. }
  3719. }
  3720. }]);
  3721. return RealLiteral;
  3722. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3723. /***/ }),
  3724. /***/ "./js/ast/expressions/stringLiteral.js":
  3725. /*!*********************************************!*\
  3726. !*** ./js/ast/expressions/stringLiteral.js ***!
  3727. \*********************************************/
  3728. /*! exports provided: StringLiteral */
  3729. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3730. "use strict";
  3731. __webpack_require__.r(__webpack_exports__);
  3732. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return StringLiteral; });
  3733. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3734. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3735. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3736. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3737. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3738. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3739. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3740. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3741. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3742. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3743. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3744. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3745. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3746. 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); }; }
  3747. 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; } }
  3748. var StringLiteral = /*#__PURE__*/function (_Literal) {
  3749. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(StringLiteral, _Literal);
  3750. var _super = _createSuper(StringLiteral);
  3751. function StringLiteral(value) {
  3752. var _this;
  3753. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, StringLiteral);
  3754. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].STRING);
  3755. _this.value = value;
  3756. return _this;
  3757. }
  3758. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(StringLiteral, [{
  3759. key: "toString",
  3760. value: function toString() {
  3761. var text = '"' + this.value + '"';
  3762. if (this.parenthesis) {
  3763. return "(".concat(text, ")");
  3764. } else {
  3765. return text;
  3766. }
  3767. }
  3768. }]);
  3769. return StringLiteral;
  3770. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3771. /***/ }),
  3772. /***/ "./js/ast/expressions/unaryApp.js":
  3773. /*!****************************************!*\
  3774. !*** ./js/ast/expressions/unaryApp.js ***!
  3775. \****************************************/
  3776. /*! exports provided: UnaryApp */
  3777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3778. "use strict";
  3779. __webpack_require__.r(__webpack_exports__);
  3780. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return UnaryApp; });
  3781. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3782. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3783. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3784. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3785. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3786. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3787. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3788. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3789. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3790. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3791. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  3792. 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); }; }
  3793. 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; } }
  3794. var UnaryApp = /*#__PURE__*/function (_InfixApp) {
  3795. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(UnaryApp, _InfixApp);
  3796. var _super = _createSuper(UnaryApp);
  3797. function UnaryApp(op, left) {
  3798. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, UnaryApp);
  3799. return _super.call(this, op, left, null);
  3800. }
  3801. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(UnaryApp, [{
  3802. key: "toString",
  3803. value: function toString() {
  3804. var l = this.left.toString();
  3805. var op = this.op.value;
  3806. if (this.parenthesis) {
  3807. return "(".concat(op + l, ")");
  3808. } else {
  3809. return op + l;
  3810. }
  3811. }
  3812. }]);
  3813. return UnaryApp;
  3814. }(_infixApp__WEBPACK_IMPORTED_MODULE_5__["InfixApp"]);
  3815. /***/ }),
  3816. /***/ "./js/ast/expressions/variableLiteral.js":
  3817. /*!***********************************************!*\
  3818. !*** ./js/ast/expressions/variableLiteral.js ***!
  3819. \***********************************************/
  3820. /*! exports provided: VariableLiteral */
  3821. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3822. "use strict";
  3823. __webpack_require__.r(__webpack_exports__);
  3824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return VariableLiteral; });
  3825. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3826. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3827. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3828. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3829. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3830. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3831. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3832. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3833. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3834. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3835. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3836. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3837. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3838. 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); }; }
  3839. 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; } }
  3840. var VariableLiteral = /*#__PURE__*/function (_Literal) {
  3841. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(VariableLiteral, _Literal);
  3842. var _super = _createSuper(VariableLiteral);
  3843. function VariableLiteral(id) {
  3844. var _this;
  3845. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, VariableLiteral);
  3846. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].UNDEFINED);
  3847. _this.id = id;
  3848. return _this;
  3849. }
  3850. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(VariableLiteral, [{
  3851. key: "toString",
  3852. value: function toString() {
  3853. if (this.parenthesis) {
  3854. return "(".concat(this.id, ")");
  3855. } else {
  3856. return this.id;
  3857. }
  3858. }
  3859. }]);
  3860. return VariableLiteral;
  3861. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3862. /***/ }),
  3863. /***/ "./js/ast/ivprogParser.js":
  3864. /*!********************************!*\
  3865. !*** ./js/ast/ivprogParser.js ***!
  3866. \********************************/
  3867. /*! exports provided: IVProgParser */
  3868. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3869. "use strict";
  3870. __webpack_require__.r(__webpack_exports__);
  3871. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgParser", function() { return IVProgParser; });
  3872. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3873. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3874. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3875. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3876. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
  3877. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antlr4_index__WEBPACK_IMPORTED_MODULE_2__);
  3878. /* harmony import */ var _expressions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./expressions */ "./js/ast/expressions/index.js");
  3879. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands */ "./js/ast/commands/index.js");
  3880. /* harmony import */ var _ast_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ast_helpers */ "./js/ast/ast_helpers.js");
  3881. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3882. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  3883. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__);
  3884. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  3885. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  3886. /* harmony import */ var _sourceInfo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sourceInfo */ "./js/ast/sourceInfo.js");
  3887. /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./operators */ "./js/ast/operators.ts");
  3888. /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_operators__WEBPACK_IMPORTED_MODULE_10__);
  3889. /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
  3890. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  3891. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  3892. var IVProgParser = /*#__PURE__*/function () {
  3893. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, null, [{
  3894. key: "createParser",
  3895. value: function createParser(input) {
  3896. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLexer();
  3897. return new IVProgParser(input, lexerClass);
  3898. } // <BEGIN scope consts>
  3899. }, {
  3900. key: "BASE",
  3901. get: function get() {
  3902. return 0;
  3903. }
  3904. }, {
  3905. key: "FUNCTION",
  3906. get: function get() {
  3907. return 1;
  3908. }
  3909. }, {
  3910. key: "COMMAND",
  3911. get: function get() {
  3912. return 2;
  3913. }
  3914. }, {
  3915. key: "BREAKABLE",
  3916. get: function get() {
  3917. return 4;
  3918. } // </ END scope consts>
  3919. }]);
  3920. function IVProgParser(input, lexerClass) {
  3921. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgParser);
  3922. this.lexerClass = lexerClass;
  3923. this.inputStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["InputStream"](input);
  3924. this.lexer = new lexerClass(this.inputStream);
  3925. this.lexer.recover = _ast_helpers__WEBPACK_IMPORTED_MODULE_5__["recover"].bind(this.lexer);
  3926. this.tokenStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["CommonTokenStream"](this.lexer);
  3927. this.tokenStream.fill();
  3928. this.pos = 1;
  3929. this.variableTypes = [this.lexerClass.RK_INTEGER, this.lexerClass.RK_REAL, this.lexerClass.RK_BOOLEAN, this.lexerClass.RK_STRING, this.lexerClass.RK_CHARACTER];
  3930. this.functionTypes = this.variableTypes.concat(this.lexerClass.RK_VOID);
  3931. this.parsingArrayDimension = 0;
  3932. this.scope = [];
  3933. this.langFuncs = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLangFuncs();
  3934. this.definedFuncsNameList = [];
  3935. this.definedVariablesStack = [];
  3936. }
  3937. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, [{
  3938. key: "parseTree",
  3939. value: function parseTree() {
  3940. return this.parseProgram();
  3941. }
  3942. }, {
  3943. key: "getToken",
  3944. value: function getToken() {
  3945. var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pos;
  3946. // if(index === null)
  3947. // index = this.pos;
  3948. return this.tokenStream.LT(index);
  3949. }
  3950. }, {
  3951. key: "insideScope",
  3952. value: function insideScope(scope) {
  3953. if (this.scope.length <= 0) {
  3954. return IVProgParser.BASE === scope;
  3955. } else {
  3956. return this.scope[this.scope.length - 1] === scope;
  3957. }
  3958. }
  3959. }, {
  3960. key: "pushScope",
  3961. value: function pushScope(scope) {
  3962. this.scope.push(scope);
  3963. }
  3964. }, {
  3965. key: "pushVariableStack",
  3966. value: function pushVariableStack() {
  3967. this.definedVariablesStack.push([]);
  3968. }
  3969. }, {
  3970. key: "popScope",
  3971. value: function popScope() {
  3972. return this.scope.pop();
  3973. }
  3974. }, {
  3975. key: "popVariableStack",
  3976. value: function popVariableStack() {
  3977. return this.definedVariablesStack.pop();
  3978. }
  3979. }, {
  3980. key: "getCurrentVariableStack",
  3981. value: function getCurrentVariableStack() {
  3982. return this.definedVariablesStack[this.definedVariablesStack.length - 1];
  3983. }
  3984. }, {
  3985. key: "isEOF",
  3986. value: function isEOF() {
  3987. this.getToken(this.pos);
  3988. return this.tokenStream.fetchedEOF;
  3989. }
  3990. }, {
  3991. key: "parseProgram",
  3992. value: function parseProgram() {
  3993. this.consumeNewLines();
  3994. var token = this.getToken();
  3995. var globalVars = [];
  3996. var functions = [];
  3997. if (this.lexerClass.RK_PROGRAM === token.type) {
  3998. this.pos++;
  3999. this.consumeNewLines();
  4000. this.checkOpenCurly();
  4001. this.pos++;
  4002. this.pushVariableStack();
  4003. for (;;) {
  4004. this.consumeNewLines();
  4005. var _token = this.getToken();
  4006. if (_token.type === this.lexerClass.RK_CONST || this.isVariableType(_token)) {
  4007. globalVars = globalVars.concat(this.parseGlobalVariables());
  4008. } else if (_token.type === this.lexerClass.RK_FUNCTION) {
  4009. this.pushVariableStack();
  4010. functions = functions.concat(this.parseFunction());
  4011. this.popVariableStack();
  4012. } else {
  4013. break;
  4014. }
  4015. }
  4016. this.consumeNewLines();
  4017. this.checkCloseCurly();
  4018. this.pos++;
  4019. this.consumeNewLines();
  4020. if (!this.isEOF()) {
  4021. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].extra_lines();
  4022. }
  4023. this.popVariableStack();
  4024. return {
  4025. global: globalVars,
  4026. functions: functions
  4027. };
  4028. } else {
  4029. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_PROGRAM], token);
  4030. }
  4031. }
  4032. }, {
  4033. key: "checkOpenCurly",
  4034. value: function checkOpenCurly() {
  4035. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4036. var token = this.getToken();
  4037. if (this.lexerClass.OPEN_CURLY !== token.type) {
  4038. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("{", token);else return false;
  4039. }
  4040. return true;
  4041. }
  4042. }, {
  4043. key: "checkCloseCurly",
  4044. value: function checkCloseCurly() {
  4045. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4046. var token = this.getToken();
  4047. if (this.lexerClass.CLOSE_CURLY !== token.type) {
  4048. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("}", token);else return false;
  4049. }
  4050. return true;
  4051. }
  4052. /* It checks if the current token at position pos is a ']'.
  4053. * As a check function it doesn't increment pos.
  4054. *
  4055. * @params bool:attempt, indicates that the token is optional. Defaults: false
  4056. *
  4057. * @returns true if the attempt is true and current token is '[',
  4058. * false is attempt is true and current token is not '['
  4059. **/
  4060. }, {
  4061. key: "checkOpenBrace",
  4062. value: function checkOpenBrace() {
  4063. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4064. var token = this.getToken();
  4065. if (this.lexerClass.OPEN_BRACE !== token.type) {
  4066. if (!attempt) {
  4067. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("[", token);
  4068. } else {
  4069. return false;
  4070. }
  4071. }
  4072. return true;
  4073. }
  4074. }, {
  4075. key: "checkCloseBrace",
  4076. value: function checkCloseBrace() {
  4077. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4078. var token = this.getToken();
  4079. if (this.lexerClass.CLOSE_BRACE !== token.type) {
  4080. if (!attempt) {
  4081. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("]", token);
  4082. } else {
  4083. return false;
  4084. }
  4085. }
  4086. return true;
  4087. }
  4088. }, {
  4089. key: "checkOpenParenthesis",
  4090. value: function checkOpenParenthesis() {
  4091. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4092. var token = this.getToken();
  4093. if (this.lexerClass.OPEN_PARENTHESIS !== token.type) {
  4094. if (!attempt) {
  4095. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("(", token);
  4096. } else {
  4097. return false;
  4098. }
  4099. }
  4100. return true;
  4101. }
  4102. }, {
  4103. key: "checkCloseParenthesis",
  4104. value: function checkCloseParenthesis() {
  4105. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4106. var token = this.getToken();
  4107. if (this.lexerClass.CLOSE_PARENTHESIS !== token.type) {
  4108. if (!attempt) {
  4109. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(")", token);
  4110. } else {
  4111. return false;
  4112. }
  4113. }
  4114. return true;
  4115. }
  4116. }, {
  4117. key: "checkEOS",
  4118. value: function checkEOS() {
  4119. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4120. var eosToken = this.getToken();
  4121. if (eosToken.type !== this.lexerClass.EOS) {
  4122. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].eos_missing(eosToken);else return false;
  4123. }
  4124. return true;
  4125. }
  4126. }, {
  4127. key: "checkFunctionDuplicate",
  4128. value: function checkFunctionDuplicate(functionID, funcIDToken) {
  4129. var id = functionID === null ? "$main" : functionID;
  4130. var index = this.definedFuncsNameList.indexOf(id);
  4131. if (index !== -1) {
  4132. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_function(funcIDToken);
  4133. }
  4134. this.definedFuncsNameList.push(id);
  4135. }
  4136. }, {
  4137. key: "checkVariableDuplicate",
  4138. value: function checkVariableDuplicate(variableID, sourceInfo) {
  4139. var index = this.getCurrentVariableStack().indexOf(variableID);
  4140. if (index !== -1) {
  4141. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_variable(sourceInfo);
  4142. }
  4143. this.getCurrentVariableStack().push(variableID);
  4144. }
  4145. }, {
  4146. key: "consumeForSemiColon",
  4147. value: function consumeForSemiColon() {
  4148. var eosToken = this.getToken();
  4149. if (eosToken.type === this.lexerClass.EOS && eosToken.text.match(";")) {
  4150. this.pos++;
  4151. return;
  4152. }
  4153. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(";", eosToken);
  4154. }
  4155. }, {
  4156. key: "parseGlobalVariables",
  4157. value: function parseGlobalVariables() {
  4158. var decl = this.parseMaybeConst();
  4159. this.checkEOS();
  4160. this.pos++;
  4161. return decl;
  4162. }
  4163. /*
  4164. * Checks if the next token is PR_CONST. It's only available
  4165. * at global variables declaration level
  4166. * @returns Declararion(const, type, id, initVal?)
  4167. **/
  4168. }, {
  4169. key: "parseMaybeConst",
  4170. value: function parseMaybeConst() {
  4171. var constToken = this.getToken();
  4172. if (constToken.type === this.lexerClass.RK_CONST) {
  4173. this.pos++;
  4174. var typeString = this.parseType();
  4175. return this.parseDeclaration(typeString, true);
  4176. } else if (this.isVariableType(constToken)) {
  4177. var _typeString = this.parseType();
  4178. return this.parseDeclaration(_typeString);
  4179. } else {
  4180. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_CONST]].concat(this.getTypeArray()), constToken);
  4181. }
  4182. }
  4183. /*
  4184. * Parses a declarion of the form: type --- id --- (= --- EAnd)?
  4185. * @returns a list of Declararion(const, type, id, initVal?)
  4186. **/
  4187. }, {
  4188. key: "parseDeclaration",
  4189. value: function parseDeclaration(typeString) {
  4190. var isConst = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  4191. var initial = null;
  4192. var dim1 = null;
  4193. var dim2 = null;
  4194. var dimensions = 0;
  4195. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(this.getToken());
  4196. var idString = this.parseID();
  4197. this.checkVariableDuplicate(idString, sourceInfo); // Check for array or vector
  4198. // ID[int/IDi?][int/IDj?]
  4199. if (this.checkOpenBrace(true)) {
  4200. this.pos += 1;
  4201. this.consumeNewLines();
  4202. dim1 = this.parseArrayDimension();
  4203. this.consumeNewLines();
  4204. this.checkCloseBrace();
  4205. this.pos += 1;
  4206. dimensions += 1;
  4207. if (this.checkOpenBrace(true)) {
  4208. this.pos += 1;
  4209. this.consumeNewLines();
  4210. dim2 = this.parseArrayDimension();
  4211. this.consumeNewLines();
  4212. this.checkCloseBrace();
  4213. this.pos += 1;
  4214. dimensions += 1;
  4215. }
  4216. return this.parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2);
  4217. } else {
  4218. var equalsToken = this.getToken();
  4219. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4220. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4221. }
  4222. if (equalsToken.type === this.lexerClass.EQUAL) {
  4223. this.pos++;
  4224. initial = this.parseExpressionOR();
  4225. }
  4226. var declaration = new _commands__WEBPACK_IMPORTED_MODULE_4__["Declaration"](idString, typeString, initial, isConst);
  4227. declaration.sourceInfo = sourceInfo;
  4228. var commaToken = this.getToken();
  4229. if (commaToken.type === this.lexerClass.COMMA) {
  4230. this.pos++;
  4231. this.consumeNewLines();
  4232. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4233. } else {
  4234. return [declaration];
  4235. }
  4236. }
  4237. }
  4238. }, {
  4239. key: "parseArrayDeclaration",
  4240. value: function parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2) {
  4241. var equalsToken = this.getToken();
  4242. var n_lines = dim1;
  4243. var n_columns = dim2;
  4244. var initial = null;
  4245. var dim_is_id = false;
  4246. if (dim1 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"] || dim2 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"]) {
  4247. dim_is_id = true;
  4248. if (dimensions > 1 && (dim1 == null || dim2 == null)) {
  4249. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_id_dimension(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4250. }
  4251. }
  4252. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4253. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4254. }
  4255. if (equalsToken.type === this.lexerClass.EQUAL) {
  4256. if (dim_is_id) {
  4257. if (dimensions == 1) {
  4258. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_vector_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4259. } else {
  4260. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4261. }
  4262. }
  4263. this.pos += 1;
  4264. initial = this.parseArrayLiteral(typeString);
  4265. }
  4266. if (initial == null && dim1 == null) {
  4267. if (dimensions > 1) {
  4268. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_line(idString, sourceInfo);
  4269. }
  4270. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_vector_size(idString, sourceInfo);
  4271. }
  4272. if (dimensions > 1) {
  4273. if (initial == null && dim2 == null) {
  4274. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_column(idString, sourceInfo);
  4275. }
  4276. }
  4277. if (dimensions === 1 && initial != null && !initial.isVector) {
  4278. var expString = initial.toString();
  4279. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].matrix_to_vector_literal_attr(idString, expString, initial.sourceInfo);
  4280. } else if (dimensions > 1 && initial != null && initial.isVector) {
  4281. var _expString = initial.toString();
  4282. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].vector_to_matrix_literal_attr(idString, _expString, initial.sourceInfo);
  4283. }
  4284. if (dim1 == null) {
  4285. n_lines = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.lines));
  4286. n_lines.sourceInfo = sourceInfo;
  4287. }
  4288. if (dimensions > 1) {
  4289. if (dim2 == null) {
  4290. n_columns = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.columns));
  4291. n_columns.sourceInfo = sourceInfo;
  4292. }
  4293. }
  4294. 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);
  4295. declaration.sourceInfo = sourceInfo;
  4296. var commaToken = this.getToken();
  4297. if (commaToken.type === this.lexerClass.COMMA) {
  4298. this.pos++;
  4299. this.consumeNewLines();
  4300. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4301. } else {
  4302. return [declaration];
  4303. }
  4304. }
  4305. }, {
  4306. key: "consumeNewLines",
  4307. value: function consumeNewLines() {
  4308. var token = this.getToken();
  4309. while (token.type === this.lexerClass.EOS && token.text.match("[\r\n]+")) {
  4310. this.pos++;
  4311. token = this.getToken();
  4312. }
  4313. }
  4314. }, {
  4315. key: "isVariableType",
  4316. value: function isVariableType(token) {
  4317. return this.variableTypes.find(function (v) {
  4318. return v === token.type;
  4319. });
  4320. }
  4321. /*
  4322. * Reads the next token of the stream to check if it is a Integer or an ID.
  4323. * @returns Integer | ID
  4324. **/
  4325. }, {
  4326. key: "parseArrayDimension",
  4327. value: function parseArrayDimension() {
  4328. var dimToken = this.getToken();
  4329. if (dimToken.type === this.lexerClass.INTEGER) {
  4330. //parse as int literal
  4331. this.pos++;
  4332. return this.getIntLiteral(dimToken);
  4333. } else if (dimToken.type === this.lexerClass.ID) {
  4334. //parse as variable
  4335. this.pos++;
  4336. return this.parseVariable(dimToken);
  4337. } else if (dimToken.type === this.lexerClass.CLOSE_BRACE) {
  4338. return null;
  4339. } else {
  4340. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_array_dimension(this.lexer.literalNames[this.lexerClass.RK_INTEGER], dimToken);
  4341. }
  4342. }
  4343. /*
  4344. * Returns an object {type: 'int', value: value}.
  4345. * It checks for binary and hexadecimal integers.
  4346. * @returns object with fields type and value
  4347. **/
  4348. }, {
  4349. key: "getIntLiteral",
  4350. value: function getIntLiteral(token) {
  4351. var text = token.text;
  4352. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4353. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](text));
  4354. exp.sourceInfo = sourceInfo;
  4355. return exp;
  4356. }
  4357. }, {
  4358. key: "getRealLiteral",
  4359. value: function getRealLiteral(token) {
  4360. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4361. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toReal"](token.text));
  4362. exp.sourceInfo = sourceInfo;
  4363. return exp;
  4364. }
  4365. }, {
  4366. key: "getStringLiteral",
  4367. value: function getStringLiteral(token) {
  4368. var text = token.text;
  4369. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4370. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["StringLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toString"](text));
  4371. exp.sourceInfo = sourceInfo;
  4372. return exp;
  4373. }
  4374. }, {
  4375. key: "getCharLiteral",
  4376. value: function getCharLiteral(token) {
  4377. var text = token.text;
  4378. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["CharLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toChar"](text));
  4379. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4380. return exp;
  4381. }
  4382. }, {
  4383. key: "getBoolLiteral",
  4384. value: function getBoolLiteral(token) {
  4385. var val = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toBool"](token.text);
  4386. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["BoolLiteral"](val);
  4387. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4388. return exp;
  4389. }
  4390. }, {
  4391. key: "parseArrayLiteral",
  4392. value: function parseArrayLiteral(typeString) {
  4393. var openCurly = this.checkOpenCurly(true);
  4394. if (!openCurly) {
  4395. var invalid_token = this.getToken();
  4396. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_init_not_literal(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(invalid_token));
  4397. }
  4398. var beginArray = this.getToken();
  4399. if (this.parsingArrayDimension >= 2) {
  4400. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
  4401. }
  4402. this.pos += 1;
  4403. this.parsingArrayDimension += 1;
  4404. this.consumeNewLines();
  4405. var data = null;
  4406. var maybeCurlyOpen = this.checkOpenCurly(true);
  4407. if (maybeCurlyOpen) {
  4408. // This is potentially a list of vectors
  4409. data = this.parseVectorList(typeString);
  4410. } else {
  4411. data = this.parseExpressionList();
  4412. }
  4413. this.consumeNewLines();
  4414. this.checkCloseCurly();
  4415. var endArray = this.getToken();
  4416. this.pos += 1;
  4417. this.parsingArrayDimension -= 1;
  4418. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4419. var dataDim = 1;
  4420. if (data[0] instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"]) {
  4421. dataDim += 1;
  4422. } else if (data.length == 1) {
  4423. console.log("Talvez uma variável seja uma melhor opção");
  4424. }
  4425. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dataDim);
  4426. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
  4427. exp.sourceInfo = sourceInfo;
  4428. return exp;
  4429. }
  4430. /**
  4431. * Returns a list of ArrayLiterals. Helper function for parsing matrices
  4432. */
  4433. }, {
  4434. key: "parseVectorList",
  4435. value: function parseVectorList(typeString) {
  4436. var list = [];
  4437. var lastSize = null;
  4438. for (;;) {
  4439. this.checkOpenCurly();
  4440. var beginArray = this.getToken();
  4441. if (this.parsingArrayDimension >= 2) {
  4442. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
  4443. }
  4444. this.pos += 1;
  4445. this.parsingArrayDimension += 1;
  4446. this.consumeNewLines();
  4447. var data = this.parseExpressionList();
  4448. this.consumeNewLines();
  4449. this.checkCloseCurly();
  4450. var endArray = this.getToken();
  4451. this.pos += 1;
  4452. this.parsingArrayDimension -= 1;
  4453. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4454. if (lastSize == null) {
  4455. lastSize = data.length;
  4456. } else if (lastSize !== data.length) {
  4457. var expString = this.inputStream.getText(beginArray.start, endArray.stop);
  4458. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_literal_line(expString, sourceInfo);
  4459. }
  4460. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, 1);
  4461. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
  4462. exp.sourceInfo = sourceInfo;
  4463. list.push(exp);
  4464. var commaToken = this.getToken();
  4465. if (commaToken.type !== this.lexerClass.COMMA) {
  4466. break;
  4467. }
  4468. this.pos += 1;
  4469. this.consumeNewLines();
  4470. }
  4471. if (list.length == 1) {
  4472. console.log("Talvez um vetor seja uma melhor opção");
  4473. }
  4474. return list;
  4475. }
  4476. /*
  4477. * Returns an object {type: 'variable', value: value}.
  4478. * @returns object with fields type and value
  4479. **/
  4480. }, {
  4481. key: "parseVariable",
  4482. value: function parseVariable(token) {
  4483. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4484. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](token.text);
  4485. exp.sourceInfo = sourceInfo;
  4486. return exp;
  4487. }
  4488. /*
  4489. * Returns an object representing a function. It has
  4490. * four attributes: returnType, id, formalParams and block.
  4491. * The block object has two attributes: declarations and commands
  4492. **/
  4493. }, {
  4494. key: "parseFunction",
  4495. value: function parseFunction() {
  4496. this.pushScope(IVProgParser.FUNCTION);
  4497. var formalParams = [];
  4498. var token = this.getToken();
  4499. if (token.type !== this.lexerClass.RK_FUNCTION) {
  4500. //throw SyntaxError.createError(this.lexer.literalNames[this.lexerClass.PR_FUNCAO], token);
  4501. return null;
  4502. }
  4503. this.pos++;
  4504. var funType = this.parseType();
  4505. var dimensions = 0;
  4506. if (this.checkOpenBrace(true)) {
  4507. this.pos++;
  4508. this.checkCloseBrace();
  4509. this.pos++;
  4510. dimensions++;
  4511. if (this.checkOpenBrace(true)) {
  4512. this.pos++;
  4513. this.checkCloseBrace();
  4514. this.pos++;
  4515. dimensions++;
  4516. }
  4517. }
  4518. var funcIDToken = this.getToken();
  4519. var functionID = this.parseID();
  4520. this.checkFunctionDuplicate(functionID, funcIDToken);
  4521. this.checkOpenParenthesis();
  4522. this.pos++;
  4523. this.consumeNewLines();
  4524. if (!this.checkCloseParenthesis(true)) {
  4525. formalParams = this.parseFormalParameters(); // formal parameters
  4526. this.consumeNewLines();
  4527. this.checkCloseParenthesis();
  4528. this.pos++;
  4529. } else {
  4530. this.pos++;
  4531. }
  4532. this.consumeNewLines();
  4533. var commandsBlock = this.parseCommandBlock();
  4534. var returnType = funType;
  4535. if (dimensions > 0) {
  4536. returnType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](funType, dimensions);
  4537. }
  4538. var func = new _commands__WEBPACK_IMPORTED_MODULE_4__["Function"](functionID, returnType, formalParams, commandsBlock);
  4539. if (functionID === null && !func.isMain) {
  4540. 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);
  4541. } else if (func.isMain && formalParams.length !== 0) {
  4542. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].main_parameters();
  4543. }
  4544. this.popScope();
  4545. return func;
  4546. }
  4547. /*
  4548. * Parse the formal parameters of a function.
  4549. * @returns a list of objects with the following attributes: type, id and dimensions.
  4550. **/
  4551. }, {
  4552. key: "parseFormalParameters",
  4553. value: function parseFormalParameters() {
  4554. var list = [];
  4555. for (;;) {
  4556. var dimensions = 0;
  4557. var reference = false;
  4558. var typeString = this.parseType();
  4559. var maybeIDToken = this.getToken();
  4560. if (maybeIDToken.type === this.lexerClass.RK_REFERENCE) {
  4561. reference = true;
  4562. this.pos += 1;
  4563. maybeIDToken = this.getToken();
  4564. }
  4565. var idString = this.parseID();
  4566. this.checkVariableDuplicate(idString, maybeIDToken);
  4567. if (this.checkOpenBrace(true)) {
  4568. this.pos += 1;
  4569. dimensions += 1;
  4570. this.checkCloseBrace();
  4571. this.pos += 1;
  4572. if (this.checkOpenBrace(true)) {
  4573. this.pos += 1;
  4574. dimensions += 1;
  4575. this.checkCloseBrace();
  4576. this.pos += 1;
  4577. }
  4578. }
  4579. var type = null;
  4580. if (dimensions > 0) {
  4581. type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dimensions);
  4582. } else {
  4583. type = typeString;
  4584. }
  4585. var parameter = new _commands__WEBPACK_IMPORTED_MODULE_4__["FormalParameter"](type, idString, reference);
  4586. parameter.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(maybeIDToken);
  4587. list.push(parameter);
  4588. var commaToken = this.getToken();
  4589. if (commaToken.type !== this.lexerClass.COMMA) break;
  4590. this.pos++;
  4591. this.consumeNewLines();
  4592. }
  4593. return list;
  4594. }
  4595. }, {
  4596. key: "parseID",
  4597. value: function parseID() {
  4598. var token = this.getToken();
  4599. if (token.type !== this.lexerClass.ID) {
  4600. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
  4601. }
  4602. this.pos++;
  4603. if (this.insideScope(IVProgParser.FUNCTION)) {
  4604. if (token.text === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
  4605. return null;
  4606. }
  4607. }
  4608. return token.text;
  4609. }
  4610. }, {
  4611. key: "parseMaybeLibID",
  4612. value: function parseMaybeLibID() {
  4613. var token = this.getToken();
  4614. if (token.type !== this.lexerClass.ID && token.type !== this.lexerClass.LIB_ID) {
  4615. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
  4616. }
  4617. this.pos++;
  4618. return token.text;
  4619. }
  4620. }, {
  4621. key: "parseType",
  4622. value: function parseType() {
  4623. var token = this.getToken();
  4624. if (token.type === this.lexerClass.ID && this.insideScope(IVProgParser.FUNCTION)) {
  4625. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
  4626. } else if (token.type === this.lexerClass.RK_VOID && this.insideScope(IVProgParser.FUNCTION)) {
  4627. this.pos++;
  4628. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
  4629. } else if (this.isVariableType(token)) {
  4630. this.pos++;
  4631. switch (token.type) {
  4632. case this.lexerClass.RK_INTEGER:
  4633. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER;
  4634. case this.lexerClass.RK_BOOLEAN:
  4635. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].BOOLEAN;
  4636. case this.lexerClass.RK_REAL:
  4637. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].REAL;
  4638. case this.lexerClass.RK_STRING:
  4639. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].STRING;
  4640. case this.lexerClass.RK_CHARACTER:
  4641. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].CHAR;
  4642. default:
  4643. break;
  4644. }
  4645. }
  4646. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_type(this.getTypeArray(), token);
  4647. }
  4648. }, {
  4649. key: "parseCommandBlock",
  4650. value: function parseCommandBlock() {
  4651. var optionalCurly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4652. var variablesDecl = [];
  4653. var commands = [];
  4654. var hasOpen = false;
  4655. if (this.checkOpenCurly(optionalCurly)) {
  4656. this.pos++;
  4657. hasOpen = true;
  4658. }
  4659. this.consumeNewLines();
  4660. var parsedCommand = false;
  4661. for (;;) {
  4662. var cmd = this.parseCommand();
  4663. if (cmd === null) break;
  4664. if (cmd !== -1) {
  4665. if (cmd instanceof Array) {
  4666. if (parsedCommand) {
  4667. var lastToken = this.getToken(this.pos - 1);
  4668. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(lastToken);
  4669. }
  4670. variablesDecl = variablesDecl.concat(cmd);
  4671. } else {
  4672. parsedCommand = true;
  4673. commands.push(cmd);
  4674. }
  4675. }
  4676. }
  4677. this.consumeNewLines();
  4678. if (hasOpen) {
  4679. this.checkCloseCurly();
  4680. this.pos++;
  4681. this.consumeNewLines();
  4682. }
  4683. return new _commands__WEBPACK_IMPORTED_MODULE_4__["CommandBlock"](variablesDecl, commands);
  4684. }
  4685. }, {
  4686. key: "parseCommand",
  4687. value: function parseCommand() {
  4688. var token = this.getToken();
  4689. if (this.isVariableType(token)) {
  4690. if (!this.insideScope(IVProgParser.FUNCTION)) {
  4691. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(token);
  4692. }
  4693. this.pushScope(IVProgParser.BASE);
  4694. var varType = this.parseType();
  4695. this.popScope();
  4696. var cmd = this.parseDeclaration(varType);
  4697. this.checkEOS();
  4698. this.pos++;
  4699. return cmd;
  4700. } else if (token.type === this.lexerClass.ID) {
  4701. return this.parseIDCommand();
  4702. } else if (token.type === this.lexerClass.LIB_ID) {
  4703. return this.parseIDCommand();
  4704. } else if (token.type === this.lexerClass.RK_RETURN) {
  4705. return this.parseReturn();
  4706. } else if (token.type === this.lexerClass.RK_WHILE || token.type === this.lexerClass.RK_WHILE_ALT) {
  4707. return this.parseWhile();
  4708. } else if (token.type === this.lexerClass.RK_FOR || token.type === this.lexerClass.RK_FOR_ALT) {
  4709. return this.parseFor();
  4710. } else if (token.type === this.lexerClass.RK_BREAK) {
  4711. if (!this.insideScope(IVProgParser.BREAKABLE)) {
  4712. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_break_command(this.lexer.literalNames[this.lexerClass.RK_BREAK], token);
  4713. }
  4714. return this.parseBreak();
  4715. } else if (token.type === this.lexerClass.RK_SWITCH) {
  4716. return this.parseSwitchCase();
  4717. } else if (token.type === this.lexerClass.RK_DO) {
  4718. return this.parseRepeatUntil();
  4719. } else if (token.type === this.lexerClass.RK_IF) {
  4720. return this.parseIfThenElse();
  4721. } else if (this.checkEOS(true)) {
  4722. this.pos++;
  4723. return -1;
  4724. } else {
  4725. return null;
  4726. }
  4727. }
  4728. }, {
  4729. key: "parseSwitchCase",
  4730. value: function parseSwitchCase() {
  4731. this.pushScope(IVProgParser.BREAKABLE);
  4732. this.pos++;
  4733. this.checkOpenParenthesis();
  4734. this.pos++;
  4735. this.consumeNewLines();
  4736. var exp = this.parseExpressionOR();
  4737. this.consumeNewLines();
  4738. this.checkCloseParenthesis();
  4739. this.pos++;
  4740. this.consumeNewLines();
  4741. this.checkOpenCurly();
  4742. this.pos++;
  4743. this.consumeNewLines();
  4744. var casesList = this.parseCases();
  4745. this.consumeNewLines();
  4746. this.checkCloseCurly();
  4747. this.pos++;
  4748. this.consumeNewLines();
  4749. this.popScope();
  4750. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Switch"](exp, casesList);
  4751. }
  4752. }, {
  4753. key: "parseRepeatUntil",
  4754. value: function parseRepeatUntil() {
  4755. this.pos++;
  4756. this.consumeNewLines();
  4757. this.pushScope(IVProgParser.BREAKABLE);
  4758. var commandsBlock = this.parseCommandBlock();
  4759. this.consumeNewLines(); //Maybe not...
  4760. var whileToken = this.getToken();
  4761. if (whileToken.type !== this.lexerClass.RK_DO_UNTIL) {
  4762. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_DO_UNTIL], whileToken);
  4763. }
  4764. this.pos++;
  4765. this.checkOpenParenthesis();
  4766. this.pos++;
  4767. this.consumeNewLines();
  4768. var condition = this.parseExpressionOR();
  4769. this.consumeNewLines();
  4770. this.checkCloseParenthesis();
  4771. this.pos++;
  4772. this.checkEOS();
  4773. this.popScope();
  4774. return new _commands__WEBPACK_IMPORTED_MODULE_4__["RepeatUntil"](condition, commandsBlock);
  4775. }
  4776. }, {
  4777. key: "parseIfThenElse",
  4778. value: function parseIfThenElse() {
  4779. if (this.insideScope(IVProgParser.BREAKABLE)) {
  4780. this.pushScope(IVProgParser.BREAKABLE);
  4781. } else {
  4782. this.pushScope(IVProgParser.COMMAND);
  4783. }
  4784. var token = this.getToken();
  4785. this.pos++;
  4786. this.checkOpenParenthesis();
  4787. this.pos++;
  4788. this.consumeNewLines();
  4789. var logicalExpression = this.parseExpressionOR();
  4790. this.consumeNewLines();
  4791. this.checkCloseParenthesis();
  4792. this.pos++;
  4793. this.consumeNewLines();
  4794. var cmdBlocks = this.parseCommandBlock();
  4795. var maybeElse = this.getToken();
  4796. if (maybeElse.type === this.lexerClass.RK_ELSE) {
  4797. this.pos++;
  4798. this.consumeNewLines();
  4799. var maybeIf = this.getToken();
  4800. var elseBlock = null;
  4801. if (this.checkOpenCurly(true)) {
  4802. elseBlock = this.parseCommandBlock();
  4803. } else if (maybeIf.type === this.lexerClass.RK_IF) {
  4804. elseBlock = this.parseIfThenElse();
  4805. } else {
  4806. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_IF], "{"], maybeIf);
  4807. }
  4808. this.popScope();
  4809. var _cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, elseBlock);
  4810. _cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4811. return _cmd;
  4812. }
  4813. this.popScope();
  4814. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, null);
  4815. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4816. return cmd;
  4817. }
  4818. }, {
  4819. key: "parseFor",
  4820. value: function parseFor() {
  4821. this.pushScope(IVProgParser.BREAKABLE);
  4822. var for_token = this.getToken();
  4823. this.pos += 1; // parse ID
  4824. var id_token = this.getToken();
  4825. var id = this.parseID();
  4826. var for_id = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
  4827. for_id.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(id_token); // END parse ID
  4828. var for_from = this.parseForParameters(this.lexerClass.RK_FOR_FROM);
  4829. var for_to = this.parseForParameters(this.lexerClass.RK_FOR_TO);
  4830. var maybePass = this.parseForParameters(this.lexerClass.RK_FOR_PASS);
  4831. this.consumeNewLines();
  4832. var commandsBlock = this.parseCommandBlock();
  4833. this.popScope();
  4834. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["For"](for_id, for_from, for_to, maybePass, commandsBlock);
  4835. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(for_token);
  4836. return cmd;
  4837. }
  4838. }, {
  4839. key: "parseWhile",
  4840. value: function parseWhile() {
  4841. this.pushScope(IVProgParser.BREAKABLE);
  4842. var token = this.getToken();
  4843. this.pos++;
  4844. this.checkOpenParenthesis();
  4845. this.pos++;
  4846. this.consumeNewLines();
  4847. var logicalExpression = this.parseExpressionOR();
  4848. this.consumeNewLines();
  4849. this.checkCloseParenthesis();
  4850. this.pos++;
  4851. this.consumeNewLines();
  4852. var cmdBlocks = this.parseCommandBlock();
  4853. this.popScope();
  4854. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["While"](logicalExpression, cmdBlocks);
  4855. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4856. return cmd;
  4857. }
  4858. }, {
  4859. key: "parseBreak",
  4860. value: function parseBreak() {
  4861. var token = this.getToken();
  4862. this.pos++;
  4863. this.checkEOS();
  4864. this.pos++;
  4865. var command = new _commands__WEBPACK_IMPORTED_MODULE_4__["Break"]();
  4866. command.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4867. return command;
  4868. }
  4869. }, {
  4870. key: "parseReturn",
  4871. value: function parseReturn() {
  4872. this.pos++;
  4873. var exp = null;
  4874. if (!this.checkEOS(true)) {
  4875. exp = this.parseExpressionOR();
  4876. this.checkEOS();
  4877. }
  4878. this.pos++;
  4879. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Return"](exp);
  4880. }
  4881. }, {
  4882. key: "parseIDCommand",
  4883. value: function parseIDCommand() {
  4884. var refToken = this.getToken();
  4885. var isID = refToken.type === this.lexerClass.ID;
  4886. var id = this.parseMaybeLibID();
  4887. if (this.checkOpenBrace(true)) {
  4888. this.pos++;
  4889. var lineExpression = null;
  4890. var columnExpression = null;
  4891. this.consumeNewLines();
  4892. lineExpression = this.parseExpression();
  4893. this.consumeNewLines();
  4894. this.checkCloseBrace();
  4895. this.pos++;
  4896. if (this.checkOpenBrace(true)) {
  4897. this.pos++;
  4898. this.consumeNewLines();
  4899. columnExpression = this.parseExpression();
  4900. this.consumeNewLines();
  4901. this.checkCloseBrace();
  4902. this.pos++;
  4903. }
  4904. var equalToken = this.getToken();
  4905. if (equalToken.type !== this.lexerClass.EQUAL) {
  4906. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("=", equalToken);
  4907. }
  4908. this.pos++;
  4909. var exp = this.parseExpressionOR();
  4910. this.checkEOS();
  4911. this.pos++;
  4912. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["ArrayIndexAssign"](id, lineExpression, columnExpression, exp);
  4913. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalToken);
  4914. return cmd;
  4915. }
  4916. var equalOrParenthesis = this.getToken();
  4917. if (isID && equalOrParenthesis.type === this.lexerClass.EQUAL) {
  4918. this.pos++;
  4919. var _exp = this.parseExpressionOR();
  4920. this.checkEOS();
  4921. this.pos++;
  4922. var _cmd2 = new _commands__WEBPACK_IMPORTED_MODULE_4__["Assign"](id, _exp);
  4923. _cmd2.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalOrParenthesis);
  4924. return _cmd2;
  4925. } else if (equalOrParenthesis.type === this.lexerClass.OPEN_PARENTHESIS) {
  4926. var funcCall = this.parseFunctionCallCommand(id);
  4927. this.checkEOS();
  4928. this.pos++;
  4929. return funcCall;
  4930. } else if (isID) {
  4931. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list(["=", "("], equalOrParenthesis);
  4932. } else {
  4933. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(refToken);
  4934. }
  4935. }
  4936. }, {
  4937. key: "parseForParameters",
  4938. value: function parseForParameters(keyword_code) {
  4939. if (keyword_code === this.lexerClass.RK_FOR_PASS) {
  4940. if (this.checkOpenCurly(true)) {
  4941. return null;
  4942. }
  4943. }
  4944. var from_token = this.getToken();
  4945. if (from_token.type !== keyword_code) {
  4946. // TODO better error message
  4947. var keyword = this.lexer.literalNames[keyword_code];
  4948. throw new Error("Error de sintaxe no comando repita_para: esperava-se " + keyword + " mas encontrou " + from_token.text);
  4949. }
  4950. this.pos += 1;
  4951. var int_or_id = this.getToken();
  4952. var is_unary_op = false;
  4953. var op = null;
  4954. if (int_or_id.type === this.lexerClass.SUM_OP) {
  4955. is_unary_op = true;
  4956. op = int_or_id.text;
  4957. this.pos += 1;
  4958. int_or_id = this.getToken();
  4959. }
  4960. var for_from = null;
  4961. if (int_or_id.type === this.lexerClass.ID) {
  4962. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](this.parseID());
  4963. for_from.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(int_or_id);
  4964. } else if (int_or_id.type === this.lexerClass.INTEGER) {
  4965. this.pos += 1;
  4966. for_from = this.getIntLiteral(int_or_id);
  4967. }
  4968. if (for_from == null) {
  4969. // TODO better error message
  4970. var _keyword = this.lexer.literalNames[keyword_code];
  4971. 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.");
  4972. }
  4973. if (is_unary_op) {
  4974. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(op), for_from);
  4975. }
  4976. return for_from;
  4977. }
  4978. }, {
  4979. key: "parseCases",
  4980. value: function parseCases() {
  4981. var token = this.getToken();
  4982. if (token.type !== this.lexerClass.RK_CASE) {
  4983. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_CASE], token);
  4984. }
  4985. this.pos++;
  4986. var nextToken = this.getToken();
  4987. if (nextToken.type === this.lexerClass.RK_DEFAULT) {
  4988. this.pos++;
  4989. var colonToken = this.getToken();
  4990. if (colonToken.type !== this.lexerClass.COLON) {
  4991. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(":", colonToken);
  4992. }
  4993. this.pos++;
  4994. this.consumeNewLines();
  4995. var block = this.parseCommandBlock(true);
  4996. var defaultCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](null);
  4997. defaultCase.setCommands(block.commands);
  4998. return [defaultCase];
  4999. } else {
  5000. var exp = this.parseExpressionOR();
  5001. var _colonToken = this.getToken();
  5002. if (_colonToken.type !== this.lexerClass.COLON) {
  5003. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(":", _colonToken);
  5004. }
  5005. this.pos++;
  5006. this.consumeNewLines();
  5007. var _block = this.parseCommandBlock(true);
  5008. var aCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](exp);
  5009. aCase.setCommands(_block.commands);
  5010. var caseToken = this.getToken();
  5011. if (caseToken.type === this.lexerClass.RK_CASE) {
  5012. return [aCase].concat(this.parseCases());
  5013. } else {
  5014. return [aCase];
  5015. }
  5016. }
  5017. }
  5018. /*
  5019. * Parses an Expression following the structure:
  5020. *
  5021. * EOR => EAnd ( 'or' EOR)? #expression and
  5022. *
  5023. * EOR => ENot ('and' EOR)? #expression or
  5024. *
  5025. * ENot => 'not'? ER #expression not
  5026. *
  5027. * ER => E ((>=, <=, ==, >, <) E)? #expression relational
  5028. *
  5029. * E => factor ((+, -) E)? #expression
  5030. *
  5031. * factor=> term ((*, /, %) factor)?
  5032. *
  5033. * term => literal || arrayAccess || FuncCall || ID || '('EAnd')'
  5034. **/
  5035. }, {
  5036. key: "parseExpressionOR",
  5037. value: function parseExpressionOR() {
  5038. var exp1 = this.parseExpressionAND();
  5039. while (this.getToken().type === this.lexerClass.OR_OPERATOR) {
  5040. var opToken = this.getToken();
  5041. this.pos++;
  5042. var or = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])("or");
  5043. this.consumeNewLines();
  5044. var exp2 = this.parseExpressionAND();
  5045. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](or, exp1, exp2);
  5046. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  5047. exp1 = finalExp;
  5048. }
  5049. return exp1;
  5050. }
  5051. }, {
  5052. key: "parseExpressionAND",
  5053. value: function parseExpressionAND() {
  5054. var exp1 = this.parseExpressionNot();
  5055. while (this.getToken().type === this.lexerClass.AND_OPERATOR) {
  5056. var opToken = this.getToken();
  5057. this.pos++;
  5058. var and = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])("and");
  5059. this.consumeNewLines();
  5060. var exp2 = this.parseExpressionNot();
  5061. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](and, exp1, exp2);
  5062. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  5063. exp1 = finalExp;
  5064. }
  5065. return exp1;
  5066. }
  5067. }, {
  5068. key: "parseExpressionNot",
  5069. value: function parseExpressionNot() {
  5070. var maybeNotToken = this.getToken();
  5071. if (maybeNotToken.type === this.lexerClass.NOT_OPERATOR) {
  5072. var opToken = this.getToken();
  5073. this.pos++;
  5074. var not = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])("not");
  5075. var exp1 = this.parseExpressionRel();
  5076. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](not, exp1);
  5077. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  5078. return finalExp;
  5079. } else {
  5080. return this.parseExpressionRel();
  5081. }
  5082. }
  5083. }, {
  5084. key: "parseExpressionRel",
  5085. value: function parseExpressionRel() {
  5086. var exp1 = this.parseExpression();
  5087. while (this.getToken().type === this.lexerClass.RELATIONAL_OPERATOR) {
  5088. var relToken = this.getToken();
  5089. this.pos++;
  5090. var rel = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(relToken.text);
  5091. var exp2 = this.parseExpression();
  5092. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](rel, exp1, exp2);
  5093. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(relToken);
  5094. exp1 = finalExp;
  5095. }
  5096. return exp1;
  5097. }
  5098. }, {
  5099. key: "parseExpression",
  5100. value: function parseExpression() {
  5101. var factor = this.parseFactor();
  5102. while (this.getToken().type === this.lexerClass.SUM_OP) {
  5103. var sumOpToken = this.getToken();
  5104. this.pos++;
  5105. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(sumOpToken.text);
  5106. var factor2 = this.parseFactor();
  5107. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, factor, factor2);
  5108. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(sumOpToken);
  5109. factor = finalExp;
  5110. }
  5111. return factor;
  5112. }
  5113. }, {
  5114. key: "parseFactor",
  5115. value: function parseFactor() {
  5116. var term = this.parseTerm();
  5117. while (this.getToken().type === this.lexerClass.MULTI_OP) {
  5118. var multOpToken = this.getToken();
  5119. this.pos++;
  5120. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(multOpToken.text);
  5121. var term2 = this.parseTerm();
  5122. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, term, term2);
  5123. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(multOpToken);
  5124. term = finalExp;
  5125. }
  5126. return term;
  5127. }
  5128. }, {
  5129. key: "parseTerm",
  5130. value: function parseTerm() {
  5131. var token = this.getToken();
  5132. var sourceInfo = null;
  5133. var exp = null;
  5134. switch (token.type) {
  5135. case this.lexerClass.SUM_OP:
  5136. this.pos++;
  5137. sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  5138. exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(token.text), this.parseTerm());
  5139. exp.sourceInfo = sourceInfo;
  5140. return exp;
  5141. case this.lexerClass.INTEGER:
  5142. this.pos++;
  5143. return this.getIntLiteral(token);
  5144. case this.lexerClass.REAL:
  5145. this.pos++;
  5146. return this.getRealLiteral(token);
  5147. case this.lexerClass.STRING:
  5148. this.pos++;
  5149. return this.getStringLiteral(token);
  5150. case this.lexerClass.CHARACTER:
  5151. this.pos++;
  5152. return this.getCharLiteral(token);
  5153. case this.lexerClass.RK_TRUE:
  5154. case this.lexerClass.RK_FALSE:
  5155. this.pos++;
  5156. return this.getBoolLiteral(token);
  5157. case this.lexerClass.OPEN_CURLY:
  5158. // No more annonymous array
  5159. // return this.parseArrayLiteral();
  5160. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].annonymous_array_literal(token);
  5161. case this.lexerClass.ID:
  5162. case this.lexerClass.LIB_ID:
  5163. return this.parseIDTerm();
  5164. case this.lexerClass.OPEN_PARENTHESIS:
  5165. return this.parseParenthesisExp();
  5166. default:
  5167. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_terminal(token);
  5168. }
  5169. }
  5170. }, {
  5171. key: "parseIDTerm",
  5172. value: function parseIDTerm() {
  5173. var tokenA = this.getToken();
  5174. var id = this.parseMaybeLibID();
  5175. var isID = tokenA.type === this.lexerClass.ID;
  5176. if (isID && this.checkOpenBrace(true)) {
  5177. var tokenB = null;
  5178. this.pos++;
  5179. var firstIndex = this.parseExpression();
  5180. var secondIndex = null;
  5181. this.consumeNewLines();
  5182. this.checkCloseBrace();
  5183. tokenB = this.getToken();
  5184. this.pos++;
  5185. if (this.checkOpenBrace(true)) {
  5186. this.pos++;
  5187. secondIndex = this.parseExpression();
  5188. this.consumeNewLines();
  5189. this.checkCloseBrace();
  5190. tokenB = this.getToken();
  5191. this.pos++;
  5192. }
  5193. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5194. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayAccess"](id, firstIndex, secondIndex);
  5195. exp.sourceInfo = sourceInfo;
  5196. return exp;
  5197. } else if (this.checkOpenParenthesis(true)) {
  5198. return this.parseFunctionCallExpression(id);
  5199. } else if (isID) {
  5200. var _sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(tokenA);
  5201. var _exp2 = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
  5202. _exp2.sourceInfo = _sourceInfo;
  5203. return _exp2;
  5204. } else {
  5205. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(tokenA);
  5206. }
  5207. }
  5208. }, {
  5209. key: "getFunctionName",
  5210. value: function getFunctionName(id) {
  5211. var name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getInternalName(id);
  5212. if (name === null) {
  5213. if (id === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
  5214. return null;
  5215. }
  5216. return id;
  5217. } else {
  5218. return name;
  5219. }
  5220. }
  5221. }, {
  5222. key: "parseFunctionCallExpression",
  5223. value: function parseFunctionCallExpression(id) {
  5224. var tokenA = this.getToken(this.pos - 1);
  5225. var actualParameters = this.parseActualParameters();
  5226. var tokenB = this.getToken(this.pos - 1);
  5227. var funcName = this.getFunctionName(id);
  5228. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5229. var cmd = new _expressions__WEBPACK_IMPORTED_MODULE_3__["FunctionCall"](funcName, actualParameters);
  5230. cmd.sourceInfo = sourceInfo;
  5231. return cmd;
  5232. }
  5233. }, {
  5234. key: "parseFunctionCallCommand",
  5235. value: function parseFunctionCallCommand(id) {
  5236. return this.parseFunctionCallExpression(id);
  5237. }
  5238. }, {
  5239. key: "parseParenthesisExp",
  5240. value: function parseParenthesisExp() {
  5241. this.checkOpenParenthesis();
  5242. var tokenA = this.getToken();
  5243. this.pos += 1;
  5244. this.consumeNewLines();
  5245. var exp = this.parseExpressionOR();
  5246. this.consumeNewLines();
  5247. this.checkCloseParenthesis();
  5248. var tokenB = this.getToken();
  5249. this.pos += 1;
  5250. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5251. exp.parenthesis = true;
  5252. return exp;
  5253. }
  5254. }, {
  5255. key: "parseActualParameters",
  5256. value: function parseActualParameters() {
  5257. this.checkOpenParenthesis();
  5258. this.pos++;
  5259. if (this.checkCloseParenthesis(true)) {
  5260. this.pos++;
  5261. return [];
  5262. }
  5263. this.consumeNewLines();
  5264. var list = this.parseExpressionList();
  5265. this.consumeNewLines();
  5266. this.checkCloseParenthesis();
  5267. this.pos++;
  5268. return list;
  5269. }
  5270. }, {
  5271. key: "parseExpressionList",
  5272. value: function parseExpressionList() {
  5273. var list = [];
  5274. for (;;) {
  5275. var exp = this.parseExpressionOR();
  5276. list.push(exp);
  5277. var maybeToken = this.getToken();
  5278. if (maybeToken.type !== this.lexerClass.COMMA) {
  5279. break;
  5280. } else {
  5281. this.pos++;
  5282. this.consumeNewLines();
  5283. }
  5284. }
  5285. return list;
  5286. }
  5287. }, {
  5288. key: "getTypeArray",
  5289. value: function getTypeArray() {
  5290. var _this = this;
  5291. var types = this.insideScope(IVProgParser.FUNCTION) ? this.functionTypes : this.variableTypes;
  5292. return types.map(function (x) {
  5293. return _this.lexer.literalNames[x];
  5294. });
  5295. }
  5296. }]);
  5297. return IVProgParser;
  5298. }();
  5299. /***/ }),
  5300. /***/ "./js/ast/operators.ts":
  5301. /*!*****************************!*\
  5302. !*** ./js/ast/operators.ts ***!
  5303. \*****************************/
  5304. /*! no static exports found */
  5305. /***/ (function(module, exports, __webpack_require__) {
  5306. "use strict";
  5307. Object.defineProperty(exports, "__esModule", { value: true });
  5308. exports.convertFromString = exports.Operators = void 0;
  5309. exports.Operators = Object.freeze({
  5310. ADD: { ord: 0, value: "+" },
  5311. SUB: { ord: 1, value: "-" },
  5312. MULT: { ord: 2, value: '*' },
  5313. DIV: { ord: 3, value: '/' },
  5314. MOD: { ord: 4, value: '%' },
  5315. GT: { ord: 5, value: '>' },
  5316. GE: { ord: 6, value: '>=' },
  5317. LT: { ord: 7, value: '<' },
  5318. LE: { ord: 8, value: '<=' },
  5319. EQ: { ord: 9, value: '==' },
  5320. NEQ: { ord: 10, value: '!=' },
  5321. AND: { ord: 11, value: 'and' },
  5322. OR: { ord: 12, value: 'or' },
  5323. NOT: { ord: 13, value: 'not' }
  5324. });
  5325. function convertFromString(op) {
  5326. switch (op) {
  5327. case '+': return exports.Operators.ADD;
  5328. case '-': return exports.Operators.SUB;
  5329. case '*': return exports.Operators.MULT;
  5330. case '/': return exports.Operators.DIV;
  5331. case '%': return exports.Operators.MOD;
  5332. case '>': return exports.Operators.GT;
  5333. case '>=': return exports.Operators.GE;
  5334. case '<': return exports.Operators.LT;
  5335. case '<=': return exports.Operators.LE;
  5336. case '==': return exports.Operators.EQ;
  5337. case '!=': return exports.Operators.NEQ;
  5338. case 'and': return exports.Operators.AND;
  5339. case 'or': return exports.Operators.OR;
  5340. case 'not': return exports.Operators.NOT;
  5341. }
  5342. return null;
  5343. }
  5344. exports.convertFromString = convertFromString;
  5345. /***/ }),
  5346. /***/ "./js/ast/sourceInfo.js":
  5347. /*!******************************!*\
  5348. !*** ./js/ast/sourceInfo.js ***!
  5349. \******************************/
  5350. /*! exports provided: SourceInfo */
  5351. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5352. "use strict";
  5353. __webpack_require__.r(__webpack_exports__);
  5354. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SourceInfo", function() { return SourceInfo; });
  5355. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5356. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5357. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5358. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5359. var SourceInfo = /*#__PURE__*/function () {
  5360. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SourceInfo, null, [{
  5361. key: "createSourceInfo",
  5362. value: function createSourceInfo(token) {
  5363. return new SourceInfo(token.line, token.column, token.text, token.text.length);
  5364. }
  5365. }, {
  5366. key: "createSourceInfoFromList",
  5367. value: function createSourceInfoFromList(tokenA, tokenB) {
  5368. var line = tokenA.line;
  5369. 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
  5370. // No idea why...
  5371. var size = tokenB.tokenIndex + 1 - tokenA.tokenIndex;
  5372. return new SourceInfo(line, column, "", size);
  5373. }
  5374. }]);
  5375. function SourceInfo(line, column, text, size) {
  5376. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SourceInfo);
  5377. this.line = line;
  5378. this.column = column;
  5379. this.text = text;
  5380. this.size = size;
  5381. }
  5382. return SourceInfo;
  5383. }();
  5384. /***/ }),
  5385. /***/ "./js/io/domConsole.js":
  5386. /*!*****************************!*\
  5387. !*** ./js/io/domConsole.js ***!
  5388. \*****************************/
  5389. /*! exports provided: DOMConsole */
  5390. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5391. "use strict";
  5392. __webpack_require__.r(__webpack_exports__);
  5393. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMConsole", function() { return DOMConsole; });
  5394. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  5395. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  5396. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  5397. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  5398. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5399. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
  5400. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5401. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
  5402. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  5403. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  5404. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  5405. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_6__);
  5406. var DOMConsole = /*#__PURE__*/function () {
  5407. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, null, [{
  5408. key: "BASH_TEMPLATE",
  5409. get: function get() {
  5410. 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>";
  5411. }
  5412. }, {
  5413. key: "INPUT_CARET_TEMPLATE",
  5414. get: function get() {
  5415. return "\n <div id=\"cmd\">\n <span></span>\n <div id=\"cursor\"></div>\n </div>";
  5416. }
  5417. }, {
  5418. key: "USER",
  5419. get: function get() {
  5420. return 0;
  5421. }
  5422. }, {
  5423. key: "INFO",
  5424. get: function get() {
  5425. return 1;
  5426. }
  5427. }, {
  5428. key: "ERR",
  5429. get: function get() {
  5430. return 2;
  5431. }
  5432. }, {
  5433. key: "INPUT",
  5434. get: function get() {
  5435. return 3;
  5436. }
  5437. }]);
  5438. function DOMConsole(elementID) {
  5439. var disableMarginTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5440. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, DOMConsole);
  5441. this.disableMarginTop = disableMarginTop;
  5442. this.input = null;
  5443. this.cursorInterval = null;
  5444. this.idleInterval = null;
  5445. this.inputDiv = null;
  5446. this.inputCMD = null;
  5447. this.inputSpan = null;
  5448. this.cursorRef = null;
  5449. this.needInput = false;
  5450. this.clearBtn = null;
  5451. this.hideBtn = null;
  5452. this.showBtn = null;
  5453. this.termDiv = null;
  5454. this.anyKey = false;
  5455. var actualID = elementID;
  5456. if (elementID[0] === "#") {
  5457. actualID = elementID.substring(1);
  5458. }
  5459. this.parent = document.getElementById(actualID);
  5460. this.setup();
  5461. this.inputListeners = [];
  5462. this.hideInput();
  5463. this.pending_writes = [];
  5464. this.last_clear = -1;
  5465. }
  5466. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, [{
  5467. key: "setup",
  5468. value: function setup() {
  5469. this._setupDom();
  5470. this._setupEvents();
  5471. }
  5472. }, {
  5473. key: "_setupEvents",
  5474. value: function _setupEvents() {
  5475. this.input.addEventListener("keydown", this.registerInput.bind(this));
  5476. this.clearBtn.addEventListener("click", this.clearBtnClick.bind(this));
  5477. this.hideBtn.addEventListener("click", this.hideBtnClick.bind(this));
  5478. this.showBtn.addEventListener("click", this.showBtnClick.bind(this));
  5479. }
  5480. }, {
  5481. key: "registerInput",
  5482. value: function registerInput(event) {
  5483. if (!this.needInput) {
  5484. return;
  5485. }
  5486. var keyCode = event.which;
  5487. if (keyCode === 13 || this.anyKey) {
  5488. if (this.idleInterval != null) {
  5489. clearInterval(this.idleInterval);
  5490. this.idleInterval = null;
  5491. }
  5492. var text = this.input.value;
  5493. text = text.replace("[\n\r]+", "");
  5494. this.notifyListeners(text);
  5495. this._appendUserInput(text);
  5496. this.input.value = "";
  5497. this.inputSpan.innerHTML = "";
  5498. this.currentLine = null;
  5499. }
  5500. }
  5501. }, {
  5502. key: "_setupDom",
  5503. value: function _setupDom() {
  5504. var bashNode = document.createElement("div");
  5505. bashNode.classList.add("bash");
  5506. bashNode.innerHTML = DOMConsole.BASH_TEMPLATE;
  5507. this.termDiv = bashNode.querySelector("#ivprog-term");
  5508. this.termDiv.classList.add("ivprog-term-div");
  5509. this.inputDiv = document.createElement("div");
  5510. this.inputDiv.id = "ivprog-terminal-inputdiv";
  5511. this.inputDiv.innerHTML = DOMConsole.INPUT_CARET_TEMPLATE;
  5512. this.input = document.createElement("input");
  5513. this.input.setAttribute("name", "command");
  5514. this.input.setAttribute("value", "");
  5515. this.input.setAttribute("type", "text");
  5516. this.input.setAttribute("autocomplete", "off");
  5517. this.inputDiv.append(this.input);
  5518. this.termDiv.append(this.inputDiv);
  5519. bashNode.append(this.termDiv);
  5520. this.parent.append(bashNode);
  5521. this.inputCMD = this.inputDiv.querySelector("#cmd");
  5522. this.cursorRef = this.inputCMD.querySelector("#cursor");
  5523. this.inputSpan = this.inputCMD.querySelector("span");
  5524. this.clearBtn = bashNode.querySelector("#ivprog-console-clearbtn");
  5525. this.hideBtn = bashNode.querySelector("#ivprog-console-hidebtn");
  5526. this.showBtn = bashNode.querySelector("#ivprog-console-showbtn");
  5527. this._setupCursor(); //Jquery tooltips....
  5528. window.$(this.clearBtn).popup({
  5529. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_clear")
  5530. });
  5531. window.$(this.showBtn).popup({
  5532. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_show")
  5533. });
  5534. window.$(this.hideBtn).popup({
  5535. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_hide")
  5536. });
  5537. }
  5538. }, {
  5539. key: "_setupCursor",
  5540. value: function _setupCursor() {
  5541. this.inputCMD.addEventListener("click", this.blinkCaretAndFocus.bind(this)); //this.inputCMD.click();
  5542. this.input.addEventListener("keyup", this.updateSpanText.bind(this));
  5543. this.input.addEventListener("blur", this.stopBlinkCaret.bind(this));
  5544. }
  5545. }, {
  5546. key: "blinkCaretAndFocus",
  5547. value: function blinkCaretAndFocus() {
  5548. var _this = this;
  5549. if (this.cursorInterval != null) {
  5550. return;
  5551. }
  5552. this.input.focus();
  5553. this.cursorInterval = window.setInterval(function () {
  5554. if (_this.cursorRef.style.visibility === "visible") {
  5555. _this.cursorRef.style.visibility = "hidden";
  5556. } else {
  5557. _this.cursorRef.style.visibility = "visible";
  5558. }
  5559. }, 500);
  5560. }
  5561. }, {
  5562. key: "updateSpanText",
  5563. value: function updateSpanText() {
  5564. this.inputSpan.innerHTML = this.input.value;
  5565. if (this.idleInterval != null) window.clearInterval(this.idleInterval);
  5566. this.scheduleNotify();
  5567. }
  5568. }, {
  5569. key: "stopBlinkCaret",
  5570. value: function stopBlinkCaret() {
  5571. clearInterval(this.cursorInterval);
  5572. this.cursorInterval = null;
  5573. this.cursorRef.style.visibility = "visible";
  5574. }
  5575. }, {
  5576. key: "notifyListeners",
  5577. value: function notifyListeners(text) {
  5578. this.inputListeners.forEach(function (resolve) {
  5579. return resolve(text);
  5580. });
  5581. this.inputListeners.splice(0, this.inputListeners.length);
  5582. this.hideInput();
  5583. this.anyKey = false;
  5584. }
  5585. }, {
  5586. key: "writeRawHTML",
  5587. value: function writeRawHTML(text, channel) {
  5588. this._appendTextLn(text, channel, false);
  5589. }
  5590. }, {
  5591. key: "write",
  5592. value: function write(text) {
  5593. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5594. this._appendText(text, DOMConsole.USER, newLine);
  5595. }
  5596. }, {
  5597. key: "info",
  5598. value: function info(text) {
  5599. this._appendTextLn(text, DOMConsole.INFO);
  5600. }
  5601. }, {
  5602. key: "err",
  5603. value: function err(text) {
  5604. this._appendTextLn(text, DOMConsole.ERR);
  5605. }
  5606. }, {
  5607. key: "_appendText",
  5608. value: function () {
  5609. 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) {
  5610. var newLine,
  5611. write_time,
  5612. divClass,
  5613. textDiv,
  5614. _args = arguments;
  5615. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  5616. while (1) {
  5617. switch (_context.prev = _context.next) {
  5618. case 0:
  5619. newLine = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
  5620. // console.debug("Caling appendText");
  5621. write_time = Date.now();
  5622. this.pending_writes.push(0);
  5623. _context.next = 5;
  5624. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](3);
  5625. case 5:
  5626. this.pending_writes.pop();
  5627. if (!(this.last_clear >= write_time)) {
  5628. _context.next = 8;
  5629. break;
  5630. }
  5631. return _context.abrupt("return");
  5632. case 8:
  5633. if (this.currentLine == null) {
  5634. divClass = this.getClassForType(type);
  5635. textDiv = document.createElement("div");
  5636. textDiv.classList.add(divClass);
  5637. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5638. this.currentLine = textDiv;
  5639. }
  5640. this.currentLine.innerHTML += this.getOutputText(text);
  5641. if (newLine) {
  5642. // console.debug("append newline");
  5643. this.currentLine = null;
  5644. }
  5645. this.scrollTerm();
  5646. case 12:
  5647. case "end":
  5648. return _context.stop();
  5649. }
  5650. }
  5651. }, _callee, this);
  5652. }));
  5653. function _appendText(_x, _x2) {
  5654. return _appendText2.apply(this, arguments);
  5655. }
  5656. return _appendText;
  5657. }()
  5658. }, {
  5659. key: "_appendTextLn",
  5660. value: function () {
  5661. 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) {
  5662. var filter,
  5663. write_time,
  5664. divClass,
  5665. textDiv,
  5666. _args2 = arguments;
  5667. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  5668. while (1) {
  5669. switch (_context2.prev = _context2.next) {
  5670. case 0:
  5671. filter = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : true;
  5672. write_time = Date.now();
  5673. this.pending_writes.push(0);
  5674. _context2.next = 5;
  5675. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](3);
  5676. case 5:
  5677. this.pending_writes.pop();
  5678. if (!(this.last_clear >= write_time)) {
  5679. _context2.next = 8;
  5680. break;
  5681. }
  5682. return _context2.abrupt("return");
  5683. case 8:
  5684. divClass = this.getClassForType(type);
  5685. textDiv = document.createElement("div");
  5686. textDiv.classList.add(divClass);
  5687. if (filter) textDiv.innerHTML = this.getOutputText(text);else textDiv.innerHTML = "<span>".concat(text, "</span>");
  5688. if (this.currentLine != null && this.currentLine.innerHTML.length === 0) {
  5689. this.termDiv.removeChild(this.currentLine);
  5690. }
  5691. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5692. this.currentLine = null;
  5693. this.scrollTerm();
  5694. case 16:
  5695. case "end":
  5696. return _context2.stop();
  5697. }
  5698. }
  5699. }, _callee2, this);
  5700. }));
  5701. function _appendTextLn(_x3, _x4) {
  5702. return _appendTextLn2.apply(this, arguments);
  5703. }
  5704. return _appendTextLn;
  5705. }()
  5706. }, {
  5707. key: "_appendUserInput",
  5708. value: function () {
  5709. 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) {
  5710. var write_time, divClass, textDiv;
  5711. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  5712. while (1) {
  5713. switch (_context3.prev = _context3.next) {
  5714. case 0:
  5715. write_time = Date.now();
  5716. this.pending_writes.push(0);
  5717. _context3.next = 4;
  5718. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](3);
  5719. case 4:
  5720. this.pending_writes.pop();
  5721. if (!(this.last_clear >= write_time)) {
  5722. _context3.next = 7;
  5723. break;
  5724. }
  5725. return _context3.abrupt("return");
  5726. case 7:
  5727. divClass = this.getClassForType(DOMConsole.INPUT);
  5728. textDiv = document.createElement("div");
  5729. textDiv.innerHTML = this.getUserInputText(text);
  5730. textDiv.classList.add(divClass);
  5731. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5732. this.currentLine = null;
  5733. this.scrollTerm();
  5734. case 14:
  5735. case "end":
  5736. return _context3.stop();
  5737. }
  5738. }
  5739. }, _callee3, this);
  5740. }));
  5741. function _appendUserInput(_x5) {
  5742. return _appendUserInput2.apply(this, arguments);
  5743. }
  5744. return _appendUserInput;
  5745. }()
  5746. }, {
  5747. key: "getOutputText",
  5748. value: function getOutputText(text) {
  5749. text = text.replace(/\s/g, "&#160;");
  5750. return "<span>".concat(text, "</span>");
  5751. }
  5752. }, {
  5753. key: "getUserInputText",
  5754. value: function getUserInputText(text) {
  5755. if (text.trim().length == 0) {
  5756. text = "&nbsp;";
  5757. }
  5758. return "<i class=\"icon keyboard outline\" style=\"float:left\"></i><span>".concat(text, "</span>");
  5759. }
  5760. }, {
  5761. key: "scrollTerm",
  5762. value: function scrollTerm() {
  5763. //scrollIt(this.inputDiv.previousSibling,200);
  5764. this.termDiv.scrollTop = this.termDiv.scrollHeight;
  5765. }
  5766. }, {
  5767. key: "focus",
  5768. value: function focus() {
  5769. this.termDiv.style.display = "block"; // Is in draggable mode?
  5770. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  5771. this.parent.style.marginTop = "-160px";
  5772. }
  5773. if (this.needInput) {
  5774. this.showInput();
  5775. this.scheduleNotify();
  5776. }
  5777. if (!_util_utils__WEBPACK_IMPORTED_MODULE_5__["isElementInViewport"](this.termDiv)) this.termDiv.scrollIntoView(false);
  5778. this.scrollTerm();
  5779. }
  5780. }, {
  5781. key: "hide",
  5782. value: function hide() {
  5783. if (this.needInput) {
  5784. clearInterval(this.idleInterval);
  5785. this.hideInput();
  5786. this.needInput = true;
  5787. } // Is in draggable mode?
  5788. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  5789. this.parent.style.marginTop = "0";
  5790. }
  5791. this.termDiv.style.display = "none";
  5792. }
  5793. }, {
  5794. key: "getClassForType",
  5795. value: function getClassForType(type) {
  5796. switch (type) {
  5797. case DOMConsole.INPUT:
  5798. return "ivprog-term-userInput";
  5799. case DOMConsole.USER:
  5800. return "ivprog-term-userText";
  5801. case DOMConsole.INFO:
  5802. return "ivprog-term-info";
  5803. case DOMConsole.ERR:
  5804. return "ivprog-term-error";
  5805. }
  5806. }
  5807. }, {
  5808. key: "dispose",
  5809. value: function dispose() {
  5810. this.input.removeEventListener("keyup", this.updateSpanText.bind(this));
  5811. this.input.removeEventListener("blur", this.stopBlinkCaret.bind(this));
  5812. this.input.removeEventListener("keydown", this.registerInput.bind(this));
  5813. this.inputCMD.removeEventListener("click", this.blinkCaretAndFocus.bind(this));
  5814. this.clearBtn.removeEventListener("click", this.clearBtnClick.bind(this));
  5815. this.hideBtn.removeEventListener("click", this.hideBtnClick.bind(this));
  5816. this.showBtn.removeEventListener("click", this.showBtnClick.bind(this));
  5817. this.input = null;
  5818. this.inputCMD = null;
  5819. this.inputDiv = null;
  5820. this.termDiv = null;
  5821. this.inputSpan = null;
  5822. this.cursorRef = null;
  5823. this.clearBtn = null;
  5824. this.hideBtn = null;
  5825. this.showBtn = null;
  5826. this.currentLine = null;
  5827. var cNode = this.parent.cloneNode(false);
  5828. this.parent.parentNode.replaceChild(cNode, this.parent);
  5829. if (this.cursorInterval != null) {
  5830. clearInterval(this.cursorInterval);
  5831. }
  5832. if (this.idleInterval != null) {
  5833. clearInterval(this.idleInterval);
  5834. }
  5835. }
  5836. }, {
  5837. key: "showInput",
  5838. value: function showInput() {
  5839. this.needInput = true;
  5840. this.inputDiv.style.display = "block";
  5841. this.inputCMD.click(); //this.inputCMD.scrollIntoView();
  5842. this.scrollTerm();
  5843. }
  5844. }, {
  5845. key: "hideInput",
  5846. value: function hideInput() {
  5847. this.needInput = false;
  5848. this.inputDiv.style.display = " none";
  5849. clearInterval(this.cursorInterval);
  5850. this.cursorInterval = null;
  5851. }
  5852. }, {
  5853. key: "requestInput",
  5854. value: function requestInput() {
  5855. var _this2 = this;
  5856. var anyKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  5857. var promise = new Promise(function (resolve, _) {
  5858. _this2.inputListeners.push(resolve);
  5859. _this2.anyKey = anyKey;
  5860. if (_this2.idleInterval == null) _this2.scheduleNotify();
  5861. _this2.showInput();
  5862. });
  5863. return promise;
  5864. }
  5865. }, {
  5866. key: "sendOutput",
  5867. value: function sendOutput(text) {
  5868. //console.debug(text);
  5869. var output = "" + text;
  5870. if (output.indexOf("\n") !== -1) {
  5871. //console.debug("newline");
  5872. var outputList = output.split("\n");
  5873. var i = 0;
  5874. for (; i < outputList.length - 1; i += 1) {
  5875. //console.debug("newline write");
  5876. var _t = outputList[i];
  5877. _t = _t.replace(/\t/g, "&#x0020;&#x0020;");
  5878. _t = _t.replace(/\s/g, "&#x0020;");
  5879. if (_t.length !== 0) {
  5880. this.write(_t);
  5881. }
  5882. this.write("", true);
  5883. }
  5884. var t = outputList[i];
  5885. t = t.replace(/\t/g, "&#x0020;&#x0020;");
  5886. t = t.replace(/\s/g, "&#x0020;");
  5887. if (t.length != 0) this.write(t);
  5888. } else {
  5889. // console.debug("no newline");
  5890. output = output.replace(/\t/g, "&#x0020;&#x0020;");
  5891. output = output.replace(/\s/g, "&#x0020;");
  5892. if (output.length != 0) this.write(output);
  5893. }
  5894. }
  5895. }, {
  5896. key: "clearPendingWrites",
  5897. value: function clearPendingWrites() {
  5898. this.last_clear = Date.now();
  5899. }
  5900. }, {
  5901. key: "clear",
  5902. value: function clear() {
  5903. this.clearPendingWrites();
  5904. while (this.inputDiv.parentElement.childNodes.length > 1) {
  5905. this.inputDiv.parentElement.removeChild(this.inputDiv.parentElement.firstChild);
  5906. }
  5907. this.input.value = "";
  5908. this.inputSpan.innerHTML = "";
  5909. this.currentLine = null;
  5910. }
  5911. }, {
  5912. key: "clearBtnClick",
  5913. value: function clearBtnClick() {
  5914. this.clear();
  5915. }
  5916. }, {
  5917. key: "showBtnClick",
  5918. value: function showBtnClick() {
  5919. this.focus();
  5920. }
  5921. }, {
  5922. key: "hideBtnClick",
  5923. value: function hideBtnClick() {
  5924. this.hide();
  5925. }
  5926. }, {
  5927. key: "notifyIdle",
  5928. value: function notifyIdle() {
  5929. this.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("awaiting_input_message"));
  5930. this.inputCMD.click();
  5931. }
  5932. }, {
  5933. key: "scheduleNotify",
  5934. value: function scheduleNotify() {
  5935. this.idleInterval = window.setInterval(this.notifyIdle.bind(this), _util_config__WEBPACK_IMPORTED_MODULE_6__["Config"].idle_input_interval);
  5936. }
  5937. }, {
  5938. key: "cancelPendingInputRequests",
  5939. value: function cancelPendingInputRequests() {
  5940. this.inputListeners.forEach(function (resolve) {
  5941. return resolve("");
  5942. });
  5943. this.inputListeners.splice(0, this.inputListeners.length);
  5944. if (this.idleInterval != null) {
  5945. clearInterval(this.idleInterval);
  5946. this.idleInterval = null;
  5947. }
  5948. this.input.value = "";
  5949. this.inputSpan.innerHTML = "";
  5950. this.currentLine = null;
  5951. this.hideInput();
  5952. this.anyKey = false;
  5953. }
  5954. }]);
  5955. return DOMConsole;
  5956. }();
  5957. /***/ }),
  5958. /***/ "./js/io/input.js":
  5959. /*!************************!*\
  5960. !*** ./js/io/input.js ***!
  5961. \************************/
  5962. /*! exports provided: Input */
  5963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5964. "use strict";
  5965. __webpack_require__.r(__webpack_exports__);
  5966. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
  5967. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5968. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5969. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5970. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5971. var Input = /*#__PURE__*/function () {
  5972. function Input() {
  5973. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Input);
  5974. }
  5975. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Input, [{
  5976. key: "requestInput",
  5977. value: function requestInput() {
  5978. throw new Error("Must be implemented");
  5979. }
  5980. }, {
  5981. key: "cancelPendingInputRequests",
  5982. value: function cancelPendingInputRequests() {
  5983. throw new Error("Must be implemented");
  5984. }
  5985. }]);
  5986. return Input;
  5987. }();
  5988. /***/ }),
  5989. /***/ "./js/io/output.js":
  5990. /*!*************************!*\
  5991. !*** ./js/io/output.js ***!
  5992. \*************************/
  5993. /*! exports provided: Output */
  5994. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5995. "use strict";
  5996. __webpack_require__.r(__webpack_exports__);
  5997. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; });
  5998. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5999. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  6000. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  6001. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  6002. var Output = /*#__PURE__*/function () {
  6003. function Output() {
  6004. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Output);
  6005. }
  6006. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Output, [{
  6007. key: "sendOutput",
  6008. value: function sendOutput(text) {
  6009. throw new Error("Must be implemented");
  6010. }
  6011. }]);
  6012. return Output;
  6013. }();
  6014. /***/ }),
  6015. /***/ "./js/main.js":
  6016. /*!********************!*\
  6017. !*** ./js/main.js ***!
  6018. \********************/
  6019. /*! exports provided: runner, initVisualUI, addFunctionChangeListener, addGlobalChangeListener, removeFunctionListener, removeGlobalListener, getTestCases, autoEval, prepareActivityToStudentHelper, LocalizedStrings, i18n, getLogs, getLogsAsString, registerClick, registerUserEvent, parseLogs, ActionTypes, CodeEditor, openAssessmentDetail, autoGenerateTestCaseOutput, Config, parseExpression */
  6020. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6021. "use strict";
  6022. __webpack_require__.r(__webpack_exports__);
  6023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  6024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18n", function() { return i18n; });
  6025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditor", function() { return CodeEditor; });
  6026. /* harmony import */ var _runner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runner */ "./js/runner.js");
  6027. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return _runner__WEBPACK_IMPORTED_MODULE_0__["runner"]; });
  6028. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualUI/functions */ "./js/visualUI/functions.js");
  6029. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["initVisualUI"]; });
  6030. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addFunctionChangeListener"]; });
  6031. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addGlobalChangeListener"]; });
  6032. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeFunctionListener"]; });
  6033. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeGlobalListener"]; });
  6034. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["getTestCases"]; });
  6035. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6036. /* harmony import */ var _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/i18nHelper */ "./js/services/i18nHelper.js");
  6037. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/userLog */ "./js/services/userLog.js");
  6038. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogs"]; });
  6039. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogsAsString"]; });
  6040. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerClick"]; });
  6041. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"]; });
  6042. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"]; });
  6043. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"]; });
  6044. /* harmony import */ var _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/iassignHelpers */ "./js/util/iassignHelpers.js");
  6045. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["autoEval"]; });
  6046. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["prepareActivityToStudentHelper"]; });
  6047. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/utils */ "./js/util/utils.js");
  6048. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return _util_utils__WEBPACK_IMPORTED_MODULE_6__["openAssessmentDetail"]; });
  6049. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/config */ "./js/util/config.ts");
  6050. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  6051. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Config", function() { return _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]; });
  6052. /* harmony import */ var _util_parseFromVisual__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util/parseFromVisual */ "./js/util/parseFromVisual.js");
  6053. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseExpression", function() { return _util_parseFromVisual__WEBPACK_IMPORTED_MODULE_8__["parseExpression"]; });
  6054. /* harmony import */ var _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./visualUI/text_editor */ "./js/visualUI/text_editor.js");
  6055. /* harmony import */ var _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util/auto_gen_output */ "./js/util/auto_gen_output.js");
  6056. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_10__["autoGenerateTestCaseOutput"]; });
  6057. var CodeEditor = {
  6058. initTextEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["initTextEditor"],
  6059. setCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["setCode"],
  6060. getCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["getCode"],
  6061. updateEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["updateEditor"],
  6062. disable: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["disable"]
  6063. };
  6064. var i18n = _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__["i18nHelper"].i18n;
  6065. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6066. /***/ }),
  6067. /***/ "./js/memory/address.ts":
  6068. /*!******************************!*\
  6069. !*** ./js/memory/address.ts ***!
  6070. \******************************/
  6071. /*! no static exports found */
  6072. /***/ (function(module, exports, __webpack_require__) {
  6073. "use strict";
  6074. Object.defineProperty(exports, "__esModule", { value: true });
  6075. exports.Address = void 0;
  6076. class Address {
  6077. /**
  6078. *
  6079. * @param {Number} id the address id
  6080. * @param {never} value the value stored at this address
  6081. */
  6082. constructor(id, value) {
  6083. this.id = id;
  6084. this.value = value;
  6085. }
  6086. }
  6087. exports.Address = Address;
  6088. /***/ }),
  6089. /***/ "./js/memory/location.ts":
  6090. /*!*******************************!*\
  6091. !*** ./js/memory/location.ts ***!
  6092. \*******************************/
  6093. /*! no static exports found */
  6094. /***/ (function(module, exports, __webpack_require__) {
  6095. "use strict";
  6096. Object.defineProperty(exports, "__esModule", { value: true });
  6097. exports.Location = void 0;
  6098. const address_1 = __webpack_require__(/*! ./address */ "./js/memory/address.ts");
  6099. class LocationHolder {
  6100. constructor() {
  6101. this.data = [];
  6102. this.address_id = 0;
  6103. }
  6104. /**
  6105. *
  6106. * @param {never} value the value to be allocated
  6107. * @returns {number} - the address id
  6108. */
  6109. allocate(value) {
  6110. const id = this.address_id;
  6111. // console.log("Allocation address "+ id);
  6112. const address = new address_1.Address(id, value);
  6113. this.data.push(address);
  6114. this.address_id += 1;
  6115. return id;
  6116. }
  6117. /**
  6118. *
  6119. * @param {number} id
  6120. */
  6121. deallocate(id) {
  6122. const index = this.findIndex(id);
  6123. // console.log("Deallocation address "+ id);
  6124. if (index !== -1) {
  6125. this.data.splice(index, 1);
  6126. return true;
  6127. }
  6128. return false;
  6129. }
  6130. /**
  6131. *
  6132. * @param {number} id
  6133. * @returns {Address} the address identified by id
  6134. */
  6135. find(id) {
  6136. let beg = 0;
  6137. let end = this.data.length;
  6138. // console.log("Finding address "+id);
  6139. while (beg < end) {
  6140. const med = Math.floor((beg + end) / 2);
  6141. const address = this.getAddressAt(med);
  6142. if (address.id === id) {
  6143. return address;
  6144. }
  6145. else if (id > address.id) {
  6146. beg = med;
  6147. }
  6148. else {
  6149. end = med;
  6150. }
  6151. }
  6152. return undefined;
  6153. }
  6154. getAddressAt(pos) {
  6155. return this.data[pos];
  6156. }
  6157. /**
  6158. *
  6159. * @param {number} id address id
  6160. * @returns {number} the index of the address identified by id
  6161. */
  6162. findIndex(id) {
  6163. let beg = 0;
  6164. let end = this.data.length;
  6165. while (beg < end) {
  6166. const med = Math.floor((beg + end) / 2);
  6167. const address = this.getAddressAt(med);
  6168. if (address.id === id) {
  6169. return med;
  6170. }
  6171. else if (id > address.id) {
  6172. beg = med;
  6173. }
  6174. else {
  6175. end = med;
  6176. }
  6177. }
  6178. return -1;
  6179. }
  6180. updateAddress(id, value) {
  6181. const index = this.findIndex(id);
  6182. if (index === -1) {
  6183. throw new Error("Invalid address..." + id);
  6184. }
  6185. this.data[index].value = value;
  6186. }
  6187. clear() {
  6188. for (let i = 0; i < this.data.length; i += 1) {
  6189. delete this.data[i];
  6190. }
  6191. this.data = [];
  6192. this.address_id = 0;
  6193. }
  6194. }
  6195. const inner_ref = new LocationHolder();
  6196. exports.Location = Object.freeze({
  6197. allocate: inner_ref.allocate.bind(inner_ref),
  6198. deallocate: inner_ref.deallocate.bind(inner_ref),
  6199. find: inner_ref.find.bind(inner_ref),
  6200. updateAddress: inner_ref.updateAddress.bind(inner_ref),
  6201. clear: inner_ref.clear.bind(inner_ref),
  6202. size: () => inner_ref.data.length
  6203. });
  6204. /***/ }),
  6205. /***/ "./js/processor/compatibilityTable.ts":
  6206. /*!********************************************!*\
  6207. !*** ./js/processor/compatibilityTable.ts ***!
  6208. \********************************************/
  6209. /*! no static exports found */
  6210. /***/ (function(module, exports, __webpack_require__) {
  6211. "use strict";
  6212. Object.defineProperty(exports, "__esModule", { value: true });
  6213. exports.resultTypeAfterUnaryOp = exports.resultTypeAfterInfixOp = void 0;
  6214. const types_1 = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  6215. const operators_1 = __webpack_require__(/*! ../ast/operators */ "./js/ast/operators.ts");
  6216. const multiType_1 = __webpack_require__(/*! ../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  6217. const config_1 = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  6218. function buildInfixAddTable() {
  6219. const table = [[], [], [], [], []];
  6220. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6221. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6222. table[types_1.Types.INTEGER.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6223. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6224. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6225. table[types_1.Types.REAL.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6226. table[types_1.Types.STRING.ord][types_1.Types.INTEGER.ord] = types_1.Types.STRING;
  6227. table[types_1.Types.STRING.ord][types_1.Types.REAL.ord] = types_1.Types.STRING;
  6228. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6229. table[types_1.Types.STRING.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.STRING;
  6230. table[types_1.Types.STRING.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6231. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6232. table[types_1.Types.CHAR.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6233. return table;
  6234. }
  6235. function buildInfixMultiDivSubTable() {
  6236. const table = [[], []];
  6237. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6238. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6239. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6240. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6241. return table;
  6242. }
  6243. function buildInfixEqualityInequalityTable() {
  6244. const table = [[], [], [], [], []];
  6245. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6246. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6247. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6248. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6249. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6250. return table;
  6251. }
  6252. function buildInfixRelationalTable() {
  6253. const table = [[], [], [], [], []];
  6254. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6255. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6256. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6257. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6258. return table;
  6259. }
  6260. function buildInfixAndOrTable() {
  6261. const table = [[], [], [], []];
  6262. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6263. return table;
  6264. }
  6265. function buildInfixModTable() {
  6266. const table = [[]];
  6267. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6268. return table;
  6269. }
  6270. function buildUnarySumSubList() {
  6271. const list = [];
  6272. list[types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6273. list[types_1.Types.REAL.ord] = types_1.Types.REAL;
  6274. return list;
  6275. }
  6276. function buildUnaryNegList() {
  6277. const list = [];
  6278. list[types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6279. return list;
  6280. }
  6281. function buildInfixCompatibilityTable() {
  6282. const compatibilityMap = new WeakMap();
  6283. compatibilityMap.set(operators_1.Operators.ADD, buildInfixAddTable());
  6284. compatibilityMap.set(operators_1.Operators.SUB, buildInfixMultiDivSubTable());
  6285. compatibilityMap.set(operators_1.Operators.MULT, buildInfixMultiDivSubTable());
  6286. compatibilityMap.set(operators_1.Operators.DIV, buildInfixMultiDivSubTable());
  6287. compatibilityMap.set(operators_1.Operators.EQ, buildInfixEqualityInequalityTable());
  6288. compatibilityMap.set(operators_1.Operators.NEQ, buildInfixEqualityInequalityTable());
  6289. compatibilityMap.set(operators_1.Operators.GE, buildInfixRelationalTable());
  6290. compatibilityMap.set(operators_1.Operators.GT, buildInfixRelationalTable());
  6291. compatibilityMap.set(operators_1.Operators.LE, buildInfixRelationalTable());
  6292. compatibilityMap.set(operators_1.Operators.LT, buildInfixRelationalTable());
  6293. compatibilityMap.set(operators_1.Operators.OR, buildInfixAndOrTable());
  6294. compatibilityMap.set(operators_1.Operators.AND, buildInfixAndOrTable());
  6295. compatibilityMap.set(operators_1.Operators.MOD, buildInfixModTable());
  6296. return compatibilityMap;
  6297. }
  6298. function buildUnaryCompatibilityTable() {
  6299. const compatibilityMap = new WeakMap();
  6300. compatibilityMap.set(operators_1.Operators.ADD, buildUnarySumSubList());
  6301. compatibilityMap.set(operators_1.Operators.SUB, buildUnarySumSubList());
  6302. compatibilityMap.set(operators_1.Operators.NOT, buildUnaryNegList());
  6303. return compatibilityMap;
  6304. }
  6305. const infixMap = buildInfixCompatibilityTable();
  6306. const unaryMap = buildUnaryCompatibilityTable();
  6307. function resultTypeAfterInfixOp(operator, leftExpressionType, rightExpressionType) {
  6308. try {
  6309. if (leftExpressionType instanceof multiType_1.MultiType && rightExpressionType instanceof multiType_1.MultiType) {
  6310. let newMulti = [];
  6311. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6312. const typeA = leftExpressionType.types[i];
  6313. for (let j = 0; j < rightExpressionType.types.length; ++i) {
  6314. const typeB = rightExpressionType.types[j];
  6315. newMulti.push(resultTypeAfterInfixOp(operator, typeA, typeB));
  6316. }
  6317. }
  6318. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6319. if (newMulti.length <= 0) {
  6320. if (config_1.Config.enable_type_casting) {
  6321. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6322. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6323. return new multiType_1.MultiType([types_1.Types.INTEGER, types_1.Types.REAL]);
  6324. }
  6325. }
  6326. }
  6327. return types_1.Types.UNDEFINED;
  6328. }
  6329. else {
  6330. return new multiType_1.MultiType(newMulti);
  6331. }
  6332. }
  6333. else if (leftExpressionType instanceof multiType_1.MultiType) {
  6334. if (leftExpressionType.isCompatible(rightExpressionType)) {
  6335. return resultTypeAfterInfixOp(operator, rightExpressionType, rightExpressionType);
  6336. }
  6337. else {
  6338. if (config_1.Config.enable_type_casting) {
  6339. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6340. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6341. return rightExpressionType;
  6342. }
  6343. }
  6344. }
  6345. return types_1.Types.UNDEFINED;
  6346. }
  6347. }
  6348. else if (rightExpressionType instanceof multiType_1.MultiType) {
  6349. if (rightExpressionType.isCompatible(leftExpressionType)) {
  6350. return resultTypeAfterInfixOp(operator, leftExpressionType, leftExpressionType);
  6351. }
  6352. else {
  6353. if (config_1.Config.enable_type_casting) {
  6354. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6355. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6356. return leftExpressionType;
  6357. }
  6358. }
  6359. }
  6360. return types_1.Types.UNDEFINED;
  6361. }
  6362. }
  6363. const resultTable = infixMap.get(operator) || [];
  6364. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6365. const resultType = resultTable[leftExpressionType.ord][rightExpressionType.ord];
  6366. if (resultType === null || resultType === undefined) {
  6367. if (config_1.Config.enable_type_casting) {
  6368. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6369. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6370. if (operator === operators_1.Operators.MOD) {
  6371. return types_1.Types.INTEGER;
  6372. }
  6373. else if (operator.ord >= 5 && operator.ord <= 10) {
  6374. return types_1.Types.BOOLEAN;
  6375. }
  6376. }
  6377. }
  6378. }
  6379. return types_1.Types.UNDEFINED;
  6380. }
  6381. return resultType;
  6382. }
  6383. catch (e) {
  6384. if (e instanceof TypeError) {
  6385. return types_1.Types.UNDEFINED;
  6386. }
  6387. else {
  6388. throw e;
  6389. }
  6390. }
  6391. }
  6392. exports.resultTypeAfterInfixOp = resultTypeAfterInfixOp;
  6393. function resultTypeAfterUnaryOp(operator, leftExpressionType) {
  6394. try {
  6395. if (leftExpressionType instanceof multiType_1.MultiType) {
  6396. let newMulti = [];
  6397. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6398. const type = leftExpressionType.types[i];
  6399. newMulti.push(resultTypeAfterUnaryOp(operator, type));
  6400. }
  6401. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6402. if (newMulti.length <= 0) {
  6403. return types_1.Types.UNDEFINED;
  6404. }
  6405. return new multiType_1.MultiType(newMulti);
  6406. }
  6407. const resultTable = unaryMap.get(operator) || [];
  6408. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6409. const resultType = resultTable[leftExpressionType.ord];
  6410. if (resultType == null) {
  6411. return types_1.Types.UNDEFINED;
  6412. }
  6413. return resultType;
  6414. }
  6415. catch (e) {
  6416. if (e instanceof TypeError) {
  6417. return types_1.Types.UNDEFINED;
  6418. }
  6419. else {
  6420. throw e;
  6421. }
  6422. }
  6423. }
  6424. exports.resultTypeAfterUnaryOp = resultTypeAfterUnaryOp;
  6425. /***/ }),
  6426. /***/ "./js/processor/context.ts":
  6427. /*!*********************************!*\
  6428. !*** ./js/processor/context.ts ***!
  6429. \*********************************/
  6430. /*! no static exports found */
  6431. /***/ (function(module, exports, __webpack_require__) {
  6432. "use strict";
  6433. Object.defineProperty(exports, "__esModule", { value: true });
  6434. exports.Context = void 0;
  6435. exports.Context = Object.freeze({
  6436. BASE: Symbol('context:base'),
  6437. BREAKABLE: Symbol('context:breakable'),
  6438. FUNCTION: Symbol('context:function')
  6439. });
  6440. /***/ }),
  6441. /***/ "./js/processor/definedFunctions.js":
  6442. /*!******************************************!*\
  6443. !*** ./js/processor/definedFunctions.js ***!
  6444. \******************************************/
  6445. /*! exports provided: LanguageDefinedFunction */
  6446. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6447. "use strict";
  6448. __webpack_require__.r(__webpack_exports__);
  6449. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageDefinedFunction", function() { return LanguageDefinedFunction; });
  6450. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  6451. /* harmony import */ var _lib_io__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/io */ "./js/processor/lib/io.js");
  6452. /* harmony import */ var _lib_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/strings */ "./js/processor/lib/strings.js");
  6453. /* harmony import */ var _lib_arrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/arrays */ "./js/processor/lib/arrays.js");
  6454. /* harmony import */ var _lib_lang__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/lang */ "./js/processor/lib/lang.js");
  6455. /* harmony import */ var _lib_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/math */ "./js/processor/lib/math.js");
  6456. function valueToKey(value, object) {
  6457. for (var key in object) {
  6458. if (Object.prototype.hasOwnProperty.call(object, key)) {
  6459. if (object[key] === value) {
  6460. return key;
  6461. }
  6462. }
  6463. }
  6464. return null;
  6465. }
  6466. function concatObjects() {
  6467. var result = {};
  6468. for (var i = 0; i < arguments.length; i++) {
  6469. var obj = i < 0 || arguments.length <= i ? undefined : arguments[i];
  6470. for (var key in obj) {
  6471. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  6472. result[key] = obj[key];
  6473. }
  6474. }
  6475. }
  6476. return result;
  6477. }
  6478. var libsObject = {
  6479. $mathLib: {
  6480. $sin: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSinFun"])(),
  6481. $cos: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createCosFun"])(),
  6482. $tan: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createTanFun"])(),
  6483. $sqrt: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSqrtFun"])(),
  6484. $pow: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createPowFun"])(),
  6485. $log: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createLogFun"])(),
  6486. $abs: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createAbsFun"])(),
  6487. $negate: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createNegateFun"])(),
  6488. $invert: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createInvertFun"])(),
  6489. $max: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMaxFun"])(),
  6490. $min: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMinFun"])(),
  6491. $rand: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createRandFun"])()
  6492. },
  6493. $ioLib: {
  6494. $read: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createInputFun"])(),
  6495. $write: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createOutputFun"])()
  6496. },
  6497. $strLib: {
  6498. $substring: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createSubstringFun"])(),
  6499. $length: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLengthFun"])(),
  6500. $uppercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createUppercaseFun"])(),
  6501. $lowercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLowercaseFun"])(),
  6502. $charAt: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createrCharAtFun"])()
  6503. },
  6504. $arrayLib: {
  6505. $numElements: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createNumElementsFun"])(),
  6506. $matrixLines: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixLinesFun"])(),
  6507. $matrixColumns: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixColumnsFun"])()
  6508. },
  6509. $langLib: {
  6510. $isReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsRealFun"])(),
  6511. $isInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsIntFun"])(),
  6512. $isBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsBoolFun"])(),
  6513. $castReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastRealFun"])(),
  6514. $castInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastIntFun"])(),
  6515. $castBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastBoolFun"])(),
  6516. $castString: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastStringFun"])(),
  6517. $castChar: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastCharFun"])()
  6518. }
  6519. };
  6520. var funcsObject = concatObjects(libsObject.$ioLib, libsObject.$langLib, libsObject.$strLib, libsObject.$arrayLib);
  6521. var LanguageDefinedFunction = Object.freeze({
  6522. getMainFunctionName: function getMainFunctionName() {
  6523. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs().main_function;
  6524. },
  6525. getInternalName: function getInternalName(localName) {
  6526. if (localName.indexOf(".") !== -1) {
  6527. var names = localName.split(".");
  6528. var lib = valueToKey(names[0], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs());
  6529. var internalName = valueToKey(names[1], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6530. if (lib === null || internalName === null) {
  6531. return null;
  6532. }
  6533. return lib + "." + internalName;
  6534. }
  6535. var funcName = valueToKey(localName, _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6536. if (funcName !== null) {
  6537. if (funcsObject[funcName]) {
  6538. return funcName;
  6539. }
  6540. }
  6541. return null;
  6542. },
  6543. getFunction: function getFunction(internalName) {
  6544. if (internalName.indexOf(".") !== -1) {
  6545. var names = internalName.split(".");
  6546. var libName = names[0];
  6547. var funName = names[1];
  6548. return libsObject[libName][funName];
  6549. }
  6550. return funcsObject[internalName];
  6551. },
  6552. getLocalName: function getLocalName(internalName) {
  6553. if (internalName.indexOf(".") !== -1) {
  6554. var names = internalName.split(".");
  6555. var libName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs()[names[0]];
  6556. var funName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[names[1]];
  6557. return "".concat(libName, ".").concat(funName);
  6558. } else if (_services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName]) {
  6559. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName];
  6560. } else {
  6561. return internalName;
  6562. }
  6563. }
  6564. });
  6565. /***/ }),
  6566. /***/ "./js/processor/error/processorErrorFactory.js":
  6567. /*!*****************************************************!*\
  6568. !*** ./js/processor/error/processorErrorFactory.js ***!
  6569. \*****************************************************/
  6570. /*! exports provided: ProcessorErrorFactory */
  6571. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6572. "use strict";
  6573. __webpack_require__.r(__webpack_exports__);
  6574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProcessorErrorFactory", function() { return ProcessorErrorFactory; });
  6575. /* harmony import */ var _runtimeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runtimeError */ "./js/processor/error/runtimeError.js");
  6576. /* harmony import */ var _semanticError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./semanticError */ "./js/processor/error/semanticError.js");
  6577. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6578. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../definedFunctions */ "./js/processor/definedFunctions.js");
  6579. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6580. function createRuntimeError(i18n_id) {
  6581. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6582. return new _runtimeError__WEBPACK_IMPORTED_MODULE_0__["RuntimeError"](LocalizedStrings.getError(i18n_id, context), i18n_id);
  6583. }
  6584. function createSemanticError(i18n_id) {
  6585. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6586. return new _semanticError__WEBPACK_IMPORTED_MODULE_1__["SemanticError"](LocalizedStrings.getError(i18n_id, context), i18n_id);
  6587. }
  6588. var ProcessorErrorFactory = Object.freeze({
  6589. symbol_not_found_full: function symbol_not_found_full(id, sourceInfo) {
  6590. if (sourceInfo) {
  6591. var context = [id, sourceInfo.line, sourceInfo.column];
  6592. var error = createSemanticError("symbol_not_found_full", context);
  6593. error.context = {
  6594. line: sourceInfo.line,
  6595. column: sourceInfo.column
  6596. };
  6597. return error;
  6598. } else {
  6599. return ProcessorErrorFactory.symbol_not_found(id);
  6600. }
  6601. },
  6602. symbol_not_found: function symbol_not_found(id) {
  6603. var context = [id];
  6604. return createSemanticError("symbol_not_found", context);
  6605. },
  6606. function_missing_full: function function_missing_full(id, sourceInfo) {
  6607. if (sourceInfo) {
  6608. var context = [id, sourceInfo.line, sourceInfo.column];
  6609. var error = createSemanticError("function_missing_full", context);
  6610. error.context = {
  6611. line: sourceInfo.line,
  6612. column: sourceInfo.column
  6613. };
  6614. return error;
  6615. } else {
  6616. return ProcessorErrorFactory.function_missing(id);
  6617. }
  6618. },
  6619. function_missing: function function_missing(id) {
  6620. var context = [id];
  6621. return createSemanticError("function_missing", context);
  6622. },
  6623. main_missing: function main_missing() {
  6624. return createSemanticError("main_missing");
  6625. },
  6626. array_dimension_not_int_full: function array_dimension_not_int_full(sourceInfo) {
  6627. if (sourceInfo) {
  6628. var context = [sourceInfo.line];
  6629. var error = createSemanticError("array_dimension_not_int_full", context);
  6630. error.context = {
  6631. line: sourceInfo.line,
  6632. column: sourceInfo.column
  6633. };
  6634. return error;
  6635. } else {
  6636. return ProcessorErrorFactory.array_dimension_not_int();
  6637. }
  6638. },
  6639. array_dimension_not_int: function array_dimension_not_int() {
  6640. return createSemanticError("array_dimension_not_int");
  6641. },
  6642. unknown_command_full: function unknown_command_full(sourceInfo) {
  6643. if (sourceInfo) {
  6644. var context = [sourceInfo.line];
  6645. var error = createRuntimeError("unknown_command_full", context);
  6646. error.context = {
  6647. line: sourceInfo.line,
  6648. column: sourceInfo.column
  6649. };
  6650. return error;
  6651. } else {
  6652. return ProcessorErrorFactory.unknown_command();
  6653. }
  6654. },
  6655. unknown_command: function unknown_command() {
  6656. return createRuntimeError("unknown_command");
  6657. },
  6658. incompatible_types_full: function incompatible_types_full(left_type, left_dim, right_type, right_dim, exp, source_info) {
  6659. if (source_info) {
  6660. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, source_info.line, LocalizedStrings.translateType(right_type, right_dim)];
  6661. var error = createSemanticError("incompatible_types_full", context);
  6662. error.context = {
  6663. line: source_info.line,
  6664. column: source_info.column
  6665. };
  6666. return error;
  6667. } else {
  6668. return ProcessorErrorFactory.incompatible_types(left_type, left_dim, right_type, right_dim, exp);
  6669. }
  6670. },
  6671. incompatible_types: function incompatible_types(left_type, left_dim, right_type, right_dim, exp) {
  6672. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, LocalizedStrings.translateType(right_type, right_dim)];
  6673. return createSemanticError("incompatible_types", context);
  6674. },
  6675. incompatible_types_array_full: function incompatible_types_array_full(exp, type, dim, sourceInfo) {
  6676. if (sourceInfo) {
  6677. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6678. var error = createSemanticError("incompatible_types_array_full", context);
  6679. error.context = {
  6680. line: sourceInfo.line,
  6681. column: sourceInfo.column
  6682. };
  6683. return error;
  6684. } else {
  6685. return ProcessorErrorFactory.incompatible_types_array(exp, type, dim);
  6686. }
  6687. },
  6688. incompatible_types_array: function incompatible_types_array(exp, type, dim) {
  6689. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6690. return createSemanticError("incompatible_types_array", context);
  6691. },
  6692. loop_condition_type_full: function loop_condition_type_full(exp, sourceInfo) {
  6693. if (sourceInfo) {
  6694. var context = [sourceInfo.line, sourceInfo.column, exp];
  6695. var error = createSemanticError("loop_condition_type_full", context);
  6696. error.context = {
  6697. line: sourceInfo.line,
  6698. column: sourceInfo.column
  6699. };
  6700. return error;
  6701. } else {
  6702. return ProcessorErrorFactory.loop_condition_type(exp);
  6703. }
  6704. },
  6705. loop_condition_type: function loop_condition_type(exp) {
  6706. var context = [exp];
  6707. return createSemanticError("loop_condition_type", context);
  6708. },
  6709. /**
  6710. * @deprecated 01/10/2019
  6711. */
  6712. endless_loop_full: function endless_loop_full(sourceInfo) {
  6713. if (sourceInfo) {
  6714. var context = [sourceInfo.line];
  6715. var error = createSemanticError("endless_loop_full", context);
  6716. error.context = {
  6717. line: sourceInfo.line,
  6718. column: sourceInfo.column
  6719. };
  6720. return error;
  6721. } else {
  6722. return ProcessorErrorFactory.endless_loop();
  6723. }
  6724. },
  6725. endless_loop: function endless_loop() {
  6726. return createSemanticError("endless_loop");
  6727. },
  6728. if_condition_type_full: function if_condition_type_full(exp, sourceInfo) {
  6729. if (sourceInfo) {
  6730. var context = [sourceInfo.line, sourceInfo.column, exp];
  6731. var error = createSemanticError("if_condition_type_full", context);
  6732. error.context = {
  6733. line: sourceInfo.line,
  6734. column: sourceInfo.column
  6735. };
  6736. return error;
  6737. } else {
  6738. return ProcessorErrorFactory.if_condition_type(exp);
  6739. }
  6740. },
  6741. if_condition_type: function if_condition_type(exp) {
  6742. var context = [exp];
  6743. return createSemanticError("if_condition_type", context);
  6744. },
  6745. invalid_global_var: function invalid_global_var() {
  6746. return createRuntimeError("invalid_global_var");
  6747. },
  6748. not_implemented: function not_implemented(id) {
  6749. var context = [id];
  6750. return createRuntimeError("not_implemented", context);
  6751. },
  6752. invalid_case_type_full: function invalid_case_type_full(exp, type, dim, sourceInfo) {
  6753. if (sourceInfo) {
  6754. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6755. var error = createSemanticError("invalid_case_type_full", context);
  6756. error.context = {
  6757. line: sourceInfo.line,
  6758. column: sourceInfo.column
  6759. };
  6760. return error;
  6761. } else {
  6762. return ProcessorErrorFactory.invalid_case_type(exp, type, dim);
  6763. }
  6764. },
  6765. invalid_case_type: function invalid_case_type(exp, type, dim) {
  6766. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6767. return createSemanticError("invalid_case_type", context);
  6768. },
  6769. void_in_expression_full: function void_in_expression_full(id, sourceInfo) {
  6770. if (sourceInfo) {
  6771. var context = [sourceInfo.line, sourceInfo.column, id];
  6772. var error = createSemanticError("void_in_expression_full", context);
  6773. error.context = {
  6774. line: sourceInfo.line,
  6775. column: sourceInfo.column
  6776. };
  6777. return error;
  6778. } else {
  6779. return ProcessorErrorFactory.void_in_expression(id);
  6780. }
  6781. },
  6782. void_in_expression: function void_in_expression(id) {
  6783. var context = [id];
  6784. return createSemanticError("void_in_expression", context);
  6785. },
  6786. invalid_array_access_full: function invalid_array_access_full(id, sourceInfo) {
  6787. if (sourceInfo) {
  6788. var context = [id, sourceInfo.line, sourceInfo.column];
  6789. var error = createSemanticError("invalid_array_access_full", context);
  6790. error.context = {
  6791. line: sourceInfo.line,
  6792. column: sourceInfo.column
  6793. };
  6794. return error;
  6795. } else {
  6796. return ProcessorErrorFactory.invalid_array_access(id);
  6797. }
  6798. },
  6799. invalid_array_access: function invalid_array_access(id) {
  6800. var context = [id];
  6801. return createSemanticError("invalid_array_access", context);
  6802. },
  6803. invalid_matrix_access_full: function invalid_matrix_access_full(id, sourceInfo) {
  6804. if (sourceInfo) {
  6805. var context = [id, sourceInfo.line, sourceInfo.column];
  6806. var error = createSemanticError("invalid_matrix_access_full", context);
  6807. error.context = {
  6808. line: sourceInfo.line,
  6809. column: sourceInfo.column
  6810. };
  6811. return error;
  6812. } else {
  6813. return ProcessorErrorFactory.invalid_matrix_access(id);
  6814. }
  6815. },
  6816. invalid_matrix_access: function invalid_matrix_access(id) {
  6817. var context = [id];
  6818. return createSemanticError("invalid_matrix_access", context);
  6819. },
  6820. matrix_column_outbounds_full: function matrix_column_outbounds_full(id, value, columns, sourceInfo) {
  6821. if (sourceInfo) {
  6822. var context = [sourceInfo.line, value, id, columns];
  6823. var error = createRuntimeError("matrix_column_outbounds_full", context);
  6824. error.context = {
  6825. line: sourceInfo.line,
  6826. column: sourceInfo.column
  6827. };
  6828. return error;
  6829. } else {
  6830. return ProcessorErrorFactory.matrix_column_outbounds(id, value, columns);
  6831. }
  6832. },
  6833. matrix_column_outbounds: function matrix_column_outbounds(id, value, columns) {
  6834. var context = [value, id, columns];
  6835. return createRuntimeError("matrix_column_outbounds", context);
  6836. },
  6837. matrix_line_outbounds_full: function matrix_line_outbounds_full(id, value, lines, sourceInfo) {
  6838. if (sourceInfo) {
  6839. var context = [sourceInfo.line, value, id, lines];
  6840. var error = createRuntimeError("matrix_line_outbounds_full", context);
  6841. error.context = {
  6842. line: sourceInfo.line,
  6843. column: sourceInfo.column
  6844. };
  6845. return error;
  6846. } else {
  6847. return ProcessorErrorFactory.matrix_line_outbounds(id, value, lines);
  6848. }
  6849. },
  6850. matrix_line_outbounds: function matrix_line_outbounds(id, value, lines) {
  6851. var context = [value, id, lines];
  6852. return createRuntimeError("matrix_line_outbounds", context);
  6853. },
  6854. vector_line_outbounds_full: function vector_line_outbounds_full(id, value, lines, sourceInfo) {
  6855. if (sourceInfo) {
  6856. var context = [sourceInfo.line, value, id, lines];
  6857. var error = createRuntimeError("vector_line_outbounds_full", context);
  6858. error.context = {
  6859. line: sourceInfo.line,
  6860. column: sourceInfo.column
  6861. };
  6862. return error;
  6863. } else {
  6864. return ProcessorErrorFactory.vector_line_outbounds(id, value, lines);
  6865. }
  6866. },
  6867. vector_line_outbounds: function vector_line_outbounds(id, value, lines) {
  6868. var context = [value, id, lines];
  6869. return createRuntimeError("vector_line_outbounds", context);
  6870. },
  6871. vector_not_matrix_full: function vector_not_matrix_full(id, sourceInfo) {
  6872. if (sourceInfo) {
  6873. var context = [sourceInfo.line, id];
  6874. var error = createRuntimeError("vector_not_matrix_full", context);
  6875. error.context = {
  6876. line: sourceInfo.line,
  6877. column: sourceInfo.column
  6878. };
  6879. return error;
  6880. } else {
  6881. return ProcessorErrorFactory.vector_not_matrix(id);
  6882. }
  6883. },
  6884. vector_not_matrix: function vector_not_matrix(id) {
  6885. var context = [id];
  6886. return createRuntimeError("vector_not_matrix", context);
  6887. },
  6888. function_no_return: function function_no_return(id) {
  6889. var context = [id];
  6890. return createSemanticError("function_no_return", context);
  6891. },
  6892. invalid_void_return_full: function invalid_void_return_full(id, type, dim, sourceInfo) {
  6893. if (sourceInfo) {
  6894. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6895. var error = createSemanticError("invalid_void_return_full", context);
  6896. error.context = {
  6897. line: sourceInfo.line,
  6898. column: sourceInfo.column
  6899. };
  6900. return error;
  6901. } else {
  6902. return ProcessorErrorFactory.invalid_void_return(id, type, dim);
  6903. }
  6904. },
  6905. invalid_void_return: function invalid_void_return(id, type, dim) {
  6906. var context = [id, LocalizedStrings.translateType(type, dim)];
  6907. return createSemanticError("invalid_void_return_full", context);
  6908. },
  6909. invalid_return_type_full: function invalid_return_type_full(id, type, dim, sourceInfo) {
  6910. if (sourceInfo) {
  6911. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6912. var error = createSemanticError("invalid_return_type_full", context);
  6913. error.context = {
  6914. line: sourceInfo.line,
  6915. column: sourceInfo.column
  6916. };
  6917. return error;
  6918. } else {
  6919. return ProcessorErrorFactory.invalid_return_type(id, type, dim);
  6920. }
  6921. },
  6922. invalid_return_type: function invalid_return_type(id, type, dim) {
  6923. var context = [id, LocalizedStrings.translateType(type, dim)];
  6924. return createSemanticError("invalid_return_type", context);
  6925. },
  6926. invalid_parameters_size_full: function invalid_parameters_size_full(id, expected, actual, sourceInfo) {
  6927. if (sourceInfo) {
  6928. var context = [sourceInfo.line, id, expected, actual];
  6929. var error = createSemanticError("invalid_parameters_size_full", context);
  6930. error.context = {
  6931. line: sourceInfo.line,
  6932. column: sourceInfo.column
  6933. };
  6934. return error;
  6935. } else {
  6936. return ProcessorErrorFactory.invalid_parameters_size(id, expected, actual);
  6937. }
  6938. },
  6939. invalid_parameters_size: function invalid_parameters_size(id, expected, actual) {
  6940. var context = [id, expected, actual];
  6941. return createSemanticError("invalid_parameters_size", context);
  6942. },
  6943. invalid_parameter_type_full: function invalid_parameter_type_full(fun_name, exp, sourceInfo) {
  6944. if (sourceInfo) {
  6945. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  6946. var error = createSemanticError("invalid_parameter_type_full", context);
  6947. error.context = {
  6948. line: sourceInfo.line,
  6949. column: sourceInfo.column
  6950. };
  6951. return error;
  6952. } else {
  6953. return ProcessorErrorFactory.invalid_parameter_type(fun_name, exp);
  6954. }
  6955. },
  6956. invalid_parameter_type: function invalid_parameter_type(fun_name, exp) {
  6957. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  6958. return createSemanticError("invalid_parameter_type_full", context);
  6959. },
  6960. invalid_ref_full: function invalid_ref_full(id, exp, sourceInfo) {
  6961. if (sourceInfo) {
  6962. var context = [exp, id, sourceInfo.line];
  6963. var error = createSemanticError("invalid_ref_full", context);
  6964. error.context = {
  6965. line: sourceInfo.line,
  6966. column: sourceInfo.column
  6967. };
  6968. return error;
  6969. } else {
  6970. return ProcessorErrorFactory.invalid_ref(id, exp);
  6971. }
  6972. },
  6973. invalid_ref: function invalid_ref(id, exp) {
  6974. var context = [exp, id];
  6975. return createSemanticError("invalid_ref", context);
  6976. },
  6977. unexpected_break_command_full: function unexpected_break_command_full(sourceInfo) {
  6978. if (sourceInfo) {
  6979. var context = [sourceInfo.line];
  6980. var error = createRuntimeError("unexpected_break_command_full", context);
  6981. error.context = {
  6982. line: sourceInfo.line,
  6983. column: sourceInfo.column
  6984. };
  6985. return error;
  6986. } else {
  6987. return ProcessorErrorFactory.unexpected_break_command();
  6988. }
  6989. },
  6990. unexpected_break_command: function unexpected_break_command() {
  6991. return createRuntimeError("unexpected_break_command");
  6992. },
  6993. invalid_array_literal_type_full: function invalid_array_literal_type_full(exp, sourceInfo) {
  6994. if (sourceInfo) {
  6995. var context = [sourceInfo.line, exp];
  6996. var error = createRuntimeError("invalid_array_literal_type_full", context);
  6997. error.context = {
  6998. line: sourceInfo.line,
  6999. column: sourceInfo.column
  7000. };
  7001. return error;
  7002. } else {
  7003. return ProcessorErrorFactory.invalid_array_literal_type(exp);
  7004. }
  7005. },
  7006. invalid_array_literal_type: function invalid_array_literal_type(exp) {
  7007. var context = [exp];
  7008. return createRuntimeError("invalid_array_literal_type", context);
  7009. },
  7010. invalid_array_literal_line_full: function invalid_array_literal_line_full(expected, actual, sourceInfo) {
  7011. if (sourceInfo) {
  7012. var context = [sourceInfo.line, expected, actual];
  7013. var error = createRuntimeError("invalid_array_literal_line_full", context);
  7014. error.context = {
  7015. line: sourceInfo.line,
  7016. column: sourceInfo.column
  7017. };
  7018. return error;
  7019. } else {
  7020. return ProcessorErrorFactory.invalid_array_literal_type(expected, actual);
  7021. }
  7022. },
  7023. invalid_array_literal_line: function invalid_array_literal_line(expected, actual) {
  7024. var context = [expected, actual];
  7025. return createRuntimeError("invalid_array_literal_line", context);
  7026. },
  7027. invalid_array_literal_column_full: function invalid_array_literal_column_full(expected, actual, sourceInfo) {
  7028. if (sourceInfo) {
  7029. var context = [sourceInfo.line, expected, actual];
  7030. var error = createRuntimeError("invalid_array_literal_column_full", context);
  7031. error.context = {
  7032. line: sourceInfo.line,
  7033. column: sourceInfo.column
  7034. };
  7035. return error;
  7036. } else {
  7037. return ProcessorErrorFactory.invalid_array_literal_column(expected, actual);
  7038. }
  7039. },
  7040. invalid_array_literal_column: function invalid_array_literal_column(expected, actual) {
  7041. var context = [expected, actual];
  7042. return createRuntimeError("invalid_array_literal_column", context);
  7043. },
  7044. invalid_unary_op_full: function invalid_unary_op_full(expString, opName, type, dim, sourceInfo) {
  7045. if (sourceInfo) {
  7046. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  7047. var error = createRuntimeError("invalid_unary_op_full", context);
  7048. error.context = {
  7049. line: sourceInfo.line,
  7050. column: sourceInfo.column
  7051. };
  7052. return error;
  7053. } else {
  7054. return ProcessorErrorFactory.invalid_unary_op(opName, type, dim);
  7055. }
  7056. },
  7057. invalid_unary_op: function invalid_unary_op(expString, opName, type, dim) {
  7058. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  7059. return createRuntimeError("invalid_unary_op", context);
  7060. },
  7061. invalid_infix_op_full: function invalid_infix_op_full(expString, opName, typeLeft, dimLeft, typeRight, dimRight, sourceInfo) {
  7062. if (sourceInfo) {
  7063. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  7064. var error = createRuntimeError("invalid_infix_op_full", context);
  7065. error.context = {
  7066. line: sourceInfo.line,
  7067. column: sourceInfo.column
  7068. };
  7069. return error;
  7070. } else {
  7071. return ProcessorErrorFactory.invalid_infix_op(opName, typeLeft, dimLeft, typeRight, dimRight);
  7072. }
  7073. },
  7074. invalid_infix_op: function invalid_infix_op(expString, opName, typeLeft, dimLeft, typeRight, dimRight) {
  7075. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  7076. return createRuntimeError("invalid_infix_op", context);
  7077. },
  7078. array_dimension_not_positive_full: function array_dimension_not_positive_full(sourceInfo) {
  7079. if (sourceInfo) {
  7080. var context = [sourceInfo.line];
  7081. var error = createSemanticError("array_dimension_not_positive_full", context);
  7082. error.context = {
  7083. line: sourceInfo.line,
  7084. column: sourceInfo.column
  7085. };
  7086. return error;
  7087. } else {
  7088. return ProcessorErrorFactory.array_dimension_not_positive();
  7089. }
  7090. },
  7091. array_dimension_not_positive: function array_dimension_not_positive() {
  7092. return createSemanticError("array_dimension_not_positive");
  7093. },
  7094. invalid_type_conversion: function invalid_type_conversion(value, type, dim) {
  7095. var context = [value, LocalizedStrings.translateType(type, dim)];
  7096. return createRuntimeError("invalid_type_conversion", context);
  7097. },
  7098. invalid_read_type: function invalid_read_type(exp, type, dim, name, source_info) {
  7099. var context = [source_info.line, exp, LocalizedStrings.translateType(type, dim), name];
  7100. var error = createRuntimeError("invalid_read_type", context);
  7101. error.context = {
  7102. line: source_info.line,
  7103. column: source_info.column
  7104. };
  7105. return error;
  7106. },
  7107. invalid_read_type_array: function invalid_read_type_array(exp, typePos, dimPos, name, typeArray, dimArray, sourceInfo) {
  7108. var context = [sourceInfo.line, exp, LocalizedStrings.translateType(typePos, dimPos), name, LocalizedStrings.translateType(typeArray, dimArray)];
  7109. var error = createRuntimeError("invalid_read_type_array", context);
  7110. error.context = {
  7111. line: sourceInfo.line,
  7112. column: sourceInfo.column
  7113. };
  7114. return error;
  7115. },
  7116. invalid_const_ref_full: function invalid_const_ref_full(fun_name, exp, sourceInfo) {
  7117. if (sourceInfo) {
  7118. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  7119. var error = createSemanticError("invalid_const_ref_full", context);
  7120. error.context = {
  7121. line: sourceInfo.line,
  7122. column: sourceInfo.column
  7123. };
  7124. return error;
  7125. } else {
  7126. return ProcessorErrorFactory.invalid_const_ref(fun_name, exp);
  7127. }
  7128. },
  7129. invalid_const_ref: function invalid_const_ref(fun_name, exp) {
  7130. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  7131. var error = createSemanticError("invalid_const_ref", context);
  7132. return error;
  7133. },
  7134. invalid_const_assignment_full: function invalid_const_assignment_full(var_id, source_info) {
  7135. if (source_info) {
  7136. var context = [source_info.line, var_id];
  7137. var error = createSemanticError("invalid_const_assignment_full", context);
  7138. error.context = {
  7139. line: source_info.line,
  7140. column: source_info.column
  7141. };
  7142. return error;
  7143. } else {
  7144. return ProcessorErrorFactory.invalid_const_assignment(var_id);
  7145. }
  7146. },
  7147. invalid_const_assignment: function invalid_const_assignment(var_id) {
  7148. var context = [var_id];
  7149. return createSemanticError("invalid_const_assignment", context);
  7150. },
  7151. invalid_vector_assignment_full: function invalid_vector_assignment_full(left_id, left_size, right_id, right_size, source_info) {
  7152. if (source_info) {
  7153. var context = [source_info.line, left_id, left_size, right_id, right_size];
  7154. var error = createRuntimeError("invalid_vector_assignment_full", context);
  7155. error.context = {
  7156. line: source_info.line,
  7157. column: source_info.column
  7158. };
  7159. return error;
  7160. } else {
  7161. return ProcessorErrorFactory.invalid_vector_assignment(left_id, left_size, right_id, right_size);
  7162. }
  7163. },
  7164. invalid_vector_assignment: function invalid_vector_assignment(left_id, left_size, right_id, right_size) {
  7165. var context = [left_id, left_size, right_id, right_size];
  7166. return createRuntimeError("invalid_vector_assignment", context);
  7167. },
  7168. invalid_matrix_assignment_full: function invalid_matrix_assignment_full(left_id, left_line, left_column, right_id, right_line, right_column, source_info) {
  7169. if (source_info) {
  7170. var context = [source_info.line, left_id, left_line, left_column, right_id, right_line, right_column];
  7171. var error = createRuntimeError("invalid_matrix_assignment_full", context);
  7172. error.context = {
  7173. line: source_info.line,
  7174. column: source_info.column
  7175. };
  7176. return error;
  7177. } else {
  7178. return ProcessorErrorFactory.invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column);
  7179. }
  7180. },
  7181. invalid_matrix_assignment: function invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column) {
  7182. var context = [left_id, left_line, left_column, right_id, right_line, right_column];
  7183. return createRuntimeError("invalid_matrix_assignment", context);
  7184. },
  7185. matrix_to_vector_attr: function matrix_to_vector_attr(left_id, right_id, source_info) {
  7186. // SourceInfo have to be valid...
  7187. var context = [source_info.line, right_id, left_id];
  7188. var error = createSemanticError("matrix_to_vector_attr", context);
  7189. error.context = {
  7190. line: source_info.line,
  7191. column: source_info.column
  7192. };
  7193. return error;
  7194. },
  7195. vector_to_matrix_attr: function vector_to_matrix_attr(left_id, right_id, source_info) {
  7196. // SourceInfo have to be valid...
  7197. var context = [source_info.line, right_id, left_id];
  7198. var error = createSemanticError("vector_to_matrix_attr", context);
  7199. error.context = {
  7200. line: source_info.line,
  7201. column: source_info.column
  7202. };
  7203. return error;
  7204. },
  7205. invalid_matrix_index_assign_full: function invalid_matrix_index_assign_full(mat_id, mat_line, mat_size, exp, exp_size, source_info) {
  7206. if (source_info) {
  7207. var context = [source_info.line, mat_line, mat_id, mat_size, exp, exp_size];
  7208. var error = createRuntimeError("invalid_matrix_index_assign_full", context);
  7209. error.context = {
  7210. line: source_info.line,
  7211. column: source_info.column
  7212. };
  7213. return error;
  7214. } else {
  7215. return ProcessorErrorFactory.invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size);
  7216. }
  7217. },
  7218. invalid_matrix_index_assign: function invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size) {
  7219. var context = [mat_line, mat_id, mat_size, exp, exp_size];
  7220. return createRuntimeError("invalid_matrix_index_assign", context);
  7221. },
  7222. invalid_number_elements_vector: function invalid_number_elements_vector(expected_num, exp, actual_num, source_info) {
  7223. // SourceInfo have to be valid...
  7224. var context = [expected_num, source_info.line, exp, actual_num];
  7225. var error = createRuntimeError("invalid_number_elements_vector", context);
  7226. error.context = {
  7227. line: source_info.line,
  7228. column: source_info.column
  7229. };
  7230. return error;
  7231. },
  7232. invalid_number_lines_matrix: function invalid_number_lines_matrix(expected_num, exp, actual_num, source_info) {
  7233. // SourceInfo have to be valid...
  7234. var context = [expected_num, source_info.line, exp, actual_num];
  7235. var error = createRuntimeError("invalid_number_lines_matrix", context);
  7236. error.context = {
  7237. line: source_info.line,
  7238. column: source_info.column
  7239. };
  7240. return error;
  7241. },
  7242. divsion_by_zero_full: function divsion_by_zero_full(exp, source_info) {
  7243. if (source_info) {
  7244. var context = [source_info.line, exp];
  7245. var error = createRuntimeError("divsion_by_zero_full", context);
  7246. error.context = {
  7247. line: source_info.line,
  7248. column: source_info.column
  7249. };
  7250. return error;
  7251. } else {
  7252. return ProcessorErrorFactory.divsion_by_zero(exp);
  7253. }
  7254. },
  7255. divsion_by_zero: function divsion_by_zero(exp) {
  7256. var context = [exp];
  7257. return createRuntimeError("divsion_by_zero", context);
  7258. },
  7259. undefined_tanget_value: function undefined_tanget_value(value, source_info) {
  7260. var context = [source_info.line, value];
  7261. var error = createRuntimeError("undefined_tanget_value", context);
  7262. error.context = {
  7263. line: source_info.line,
  7264. column: source_info.column
  7265. };
  7266. return error;
  7267. },
  7268. negative_log_value: function negative_log_value(source_info) {
  7269. var error = createRuntimeError("negative_log_value", [source_info.line]);
  7270. error.context = {
  7271. line: source_info.line,
  7272. column: source_info.column
  7273. };
  7274. return error;
  7275. },
  7276. invalid_string_index: function invalid_string_index(index, str, source_info) {
  7277. var local_fun_name = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName("$charAt");
  7278. var context = [source_info.line, local_fun_name, index, str, str.length - 1];
  7279. var error = createRuntimeError("invalid_string_index", context);
  7280. error.context = {
  7281. line: source_info.line,
  7282. column: source_info.column
  7283. };
  7284. return error;
  7285. },
  7286. negative_sqrt_value: function negative_sqrt_value(source_info) {
  7287. var error = createRuntimeError("negative_sqrt_value", [source_info.line]);
  7288. error.context = {
  7289. line: source_info.line,
  7290. column: source_info.column
  7291. };
  7292. return error;
  7293. },
  7294. /**
  7295. * @deprecated 01/10/2019
  7296. */
  7297. exceeded_recursive_calls: function exceeded_recursive_calls(source_info) {
  7298. var context = [source_info.line];
  7299. var error = createRuntimeError("exceeded_recursive_calls", context);
  7300. error.context = {
  7301. line: source_info.line,
  7302. column: source_info.column
  7303. };
  7304. return error;
  7305. },
  7306. invalid_for_variable: function invalid_for_variable(id, source_info) {
  7307. var context = [source_info.line, id];
  7308. var error = createSemanticError("invalid_for_variable", context);
  7309. error.context = {
  7310. line: source_info.line,
  7311. column: source_info.column
  7312. };
  7313. return error;
  7314. },
  7315. invalid_for_from: function invalid_for_from(exp, source_info) {
  7316. var context = [source_info.line, exp];
  7317. var error = createSemanticError("invalid_for_from", context);
  7318. error.context = {
  7319. line: source_info.line,
  7320. column: source_info.column
  7321. };
  7322. return error;
  7323. },
  7324. invalid_for_to: function invalid_for_to(exp, source_info) {
  7325. var context = [source_info.line, exp];
  7326. var error = createSemanticError("invalid_for_to", context);
  7327. error.context = {
  7328. line: source_info.line,
  7329. column: source_info.column
  7330. };
  7331. return error;
  7332. },
  7333. invalid_for_pass: function invalid_for_pass(exp, source_info) {
  7334. var context = [source_info.line, exp];
  7335. var error = createSemanticError("invalid_for_pass", context);
  7336. error.context = {
  7337. line: source_info.line,
  7338. column: source_info.column
  7339. };
  7340. return error;
  7341. },
  7342. exceed_max_instructions: function exceed_max_instructions() {
  7343. return createRuntimeError("exceed_max_instructions");
  7344. }
  7345. });
  7346. /***/ }),
  7347. /***/ "./js/processor/error/runtimeError.js":
  7348. /*!********************************************!*\
  7349. !*** ./js/processor/error/runtimeError.js ***!
  7350. \********************************************/
  7351. /*! exports provided: RuntimeError */
  7352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7353. "use strict";
  7354. __webpack_require__.r(__webpack_exports__);
  7355. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuntimeError", function() { return RuntimeError; });
  7356. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7357. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  7358. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  7359. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  7360. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  7361. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__);
  7362. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  7363. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);
  7364. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  7365. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);
  7366. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  7367. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);
  7368. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  7369. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6__);
  7370. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, result); }; }
  7371. 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; } }
  7372. var RuntimeError = /*#__PURE__*/function (_Error) {
  7373. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(RuntimeError, _Error);
  7374. var _super = _createSuper(RuntimeError);
  7375. function RuntimeError(msg, id) {
  7376. var _this;
  7377. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RuntimeError);
  7378. _this = _super.call(this, msg);
  7379. _this.id = id;
  7380. _this._context = {};
  7381. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), RuntimeError);
  7382. return _this;
  7383. }
  7384. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RuntimeError, [{
  7385. key: "context",
  7386. get: function get() {
  7387. return this._context;
  7388. },
  7389. set: function set(contextObj) {
  7390. this._context = contextObj;
  7391. }
  7392. }]);
  7393. return RuntimeError;
  7394. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6___default()(Error));
  7395. /***/ }),
  7396. /***/ "./js/processor/error/semanticError.js":
  7397. /*!*********************************************!*\
  7398. !*** ./js/processor/error/semanticError.js ***!
  7399. \*********************************************/
  7400. /*! exports provided: SemanticError */
  7401. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7402. "use strict";
  7403. __webpack_require__.r(__webpack_exports__);
  7404. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticError", function() { return SemanticError; });
  7405. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7406. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  7407. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  7408. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  7409. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  7410. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__);
  7411. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  7412. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);
  7413. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  7414. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);
  7415. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  7416. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);
  7417. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  7418. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6__);
  7419. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, result); }; }
  7420. 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; } }
  7421. var SemanticError = /*#__PURE__*/function (_Error) {
  7422. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(SemanticError, _Error);
  7423. var _super = _createSuper(SemanticError);
  7424. function SemanticError(msg, id) {
  7425. var _this;
  7426. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticError);
  7427. _this = _super.call(this, msg);
  7428. _this.id = id;
  7429. _this._context = {};
  7430. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), SemanticError);
  7431. return _this;
  7432. }
  7433. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticError, [{
  7434. key: "context",
  7435. get: function get() {
  7436. return this._context;
  7437. },
  7438. set: function set(contextObj) {
  7439. this._context = contextObj;
  7440. }
  7441. }]);
  7442. return SemanticError;
  7443. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_6___default()(Error));
  7444. /***/ }),
  7445. /***/ "./js/processor/ivprogProcessor.js":
  7446. /*!*****************************************!*\
  7447. !*** ./js/processor/ivprogProcessor.js ***!
  7448. \*****************************************/
  7449. /*! exports provided: IVProgProcessor */
  7450. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7451. "use strict";
  7452. __webpack_require__.r(__webpack_exports__);
  7453. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgProcessor", function() { return IVProgProcessor; });
  7454. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
  7455. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
  7456. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  7457. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  7458. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  7459. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  7460. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7461. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);
  7462. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  7463. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);
  7464. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./store/store */ "./js/processor/store/store.ts");
  7465. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_5__);
  7466. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modes */ "./js/processor/modes.ts");
  7467. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  7468. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./context */ "./js/processor/context.ts");
  7469. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_context__WEBPACK_IMPORTED_MODULE_7__);
  7470. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../typeSystem/types */ "./js/typeSystem/types.ts");
  7471. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__);
  7472. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  7473. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  7474. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./definedFunctions */ "./js/processor/definedFunctions.js");
  7475. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./compatibilityTable */ "./js/processor/compatibilityTable.ts");
  7476. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__);
  7477. /* harmony import */ var _ast_commands___WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../ast/commands/ */ "./js/ast/commands/index.js");
  7478. /* harmony import */ var _ast_commands_command__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../ast/commands/command */ "./js/ast/commands/command.js");
  7479. /* harmony import */ var _ast_expressions___WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../ast/expressions/ */ "./js/ast/expressions/index.js");
  7480. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  7481. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  7482. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  7483. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__);
  7484. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  7485. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  7486. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_19__);
  7487. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  7488. /* harmony import */ var _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./error/runtimeError */ "./js/processor/error/runtimeError.js");
  7489. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../memory/location */ "./js/memory/location.ts");
  7490. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_22__);
  7491. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./store/value/store_value */ "./js/processor/store/value/store_value.ts");
  7492. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_23__);
  7493. /* 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");
  7494. /* 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__);
  7495. /* 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");
  7496. /* 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__);
  7497. /* 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");
  7498. /* 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__);
  7499. /* 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");
  7500. /* 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__);
  7501. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  7502. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7503. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7504. var IVProgProcessor = /*#__PURE__*/function () {
  7505. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, null, [{
  7506. key: "MAIN_INTERNAL_ID",
  7507. get: function get() {
  7508. return "$main";
  7509. }
  7510. }]);
  7511. function IVProgProcessor(ast) {
  7512. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, IVProgProcessor);
  7513. this.ast = ast;
  7514. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7515. this.stores = [this.globalStore];
  7516. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7517. this.input = null;
  7518. this.forceKill = false;
  7519. this.output = null;
  7520. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7521. /**
  7522. * Stores the sourceInfo of every function call, command or expression
  7523. */
  7524. this.function_call_stack = [];
  7525. this.instruction_count = 0;
  7526. this.function_call_count = 0;
  7527. }
  7528. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, [{
  7529. key: "registerInput",
  7530. value: function registerInput(input) {
  7531. if (this.input !== null) this.input = null;
  7532. this.input = input;
  7533. }
  7534. }, {
  7535. key: "registerOutput",
  7536. value: function registerOutput(output) {
  7537. if (this.output !== null) this.output = null;
  7538. this.output = output;
  7539. }
  7540. }, {
  7541. key: "checkContext",
  7542. value: function checkContext(context) {
  7543. return this.context[this.context.length - 1] === context;
  7544. }
  7545. }, {
  7546. key: "ignoreSwitchCases",
  7547. value: function ignoreSwitchCases(store) {
  7548. if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN) {
  7549. return true;
  7550. } else if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  7551. return true;
  7552. } else {
  7553. return false;
  7554. }
  7555. }
  7556. }, {
  7557. key: "prepareState",
  7558. value: function prepareState() {
  7559. if (this.stores !== null) {
  7560. for (var i = 0; i < this.stores.length; i++) {
  7561. delete this.stores[i];
  7562. }
  7563. this.stores = null;
  7564. }
  7565. if (this.globalStore !== null) this.globalStore = null;
  7566. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7567. this.stores = [this.globalStore];
  7568. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7569. this.instruction_count = 0;
  7570. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7571. }
  7572. }, {
  7573. key: "interpretAST",
  7574. value: function () {
  7575. var _interpretAST = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee() {
  7576. var mainFunc;
  7577. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  7578. while (1) {
  7579. switch (_context.prev = _context.next) {
  7580. case 0:
  7581. this.prepareState();
  7582. _memory_location__WEBPACK_IMPORTED_MODULE_22__["Location"].clear();
  7583. _context.next = 4;
  7584. return this.initGlobal();
  7585. case 4:
  7586. mainFunc = this.findMainFunction();
  7587. if (!(mainFunc === null)) {
  7588. _context.next = 7;
  7589. break;
  7590. }
  7591. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].main_missing();
  7592. case 7:
  7593. return _context.abrupt("return", this.runFunction(mainFunc, [], this.globalStore));
  7594. case 8:
  7595. case "end":
  7596. return _context.stop();
  7597. }
  7598. }
  7599. }, _callee, this);
  7600. }));
  7601. function interpretAST() {
  7602. return _interpretAST.apply(this, arguments);
  7603. }
  7604. return interpretAST;
  7605. }()
  7606. }, {
  7607. key: "initGlobal",
  7608. value: function () {
  7609. var _initGlobal = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2() {
  7610. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  7611. while (1) {
  7612. switch (_context2.prev = _context2.next) {
  7613. case 0:
  7614. if (this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE)) {
  7615. _context2.next = 2;
  7616. break;
  7617. }
  7618. return _context2.abrupt("return", _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_global_var());
  7619. case 2:
  7620. return _context2.abrupt("return", this.executeCommands(this.globalStore, this.ast.global));
  7621. case 3:
  7622. case "end":
  7623. return _context2.stop();
  7624. }
  7625. }
  7626. }, _callee2, this);
  7627. }));
  7628. function initGlobal() {
  7629. return _initGlobal.apply(this, arguments);
  7630. }
  7631. return initGlobal;
  7632. }()
  7633. }, {
  7634. key: "findMainFunction",
  7635. value: function findMainFunction() {
  7636. return this.ast.functions.find(function (v) {
  7637. return v.isMain;
  7638. });
  7639. }
  7640. }, {
  7641. key: "findFunction",
  7642. value: function findFunction(name) {
  7643. if (name.match(/^\$.+$/)) {
  7644. if (name === IVProgProcessor.MAIN_INTERNAL_ID) {
  7645. return this.findMainFunction();
  7646. }
  7647. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getFunction(name);
  7648. if (!fun) {
  7649. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].not_implemented(name);
  7650. }
  7651. return fun;
  7652. } else {
  7653. var val = this.ast.functions.find(function (v) {
  7654. return v.name === name;
  7655. });
  7656. if (!val) {
  7657. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_missing(name);
  7658. }
  7659. return val;
  7660. }
  7661. }
  7662. }, {
  7663. key: "runFunction",
  7664. value: function () {
  7665. 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) {
  7666. var funcName, funcStore, stoWithVars, finalSto;
  7667. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  7668. while (1) {
  7669. switch (_context3.prev = _context3.next) {
  7670. case 0:
  7671. funcName = func.isMain ? IVProgProcessor.MAIN_INTERNAL_ID : func.name;
  7672. funcStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"](funcName);
  7673. funcStore.extendStore(this.globalStore);
  7674. _context3.next = 5;
  7675. return this.associateParameters(func.formalParameters, actualParameters, store, funcStore);
  7676. case 5:
  7677. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].FUNCTION);
  7678. this.stores.push(funcStore);
  7679. _context3.next = 9;
  7680. return this.executeCommands(funcStore, func.variablesDeclarations);
  7681. case 9:
  7682. stoWithVars = _context3.sent;
  7683. _context3.next = 12;
  7684. return this.executeCommands(stoWithVars, func.commands);
  7685. case 12:
  7686. finalSto = _context3.sent;
  7687. this.stores.pop();
  7688. this.context.pop();
  7689. return _context3.abrupt("return", finalSto);
  7690. case 16:
  7691. case "end":
  7692. return _context3.stop();
  7693. }
  7694. }
  7695. }, _callee3, this);
  7696. }));
  7697. function runFunction(_x, _x2, _x3) {
  7698. return _runFunction.apply(this, arguments);
  7699. }
  7700. return runFunction;
  7701. }()
  7702. /**
  7703. *
  7704. * @param {import('./../ast/commands/formalParameter').FormalParameter[]} formal_params
  7705. * @param {Expression[]} effective_params
  7706. * @param {Store} caller_store
  7707. * @param {Store} callee_store
  7708. */
  7709. }, {
  7710. key: "associateParameters",
  7711. value: function () {
  7712. 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) {
  7713. var funcName, hasVariadic, i, j, formalParameter, _yield$this$associate, _yield$this$associate2, actualParam;
  7714. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  7715. while (1) {
  7716. switch (_context4.prev = _context4.next) {
  7717. case 0:
  7718. funcName = callee_store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : callee_store.name;
  7719. hasVariadic = formal_params.some(function (p) {
  7720. return p.variadic;
  7721. });
  7722. if (!(formal_params.length != effective_params.length && !hasVariadic || formal_params.length > effective_params.length)) {
  7723. _context4.next = 4;
  7724. break;
  7725. }
  7726. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameters_size(funcName, formal_params.length, effective_params.length);
  7727. case 4:
  7728. i = 0, j = 0;
  7729. case 5:
  7730. if (!(i < formal_params.length && j < effective_params.length)) {
  7731. _context4.next = 23;
  7732. break;
  7733. }
  7734. formalParameter = formal_params[i];
  7735. if (!formalParameter.variadic) {
  7736. _context4.next = 16;
  7737. break;
  7738. }
  7739. _context4.next = 10;
  7740. return this.associateVariadicParameter(funcName, formalParameter, j, effective_params, caller_store, callee_store);
  7741. case 10:
  7742. _yield$this$associate = _context4.sent;
  7743. _yield$this$associate2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_yield$this$associate, 2);
  7744. j = _yield$this$associate2[0];
  7745. callee_store = _yield$this$associate2[1];
  7746. _context4.next = 20;
  7747. break;
  7748. case 16:
  7749. actualParam = effective_params[i];
  7750. _context4.next = 19;
  7751. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store);
  7752. case 19:
  7753. callee_store = _context4.sent;
  7754. case 20:
  7755. i += 1, j += 1;
  7756. _context4.next = 5;
  7757. break;
  7758. case 23:
  7759. return _context4.abrupt("return", callee_store);
  7760. case 24:
  7761. case "end":
  7762. return _context4.stop();
  7763. }
  7764. }
  7765. }, _callee4, this);
  7766. }));
  7767. function associateParameters(_x4, _x5, _x6, _x7) {
  7768. return _associateParameters.apply(this, arguments);
  7769. }
  7770. return associateParameters;
  7771. }()
  7772. /**
  7773. *
  7774. * @param {string} funcName
  7775. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7776. * @param {number} index
  7777. * @param {Expression[]} effective_params
  7778. * @param {Store} caller_store
  7779. * @param {Store} callee_store
  7780. */
  7781. }, {
  7782. key: "associateVariadicParameter",
  7783. value: function () {
  7784. 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) {
  7785. var i, count, actualParam, variadicCount;
  7786. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  7787. while (1) {
  7788. switch (_context5.prev = _context5.next) {
  7789. case 0:
  7790. count = 1;
  7791. i = index;
  7792. case 2:
  7793. if (!(i < effective_params.length)) {
  7794. _context5.next = 11;
  7795. break;
  7796. }
  7797. actualParam = effective_params[i];
  7798. _context5.next = 6;
  7799. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store, count);
  7800. case 6:
  7801. callee_store = _context5.sent;
  7802. count += 1;
  7803. case 8:
  7804. i += 1;
  7805. _context5.next = 2;
  7806. break;
  7807. case 11:
  7808. variadicCount = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER, count, undefined, true);
  7809. callee_store.insertStore("".concat(formalParameter.id, ".0"), variadicCount);
  7810. return _context5.abrupt("return", [i - 1, callee_store]);
  7811. case 14:
  7812. case "end":
  7813. return _context5.stop();
  7814. }
  7815. }
  7816. }, _callee5, this);
  7817. }));
  7818. function associateVariadicParameter(_x8, _x9, _x10, _x11, _x12, _x13) {
  7819. return _associateVariadicParameter.apply(this, arguments);
  7820. }
  7821. return associateVariadicParameter;
  7822. }()
  7823. /**
  7824. *
  7825. * @param {string} funcName
  7826. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7827. * @param {Expression} actualParameter
  7828. * @param {Store} callerStore
  7829. * @param {Store} calleeStore
  7830. * @param {number} variadicCount The number of the current value being assigned to the variadic parameter, default 0
  7831. */
  7832. }, {
  7833. key: "associateParameter",
  7834. value: function () {
  7835. 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) {
  7836. var variadicCount,
  7837. actualValue,
  7838. shouldTypeCast,
  7839. realObj,
  7840. ref,
  7841. values,
  7842. array_type,
  7843. addresses,
  7844. columns,
  7845. line,
  7846. column,
  7847. varID,
  7848. realValue,
  7849. _varID,
  7850. _args6 = arguments;
  7851. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  7852. while (1) {
  7853. switch (_context6.prev = _context6.next) {
  7854. case 0:
  7855. variadicCount = _args6.length > 5 && _args6[5] !== undefined ? _args6[5] : 0;
  7856. _context6.next = 3;
  7857. return this.evaluateExpression(callerStore, actualParameter);
  7858. case 3:
  7859. actualValue = _context6.sent;
  7860. shouldTypeCast = false;
  7861. if (formalParameter.type.isCompatible(actualValue.type)) {
  7862. _context6.next = 11;
  7863. break;
  7864. }
  7865. 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))) {
  7866. _context6.next = 10;
  7867. break;
  7868. }
  7869. shouldTypeCast = true;
  7870. _context6.next = 11;
  7871. break;
  7872. case 10:
  7873. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameter_type(funcName, actualParameter.toString());
  7874. case 11:
  7875. if (!(formalParameter.byRef && !actualValue.inStore())) {
  7876. _context6.next = 13;
  7877. break;
  7878. }
  7879. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_ref(funcName, actualParameter.toString());
  7880. case 13:
  7881. if (formalParameter.byRef) {
  7882. realObj = callerStore.getStoreObject(actualValue.id);
  7883. ref = null;
  7884. if (actualValue instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"]) {
  7885. // it's a vector or matrix...
  7886. values = actualValue.get();
  7887. array_type = actualValue.type;
  7888. addresses = values.map(function (v) {
  7889. return realObj.getLocAddressOf(v.line, v.column);
  7890. });
  7891. columns = actualValue.isVector() ? 0 : actualValue.columns;
  7892. ref = new _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__["ArrayStoreValueRef"](array_type, values, addresses, actualValue.lines, columns, realObj.id);
  7893. } else {
  7894. if (actualValue instanceof _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"]) {
  7895. line = actualValue.line;
  7896. column = actualValue.column;
  7897. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.getLocAddressOf(line, column), realObj.id);
  7898. ref.setReferenceDimension(realObj.type.dimensions);
  7899. } else {
  7900. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.locAddress, realObj.id);
  7901. }
  7902. }
  7903. varID = formalParameter.id;
  7904. if (formalParameter.variadic) varID = "".concat(varID, ".").concat(variadicCount);
  7905. calleeStore.insertStore(varID, ref);
  7906. } else {
  7907. realValue = actualValue;
  7908. if (shouldTypeCast) {
  7909. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(formalParameter.type, realValue);
  7910. }
  7911. _varID = formalParameter.id;
  7912. if (formalParameter.variadic) _varID = "".concat(_varID, ".").concat(variadicCount);
  7913. calleeStore.insertStore(_varID, realValue);
  7914. }
  7915. return _context6.abrupt("return", calleeStore);
  7916. case 15:
  7917. case "end":
  7918. return _context6.stop();
  7919. }
  7920. }
  7921. }, _callee6, this);
  7922. }));
  7923. function associateParameter(_x14, _x15, _x16, _x17, _x18) {
  7924. return _associateParameter.apply(this, arguments);
  7925. }
  7926. return associateParameter;
  7927. }()
  7928. /**
  7929. *
  7930. * @param {Store} store
  7931. * @param {Command[]} cmds
  7932. *
  7933. * @returns {Promise<Store>}
  7934. */
  7935. }, {
  7936. key: "executeCommands",
  7937. value: function () {
  7938. 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) {
  7939. var sto, i;
  7940. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  7941. while (1) {
  7942. switch (_context7.prev = _context7.next) {
  7943. case 0:
  7944. // helper to partially apply a function, in this case executeCommand
  7945. sto = store;
  7946. i = 0;
  7947. case 2:
  7948. if (!(i < cmds.length)) {
  7949. _context7.next = 9;
  7950. break;
  7951. }
  7952. _context7.next = 5;
  7953. return this.executeCommand(sto, cmds[i]);
  7954. case 5:
  7955. sto = _context7.sent;
  7956. case 6:
  7957. i += 1;
  7958. _context7.next = 2;
  7959. break;
  7960. case 9:
  7961. return _context7.abrupt("return", sto);
  7962. case 10:
  7963. case "end":
  7964. return _context7.stop();
  7965. }
  7966. }
  7967. }, _callee7, this);
  7968. }));
  7969. function executeCommands(_x19, _x20) {
  7970. return _executeCommands.apply(this, arguments);
  7971. }
  7972. return executeCommands;
  7973. }()
  7974. /**
  7975. *
  7976. * @param {Store} store
  7977. * @param {Command} cmd
  7978. *
  7979. * @returns {Promise<Store>}
  7980. */
  7981. }, {
  7982. key: "executeCommand",
  7983. value: function () {
  7984. 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) {
  7985. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  7986. while (1) {
  7987. switch (_context8.prev = _context8.next) {
  7988. case 0:
  7989. this.instruction_count += 1;
  7990. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  7991. _context8.next = 4;
  7992. break;
  7993. }
  7994. _context8.next = 4;
  7995. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](3);
  7996. case 4:
  7997. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  7998. _context8.next = 8;
  7999. break;
  8000. }
  8001. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceed_max_instructions();
  8002. case 8:
  8003. if (!this.forceKill) {
  8004. _context8.next = 12;
  8005. break;
  8006. }
  8007. throw "FORCED_KILL!";
  8008. case 12:
  8009. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].PAUSE)) {
  8010. _context8.next = 16;
  8011. break;
  8012. }
  8013. return _context8.abrupt("return", this.executeCommand(store, cmd));
  8014. case 16:
  8015. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  8016. _context8.next = 20;
  8017. break;
  8018. }
  8019. return _context8.abrupt("return", store);
  8020. case 20:
  8021. if (!(this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE) && store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8022. _context8.next = 24;
  8023. break;
  8024. }
  8025. return _context8.abrupt("return", store);
  8026. case 24:
  8027. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  8028. _context8.next = 26;
  8029. break;
  8030. }
  8031. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  8032. case 26:
  8033. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Declaration"])) {
  8034. _context8.next = 30;
  8035. break;
  8036. }
  8037. return _context8.abrupt("return", this.executeDeclaration(store, cmd));
  8038. case 30:
  8039. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayIndexAssign"])) {
  8040. _context8.next = 34;
  8041. break;
  8042. }
  8043. return _context8.abrupt("return", this.executeArrayIndexAssign(store, cmd));
  8044. case 34:
  8045. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"])) {
  8046. _context8.next = 38;
  8047. break;
  8048. }
  8049. return _context8.abrupt("return", this.executeAssign(store, cmd));
  8050. case 38:
  8051. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Break"])) {
  8052. _context8.next = 42;
  8053. break;
  8054. }
  8055. return _context8.abrupt("return", this.executeBreak(store, cmd));
  8056. case 42:
  8057. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Return"])) {
  8058. _context8.next = 46;
  8059. break;
  8060. }
  8061. return _context8.abrupt("return", this.executeReturn(store, cmd));
  8062. case 46:
  8063. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  8064. _context8.next = 50;
  8065. break;
  8066. }
  8067. return _context8.abrupt("return", this.executeIfThenElse(store, cmd));
  8068. case 50:
  8069. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["RepeatUntil"])) {
  8070. _context8.next = 54;
  8071. break;
  8072. }
  8073. return _context8.abrupt("return", this.executeRepeatUntil(store, cmd));
  8074. case 54:
  8075. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"])) {
  8076. _context8.next = 58;
  8077. break;
  8078. }
  8079. return _context8.abrupt("return", this.executeWhile(store, cmd));
  8080. case 58:
  8081. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["For"])) {
  8082. _context8.next = 62;
  8083. break;
  8084. }
  8085. return _context8.abrupt("return", this.executeFor(store, cmd));
  8086. case 62:
  8087. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Switch"])) {
  8088. _context8.next = 66;
  8089. break;
  8090. }
  8091. return _context8.abrupt("return", this.executeSwitch(store, cmd));
  8092. case 66:
  8093. if (!(cmd instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  8094. _context8.next = 70;
  8095. break;
  8096. }
  8097. return _context8.abrupt("return", this.executeFunctionCall(store, cmd));
  8098. case 70:
  8099. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["SysCall"])) {
  8100. _context8.next = 74;
  8101. break;
  8102. }
  8103. return _context8.abrupt("return", this.executeSysCall(store, cmd));
  8104. case 74:
  8105. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unknown_command(cmd.sourceInfo);
  8106. case 75:
  8107. case "end":
  8108. return _context8.stop();
  8109. }
  8110. }
  8111. }, _callee8, this);
  8112. }));
  8113. function executeCommand(_x21, _x22) {
  8114. return _executeCommand.apply(this, arguments);
  8115. }
  8116. return executeCommand;
  8117. }()
  8118. /**
  8119. *
  8120. * @param {Store} store
  8121. * @param {Commands.SysCall} cmd
  8122. *
  8123. * @returns {Promise<Store>}
  8124. */
  8125. }, {
  8126. key: "executeSysCall",
  8127. value: function () {
  8128. 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) {
  8129. var func;
  8130. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  8131. while (1) {
  8132. switch (_context9.prev = _context9.next) {
  8133. case 0:
  8134. func = cmd.langFunc.bind(this);
  8135. return _context9.abrupt("return", func(store, cmd));
  8136. case 2:
  8137. case "end":
  8138. return _context9.stop();
  8139. }
  8140. }
  8141. }, _callee9, this);
  8142. }));
  8143. function executeSysCall(_x23, _x24) {
  8144. return _executeSysCall.apply(this, arguments);
  8145. }
  8146. return executeSysCall;
  8147. }()
  8148. /**
  8149. *
  8150. * @param {Store} store
  8151. * @param {Commands.FunctionCall} cmd
  8152. *
  8153. * @returns {Promise<Store>}
  8154. */
  8155. }, {
  8156. key: "executeFunctionCall",
  8157. value: function () {
  8158. 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) {
  8159. var func, sto, funcName;
  8160. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  8161. while (1) {
  8162. switch (_context10.prev = _context10.next) {
  8163. case 0:
  8164. func = null;
  8165. if (cmd.isMainCall) {
  8166. func = this.findMainFunction();
  8167. } else {
  8168. func = this.findFunction(cmd.id);
  8169. }
  8170. this.function_call_stack.push(cmd.sourceInfo);
  8171. _context10.next = 5;
  8172. return this.runFunction(func, cmd.actualParameters, store);
  8173. case 5:
  8174. sto = _context10.sent;
  8175. sto.destroy();
  8176. if (!(!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType) && sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  8177. _context10.next = 12;
  8178. break;
  8179. }
  8180. funcName = func.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : func.name;
  8181. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_no_return(funcName);
  8182. case 12:
  8183. this.function_call_stack.pop();
  8184. return _context10.abrupt("return", store);
  8185. case 14:
  8186. case "end":
  8187. return _context10.stop();
  8188. }
  8189. }
  8190. }, _callee10, this);
  8191. }));
  8192. function executeFunctionCall(_x25, _x26) {
  8193. return _executeFunctionCall.apply(this, arguments);
  8194. }
  8195. return executeFunctionCall;
  8196. }()
  8197. /**
  8198. *
  8199. * @param {Store} store
  8200. * @param {Commands.Switch} cmd
  8201. *
  8202. * @returns {Promise<Store>}
  8203. */
  8204. }, {
  8205. key: "executeSwitch",
  8206. value: function () {
  8207. 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) {
  8208. var switchCases, lastStore, lastCaseCheckResult, i, switchCase, equalityInfixApp, result;
  8209. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  8210. while (1) {
  8211. switch (_context11.prev = _context11.next) {
  8212. case 0:
  8213. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  8214. switchCases = cmd.cases;
  8215. lastStore = store;
  8216. lastCaseCheckResult = false;
  8217. i = 0;
  8218. case 5:
  8219. if (!(i < switchCases.length && !this.ignoreSwitchCases(lastStore))) {
  8220. _context11.next = 26;
  8221. break;
  8222. }
  8223. switchCase = switchCases[i];
  8224. if (!(lastCaseCheckResult || switchCase.isDefault)) {
  8225. _context11.next = 13;
  8226. break;
  8227. }
  8228. _context11.next = 10;
  8229. return this.executeCommands(lastStore, switchCase.commands);
  8230. case 10:
  8231. lastStore = _context11.sent;
  8232. _context11.next = 23;
  8233. break;
  8234. case 13:
  8235. equalityInfixApp = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].EQ, cmd.expression, switchCase.expression);
  8236. equalityInfixApp.sourceInfo = switchCase.sourceInfo;
  8237. _context11.next = 17;
  8238. return this.evaluateExpression(lastStore, equalityInfixApp);
  8239. case 17:
  8240. result = _context11.sent;
  8241. if (!result.get()) {
  8242. _context11.next = 22;
  8243. break;
  8244. }
  8245. _context11.next = 21;
  8246. return this.executeCommands(lastStore, switchCase.commands);
  8247. case 21:
  8248. lastStore = _context11.sent;
  8249. case 22:
  8250. lastCaseCheckResult = result.get();
  8251. case 23:
  8252. i += 1;
  8253. _context11.next = 5;
  8254. break;
  8255. case 26:
  8256. this.context.pop();
  8257. if (lastStore.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  8258. lastStore.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8259. }
  8260. return _context11.abrupt("return", lastStore);
  8261. case 29:
  8262. case "end":
  8263. return _context11.stop();
  8264. }
  8265. }
  8266. }, _callee11, this);
  8267. }));
  8268. function executeSwitch(_x27, _x28) {
  8269. return _executeSwitch.apply(this, arguments);
  8270. }
  8271. return executeSwitch;
  8272. }()
  8273. /**
  8274. *
  8275. * @param {Store} store
  8276. * @param {Commands.For} cmd
  8277. *
  8278. * @returns {Promise<Store>}
  8279. */
  8280. }, {
  8281. key: "executeFor",
  8282. value: function () {
  8283. 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) {
  8284. var initCmd, passValue, condition, checkEndGTBegin, isForward, increment, whileBlock, forAsWhile, newCmdList;
  8285. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  8286. while (1) {
  8287. switch (_context12.prev = _context12.next) {
  8288. case 0:
  8289. //BEGIN for -> while rewrite
  8290. initCmd = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"](cmd.for_id.id, cmd.for_from);
  8291. initCmd.sourceInfo = cmd.sourceInfo; // Assume for is iterating forward and that pass is not missing
  8292. passValue = cmd.for_pass;
  8293. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LT, cmd.for_id, cmd.for_to);
  8294. if (!(cmd.for_pass == null)) {
  8295. _context12.next = 12;
  8296. break;
  8297. }
  8298. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(1));
  8299. _context12.next = 8;
  8300. 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));
  8301. case 8:
  8302. checkEndGTBegin = _context12.sent;
  8303. if (!checkEndGTBegin.get()) {
  8304. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(-1));
  8305. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  8306. }
  8307. _context12.next = 16;
  8308. break;
  8309. case 12:
  8310. _context12.next = 14;
  8311. 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))));
  8312. case 14:
  8313. isForward = _context12.sent;
  8314. if (!isForward.get()) {
  8315. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  8316. }
  8317. case 16:
  8318. condition.sourceInfo = cmd.sourceInfo;
  8319. 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));
  8320. increment.sourceInfo = cmd.sourceInfo;
  8321. whileBlock = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["CommandBlock"]([], cmd.commands.concat(increment));
  8322. forAsWhile = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"](condition, whileBlock);
  8323. forAsWhile.sourceInfo = cmd.sourceInfo; //END for -> while rewrite
  8324. newCmdList = [initCmd, forAsWhile];
  8325. return _context12.abrupt("return", this.executeCommands(store, newCmdList));
  8326. case 24:
  8327. case "end":
  8328. return _context12.stop();
  8329. }
  8330. }
  8331. }, _callee12, this);
  8332. }));
  8333. function executeFor(_x29, _x30) {
  8334. return _executeFor.apply(this, arguments);
  8335. }
  8336. return executeFor;
  8337. }()
  8338. /**
  8339. *
  8340. * @param {Store} store
  8341. * @param {Commands.RepeatUntil} cmd
  8342. *
  8343. * @returns {Promise<Store>}
  8344. */
  8345. }, {
  8346. key: "executeRepeatUntil",
  8347. value: function () {
  8348. 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) {
  8349. var sto, checkCondition;
  8350. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  8351. while (1) {
  8352. switch (_context13.prev = _context13.next) {
  8353. case 0:
  8354. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  8355. _context13.next = 3;
  8356. return this.executeCommands(store, cmd.commands);
  8357. case 3:
  8358. sto = _context13.sent;
  8359. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8360. _context13.next = 8;
  8361. break;
  8362. }
  8363. this.context.pop();
  8364. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8365. return _context13.abrupt("return", sto);
  8366. case 8:
  8367. _context13.next = 10;
  8368. return this.evaluateExpression(sto, cmd.expression);
  8369. case 10:
  8370. checkCondition = _context13.sent;
  8371. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8372. _context13.next = 13;
  8373. break;
  8374. }
  8375. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.sourceInfo);
  8376. case 13:
  8377. this.context.pop();
  8378. if (!checkCondition.get()) {
  8379. _context13.next = 18;
  8380. break;
  8381. }
  8382. return _context13.abrupt("return", sto);
  8383. case 18:
  8384. return _context13.abrupt("return", this.executeCommand(sto, cmd));
  8385. case 19:
  8386. case "end":
  8387. return _context13.stop();
  8388. }
  8389. }
  8390. }, _callee13, this);
  8391. }));
  8392. function executeRepeatUntil(_x31, _x32) {
  8393. return _executeRepeatUntil.apply(this, arguments);
  8394. }
  8395. return executeRepeatUntil;
  8396. }()
  8397. /**
  8398. *
  8399. * @param {Store} store
  8400. * @param {Commands.While} cmd
  8401. *
  8402. * @returns {Promise<Store>}
  8403. */
  8404. }, {
  8405. key: "executeWhile",
  8406. value: function () {
  8407. 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) {
  8408. var checkCondition, sto;
  8409. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee14$(_context14) {
  8410. while (1) {
  8411. switch (_context14.prev = _context14.next) {
  8412. case 0:
  8413. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  8414. _context14.next = 3;
  8415. return this.evaluateExpression(store, cmd.expression);
  8416. case 3:
  8417. checkCondition = _context14.sent;
  8418. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8419. _context14.next = 6;
  8420. break;
  8421. }
  8422. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  8423. case 6:
  8424. if (!checkCondition.get()) {
  8425. _context14.next = 17;
  8426. break;
  8427. }
  8428. _context14.next = 9;
  8429. return this.executeCommands(store, cmd.commands);
  8430. case 9:
  8431. sto = _context14.sent;
  8432. this.context.pop();
  8433. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8434. _context14.next = 14;
  8435. break;
  8436. }
  8437. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8438. return _context14.abrupt("return", sto);
  8439. case 14:
  8440. return _context14.abrupt("return", this.executeCommand(sto, cmd));
  8441. case 17:
  8442. this.context.pop();
  8443. return _context14.abrupt("return", store);
  8444. case 19:
  8445. case "end":
  8446. return _context14.stop();
  8447. }
  8448. }
  8449. }, _callee14, this);
  8450. }));
  8451. function executeWhile(_x33, _x34) {
  8452. return _executeWhile.apply(this, arguments);
  8453. }
  8454. return executeWhile;
  8455. }()
  8456. /**
  8457. *
  8458. * @param {Store} store
  8459. * @param {Commands.IfThenElse} cmd
  8460. *
  8461. * @returns {Promise<Store>}
  8462. */
  8463. }, {
  8464. key: "executeIfThenElse",
  8465. value: function () {
  8466. 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) {
  8467. var isTrue;
  8468. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee15$(_context15) {
  8469. while (1) {
  8470. switch (_context15.prev = _context15.next) {
  8471. case 0:
  8472. _context15.next = 2;
  8473. return this.evaluateExpression(store, cmd.condition);
  8474. case 2:
  8475. isTrue = _context15.sent;
  8476. if (isTrue.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8477. _context15.next = 5;
  8478. break;
  8479. }
  8480. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  8481. case 5:
  8482. if (!isTrue.get()) {
  8483. _context15.next = 9;
  8484. break;
  8485. }
  8486. return _context15.abrupt("return", this.executeCommands(store, cmd.ifTrue.commands));
  8487. case 9:
  8488. if (!(cmd.ifFalse !== null)) {
  8489. _context15.next = 17;
  8490. break;
  8491. }
  8492. if (!(cmd.ifFalse instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  8493. _context15.next = 14;
  8494. break;
  8495. }
  8496. return _context15.abrupt("return", this.executeCommand(store, cmd.ifFalse));
  8497. case 14:
  8498. return _context15.abrupt("return", this.executeCommands(store, cmd.ifFalse.commands));
  8499. case 15:
  8500. _context15.next = 18;
  8501. break;
  8502. case 17:
  8503. return _context15.abrupt("return", store);
  8504. case 18:
  8505. case "end":
  8506. return _context15.stop();
  8507. }
  8508. }
  8509. }, _callee15, this);
  8510. }));
  8511. function executeIfThenElse(_x35, _x36) {
  8512. return _executeIfThenElse.apply(this, arguments);
  8513. }
  8514. return executeIfThenElse;
  8515. }()
  8516. /**
  8517. *
  8518. * @param {Store} store
  8519. * @param {Commands.Return} cmd
  8520. *
  8521. * @returns {Promise<Store>}
  8522. */
  8523. }, {
  8524. key: "executeReturn",
  8525. value: function () {
  8526. 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) {
  8527. var funcName, func, funcType, value, real_value, stringInfo, info;
  8528. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee16$(_context16) {
  8529. while (1) {
  8530. switch (_context16.prev = _context16.next) {
  8531. case 0:
  8532. 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);
  8533. func = this.findFunction(store.name);
  8534. funcType = func.returnType;
  8535. _context16.next = 5;
  8536. return this.evaluateExpression(store, cmd.expression);
  8537. case 5:
  8538. value = _context16.sent;
  8539. if (!(value === null && funcType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID))) {
  8540. _context16.next = 9;
  8541. break;
  8542. }
  8543. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8544. return _context16.abrupt("return", store);
  8545. case 9:
  8546. real_value = value;
  8547. if (!(value === null || !funcType.isCompatible(value.type))) {
  8548. _context16.next = 16;
  8549. break;
  8550. }
  8551. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(funcType, value.type))) {
  8552. _context16.next = 15;
  8553. break;
  8554. }
  8555. stringInfo = funcType.stringInfo();
  8556. info = stringInfo[0];
  8557. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_return_type_full(funcName, info.type, info.dim, cmd.sourceInfo);
  8558. case 15:
  8559. real_value = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(funcType, value);
  8560. case 16:
  8561. store.insertStore("$", real_value);
  8562. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8563. return _context16.abrupt("return", store);
  8564. case 19:
  8565. case "end":
  8566. return _context16.stop();
  8567. }
  8568. }
  8569. }, _callee16, this);
  8570. }));
  8571. function executeReturn(_x37, _x38) {
  8572. return _executeReturn.apply(this, arguments);
  8573. }
  8574. return executeReturn;
  8575. }()
  8576. /**
  8577. *
  8578. * @param {Store} store
  8579. * @param {Commands.Break} cmd
  8580. *
  8581. * @returns {Promise<Store>}
  8582. */
  8583. }, {
  8584. key: "executeBreak",
  8585. value: function () {
  8586. 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) {
  8587. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee17$(_context17) {
  8588. while (1) {
  8589. switch (_context17.prev = _context17.next) {
  8590. case 0:
  8591. if (!this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE)) {
  8592. _context17.next = 5;
  8593. break;
  8594. }
  8595. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK;
  8596. return _context17.abrupt("return", store);
  8597. case 5:
  8598. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unexpected_break_command_full(cmd.sourceInfo);
  8599. case 6:
  8600. case "end":
  8601. return _context17.stop();
  8602. }
  8603. }
  8604. }, _callee17, this);
  8605. }));
  8606. function executeBreak(_x39, _x40) {
  8607. return _executeBreak.apply(this, arguments);
  8608. }
  8609. return executeBreak;
  8610. }()
  8611. /**
  8612. *
  8613. * @param {Store} store
  8614. * @param {Commands.Assign} cmd
  8615. *
  8616. * @returns {Promise<Store>}
  8617. */
  8618. }, {
  8619. key: "executeAssign",
  8620. value: function () {
  8621. 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) {
  8622. var inStore, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp, columns, _exp;
  8623. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee18$(_context18) {
  8624. while (1) {
  8625. switch (_context18.prev = _context18.next) {
  8626. case 0:
  8627. inStore = store.applyStore(cmd.id);
  8628. if (!inStore.isConst) {
  8629. _context18.next = 3;
  8630. break;
  8631. }
  8632. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8633. case 3:
  8634. _context18.next = 5;
  8635. return this.evaluateExpression(store, cmd.expression);
  8636. case 5:
  8637. value = _context18.sent;
  8638. realValue = value;
  8639. if (inStore.type.isCompatible(realValue.type)) {
  8640. _context18.next = 18;
  8641. break;
  8642. }
  8643. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(inStore.type, value.type))) {
  8644. _context18.next = 12;
  8645. break;
  8646. }
  8647. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(inStore.type, realValue);
  8648. _context18.next = 18;
  8649. break;
  8650. case 12:
  8651. stringInfo = inStore.type.stringInfo();
  8652. info = stringInfo[0];
  8653. exp_type_string_info = value.type.stringInfo();
  8654. exp_type_info = exp_type_string_info[0];
  8655. exp = cmd.expression.toString();
  8656. 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);
  8657. case 18:
  8658. if (!(inStore instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8659. _context18.next = 27;
  8660. break;
  8661. }
  8662. columns = realValue.columns == null ? 0 : realValue.columns;
  8663. if (!(inStore.lines !== realValue.lines || inStore.columns !== columns)) {
  8664. _context18.next = 27;
  8665. break;
  8666. }
  8667. _exp = cmd.expression.toString();
  8668. if (!inStore.isVector()) {
  8669. _context18.next = 26;
  8670. break;
  8671. }
  8672. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_vector_assignment_full(cmd.id, inStore.lines, _exp, realValue.lines, cmd.sourceInfo);
  8673. case 26:
  8674. 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);
  8675. case 27:
  8676. store.updateStore(cmd.id, realValue);
  8677. return _context18.abrupt("return", store);
  8678. case 29:
  8679. case "end":
  8680. return _context18.stop();
  8681. }
  8682. }
  8683. }, _callee18, this);
  8684. }));
  8685. function executeAssign(_x41, _x42) {
  8686. return _executeAssign.apply(this, arguments);
  8687. }
  8688. return executeAssign;
  8689. }()
  8690. /**
  8691. *
  8692. * @param {Store} store
  8693. * @param {Commands.ArrayIndexAssign} cmd
  8694. *
  8695. * @returns {Promise<Store>}
  8696. */
  8697. }, {
  8698. key: "executeArrayIndexAssign",
  8699. value: function () {
  8700. 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) {
  8701. var mustBeArray, used_dims, lineSV, line, columnSV, column, value, actualValue, type, stringInfo, info, exp_type_string_info, exp_type_info, exp, current_value, _exp2;
  8702. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee19$(_context19) {
  8703. while (1) {
  8704. switch (_context19.prev = _context19.next) {
  8705. case 0:
  8706. mustBeArray = store.applyStore(cmd.id);
  8707. used_dims = 0;
  8708. if (!mustBeArray.isConst) {
  8709. _context19.next = 4;
  8710. break;
  8711. }
  8712. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8713. case 4:
  8714. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  8715. _context19.next = 6;
  8716. break;
  8717. }
  8718. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  8719. case 6:
  8720. _context19.next = 8;
  8721. return this.evaluateExpression(store, cmd.line);
  8722. case 8:
  8723. lineSV = _context19.sent;
  8724. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  8725. _context19.next = 11;
  8726. break;
  8727. }
  8728. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8729. case 11:
  8730. used_dims += 1;
  8731. line = lineSV.get().toNumber();
  8732. _context19.next = 15;
  8733. return this.evaluateExpression(store, cmd.column);
  8734. case 15:
  8735. columnSV = _context19.sent;
  8736. column = null;
  8737. if (!(columnSV != null)) {
  8738. _context19.next = 22;
  8739. break;
  8740. }
  8741. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  8742. _context19.next = 20;
  8743. break;
  8744. }
  8745. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8746. case 20:
  8747. column = columnSV.get().toNumber();
  8748. used_dims += 1;
  8749. case 22:
  8750. _context19.next = 24;
  8751. return this.evaluateExpression(store, cmd.expression);
  8752. case 24:
  8753. value = _context19.sent;
  8754. actualValue = value;
  8755. if (!(line >= mustBeArray.lines)) {
  8756. _context19.next = 34;
  8757. break;
  8758. }
  8759. if (!mustBeArray.isVector) {
  8760. _context19.next = 31;
  8761. break;
  8762. }
  8763. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8764. case 31:
  8765. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8766. case 32:
  8767. _context19.next = 36;
  8768. break;
  8769. case 34:
  8770. if (!(line < 0)) {
  8771. _context19.next = 36;
  8772. break;
  8773. }
  8774. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8775. case 36:
  8776. if (!(column != null && mustBeArray.columns === 0)) {
  8777. _context19.next = 38;
  8778. break;
  8779. }
  8780. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(cmd.id, cmd.sourceInfo);
  8781. case 38:
  8782. if (!(column != null)) {
  8783. _context19.next = 45;
  8784. break;
  8785. }
  8786. if (!(column >= mustBeArray.columns)) {
  8787. _context19.next = 43;
  8788. break;
  8789. }
  8790. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(cmd.id, column, mustBeArray.columns, cmd.sourceInfo);
  8791. case 43:
  8792. if (!(column < 0)) {
  8793. _context19.next = 45;
  8794. break;
  8795. }
  8796. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8797. case 45:
  8798. if (mustBeArray.type.canAccept(value.type, used_dims)) {
  8799. _context19.next = 55;
  8800. break;
  8801. }
  8802. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(mustBeArray.type.innerType, value.type))) {
  8803. _context19.next = 54;
  8804. break;
  8805. }
  8806. type = mustBeArray.type.innerType;
  8807. stringInfo = type.stringInfo();
  8808. info = stringInfo[0];
  8809. exp_type_string_info = value.type.stringInfo();
  8810. exp_type_info = exp_type_string_info[0];
  8811. exp = cmd.expression.toString();
  8812. 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);
  8813. case 54:
  8814. actualValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(mustBeArray.type.innerType, value);
  8815. case 55:
  8816. current_value = mustBeArray.getAt(line, column);
  8817. if (!(current_value instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8818. _context19.next = 60;
  8819. break;
  8820. }
  8821. if (!(current_value.lines !== actualValue.lines || current_value.columns !== actualValue.columns)) {
  8822. _context19.next = 60;
  8823. break;
  8824. }
  8825. _exp2 = cmd.expression.toString();
  8826. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_matrix_index_assign_full(cmd.id, line, current_value.lines, _exp2, actualValue.lines, cmd.sourceInfo);
  8827. case 60:
  8828. return _context19.abrupt("return", store.updateStoreArray(cmd.id, actualValue, line, column));
  8829. case 61:
  8830. case "end":
  8831. return _context19.stop();
  8832. }
  8833. }
  8834. }, _callee19, this);
  8835. }));
  8836. function executeArrayIndexAssign(_x43, _x44) {
  8837. return _executeArrayIndexAssign.apply(this, arguments);
  8838. }
  8839. return executeArrayIndexAssign;
  8840. }()
  8841. /**
  8842. *
  8843. * @param {Store} store
  8844. * @param {Commands.Declaration} cmd
  8845. *
  8846. * @returns {Promise<Store>}
  8847. */
  8848. }, {
  8849. key: "executeDeclaration",
  8850. value: function () {
  8851. 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) {
  8852. var temp, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp;
  8853. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee20$(_context20) {
  8854. while (1) {
  8855. switch (_context20.prev = _context20.next) {
  8856. case 0:
  8857. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayDeclaration"])) {
  8858. _context20.next = 4;
  8859. break;
  8860. }
  8861. return _context20.abrupt("return", this.executeArrayDeclaration(store, cmd));
  8862. case 4:
  8863. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, null, null, cmd.isConst);
  8864. if (!(cmd.initial !== null)) {
  8865. _context20.next = 22;
  8866. break;
  8867. }
  8868. _context20.next = 8;
  8869. return this.evaluateExpression(store, cmd.initial);
  8870. case 8:
  8871. value = _context20.sent;
  8872. realValue = value;
  8873. if (value.type.isCompatible(cmd.type)) {
  8874. _context20.next = 21;
  8875. break;
  8876. }
  8877. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(cmd.type, value.type))) {
  8878. _context20.next = 15;
  8879. break;
  8880. }
  8881. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(cmd.type, realValue);
  8882. _context20.next = 21;
  8883. break;
  8884. case 15:
  8885. stringInfo = value.type.stringInfo();
  8886. info = stringInfo[0];
  8887. exp_type_string_info = value.type.stringInfo();
  8888. exp_type_info = exp_type_string_info[0];
  8889. exp = cmd.expression.toString();
  8890. 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);
  8891. case 21:
  8892. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, realValue.get(), null, cmd.isConst);
  8893. case 22:
  8894. store.insertStore(cmd.id, temp);
  8895. return _context20.abrupt("return", store);
  8896. case 24:
  8897. case "end":
  8898. return _context20.stop();
  8899. }
  8900. }
  8901. }, _callee20, this);
  8902. }));
  8903. function executeDeclaration(_x45, _x46) {
  8904. return _executeDeclaration.apply(this, arguments);
  8905. }
  8906. return executeDeclaration;
  8907. }()
  8908. /**
  8909. *
  8910. * @param {Store} store
  8911. * @param {Commands.ArrayDeclaration} cmd
  8912. *
  8913. * @returns {Promise<Store>}
  8914. */
  8915. }, {
  8916. key: "executeArrayDeclaration",
  8917. value: function () {
  8918. 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) {
  8919. var linesSV, line, columnsSV, column, temp, valueList;
  8920. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee21$(_context21) {
  8921. while (1) {
  8922. switch (_context21.prev = _context21.next) {
  8923. case 0:
  8924. _context21.next = 2;
  8925. return this.evaluateExpression(store, cmd.lines);
  8926. case 2:
  8927. linesSV = _context21.sent;
  8928. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(linesSV.type)) {
  8929. _context21.next = 5;
  8930. break;
  8931. }
  8932. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8933. case 5:
  8934. line = linesSV.get().toNumber();
  8935. _context21.next = 8;
  8936. return this.evaluateExpression(store, cmd.columns);
  8937. case 8:
  8938. columnsSV = _context21.sent;
  8939. column = null;
  8940. if (!(columnsSV !== null)) {
  8941. _context21.next = 16;
  8942. break;
  8943. }
  8944. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnsSV.type)) {
  8945. _context21.next = 13;
  8946. break;
  8947. }
  8948. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8949. case 13:
  8950. column = columnsSV.get().toNumber();
  8951. if (!(column < 0)) {
  8952. _context21.next = 16;
  8953. break;
  8954. }
  8955. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8956. case 16:
  8957. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, [], line, column, null, cmd.isConst);
  8958. if (!(cmd.initial !== null)) {
  8959. _context21.next = 22;
  8960. break;
  8961. }
  8962. _context21.next = 20;
  8963. return this.evaluateArrayLiteral(store, cmd.initial, cmd.type, line, column);
  8964. case 20:
  8965. valueList = _context21.sent;
  8966. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, valueList, line, column, null, cmd.isConst);
  8967. case 22:
  8968. store.insertStore(cmd.id, temp);
  8969. return _context21.abrupt("return", store);
  8970. case 24:
  8971. case "end":
  8972. return _context21.stop();
  8973. }
  8974. }
  8975. }, _callee21, this);
  8976. }));
  8977. function executeArrayDeclaration(_x47, _x48) {
  8978. return _executeArrayDeclaration.apply(this, arguments);
  8979. }
  8980. return executeArrayDeclaration;
  8981. }()
  8982. /**
  8983. *
  8984. * @param {Store} store
  8985. * @param {Expression} exp
  8986. *
  8987. * @returns {Promise<import('./store/value/istore_value').IStoreValue>}
  8988. */
  8989. }, {
  8990. key: "evaluateExpression",
  8991. value: function () {
  8992. 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) {
  8993. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee22$(_context22) {
  8994. while (1) {
  8995. switch (_context22.prev = _context22.next) {
  8996. case 0:
  8997. this.instruction_count += 1;
  8998. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  8999. _context22.next = 4;
  9000. break;
  9001. }
  9002. _context22.next = 4;
  9003. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](3);
  9004. case 4:
  9005. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  9006. _context22.next = 6;
  9007. break;
  9008. }
  9009. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  9010. case 6:
  9011. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  9012. _context22.next = 8;
  9013. break;
  9014. }
  9015. 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.");
  9016. case 8:
  9017. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["UnaryApp"])) {
  9018. _context22.next = 12;
  9019. break;
  9020. }
  9021. return _context22.abrupt("return", this.evaluateUnaryApp(store, exp));
  9022. case 12:
  9023. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"])) {
  9024. _context22.next = 16;
  9025. break;
  9026. }
  9027. return _context22.abrupt("return", this.evaluateInfixApp(store, exp));
  9028. case 16:
  9029. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayAccess"])) {
  9030. _context22.next = 20;
  9031. break;
  9032. }
  9033. return _context22.abrupt("return", this.evaluateArrayAccess(store, exp));
  9034. case 20:
  9035. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["VariableLiteral"])) {
  9036. _context22.next = 24;
  9037. break;
  9038. }
  9039. return _context22.abrupt("return", this.evaluateVariableLiteral(store, exp));
  9040. case 24:
  9041. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"])) {
  9042. _context22.next = 28;
  9043. break;
  9044. }
  9045. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9046. case 28:
  9047. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["RealLiteral"])) {
  9048. _context22.next = 32;
  9049. break;
  9050. }
  9051. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9052. case 32:
  9053. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["BoolLiteral"])) {
  9054. _context22.next = 36;
  9055. break;
  9056. }
  9057. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9058. case 36:
  9059. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["StringLiteral"])) {
  9060. _context22.next = 40;
  9061. break;
  9062. }
  9063. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9064. case 40:
  9065. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["CharLiteral"])) {
  9066. _context22.next = 44;
  9067. break;
  9068. }
  9069. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9070. case 44:
  9071. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayLiteral"])) {
  9072. _context22.next = 48;
  9073. break;
  9074. }
  9075. throw new Error("Internal Error: The system should not eval an array literal.");
  9076. case 48:
  9077. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  9078. _context22.next = 50;
  9079. break;
  9080. }
  9081. return _context22.abrupt("return", this.evaluateFunctionCall(store, exp));
  9082. case 50:
  9083. return _context22.abrupt("return", null);
  9084. case 51:
  9085. case "end":
  9086. return _context22.stop();
  9087. }
  9088. }
  9089. }, _callee22, this);
  9090. }));
  9091. function evaluateExpression(_x49, _x50) {
  9092. return _evaluateExpression.apply(this, arguments);
  9093. }
  9094. return evaluateExpression;
  9095. }()
  9096. }, {
  9097. key: "evaluateFunctionCall",
  9098. value: function () {
  9099. 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) {
  9100. var func, sto, val;
  9101. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee23$(_context23) {
  9102. while (1) {
  9103. switch (_context23.prev = _context23.next) {
  9104. case 0:
  9105. if (!exp.isMainCall) {
  9106. _context23.next = 2;
  9107. break;
  9108. }
  9109. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName(), exp.sourceInfo);
  9110. case 2:
  9111. func = this.findFunction(exp.id);
  9112. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType)) {
  9113. _context23.next = 5;
  9114. break;
  9115. }
  9116. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(exp.id, exp.sourceInfo);
  9117. case 5:
  9118. if (!(this.function_call_stack.length >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_call_stack)) {
  9119. _context23.next = 7;
  9120. break;
  9121. }
  9122. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceeded_recursive_calls(exp.sourceInfo);
  9123. case 7:
  9124. this.function_call_stack.push(exp.sourceInfo);
  9125. _context23.next = 10;
  9126. return this.runFunction(func, exp.actualParameters, store);
  9127. case 10:
  9128. sto = _context23.sent;
  9129. if (!(sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  9130. _context23.next = 13;
  9131. break;
  9132. }
  9133. 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);
  9134. case 13:
  9135. val = sto.applyStore("$");
  9136. sto.destroy();
  9137. this.function_call_stack.pop();
  9138. return _context23.abrupt("return", val);
  9139. case 17:
  9140. case "end":
  9141. return _context23.stop();
  9142. }
  9143. }
  9144. }, _callee23, this);
  9145. }));
  9146. function evaluateFunctionCall(_x51, _x52) {
  9147. return _evaluateFunctionCall.apply(this, arguments);
  9148. }
  9149. return evaluateFunctionCall;
  9150. }()
  9151. /**
  9152. *
  9153. * @param {Store} store
  9154. * @param {Expressions.ArrayLiteral} exp
  9155. * @param {ArrayType} type
  9156. *
  9157. * @returns {Promise<StoreValue[]>}
  9158. */
  9159. }, {
  9160. key: "evaluateArrayLiteral",
  9161. value: function () {
  9162. 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) {
  9163. var storeValueMatrix;
  9164. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee24$(_context24) {
  9165. while (1) {
  9166. switch (_context24.prev = _context24.next) {
  9167. case 0:
  9168. if (exp.isVector) {
  9169. _context24.next = 9;
  9170. break;
  9171. }
  9172. if (!(columns == null)) {
  9173. _context24.next = 3;
  9174. break;
  9175. }
  9176. throw new Error("This should never happen: Vector cannot be initialized by a matrix");
  9177. case 3:
  9178. _context24.next = 5;
  9179. return this.evaluateMatrix(store, exp, type, lines, columns);
  9180. case 5:
  9181. storeValueMatrix = _context24.sent;
  9182. return _context24.abrupt("return", storeValueMatrix.reduce(function (prev, next) {
  9183. return prev.concat(next);
  9184. }, []));
  9185. case 9:
  9186. if (!(columns != null)) {
  9187. _context24.next = 11;
  9188. break;
  9189. }
  9190. throw new Error("This should never happen: Matrix cannot be initialized by a vector");
  9191. case 11:
  9192. return _context24.abrupt("return", this.evaluateVector(store, exp, type, lines));
  9193. case 12:
  9194. case "end":
  9195. return _context24.stop();
  9196. }
  9197. }
  9198. }, _callee24, this);
  9199. }));
  9200. function evaluateArrayLiteral(_x53, _x54, _x55, _x56, _x57) {
  9201. return _evaluateArrayLiteral.apply(this, arguments);
  9202. }
  9203. return evaluateArrayLiteral;
  9204. }()
  9205. /**
  9206. * Evalautes a list of literals and expression composing the vector
  9207. * @param {Store} store
  9208. * @param {Expressions.ArrayLiteral} exps
  9209. * @param {ArrayType} type
  9210. * @param {number} n_elements
  9211. *
  9212. * @returns {Promise<StoreValue[]>} store object list
  9213. */
  9214. }, {
  9215. key: "evaluateVector",
  9216. value: function () {
  9217. 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) {
  9218. var _this = this;
  9219. var values, actualValues;
  9220. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee25$(_context25) {
  9221. while (1) {
  9222. switch (_context25.prev = _context25.next) {
  9223. case 0:
  9224. values = exps.value;
  9225. if (!(n_elements !== values.length)) {
  9226. _context25.next = 3;
  9227. break;
  9228. }
  9229. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_elements_vector(n_elements, exps.toString(), values.length, exps.sourceInfo);
  9230. case 3:
  9231. _context25.next = 5;
  9232. return Promise.all(values.map(function (exp) {
  9233. return _this.evaluateExpression(store, exp);
  9234. }));
  9235. case 5:
  9236. actualValues = _context25.sent;
  9237. return _context25.abrupt("return", actualValues.map(function (v, index) {
  9238. if (!type.canAccept(v.type, 1)) {
  9239. if (!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(type.innerType, v.type)) {
  9240. // const stringInfo = v.type.stringInfo();
  9241. // const info = stringInfo[0];
  9242. var exp_str = values[index].toString(); // TODO - fix error message
  9243. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_literal_type_full(exp_str, values[index].sourceInfo);
  9244. }
  9245. var newValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(type.innerType, v);
  9246. return newValue;
  9247. }
  9248. return v;
  9249. }));
  9250. case 7:
  9251. case "end":
  9252. return _context25.stop();
  9253. }
  9254. }
  9255. }, _callee25);
  9256. }));
  9257. function evaluateVector(_x58, _x59, _x60, _x61) {
  9258. return _evaluateVector.apply(this, arguments);
  9259. }
  9260. return evaluateVector;
  9261. }()
  9262. /**
  9263. * Evaluates a list of array literals composing the matrix
  9264. * @param {Store} store
  9265. * @param {Expressions.ArrayLiteral} exps
  9266. * @param {ArrayType} type
  9267. *
  9268. * @returns {Promise<StoreValue[][]>}
  9269. */
  9270. }, {
  9271. key: "evaluateMatrix",
  9272. value: function () {
  9273. 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) {
  9274. var _this2 = this;
  9275. var values, vectors;
  9276. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee26$(_context26) {
  9277. while (1) {
  9278. switch (_context26.prev = _context26.next) {
  9279. case 0:
  9280. values = exps.value;
  9281. if (!(values.length !== lines)) {
  9282. _context26.next = 3;
  9283. break;
  9284. }
  9285. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_lines_matrix(lines, exps.toString(), values.length, exps.sourceInfo);
  9286. case 3:
  9287. vectors = values.map(function (vector) {
  9288. var vec_type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"](type.innerType, 1);
  9289. return _this2.evaluateVector(store, vector, vec_type, columns);
  9290. });
  9291. _context26.next = 6;
  9292. return Promise.all(vectors);
  9293. case 6:
  9294. return _context26.abrupt("return", _context26.sent);
  9295. case 7:
  9296. case "end":
  9297. return _context26.stop();
  9298. }
  9299. }
  9300. }, _callee26);
  9301. }));
  9302. function evaluateMatrix(_x62, _x63, _x64, _x65, _x66) {
  9303. return _evaluateMatrix.apply(this, arguments);
  9304. }
  9305. return evaluateMatrix;
  9306. }()
  9307. /**
  9308. *
  9309. * @param {Store} _
  9310. * @param {import('../ast/expressions/literal').Literal} exp
  9311. *
  9312. * @returns {import('./store/value/istore_value').IStoreValue}
  9313. */
  9314. }, {
  9315. key: "evaluateLiteral",
  9316. value: function () {
  9317. 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) {
  9318. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee27$(_context27) {
  9319. while (1) {
  9320. switch (_context27.prev = _context27.next) {
  9321. case 0:
  9322. return _context27.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](exp.type, exp.value));
  9323. case 1:
  9324. case "end":
  9325. return _context27.stop();
  9326. }
  9327. }
  9328. }, _callee27);
  9329. }));
  9330. function evaluateLiteral(_x67, _x68) {
  9331. return _evaluateLiteral.apply(this, arguments);
  9332. }
  9333. return evaluateLiteral;
  9334. }()
  9335. /**
  9336. *
  9337. * @param {Store} store
  9338. * @param {Expressions.VariableLiteral} exp
  9339. *
  9340. * @returns {import('./store/value/istore_value').IStoreValue}
  9341. */
  9342. }, {
  9343. key: "evaluateVariableLiteral",
  9344. value: function () {
  9345. 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) {
  9346. var val;
  9347. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee28$(_context28) {
  9348. while (1) {
  9349. switch (_context28.prev = _context28.next) {
  9350. case 0:
  9351. val = store.applyStore(exp.id);
  9352. return _context28.abrupt("return", val);
  9353. case 2:
  9354. case "end":
  9355. return _context28.stop();
  9356. }
  9357. }
  9358. }, _callee28);
  9359. }));
  9360. function evaluateVariableLiteral(_x69, _x70) {
  9361. return _evaluateVariableLiteral.apply(this, arguments);
  9362. }
  9363. return evaluateVariableLiteral;
  9364. }()
  9365. /**
  9366. *
  9367. * @param {Store} store
  9368. * @param {Expressions.ArrayAccess} exp
  9369. *
  9370. * @returns {import('./store/value/istore_value').IStoreValue}
  9371. */
  9372. }, {
  9373. key: "evaluateArrayAccess",
  9374. value: function () {
  9375. 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) {
  9376. var mustBeArray, lineSV, line, columnSV, column, result, type, values;
  9377. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee29$(_context29) {
  9378. while (1) {
  9379. switch (_context29.prev = _context29.next) {
  9380. case 0:
  9381. mustBeArray = store.getStoreObject(exp.id);
  9382. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  9383. _context29.next = 3;
  9384. break;
  9385. }
  9386. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(exp.id, exp.sourceInfo);
  9387. case 3:
  9388. _context29.next = 5;
  9389. return this.evaluateExpression(store, exp.line);
  9390. case 5:
  9391. lineSV = _context29.sent;
  9392. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  9393. _context29.next = 8;
  9394. break;
  9395. }
  9396. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  9397. case 8:
  9398. line = lineSV.get().toNumber();
  9399. _context29.next = 11;
  9400. return this.evaluateExpression(store, exp.column);
  9401. case 11:
  9402. columnSV = _context29.sent;
  9403. column = null;
  9404. if (!(columnSV !== null)) {
  9405. _context29.next = 17;
  9406. break;
  9407. }
  9408. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  9409. _context29.next = 16;
  9410. break;
  9411. }
  9412. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  9413. case 16:
  9414. column = columnSV.get().toNumber();
  9415. case 17:
  9416. if (!(line >= mustBeArray.lines)) {
  9417. _context29.next = 25;
  9418. break;
  9419. }
  9420. if (!mustBeArray.isVector) {
  9421. _context29.next = 22;
  9422. break;
  9423. }
  9424. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  9425. case 22:
  9426. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  9427. case 23:
  9428. _context29.next = 27;
  9429. break;
  9430. case 25:
  9431. if (!(line < 0)) {
  9432. _context29.next = 27;
  9433. break;
  9434. }
  9435. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9436. case 27:
  9437. if (!(column !== null && mustBeArray.columns === 0)) {
  9438. _context29.next = 29;
  9439. break;
  9440. }
  9441. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(exp.id, exp.sourceInfo);
  9442. case 29:
  9443. if (!(column !== null)) {
  9444. _context29.next = 36;
  9445. break;
  9446. }
  9447. if (!(column >= mustBeArray.columns)) {
  9448. _context29.next = 34;
  9449. break;
  9450. }
  9451. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(exp.id, column, mustBeArray.columns, exp.sourceInfo);
  9452. case 34:
  9453. if (!(column < 0)) {
  9454. _context29.next = 36;
  9455. break;
  9456. }
  9457. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9458. case 36:
  9459. result = mustBeArray.getAt(line, column);
  9460. type = mustBeArray.type.innerType;
  9461. if (!Array.isArray(result)) {
  9462. _context29.next = 43;
  9463. break;
  9464. }
  9465. values = result.map(function (val, col) {
  9466. return new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, val, line, col, mustBeArray.id, mustBeArray.readOnly);
  9467. });
  9468. 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));
  9469. case 43:
  9470. return _context29.abrupt("return", new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, result, line, column, mustBeArray.id, mustBeArray.readOnly));
  9471. case 44:
  9472. case "end":
  9473. return _context29.stop();
  9474. }
  9475. }
  9476. }, _callee29, this);
  9477. }));
  9478. function evaluateArrayAccess(_x71, _x72) {
  9479. return _evaluateArrayAccess.apply(this, arguments);
  9480. }
  9481. return evaluateArrayAccess;
  9482. }()
  9483. /**
  9484. *
  9485. * @param {Store} store
  9486. * @param {Expressions.UnaryApp} unaryApp
  9487. *
  9488. * @returns {import('./store/value/istore_value').IStoreValue}
  9489. */
  9490. }, {
  9491. key: "evaluateUnaryApp",
  9492. value: function () {
  9493. 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) {
  9494. var left, resultType, stringInfo, info;
  9495. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee30$(_context30) {
  9496. while (1) {
  9497. switch (_context30.prev = _context30.next) {
  9498. case 0:
  9499. _context30.next = 2;
  9500. return this.evaluateExpression(store, unaryApp.left);
  9501. case 2:
  9502. left = _context30.sent;
  9503. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterUnaryOp"])(unaryApp.op, left.type);
  9504. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9505. _context30.next = 8;
  9506. break;
  9507. }
  9508. stringInfo = left.type.stringInfo();
  9509. info = stringInfo[0];
  9510. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_unary_op_full(unaryApp.op, info.type, info.dim, unaryApp.sourceInfo);
  9511. case 8:
  9512. _context30.t0 = unaryApp.op.ord;
  9513. _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;
  9514. break;
  9515. case 11:
  9516. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get()));
  9517. case 12:
  9518. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().negated()));
  9519. case 13:
  9520. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, !left.get()));
  9521. case 14:
  9522. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid UnaryApp " + unaryApp.op);
  9523. case 15:
  9524. case "end":
  9525. return _context30.stop();
  9526. }
  9527. }
  9528. }, _callee30, this);
  9529. }));
  9530. function evaluateUnaryApp(_x73, _x74) {
  9531. return _evaluateUnaryApp.apply(this, arguments);
  9532. }
  9533. return evaluateUnaryApp;
  9534. }()
  9535. /**
  9536. *
  9537. * @param {Store} store
  9538. * @param {Expressions.InfixApp} infixApp
  9539. *
  9540. * @returns {import('./store/value/istore_value').IStoreValue}
  9541. */
  9542. }, {
  9543. key: "evaluateInfixApp",
  9544. value: function () {
  9545. 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) {
  9546. 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;
  9547. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee31$(_context31) {
  9548. while (1) {
  9549. switch (_context31.prev = _context31.next) {
  9550. case 0:
  9551. _context31.next = 2;
  9552. return this.evaluateExpression(store, infixApp.left);
  9553. case 2:
  9554. left = _context31.sent;
  9555. _context31.next = 5;
  9556. return this.evaluateExpression(store, infixApp.right);
  9557. case 5:
  9558. right = _context31.sent;
  9559. shouldImplicitCast = false;
  9560. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterInfixOp"])(infixApp.op, left.type, right.type);
  9561. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9562. _context31.next = 18;
  9563. break;
  9564. }
  9565. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(left.type, right.type))) {
  9566. _context31.next = 13;
  9567. break;
  9568. }
  9569. shouldImplicitCast = true;
  9570. _context31.next = 18;
  9571. break;
  9572. case 13:
  9573. stringInfoLeft = left.type.stringInfo();
  9574. infoLeft = stringInfoLeft[0];
  9575. stringInfoRight = right.type.stringInfo();
  9576. infoRight = stringInfoRight[0];
  9577. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_infix_op_full(infixApp.op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, infixApp.sourceInfo);
  9578. case 18:
  9579. result = null;
  9580. _context31.t0 = infixApp.op.ord;
  9581. _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;
  9582. break;
  9583. case 22:
  9584. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9585. _context31.next = 27;
  9586. break;
  9587. }
  9588. rightStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9589. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() + rightStr));
  9590. case 27:
  9591. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(right.type)) {
  9592. _context31.next = 32;
  9593. break;
  9594. }
  9595. leftStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9596. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, leftStr + right.get()));
  9597. case 32:
  9598. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9599. _context31.next = 38;
  9600. break;
  9601. }
  9602. strLeft = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9603. strRight = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9604. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, strLeft + strRight));
  9605. case 38:
  9606. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().plus(right.get())));
  9607. case 39:
  9608. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().minus(right.get())));
  9609. case 40:
  9610. result = left.get().times(right.get());
  9611. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9612. case 42:
  9613. if (!(right.get() == 0)) {
  9614. _context31.next = 44;
  9615. break;
  9616. }
  9617. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].divsion_by_zero_full(infixApp.toString(), infixApp.sourceInfo);
  9618. case 44:
  9619. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(resultType)) result = left.get().divToInt(right.get());else result = left.get().div(right.get());
  9620. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9621. case 46:
  9622. leftValue = left.get();
  9623. rightValue = right.get();
  9624. if (shouldImplicitCast) {
  9625. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER;
  9626. leftValue = leftValue.trunc();
  9627. rightValue = rightValue.trunc();
  9628. }
  9629. result = leftValue.modulo(rightValue);
  9630. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9631. case 51:
  9632. _leftValue = left.get();
  9633. _rightValue = right.get();
  9634. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9635. result = _leftValue.length > _rightValue.length;
  9636. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9637. result = _leftValue.charCodeAt(0) > _rightValue.charCodeAt(0);
  9638. } else {
  9639. if (shouldImplicitCast) {
  9640. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9641. _leftValue = _leftValue.trunc();
  9642. _rightValue = _rightValue.trunc();
  9643. }
  9644. result = _leftValue.gt(_rightValue);
  9645. }
  9646. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9647. case 55:
  9648. _leftValue2 = left.get();
  9649. _rightValue2 = right.get();
  9650. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9651. result = _leftValue2.length >= _rightValue2.length;
  9652. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9653. result = _leftValue2.charCodeAt(0) >= _rightValue2.charCodeAt(0);
  9654. } else {
  9655. if (shouldImplicitCast) {
  9656. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9657. _leftValue2 = _leftValue2.trunc();
  9658. _rightValue2 = _rightValue2.trunc();
  9659. }
  9660. result = _leftValue2.gte(_rightValue2);
  9661. }
  9662. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9663. case 59:
  9664. _leftValue3 = left.get();
  9665. _rightValue3 = right.get();
  9666. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9667. result = _leftValue3.length < _rightValue3.length;
  9668. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9669. result = _leftValue3.charCodeAt(0) < _rightValue3.charCodeAt(0);
  9670. } else {
  9671. if (shouldImplicitCast) {
  9672. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9673. _leftValue3 = _leftValue3.trunc();
  9674. _rightValue3 = _rightValue3.trunc();
  9675. }
  9676. result = _leftValue3.lt(_rightValue3);
  9677. }
  9678. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9679. case 63:
  9680. _leftValue4 = left.get();
  9681. _rightValue4 = right.get();
  9682. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9683. result = _leftValue4.length <= _rightValue4.length;
  9684. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9685. result = _leftValue4.charCodeAt(0) <= _rightValue4.charCodeAt(0);
  9686. } else {
  9687. if (shouldImplicitCast) {
  9688. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9689. _leftValue4 = _leftValue4.trunc();
  9690. _rightValue4 = _rightValue4.trunc();
  9691. }
  9692. result = _leftValue4.lte(_rightValue4);
  9693. }
  9694. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9695. case 67:
  9696. _leftValue5 = left.get();
  9697. _rightValue5 = right.get();
  9698. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9699. if (shouldImplicitCast) {
  9700. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9701. _leftValue5 = _leftValue5.trunc();
  9702. _rightValue5 = _rightValue5.trunc();
  9703. }
  9704. result = _leftValue5.eq(_rightValue5);
  9705. } else {
  9706. result = _leftValue5 === _rightValue5;
  9707. }
  9708. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9709. case 71:
  9710. _leftValue6 = left.get();
  9711. _rightValue6 = right.get();
  9712. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9713. if (shouldImplicitCast) {
  9714. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9715. _leftValue6 = _leftValue6.trunc();
  9716. _rightValue6 = _rightValue6.trunc();
  9717. }
  9718. result = !_leftValue6.eq(_rightValue6);
  9719. } else {
  9720. result = _leftValue6 !== _rightValue6;
  9721. }
  9722. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9723. case 75:
  9724. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() && right.get()));
  9725. case 76:
  9726. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() || right.get()));
  9727. case 77:
  9728. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid InfixApp " + infixApp.op);
  9729. case 78:
  9730. case "end":
  9731. return _context31.stop();
  9732. }
  9733. }
  9734. }, _callee31, this);
  9735. }));
  9736. function evaluateInfixApp(_x75, _x76) {
  9737. return _evaluateInfixApp.apply(this, arguments);
  9738. }
  9739. return evaluateInfixApp;
  9740. }()
  9741. }]);
  9742. return IVProgProcessor;
  9743. }();
  9744. /***/ }),
  9745. /***/ "./js/processor/lib/arrays.js":
  9746. /*!************************************!*\
  9747. !*** ./js/processor/lib/arrays.js ***!
  9748. \************************************/
  9749. /*! exports provided: createNumElementsFun, createMatrixLinesFun, createMatrixColumnsFun */
  9750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9751. "use strict";
  9752. __webpack_require__.r(__webpack_exports__);
  9753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumElementsFun", function() { return createNumElementsFun; });
  9754. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixLinesFun", function() { return createMatrixLinesFun; });
  9755. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixColumnsFun", function() { return createMatrixColumnsFun; });
  9756. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9757. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9758. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9759. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9760. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9761. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9762. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  9763. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9764. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  9765. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__);
  9766. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9767. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  9768. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9769. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  9770. /**
  9771. * num_elements
  9772. * matrix_lines
  9773. * matrix_columns
  9774. */
  9775. function createNumElementsFun() {
  9776. var numElementsFun = /*#__PURE__*/function () {
  9777. 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, _) {
  9778. var vector, temp;
  9779. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9780. while (1) {
  9781. switch (_context.prev = _context.next) {
  9782. case 0:
  9783. vector = sto.applyStore("vector");
  9784. 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));
  9785. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9786. sto.insertStore("$", temp);
  9787. return _context.abrupt("return", sto);
  9788. case 5:
  9789. case "end":
  9790. return _context.stop();
  9791. }
  9792. }
  9793. }, _callee);
  9794. }));
  9795. return function numElementsFun(_x, _x2) {
  9796. return _ref.apply(this, arguments);
  9797. };
  9798. }();
  9799. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](numElementsFun)]);
  9800. 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);
  9801. return func;
  9802. }
  9803. function createMatrixLinesFun() {
  9804. var matrixLinesFun = /*#__PURE__*/function () {
  9805. 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, _) {
  9806. var matrix, temp;
  9807. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9808. while (1) {
  9809. switch (_context2.prev = _context2.next) {
  9810. case 0:
  9811. matrix = sto.applyStore("matrix");
  9812. 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));
  9813. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9814. sto.insertStore("$", temp);
  9815. return _context2.abrupt("return", sto);
  9816. case 5:
  9817. case "end":
  9818. return _context2.stop();
  9819. }
  9820. }
  9821. }, _callee2);
  9822. }));
  9823. return function matrixLinesFun(_x3, _x4) {
  9824. return _ref2.apply(this, arguments);
  9825. };
  9826. }();
  9827. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixLinesFun)]);
  9828. 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);
  9829. return func;
  9830. }
  9831. function createMatrixColumnsFun() {
  9832. var matrixColumnsFun = /*#__PURE__*/function () {
  9833. 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, _) {
  9834. var matrix, temp;
  9835. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  9836. while (1) {
  9837. switch (_context3.prev = _context3.next) {
  9838. case 0:
  9839. matrix = sto.applyStore("matrix");
  9840. 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));
  9841. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9842. sto.insertStore("$", temp);
  9843. return _context3.abrupt("return", sto);
  9844. case 5:
  9845. case "end":
  9846. return _context3.stop();
  9847. }
  9848. }
  9849. }, _callee3);
  9850. }));
  9851. return function matrixColumnsFun(_x5, _x6) {
  9852. return _ref3.apply(this, arguments);
  9853. };
  9854. }();
  9855. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixColumnsFun)]);
  9856. 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);
  9857. return func;
  9858. }
  9859. /***/ }),
  9860. /***/ "./js/processor/lib/io.js":
  9861. /*!********************************!*\
  9862. !*** ./js/processor/lib/io.js ***!
  9863. \********************************/
  9864. /*! exports provided: createOutputFun, createInputFun */
  9865. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9866. "use strict";
  9867. __webpack_require__.r(__webpack_exports__);
  9868. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createOutputFun", function() { return createOutputFun; });
  9869. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInputFun", function() { return createInputFun; });
  9870. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9871. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9872. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9873. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9874. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9875. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9876. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_3__);
  9877. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9878. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9879. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__);
  9880. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9881. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9882. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  9883. function createOutputFun() {
  9884. var writeFunction = /*#__PURE__*/function () {
  9885. 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, _) {
  9886. var totalSV, total, i, val;
  9887. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9888. while (1) {
  9889. switch (_context.prev = _context.next) {
  9890. case 0:
  9891. totalSV = store.applyStore("p1.0");
  9892. total = totalSV.get();
  9893. for (i = 1; i < total; i += 1) {
  9894. val = store.applyStore("p1.".concat(i));
  9895. this.output.sendOutput(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type));
  9896. }
  9897. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9898. return _context.abrupt("return", store);
  9899. case 5:
  9900. case "end":
  9901. return _context.stop();
  9902. }
  9903. }
  9904. }, _callee, this);
  9905. }));
  9906. return function writeFunction(_x, _x2) {
  9907. return _ref.apply(this, arguments);
  9908. };
  9909. }();
  9910. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](writeFunction)]);
  9911. 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);
  9912. return func;
  9913. }
  9914. function createInputFun() {
  9915. var readFunction = /*#__PURE__*/function () {
  9916. 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, _) {
  9917. var text, typeToConvert, type, result, stringInfo, realObject, arrayInfo, dim, stoValue;
  9918. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9919. while (1) {
  9920. switch (_context2.prev = _context2.next) {
  9921. case 0:
  9922. _context2.next = 2;
  9923. return this.input.requestInput();
  9924. case 2:
  9925. text = _context2.sent;
  9926. typeToConvert = store.applyStore("p1").type;
  9927. type = null;
  9928. result = null;
  9929. _context2.prev = 6;
  9930. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER)) {
  9931. _context2.next = 12;
  9932. break;
  9933. }
  9934. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"](text.trim()).trunc();
  9935. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER;
  9936. _context2.next = 33;
  9937. break;
  9938. case 12:
  9939. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL)) {
  9940. _context2.next = 17;
  9941. break;
  9942. }
  9943. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toReal"](text.trim());
  9944. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL;
  9945. _context2.next = 33;
  9946. break;
  9947. case 17:
  9948. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN)) {
  9949. _context2.next = 22;
  9950. break;
  9951. }
  9952. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toBool"](text.trim());
  9953. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN;
  9954. _context2.next = 33;
  9955. break;
  9956. case 22:
  9957. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING)) {
  9958. _context2.next = 27;
  9959. break;
  9960. }
  9961. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toString"](text);
  9962. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING;
  9963. _context2.next = 33;
  9964. break;
  9965. case 27:
  9966. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR)) {
  9967. _context2.next = 32;
  9968. break;
  9969. }
  9970. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toChar"](text);
  9971. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR;
  9972. _context2.next = 33;
  9973. break;
  9974. case 32:
  9975. throw new Error("!!!!Critical error: Unknown type in readFunction!!!!");
  9976. case 33:
  9977. _context2.next = 47;
  9978. break;
  9979. case 35:
  9980. _context2.prev = 35;
  9981. _context2.t0 = _context2["catch"](6);
  9982. if (!(this.mode == _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].ABORT)) {
  9983. _context2.next = 40;
  9984. break;
  9985. }
  9986. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9987. return _context2.abrupt("return", store);
  9988. case 40:
  9989. stringInfo = typeToConvert.stringInfo()[0];
  9990. realObject = store.getStoreObject("p1");
  9991. if (!(realObject.getReferenceDimension() > 0)) {
  9992. _context2.next = 46;
  9993. break;
  9994. }
  9995. arrayInfo = realObject.type.stringInfo()[0];
  9996. dim = realObject.getReferenceDimension();
  9997. 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());
  9998. case 46:
  9999. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__["ProcessorErrorFactory"].invalid_read_type(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), this.function_call_stack.pop());
  10000. case 47:
  10001. stoValue = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](type, result);
  10002. store.updateStore("p1", stoValue);
  10003. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  10004. return _context2.abrupt("return", store);
  10005. case 51:
  10006. case "end":
  10007. return _context2.stop();
  10008. }
  10009. }
  10010. }, _callee2, this, [[6, 35]]);
  10011. }));
  10012. return function readFunction(_x3, _x4) {
  10013. return _ref2.apply(this, arguments);
  10014. };
  10015. }();
  10016. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](readFunction)]);
  10017. 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);
  10018. return func;
  10019. }
  10020. /***/ }),
  10021. /***/ "./js/processor/lib/lang.js":
  10022. /*!**********************************!*\
  10023. !*** ./js/processor/lib/lang.js ***!
  10024. \**********************************/
  10025. /*! exports provided: createIsRealFun, createIsIntFun, createIsBoolFun, createCastRealFun, createCastIntFun, createCastBoolFun, createCastStringFun, createCastCharFun */
  10026. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10027. "use strict";
  10028. __webpack_require__.r(__webpack_exports__);
  10029. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsRealFun", function() { return createIsRealFun; });
  10030. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsIntFun", function() { return createIsIntFun; });
  10031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsBoolFun", function() { return createIsBoolFun; });
  10032. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastRealFun", function() { return createCastRealFun; });
  10033. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastIntFun", function() { return createCastIntFun; });
  10034. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastBoolFun", function() { return createCastBoolFun; });
  10035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastStringFun", function() { return createCastStringFun; });
  10036. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastCharFun", function() { return createCastCharFun; });
  10037. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10038. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  10039. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10040. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  10041. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10042. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10043. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  10044. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10045. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  10046. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  10047. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10048. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_7__);
  10049. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  10050. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__);
  10051. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10052. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10053. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  10054. /**
  10055. *
  10056. * is_real
  10057. * is_int
  10058. * is_bool
  10059. * cast_real
  10060. * cast_int
  10061. * cast_bool
  10062. * cast_string
  10063. * cast_char
  10064. */
  10065. function createIsRealFun() {
  10066. var isRealFun = /*#__PURE__*/function () {
  10067. 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, _) {
  10068. var str, parser, result, val, temp;
  10069. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  10070. while (1) {
  10071. switch (_context.prev = _context.next) {
  10072. case 0:
  10073. str = sto.applyStore("str");
  10074. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  10075. result = false;
  10076. try {
  10077. val = parser.parseTerm();
  10078. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"]) {
  10079. result = true;
  10080. }
  10081. } catch (error) {// ignore
  10082. }
  10083. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  10084. sto.insertStore("$", temp);
  10085. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10086. return _context.abrupt("return", sto);
  10087. case 8:
  10088. case "end":
  10089. return _context.stop();
  10090. }
  10091. }
  10092. }, _callee);
  10093. }));
  10094. return function isRealFun(_x, _x2) {
  10095. return _ref.apply(this, arguments);
  10096. };
  10097. }();
  10098. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isRealFun)]);
  10099. 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);
  10100. return func;
  10101. }
  10102. function createIsIntFun() {
  10103. var isIntFun = /*#__PURE__*/function () {
  10104. 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, _) {
  10105. var str, parser, result, val, temp;
  10106. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  10107. while (1) {
  10108. switch (_context2.prev = _context2.next) {
  10109. case 0:
  10110. str = sto.applyStore("str");
  10111. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  10112. result = false;
  10113. try {
  10114. val = parser.parseTerm();
  10115. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"]) {
  10116. result = true;
  10117. }
  10118. } catch (_unused) {// ignore
  10119. }
  10120. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  10121. sto.insertStore("$", temp);
  10122. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10123. return _context2.abrupt("return", sto);
  10124. case 8:
  10125. case "end":
  10126. return _context2.stop();
  10127. }
  10128. }
  10129. }, _callee2);
  10130. }));
  10131. return function isIntFun(_x3, _x4) {
  10132. return _ref2.apply(this, arguments);
  10133. };
  10134. }();
  10135. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isIntFun)]);
  10136. 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);
  10137. return func;
  10138. }
  10139. function createIsBoolFun() {
  10140. var isBoolFun = function isBoolFun(sto, _) {
  10141. var str = sto.applyStore("str");
  10142. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  10143. var result = false;
  10144. try {
  10145. var val = parser.parseTerm();
  10146. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"]) {
  10147. result = true;
  10148. }
  10149. } catch (error) {// ignore
  10150. }
  10151. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  10152. sto.insertStore("$", temp);
  10153. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10154. return sto;
  10155. };
  10156. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isBoolFun)]);
  10157. 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);
  10158. return func;
  10159. }
  10160. function createCastRealFun() {
  10161. var castRealFun = /*#__PURE__*/function () {
  10162. 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, _) {
  10163. var val, value, temp, parser, result, _temp, typeStringInfoArray, typeInfo;
  10164. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  10165. while (1) {
  10166. switch (_context3.prev = _context3.next) {
  10167. case 0:
  10168. val = sto.applyStore("val");
  10169. value = val.get();
  10170. _context3.t0 = val.type.ord;
  10171. _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;
  10172. break;
  10173. case 5:
  10174. value = value.toNumber();
  10175. 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));
  10176. sto.insertStore("$", temp);
  10177. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10178. return _context3.abrupt("return", sto);
  10179. case 10:
  10180. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  10181. _context3.prev = 11;
  10182. result = parser.parseTerm();
  10183. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"])) {
  10184. _context3.next = 18;
  10185. break;
  10186. }
  10187. _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"](result.value));
  10188. sto.insertStore("$", _temp);
  10189. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10190. return _context3.abrupt("return", sto);
  10191. case 18:
  10192. _context3.next = 22;
  10193. break;
  10194. case 20:
  10195. _context3.prev = 20;
  10196. _context3.t1 = _context3["catch"](11);
  10197. case 22:
  10198. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.stringInfo();
  10199. typeInfo = typeStringInfoArray[0];
  10200. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  10201. case 25:
  10202. case "end":
  10203. return _context3.stop();
  10204. }
  10205. }
  10206. }, _callee3, null, [[11, 20]]);
  10207. }));
  10208. return function castRealFun(_x5, _x6) {
  10209. return _ref3.apply(this, arguments);
  10210. };
  10211. }();
  10212. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castRealFun)]);
  10213. 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);
  10214. return func;
  10215. }
  10216. function createCastIntFun() {
  10217. var castIntFun = /*#__PURE__*/function () {
  10218. 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, _) {
  10219. var val, value, temp, _temp2, parser, result, _temp3, typeStringInfoArray, typeInfo;
  10220. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  10221. while (1) {
  10222. switch (_context4.prev = _context4.next) {
  10223. case 0:
  10224. val = sto.applyStore("val");
  10225. value = val.get();
  10226. _context4.t0 = val.type.ord;
  10227. _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;
  10228. break;
  10229. case 5:
  10230. value = value.toNumber();
  10231. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"](Math.floor(value)));
  10232. sto.insertStore("$", temp);
  10233. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10234. return _context4.abrupt("return", sto);
  10235. case 10:
  10236. _temp2 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"](value.charCodeAt(0)));
  10237. sto.insertStore("$", _temp2);
  10238. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10239. return _context4.abrupt("return", sto);
  10240. case 14:
  10241. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  10242. _context4.prev = 15;
  10243. result = parser.parseTerm();
  10244. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"])) {
  10245. _context4.next = 22;
  10246. break;
  10247. }
  10248. _temp3 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"](result.value));
  10249. sto.insertStore("$", _temp3);
  10250. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10251. return _context4.abrupt("return", sto);
  10252. case 22:
  10253. _context4.next = 26;
  10254. break;
  10255. case 24:
  10256. _context4.prev = 24;
  10257. _context4.t1 = _context4["catch"](15);
  10258. case 26:
  10259. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.stringInfo();
  10260. typeInfo = typeStringInfoArray[0];
  10261. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  10262. case 29:
  10263. case "end":
  10264. return _context4.stop();
  10265. }
  10266. }
  10267. }, _callee4, null, [[15, 24]]);
  10268. }));
  10269. return function castIntFun(_x7, _x8) {
  10270. return _ref4.apply(this, arguments);
  10271. };
  10272. }();
  10273. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castIntFun)]);
  10274. 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, _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR]), "val", false)], block);
  10275. return func;
  10276. }
  10277. function createCastBoolFun() {
  10278. var castBoolFun = /*#__PURE__*/function () {
  10279. 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, _) {
  10280. var str, value, parser, val, temp, typeStringInfoArray, typeInfo;
  10281. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  10282. while (1) {
  10283. switch (_context5.prev = _context5.next) {
  10284. case 0:
  10285. str = sto.applyStore("str");
  10286. value = str.get();
  10287. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  10288. _context5.prev = 3;
  10289. val = parser.parseTerm();
  10290. if (!(val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"])) {
  10291. _context5.next = 10;
  10292. break;
  10293. }
  10294. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, val.value);
  10295. sto.insertStore("$", temp);
  10296. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10297. return _context5.abrupt("return", sto);
  10298. case 10:
  10299. _context5.next = 14;
  10300. break;
  10301. case 12:
  10302. _context5.prev = 12;
  10303. _context5.t0 = _context5["catch"](3);
  10304. case 14:
  10305. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN.stringInfo();
  10306. typeInfo = typeStringInfoArray[0];
  10307. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  10308. case 17:
  10309. case "end":
  10310. return _context5.stop();
  10311. }
  10312. }
  10313. }, _callee5, null, [[3, 12]]);
  10314. }));
  10315. return function castBoolFun(_x9, _x10) {
  10316. return _ref5.apply(this, arguments);
  10317. };
  10318. }();
  10319. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castBoolFun)]);
  10320. 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);
  10321. return func;
  10322. }
  10323. function createCastStringFun() {
  10324. var castStringFun = /*#__PURE__*/function () {
  10325. 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, _) {
  10326. var val, result, temp;
  10327. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee6$(_context6) {
  10328. while (1) {
  10329. switch (_context6.prev = _context6.next) {
  10330. case 0:
  10331. val = store.applyStore("str");
  10332. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type);
  10333. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  10334. store.insertStore("$", temp);
  10335. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10336. return _context6.abrupt("return", store);
  10337. case 6:
  10338. case "end":
  10339. return _context6.stop();
  10340. }
  10341. }
  10342. }, _callee6);
  10343. }));
  10344. return function castStringFun(_x11, _x12) {
  10345. return _ref6.apply(this, arguments);
  10346. };
  10347. }();
  10348. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castStringFun)]);
  10349. 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);
  10350. return func;
  10351. }
  10352. function createCastCharFun() {
  10353. var castCharFun = function castCharFun(store, _) {
  10354. var valSV = store.applyStore("charCode"); // Force the int value to the range [0, 255]
  10355. var value = valSV.get().toNumber() & 0xff;
  10356. var result = String.fromCharCode(value);
  10357. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, result);
  10358. store.insertStore("$", temp);
  10359. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10360. return store;
  10361. };
  10362. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castCharFun)]);
  10363. 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);
  10364. return func;
  10365. }
  10366. /***/ }),
  10367. /***/ "./js/processor/lib/math.js":
  10368. /*!**********************************!*\
  10369. !*** ./js/processor/lib/math.js ***!
  10370. \**********************************/
  10371. /*! exports provided: createSinFun, createCosFun, createTanFun, createSqrtFun, createPowFun, createLogFun, createAbsFun, createNegateFun, createInvertFun, createMaxFun, createMinFun, createRandFun, createSetSeedFun */
  10372. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10373. "use strict";
  10374. __webpack_require__.r(__webpack_exports__);
  10375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSinFun", function() { return createSinFun; });
  10376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCosFun", function() { return createCosFun; });
  10377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTanFun", function() { return createTanFun; });
  10378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSqrtFun", function() { return createSqrtFun; });
  10379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPowFun", function() { return createPowFun; });
  10380. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLogFun", function() { return createLogFun; });
  10381. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAbsFun", function() { return createAbsFun; });
  10382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNegateFun", function() { return createNegateFun; });
  10383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInvertFun", function() { return createInvertFun; });
  10384. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMaxFun", function() { return createMaxFun; });
  10385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMinFun", function() { return createMinFun; });
  10386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRandFun", function() { return createRandFun; });
  10387. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSetSeedFun", function() { return createSetSeedFun; });
  10388. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  10389. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  10390. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10391. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  10392. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10393. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  10394. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10395. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10396. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__);
  10397. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10398. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  10399. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_6__);
  10400. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  10401. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__);
  10402. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  10403. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  10404. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10405. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_9__);
  10406. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10407. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  10408. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10409. /**
  10410. * sin
  10411. * cos
  10412. * tan
  10413. * sqrt
  10414. * pow
  10415. * log
  10416. * abs
  10417. * negate
  10418. * invert
  10419. * max
  10420. * min
  10421. */
  10422. function convertToRadians(degrees) {
  10423. return degrees.times(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].acos(-1)).div(180);
  10424. }
  10425. function createSinFun() {
  10426. var sinFun = /*#__PURE__*/function () {
  10427. 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, _) {
  10428. var x, angle, result, temp;
  10429. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  10430. while (1) {
  10431. switch (_context.prev = _context.next) {
  10432. case 0:
  10433. x = sto.applyStore('x');
  10434. angle = x.get().mod(360);
  10435. result = null;
  10436. if (angle.eq(90)) {
  10437. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](1);
  10438. } else if (angle.eq(180)) {
  10439. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10440. } else if (angle.eq(270)) {
  10441. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10442. } else {
  10443. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].sin(convertToRadians(angle));
  10444. }
  10445. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10446. sto.insertStore("$", temp);
  10447. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10448. return _context.abrupt("return", sto);
  10449. case 8:
  10450. case "end":
  10451. return _context.stop();
  10452. }
  10453. }
  10454. }, _callee);
  10455. }));
  10456. return function sinFun(_x, _x2) {
  10457. return _ref.apply(this, arguments);
  10458. };
  10459. }();
  10460. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sinFun)]);
  10461. 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);
  10462. return func;
  10463. }
  10464. function createCosFun() {
  10465. var cosFun = /*#__PURE__*/function () {
  10466. 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, _) {
  10467. var x, angle, result, temp;
  10468. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  10469. while (1) {
  10470. switch (_context2.prev = _context2.next) {
  10471. case 0:
  10472. x = sto.applyStore('x');
  10473. angle = x.get().mod(360);
  10474. result = null;
  10475. if (angle.eq(90)) {
  10476. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10477. } else if (angle.eq(180)) {
  10478. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10479. } else if (angle.eq(270)) {
  10480. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10481. }
  10482. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].cos(convertToRadians(angle));
  10483. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10484. sto.insertStore("$", temp);
  10485. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10486. return _context2.abrupt("return", sto);
  10487. case 9:
  10488. case "end":
  10489. return _context2.stop();
  10490. }
  10491. }
  10492. }, _callee2);
  10493. }));
  10494. return function cosFun(_x3, _x4) {
  10495. return _ref2.apply(this, arguments);
  10496. };
  10497. }();
  10498. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](cosFun)]);
  10499. 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);
  10500. return func;
  10501. }
  10502. function createTanFun() {
  10503. var tanFun = /*#__PURE__*/function () {
  10504. 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, _) {
  10505. var x, angle, result, temp;
  10506. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  10507. while (1) {
  10508. switch (_context3.prev = _context3.next) {
  10509. case 0:
  10510. x = sto.applyStore('x');
  10511. angle = x.get().mod(360);
  10512. if (!(angle.eq(90) || angle.eq(270))) {
  10513. _context3.next = 4;
  10514. break;
  10515. }
  10516. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].undefined_tanget_value(x.get().toNumber(), this.function_call_stack.pop());
  10517. case 4:
  10518. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].tan(convertToRadians(angle));
  10519. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10520. sto.insertStore("$", temp);
  10521. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10522. return _context3.abrupt("return", sto);
  10523. case 9:
  10524. case "end":
  10525. return _context3.stop();
  10526. }
  10527. }
  10528. }, _callee3, this);
  10529. }));
  10530. return function tanFun(_x5, _x6) {
  10531. return _ref3.apply(this, arguments);
  10532. };
  10533. }();
  10534. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](tanFun)]);
  10535. 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);
  10536. return func;
  10537. }
  10538. function createSqrtFun() {
  10539. var sqrtFun = /*#__PURE__*/function () {
  10540. 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, _) {
  10541. var x, result, temp;
  10542. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  10543. while (1) {
  10544. switch (_context4.prev = _context4.next) {
  10545. case 0:
  10546. x = sto.applyStore('x');
  10547. if (!x.get().isNeg()) {
  10548. _context4.next = 3;
  10549. break;
  10550. }
  10551. return _context4.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_sqrt_value(this.function_call_stack.pop())));
  10552. case 3:
  10553. result = x.get().sqrt();
  10554. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10555. sto.insertStore("$", temp);
  10556. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10557. return _context4.abrupt("return", sto);
  10558. case 8:
  10559. case "end":
  10560. return _context4.stop();
  10561. }
  10562. }
  10563. }, _callee4, this);
  10564. }));
  10565. return function sqrtFun(_x7, _x8) {
  10566. return _ref4.apply(this, arguments);
  10567. };
  10568. }();
  10569. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sqrtFun)]);
  10570. 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);
  10571. return func;
  10572. }
  10573. function createPowFun() {
  10574. var powFun = /*#__PURE__*/function () {
  10575. 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, _) {
  10576. var x, y, result, temp;
  10577. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  10578. while (1) {
  10579. switch (_context5.prev = _context5.next) {
  10580. case 0:
  10581. x = sto.applyStore('x');
  10582. y = sto.applyStore('y');
  10583. result = x.get().pow(y.get());
  10584. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10585. sto.insertStore("$", temp);
  10586. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10587. return _context5.abrupt("return", sto);
  10588. case 7:
  10589. case "end":
  10590. return _context5.stop();
  10591. }
  10592. }
  10593. }, _callee5);
  10594. }));
  10595. return function powFun(_x9, _x10) {
  10596. return _ref5.apply(this, arguments);
  10597. };
  10598. }();
  10599. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](powFun)]);
  10600. 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);
  10601. return func;
  10602. }
  10603. function createLogFun() {
  10604. var logFun = /*#__PURE__*/function () {
  10605. 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, _) {
  10606. var x, result, temp;
  10607. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  10608. while (1) {
  10609. switch (_context6.prev = _context6.next) {
  10610. case 0:
  10611. x = sto.applyStore('x');
  10612. if (!x.get().isNegative()) {
  10613. _context6.next = 3;
  10614. break;
  10615. }
  10616. return _context6.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_log_value(this.function_call_stack.pop())));
  10617. case 3:
  10618. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].log10(x.get());
  10619. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10620. sto.insertStore("$", temp);
  10621. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10622. return _context6.abrupt("return", sto);
  10623. case 8:
  10624. case "end":
  10625. return _context6.stop();
  10626. }
  10627. }
  10628. }, _callee6, this);
  10629. }));
  10630. return function logFun(_x11, _x12) {
  10631. return _ref6.apply(this, arguments);
  10632. };
  10633. }();
  10634. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](logFun)]);
  10635. 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);
  10636. return func;
  10637. }
  10638. function createAbsFun() {
  10639. var absFun = /*#__PURE__*/function () {
  10640. 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, _) {
  10641. var x, result, temp;
  10642. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  10643. while (1) {
  10644. switch (_context7.prev = _context7.next) {
  10645. case 0:
  10646. x = sto.applyStore('x');
  10647. result = x.get().abs();
  10648. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10649. sto.insertStore("$", temp);
  10650. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10651. return _context7.abrupt("return", sto);
  10652. case 6:
  10653. case "end":
  10654. return _context7.stop();
  10655. }
  10656. }
  10657. }, _callee7);
  10658. }));
  10659. return function absFun(_x13, _x14) {
  10660. return _ref7.apply(this, arguments);
  10661. };
  10662. }();
  10663. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](absFun)]);
  10664. 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);
  10665. return func;
  10666. }
  10667. function createNegateFun() {
  10668. var negateFun = /*#__PURE__*/function () {
  10669. 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, _) {
  10670. var x, result, temp;
  10671. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  10672. while (1) {
  10673. switch (_context8.prev = _context8.next) {
  10674. case 0:
  10675. x = sto.applyStore('x');
  10676. result = x.get().negated();
  10677. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10678. sto.insertStore("$", temp);
  10679. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10680. return _context8.abrupt("return", sto);
  10681. case 6:
  10682. case "end":
  10683. return _context8.stop();
  10684. }
  10685. }
  10686. }, _callee8);
  10687. }));
  10688. return function negateFun(_x15, _x16) {
  10689. return _ref8.apply(this, arguments);
  10690. };
  10691. }();
  10692. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](negateFun)]);
  10693. 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);
  10694. return func;
  10695. }
  10696. function createInvertFun() {
  10697. var invertFun = /*#__PURE__*/function () {
  10698. 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, _) {
  10699. var x, result, temp;
  10700. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  10701. while (1) {
  10702. switch (_context9.prev = _context9.next) {
  10703. case 0:
  10704. x = sto.applyStore('x');
  10705. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__["toReal"](1).dividedBy(x.get());
  10706. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10707. sto.insertStore("$", temp);
  10708. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10709. return _context9.abrupt("return", sto);
  10710. case 6:
  10711. case "end":
  10712. return _context9.stop();
  10713. }
  10714. }
  10715. }, _callee9);
  10716. }));
  10717. return function invertFun(_x17, _x18) {
  10718. return _ref9.apply(this, arguments);
  10719. };
  10720. }();
  10721. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](invertFun)]);
  10722. 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);
  10723. return func;
  10724. }
  10725. function createMaxFun() {
  10726. var maxFun = /*#__PURE__*/function () {
  10727. 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, _) {
  10728. var x, numbers, result, temp;
  10729. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  10730. while (1) {
  10731. switch (_context10.prev = _context10.next) {
  10732. case 0:
  10733. x = sto.applyStore('x');
  10734. numbers = x.get().map(function (sto_addrs) {
  10735. return sto_addrs.get();
  10736. });
  10737. 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));
  10738. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10739. sto.insertStore("$", temp);
  10740. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10741. return _context10.abrupt("return", sto);
  10742. case 7:
  10743. case "end":
  10744. return _context10.stop();
  10745. }
  10746. }
  10747. }, _callee10);
  10748. }));
  10749. return function maxFun(_x19, _x20) {
  10750. return _ref10.apply(this, arguments);
  10751. };
  10752. }();
  10753. 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);
  10754. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](maxFun)]);
  10755. 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);
  10756. return func;
  10757. }
  10758. function createMinFun() {
  10759. var minFun = /*#__PURE__*/function () {
  10760. 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, _) {
  10761. var x, numbers, result, temp;
  10762. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  10763. while (1) {
  10764. switch (_context11.prev = _context11.next) {
  10765. case 0:
  10766. x = sto.applyStore('x');
  10767. numbers = x.get().map(function (sto_addrs) {
  10768. return sto_addrs.get();
  10769. });
  10770. 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));
  10771. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10772. sto.insertStore("$", temp);
  10773. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10774. return _context11.abrupt("return", sto);
  10775. case 7:
  10776. case "end":
  10777. return _context11.stop();
  10778. }
  10779. }
  10780. }, _callee11);
  10781. }));
  10782. return function minFun(_x21, _x22) {
  10783. return _ref11.apply(this, arguments);
  10784. };
  10785. }();
  10786. 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);
  10787. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](minFun)]);
  10788. 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);
  10789. return func;
  10790. }
  10791. var seed = Date.now();
  10792. function createRandFun() {
  10793. var a = 16807;
  10794. var m = 2147483647;
  10795. var c = 12345;
  10796. var randFun = /*#__PURE__*/function () {
  10797. 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, _) {
  10798. var val, temp;
  10799. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  10800. while (1) {
  10801. switch (_context12.prev = _context12.next) {
  10802. case 0:
  10803. seed = (a * seed + c) % m;
  10804. val = seed / (m - 1);
  10805. 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));
  10806. sto.insertStore("$", temp);
  10807. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10808. return _context12.abrupt("return", sto);
  10809. case 6:
  10810. case "end":
  10811. return _context12.stop();
  10812. }
  10813. }
  10814. }, _callee12);
  10815. }));
  10816. return function randFun(_x23, _x24) {
  10817. return _ref12.apply(this, arguments);
  10818. };
  10819. }();
  10820. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](randFun)]);
  10821. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$rand", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [], block);
  10822. return func;
  10823. }
  10824. function createSetSeedFun() {
  10825. var setSeedFun = /*#__PURE__*/function () {
  10826. 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, _) {
  10827. var value;
  10828. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  10829. while (1) {
  10830. switch (_context13.prev = _context13.next) {
  10831. case 0:
  10832. value = sto.applyStore("x");
  10833. seed = value.get().toNumber();
  10834. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10835. return _context13.abrupt("return", sto);
  10836. case 4:
  10837. case "end":
  10838. return _context13.stop();
  10839. }
  10840. }
  10841. }, _callee13);
  10842. }));
  10843. return function setSeedFun(_x25, _x26) {
  10844. return _ref13.apply(this, arguments);
  10845. };
  10846. }();
  10847. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](setSeedFun)]);
  10848. 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);
  10849. return func;
  10850. }
  10851. /***/ }),
  10852. /***/ "./js/processor/lib/strings.js":
  10853. /*!*************************************!*\
  10854. !*** ./js/processor/lib/strings.js ***!
  10855. \*************************************/
  10856. /*! exports provided: createSubstringFun, createLengthFun, createUppercaseFun, createLowercaseFun, createrCharAtFun */
  10857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10858. "use strict";
  10859. __webpack_require__.r(__webpack_exports__);
  10860. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSubstringFun", function() { return createSubstringFun; });
  10861. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLengthFun", function() { return createLengthFun; });
  10862. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUppercaseFun", function() { return createUppercaseFun; });
  10863. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLowercaseFun", function() { return createLowercaseFun; });
  10864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createrCharAtFun", function() { return createrCharAtFun; });
  10865. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10866. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  10867. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10868. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  10869. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10870. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10871. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  10872. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10873. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10874. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_5__);
  10875. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10876. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_6__);
  10877. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10878. /*
  10879. * substring
  10880. * length
  10881. * uppercase
  10882. * lowercase
  10883. * charAt
  10884. **/
  10885. function createSubstringFun() {
  10886. var substringFun = /*#__PURE__*/function () {
  10887. 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, _) {
  10888. var str, start, end, result, temp;
  10889. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  10890. while (1) {
  10891. switch (_context.prev = _context.next) {
  10892. case 0:
  10893. str = sto.applyStore("str");
  10894. start = sto.applyStore("start");
  10895. end = sto.applyStore("end");
  10896. result = str.get().substring(start.get(), end.get());
  10897. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  10898. sto.insertStore("$", temp);
  10899. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10900. return _context.abrupt("return", sto);
  10901. case 8:
  10902. case "end":
  10903. return _context.stop();
  10904. }
  10905. }
  10906. }, _callee);
  10907. }));
  10908. return function substringFun(_x, _x2) {
  10909. return _ref.apply(this, arguments);
  10910. };
  10911. }();
  10912. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](substringFun)]);
  10913. 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);
  10914. return func;
  10915. }
  10916. function createLengthFun() {
  10917. var lengthFun = /*#__PURE__*/function () {
  10918. 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, _) {
  10919. var str, temp;
  10920. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  10921. while (1) {
  10922. switch (_context2.prev = _context2.next) {
  10923. case 0:
  10924. str = sto.applyStore("str");
  10925. 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));
  10926. sto.insertStore("$", temp);
  10927. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10928. return _context2.abrupt("return", sto);
  10929. case 5:
  10930. case "end":
  10931. return _context2.stop();
  10932. }
  10933. }
  10934. }, _callee2);
  10935. }));
  10936. return function lengthFun(_x3, _x4) {
  10937. return _ref2.apply(this, arguments);
  10938. };
  10939. }();
  10940. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lengthFun)]);
  10941. 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);
  10942. return func;
  10943. }
  10944. function createUppercaseFun() {
  10945. var uppercaseFun = /*#__PURE__*/function () {
  10946. 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, _) {
  10947. var str, temp;
  10948. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  10949. while (1) {
  10950. switch (_context3.prev = _context3.next) {
  10951. case 0:
  10952. str = sto.applyStore("str");
  10953. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toUpperCase());
  10954. sto.insertStore("$", temp);
  10955. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10956. return _context3.abrupt("return", sto);
  10957. case 5:
  10958. case "end":
  10959. return _context3.stop();
  10960. }
  10961. }
  10962. }, _callee3);
  10963. }));
  10964. return function uppercaseFun(_x5, _x6) {
  10965. return _ref3.apply(this, arguments);
  10966. };
  10967. }();
  10968. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](uppercaseFun)]);
  10969. 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);
  10970. return func;
  10971. }
  10972. function createLowercaseFun() {
  10973. var lowercaseFun = /*#__PURE__*/function () {
  10974. 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, _) {
  10975. var str, temp;
  10976. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  10977. while (1) {
  10978. switch (_context4.prev = _context4.next) {
  10979. case 0:
  10980. str = sto.applyStore("str");
  10981. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toLowerCase());
  10982. sto.insertStore("$", temp);
  10983. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10984. return _context4.abrupt("return", sto);
  10985. case 5:
  10986. case "end":
  10987. return _context4.stop();
  10988. }
  10989. }
  10990. }, _callee4);
  10991. }));
  10992. return function lowercaseFun(_x7, _x8) {
  10993. return _ref4.apply(this, arguments);
  10994. };
  10995. }();
  10996. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lowercaseFun)]);
  10997. 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);
  10998. return func;
  10999. }
  11000. function createrCharAtFun() {
  11001. var charAtFun = /*#__PURE__*/function () {
  11002. 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, _) {
  11003. var str, idx, temp;
  11004. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  11005. while (1) {
  11006. switch (_context5.prev = _context5.next) {
  11007. case 0:
  11008. str = sto.applyStore("str");
  11009. idx = sto.applyStore("index");
  11010. if (!(idx.get().toNumber() < 0 || idx.get().toNumber() >= str.get().length)) {
  11011. _context5.next = 4;
  11012. break;
  11013. }
  11014. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__["ProcessorErrorFactory"].invalid_string_index(idx.get().toNumber(), str.get(), this.function_call_stack.pop());
  11015. case 4:
  11016. 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()));
  11017. sto.insertStore("$", temp);
  11018. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  11019. return _context5.abrupt("return", sto);
  11020. case 8:
  11021. case "end":
  11022. return _context5.stop();
  11023. }
  11024. }
  11025. }, _callee5, this);
  11026. }));
  11027. return function charAtFun(_x9, _x10) {
  11028. return _ref5.apply(this, arguments);
  11029. };
  11030. }();
  11031. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](charAtFun)]);
  11032. 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);
  11033. return func;
  11034. }
  11035. /***/ }),
  11036. /***/ "./js/processor/modes.ts":
  11037. /*!*******************************!*\
  11038. !*** ./js/processor/modes.ts ***!
  11039. \*******************************/
  11040. /*! no static exports found */
  11041. /***/ (function(module, exports, __webpack_require__) {
  11042. "use strict";
  11043. Object.defineProperty(exports, "__esModule", { value: true });
  11044. exports.Modes = void 0;
  11045. exports.Modes = Object.freeze({
  11046. RETURN: Symbol('mode:return'),
  11047. BREAK: Symbol('mode:break'),
  11048. PAUSE: Symbol('mode:pause'),
  11049. RUN: Symbol('mode:run'),
  11050. ABORT: Symbol('mode:abort')
  11051. });
  11052. /***/ }),
  11053. /***/ "./js/processor/semantic/semanticAnalyser.js":
  11054. /*!***************************************************!*\
  11055. !*** ./js/processor/semantic/semanticAnalyser.js ***!
  11056. \***************************************************/
  11057. /*! exports provided: SemanticAnalyser */
  11058. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11059. "use strict";
  11060. __webpack_require__.r(__webpack_exports__);
  11061. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticAnalyser", function() { return SemanticAnalyser; });
  11062. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  11063. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  11064. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  11065. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  11066. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  11067. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../definedFunctions */ "./js/processor/definedFunctions.js");
  11068. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../services/languageService */ "./js/services/languageService.js");
  11069. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/commands */ "./js/ast/commands/index.js");
  11070. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  11071. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  11072. /* harmony import */ var _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ast/expressions/literal */ "./js/ast/expressions/literal.js");
  11073. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../compatibilityTable */ "./js/processor/compatibilityTable.ts");
  11074. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__);
  11075. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  11076. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__);
  11077. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11078. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__);
  11079. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  11080. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__);
  11081. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
  11082. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_13__);
  11083. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../store/store */ "./js/processor/store/store.ts");
  11084. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_14__);
  11085. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  11086. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  11087. var SemanticAnalyser = /*#__PURE__*/function () {
  11088. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, null, [{
  11089. key: "analyseFromSource",
  11090. value: function analyseFromSource(stringCode) {
  11091. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__["IVProgParser"].createParser(stringCode);
  11092. var semantic = new SemanticAnalyser(parser.parseTree());
  11093. return semantic.analyseTree();
  11094. }
  11095. }]);
  11096. function SemanticAnalyser(ast) {
  11097. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticAnalyser);
  11098. this.ast = ast;
  11099. this.lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_4__["LanguageService"].getCurrentLexer();
  11100. var lexer = new this.lexerClass(null);
  11101. this.literalNames = lexer.literalNames;
  11102. this.symbolMap = null;
  11103. this.currentFunction = null;
  11104. }
  11105. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, [{
  11106. key: "pushMap",
  11107. value: function pushMap() {
  11108. if (this.symbolMap === null) {
  11109. this.symbolMap = {
  11110. map: {},
  11111. next: null
  11112. };
  11113. } else {
  11114. var n = {
  11115. map: {},
  11116. next: this.symbolMap
  11117. };
  11118. this.symbolMap = n;
  11119. }
  11120. }
  11121. }, {
  11122. key: "popMap",
  11123. value: function popMap() {
  11124. if (this.symbolMap !== null) {
  11125. this.symbolMap = this.symbolMap.next;
  11126. }
  11127. }
  11128. }, {
  11129. key: "insertSymbol",
  11130. value: function insertSymbol(id, typeInfo) {
  11131. this.symbolMap.map[id] = typeInfo;
  11132. }
  11133. }, {
  11134. key: "findSymbol",
  11135. value: function findSymbol(id, symbol_map) {
  11136. if (!symbol_map.map[id]) {
  11137. if (symbol_map.next) {
  11138. return this.findSymbol(id, symbol_map.next);
  11139. }
  11140. return null;
  11141. } else {
  11142. return symbol_map.map[id];
  11143. }
  11144. }
  11145. }, {
  11146. key: "getMainFunction",
  11147. value: function getMainFunction() {
  11148. return this.ast.functions.find(function (v) {
  11149. return v.isMain;
  11150. });
  11151. }
  11152. }, {
  11153. key: "findFunction",
  11154. value: function findFunction(name) {
  11155. if (name.match(/^\$.+$/)) {
  11156. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getFunction(name);
  11157. if (!fun) {
  11158. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].not_implemented(name);
  11159. }
  11160. return fun;
  11161. } else {
  11162. var val = this.ast.functions.find(function (v) {
  11163. return v.name === name;
  11164. });
  11165. if (!val) {
  11166. return null;
  11167. }
  11168. return val;
  11169. }
  11170. }
  11171. }, {
  11172. key: "analyseTree",
  11173. value: function analyseTree() {
  11174. var globalVars = this.ast.global;
  11175. this.pushMap();
  11176. this.assertDeclarations(globalVars);
  11177. var functions = this.ast.functions;
  11178. var mainFunc = functions.filter(function (f) {
  11179. return f.name === null;
  11180. });
  11181. if (mainFunc.length <= 0) {
  11182. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].main_missing();
  11183. }
  11184. for (var i = 0; i < functions.length; i++) {
  11185. var fun = functions[i];
  11186. this.assertFunction(fun);
  11187. }
  11188. return this.ast;
  11189. }
  11190. }, {
  11191. key: "assertDeclarations",
  11192. value: function assertDeclarations(list) {
  11193. for (var i = 0; i < list.length; i++) {
  11194. this.assertDeclaration(list[i]);
  11195. }
  11196. }
  11197. }, {
  11198. key: "assertDeclaration",
  11199. value: function assertDeclaration(declaration) {
  11200. if (declaration instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]) {
  11201. this.assertArrayDeclaration(declaration);
  11202. this.insertSymbol(declaration.id, {
  11203. id: declaration.id,
  11204. lines: declaration.lines,
  11205. columns: declaration.columns,
  11206. type: declaration.type,
  11207. isConst: declaration.isConst
  11208. });
  11209. } else {
  11210. if (declaration.initial === null) {
  11211. this.insertSymbol(declaration.id, {
  11212. id: declaration.id,
  11213. type: declaration.type,
  11214. isConst: declaration.isConst
  11215. });
  11216. return;
  11217. }
  11218. var resultType = this.evaluateExpressionType(declaration.initial);
  11219. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11220. if (!resultType.isCompatible(declaration.type)) {
  11221. var stringInfo = declaration.type.stringInfo();
  11222. var info = stringInfo[0];
  11223. var result_string_info = resultType.stringInfo();
  11224. var result_info = result_string_info[0];
  11225. var exp = declaration.initial;
  11226. 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);
  11227. }
  11228. this.insertSymbol(declaration.id, {
  11229. id: declaration.id,
  11230. type: declaration.type,
  11231. isConst: declaration.isConst
  11232. });
  11233. } 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)) {
  11234. var _stringInfo = declaration.type.stringInfo();
  11235. var _info = _stringInfo[0];
  11236. var _result_string_info = resultType.stringInfo();
  11237. var _result_info = _result_string_info[0];
  11238. var _exp = declaration.initial;
  11239. 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);
  11240. } else {
  11241. this.insertSymbol(declaration.id, {
  11242. id: declaration.id,
  11243. type: declaration.type,
  11244. isConst: declaration.isConst
  11245. });
  11246. }
  11247. }
  11248. }
  11249. }, {
  11250. key: "assertArrayDeclaration",
  11251. value: function assertArrayDeclaration(declaration) {
  11252. if (declaration.initial === null) {
  11253. var lineType = this.evaluateExpressionType(declaration.lines);
  11254. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11255. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  11256. }
  11257. if (declaration.columns !== null) {
  11258. var columnType = this.evaluateExpressionType(declaration.columns);
  11259. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11260. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  11261. }
  11262. }
  11263. } else {
  11264. this.evaluateArrayLiteral(declaration);
  11265. }
  11266. this.insertSymbol(declaration.id, {
  11267. id: declaration.id,
  11268. lines: declaration.lines,
  11269. columns: declaration.columns,
  11270. type: declaration.type
  11271. });
  11272. return;
  11273. }
  11274. }, {
  11275. key: "evaluateExpressionType",
  11276. value: function evaluateExpressionType(expression) {
  11277. // TODO: Throw operator error in case type == UNDEFINED
  11278. if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["UnaryApp"]) {
  11279. var op = expression.op;
  11280. var resultType = this.evaluateExpressionType(expression.left);
  11281. var finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterUnaryOp"])(op, resultType);
  11282. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(finalResult)) {
  11283. var stringInfo = resultType.stringInfo();
  11284. var info = stringInfo[0];
  11285. var expString = expression.toString();
  11286. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_unary_op_full(expString, op, info.type, info.dim, expression.sourceInfo);
  11287. }
  11288. return finalResult;
  11289. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["InfixApp"]) {
  11290. var _op = expression.op;
  11291. var resultTypeLeft = this.evaluateExpressionType(expression.left);
  11292. var resultTypeRight = this.evaluateExpressionType(expression.right);
  11293. var _finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterInfixOp"])(_op, resultTypeLeft, resultTypeRight);
  11294. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(_finalResult)) {
  11295. var stringInfoLeft = resultTypeLeft.stringInfo();
  11296. var infoLeft = stringInfoLeft[0];
  11297. var stringInfoRight = resultTypeRight.stringInfo();
  11298. var infoRight = stringInfoRight[0];
  11299. var _expString = expression.toString();
  11300. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_infix_op_full(_expString, _op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, expression.sourceInfo);
  11301. }
  11302. return _finalResult;
  11303. } else if (expression instanceof _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__["Literal"]) {
  11304. return this.evaluateLiteralType(expression);
  11305. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  11306. if (expression.isMainCall) {
  11307. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName(), expression.sourceInfo);
  11308. }
  11309. var fun = this.findFunction(expression.id);
  11310. if (fun === null) {
  11311. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(expression.id, expression.sourceInfo);
  11312. }
  11313. if (fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  11314. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(expression.id, expression.sourceInfo);
  11315. }
  11316. this.assertParameters(fun, expression.actualParameters);
  11317. return fun.returnType;
  11318. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"]) {
  11319. var arrayTypeInfo = this.findSymbol(expression.id, this.symbolMap);
  11320. if (arrayTypeInfo === null) {
  11321. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(expression.id, expression.sourceInfo);
  11322. }
  11323. if (!(arrayTypeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11324. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(expression.id, expression.sourceInfo);
  11325. }
  11326. var lineType = this.evaluateExpressionType(expression.line);
  11327. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11328. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  11329. }
  11330. if (expression.column !== null) {
  11331. if (arrayTypeInfo.columns === null) {
  11332. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(expression.id, expression.sourceInfo);
  11333. }
  11334. var columnType = this.evaluateExpressionType(expression.column);
  11335. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11336. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  11337. }
  11338. }
  11339. var arrType = arrayTypeInfo.type;
  11340. if (expression.column !== null) {
  11341. // indexing matrix
  11342. return arrType.innerType;
  11343. } else {
  11344. if (arrayTypeInfo.columns === null) {
  11345. return arrType.innerType;
  11346. }
  11347. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](arrType.innerType, 1);
  11348. }
  11349. }
  11350. }
  11351. }, {
  11352. key: "evaluateLiteralType",
  11353. value: function evaluateLiteralType(literal) {
  11354. if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["IntLiteral"]) {
  11355. return literal.type;
  11356. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["RealLiteral"]) {
  11357. return literal.type;
  11358. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["StringLiteral"]) {
  11359. return literal.type;
  11360. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["BoolLiteral"]) {
  11361. return literal.type;
  11362. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["CharLiteral"]) {
  11363. return literal.type;
  11364. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  11365. var typeInfo = this.findSymbol(literal.id, this.symbolMap);
  11366. if (typeInfo === null) {
  11367. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(literal.id, literal.sourceInfo);
  11368. }
  11369. if (typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11370. return typeInfo.type;
  11371. }
  11372. return typeInfo.type;
  11373. } else {
  11374. // console.warn("Evaluating type only for an array literal...");
  11375. var last = null;
  11376. if (literal.value.length === 1) {
  11377. last = this.evaluateExpressionType(literal.value[0]);
  11378. } else {
  11379. for (var i = 0; i < literal.value.length; i++) {
  11380. var e = this.evaluateExpressionType(literal.value[i]);
  11381. if (last === null) {
  11382. last = e;
  11383. } else if (!last.isCompatible(e)) {
  11384. var strInfo = last.stringInfo();
  11385. var info = strInfo[0];
  11386. var strExp = literal.toString();
  11387. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_array_full(strExp, info.type, info.dim, literal.sourceInfo);
  11388. }
  11389. }
  11390. }
  11391. if (last instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11392. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last.innerType, last.dimensions + 1);
  11393. }
  11394. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last, 1);
  11395. }
  11396. }
  11397. }, {
  11398. key: "evaluateArrayLiteral",
  11399. value: function evaluateArrayLiteral(arrayDeclaration) {
  11400. var type = arrayDeclaration.type;
  11401. var literal = arrayDeclaration.initial; // console.log(arrayDeclaration);
  11402. if (arrayDeclaration.isVector) {
  11403. this.evaluateVectorLiteralType(literal, type);
  11404. } else {
  11405. // TODO matrix type check
  11406. for (var i = 0; i < literal.lines; ++i) {
  11407. var line_literal = literal.value[i];
  11408. this.evaluateVectorLiteralType(line_literal, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](type.innerType, 1));
  11409. }
  11410. }
  11411. return true;
  11412. }
  11413. }, {
  11414. key: "assertFunction",
  11415. value: function assertFunction(fun) {
  11416. var _this = this;
  11417. this.pushMap();
  11418. this.currentFunction = fun;
  11419. fun.formalParameters.forEach(function (formalParam) {
  11420. if (formalParam.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11421. if (formalParam.type.dimensions > 1) {
  11422. _this.insertSymbol(formalParam.id, {
  11423. id: formalParam.id,
  11424. lines: -1,
  11425. columns: -1,
  11426. type: formalParam.type
  11427. });
  11428. } else {
  11429. _this.insertSymbol(formalParam.id, {
  11430. id: formalParam.id,
  11431. lines: -1,
  11432. columns: null,
  11433. type: formalParam.type
  11434. });
  11435. }
  11436. } else {
  11437. _this.insertSymbol(formalParam.id, {
  11438. id: formalParam.id,
  11439. type: formalParam.type
  11440. });
  11441. }
  11442. });
  11443. this.assertDeclarations(fun.variablesDeclarations);
  11444. var optional = fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID);
  11445. var valid = this.assertReturn(fun, optional);
  11446. if (!valid) {
  11447. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_no_return(fun.name);
  11448. }
  11449. this.popMap();
  11450. }
  11451. }, {
  11452. key: "assertReturn",
  11453. value: function assertReturn(fun, optional) {
  11454. var _this2 = this;
  11455. return fun.commands.reduce(function (last, next) {
  11456. return _this2.checkCommand(fun.returnType, next, optional) || last;
  11457. }, optional);
  11458. }
  11459. }, {
  11460. key: "checkCommand",
  11461. value: function checkCommand(type, cmd, optional) {
  11462. if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["While"]) {
  11463. var resultType = this.evaluateExpressionType(cmd.expression);
  11464. if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11465. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  11466. }
  11467. this.checkCommands(type, cmd.commands, optional);
  11468. return false;
  11469. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["For"]) {
  11470. var var_type = this.evaluateExpressionType(cmd.for_id);
  11471. if (!var_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11472. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_variable(cmd.for_id, cmd.sourceInfo);
  11473. }
  11474. var from_type = this.evaluateExpressionType(cmd.for_from);
  11475. if (!from_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11476. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_from(cmd.for_from, cmd.sourceInfo);
  11477. }
  11478. var to_type = this.evaluateExpressionType(cmd.for_to);
  11479. if (!to_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11480. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_to(cmd.for_to, cmd.sourceInfo);
  11481. }
  11482. if (cmd.for_pass != null) {
  11483. var pass_type = this.evaluateExpressionType(cmd.for_pass);
  11484. if (!pass_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11485. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_pass(cmd.for_pass, cmd.sourceInfo);
  11486. }
  11487. }
  11488. this.checkCommands(type, cmd.commands, optional);
  11489. return false;
  11490. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Switch"]) {
  11491. var sType = this.evaluateExpressionType(cmd.expression);
  11492. var result = optional;
  11493. var hasDefault = false;
  11494. for (var i = 0; i < cmd.cases.length; i++) {
  11495. var aCase = cmd.cases[i];
  11496. if (aCase.expression !== null) {
  11497. var caseType = this.evaluateExpressionType(aCase.expression);
  11498. if (!sType.isCompatible(caseType)) {
  11499. var strInfo = sType.stringInfo();
  11500. var info = strInfo[0];
  11501. var strExp = aCase.expression.toString();
  11502. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_case_type_full(strExp, info.type, info.dim, aCase.sourceInfo);
  11503. }
  11504. } else {
  11505. hasDefault = true;
  11506. }
  11507. result = result && this.checkCommands(type, aCase.commands, result);
  11508. }
  11509. return result && hasDefault;
  11510. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayIndexAssign"]) {
  11511. // TODO - rework!!!!!
  11512. var used_dims = 0;
  11513. var typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11514. if (typeInfo === null) {
  11515. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11516. }
  11517. if (typeInfo.isConst) {
  11518. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11519. }
  11520. if (!(typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11521. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  11522. }
  11523. var exp = cmd.expression;
  11524. var lineExp = cmd.line;
  11525. var lineType = this.evaluateExpressionType(lineExp);
  11526. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11527. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11528. }
  11529. used_dims += 1;
  11530. var columnExp = cmd.column;
  11531. if (typeInfo.columns === null && columnExp !== null) {
  11532. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(cmd.id, cmd.sourceInfo);
  11533. } else if (columnExp !== null) {
  11534. var columnType = this.evaluateExpressionType(columnExp);
  11535. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11536. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11537. }
  11538. used_dims += 1;
  11539. } // exp a single value exp or an array access
  11540. var exp_type = this.evaluateExpressionType(exp);
  11541. var access_type = typeInfo.type;
  11542. var compatible = false;
  11543. var _type = access_type;
  11544. if (exp_type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11545. if (access_type.dimensions - used_dims == 0) {
  11546. _type = access_type.innerType;
  11547. } else {
  11548. _type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](access_type.innerType, Math.max(0, access_type.dimensions - used_dims));
  11549. }
  11550. compatible = exp_type.isCompatible(_type);
  11551. } else {
  11552. compatible = access_type.canAccept(exp_type, used_dims);
  11553. }
  11554. if (!compatible) {
  11555. if (0 === access_type.dimensions - used_dims) {
  11556. _type = access_type.innerType; // enable a valid attempt to cast real <--> integer
  11557. }
  11558. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(_type, exp_type)) {
  11559. var access_type_string_info = access_type.stringInfo();
  11560. var access_type_info = access_type_string_info[0];
  11561. var exp_type_string_info = exp_type.stringInfo();
  11562. var exp_type_info = exp_type_string_info[0];
  11563. 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);
  11564. }
  11565. }
  11566. return optional;
  11567. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Assign"]) {
  11568. // TODO - rework since there is no literal array assignment
  11569. var _typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11570. if (_typeInfo === null) {
  11571. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11572. }
  11573. if (_typeInfo.isConst) {
  11574. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11575. }
  11576. var _exp2 = cmd.expression;
  11577. var _exp_type = this.evaluateExpressionType(_exp2);
  11578. if (_exp_type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11579. if (!(_typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11580. // TODO better error message
  11581. throw new Error("Cannot assign an array to a non-array variable ");
  11582. } // Both are arrays...
  11583. // if both don't have same dimensions and type, cannot perform assignment
  11584. if (!_exp_type.isCompatible(_typeInfo.type)) {
  11585. if (_exp_type.dimensions === _typeInfo.type.dimensions && !_exp_type.innerType.isCompatible(_typeInfo.type.innerType)) {
  11586. 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)) {
  11587. var stringInfo = _typeInfo.type.stringInfo();
  11588. var _info2 = stringInfo[0];
  11589. var _exp_type_string_info = _exp_type.stringInfo();
  11590. var _exp_type_info = _exp_type_string_info[0];
  11591. 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);
  11592. }
  11593. } else {
  11594. switch (_exp_type.dimensions) {
  11595. case 1:
  11596. {
  11597. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].vector_to_matrix_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11598. }
  11599. case 2:
  11600. {
  11601. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].matrix_to_vector_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11602. }
  11603. }
  11604. }
  11605. }
  11606. } else if (!_exp_type.isCompatible(_typeInfo.type)) {
  11607. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(_typeInfo.type, _exp_type)) {
  11608. var _stringInfo2 = _typeInfo.type.stringInfo();
  11609. var _info3 = _stringInfo2[0];
  11610. var _exp_type_string_info2 = _exp_type.stringInfo();
  11611. var _exp_type_info2 = _exp_type_string_info2[0];
  11612. 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);
  11613. }
  11614. }
  11615. return optional;
  11616. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Break"]) {
  11617. return optional;
  11618. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11619. var _resultType = this.evaluateExpressionType(cmd.condition);
  11620. if (!_resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11621. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  11622. }
  11623. if (cmd.ifFalse instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11624. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommand(type, cmd.ifFalse, optional);
  11625. } else if (cmd.ifFalse != null) {
  11626. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommands(type, cmd.ifFalse.commands, optional);
  11627. } else {
  11628. return this.checkCommands(type, cmd.ifTrue.commands, optional);
  11629. }
  11630. } else if (cmd instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  11631. var fun = null;
  11632. if (cmd.isMainCall) {
  11633. fun = this.getMainFunction();
  11634. } else {
  11635. fun = this.findFunction(cmd.id);
  11636. }
  11637. if (fun === null) {
  11638. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(cmd.id, cmd.sourceInfo);
  11639. }
  11640. this.assertParameters(fun, cmd.actualParameters);
  11641. return optional;
  11642. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Return"]) {
  11643. var funcName = this.currentFunction.isMain ? _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName() : this.currentFunction.name;
  11644. if (cmd.expression === null && !type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  11645. var _stringInfo3 = type.stringInfo();
  11646. var _info4 = _stringInfo3[0];
  11647. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_void_return_full(funcName, _info4.type, _info4.dim, cmd.sourceInfo);
  11648. } else if (cmd.expression !== null) {
  11649. var _resultType2 = this.evaluateExpressionType(cmd.expression);
  11650. if (!type.isCompatible(_resultType2)) {
  11651. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type, _resultType2)) {
  11652. var _stringInfo4 = type.stringInfo();
  11653. var _info5 = _stringInfo4[0];
  11654. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_return_type_full(funcName, _info5.type, _info5.dim, cmd.sourceInfo);
  11655. }
  11656. }
  11657. return true;
  11658. } else {
  11659. return true;
  11660. }
  11661. }
  11662. }
  11663. }, {
  11664. key: "checkCommands",
  11665. value: function checkCommands(type, cmds, optional) {
  11666. var _this3 = this;
  11667. return cmds.reduce(function (last, next) {
  11668. return _this3.checkCommand(type, next, optional) || last;
  11669. }, optional);
  11670. }
  11671. /**
  11672. *
  11673. * @param {import('./../../ast/commands/function').Function} fun
  11674. * @param {Expression[]} actualParametersList
  11675. */
  11676. }, {
  11677. key: "assertParameters",
  11678. value: function assertParameters(fun, actualParametersList) {
  11679. var parameterList = fun.formalParameters;
  11680. if (parameterList.length > actualParametersList.length || parameterList.length !== actualParametersList.length && !fun.hasVariadic()) {
  11681. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameters_size_full(fun.name, actualParametersList.length, fun.formalParameters.length, null);
  11682. }
  11683. for (var i = 0, j = 0; i < parameterList.length && j < actualParametersList.length; i += 1, j += 1) {
  11684. var formalParam = parameterList[i];
  11685. if (formalParam.variadic && i + 1 !== parameterList.length) {
  11686. throw "A function variadic parameter must be its last parameter!";
  11687. }
  11688. if (formalParam.variadic) {
  11689. j = this.assertVariadicParameter(fun, formalParam, j, actualParametersList);
  11690. } else {
  11691. var param = actualParametersList[j];
  11692. this.assertParameter(fun, formalParam, param);
  11693. }
  11694. }
  11695. }
  11696. }, {
  11697. key: "evaluateVectorLiteralType",
  11698. value: function evaluateVectorLiteralType(literal, type) {
  11699. // console.log(literal);
  11700. for (var i = 0; i < literal.value.length; i += 1) {
  11701. var exp = literal.value[i];
  11702. var expType = this.evaluateExpressionType(exp);
  11703. var compatible = false;
  11704. if (expType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11705. compatible = expType.isCompatible(type.innerType);
  11706. } else {
  11707. compatible = type.canAccept(expType, 1);
  11708. }
  11709. if (!compatible) {
  11710. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type.innerType, expType)) {
  11711. var stringInfo = type.stringInfo();
  11712. var info = stringInfo[0];
  11713. var result_string_info = expType.stringInfo();
  11714. var result_info = result_string_info[0];
  11715. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(info.type, 0, result_info.type, result_info.dim, exp.toString(), literal.sourceInfo);
  11716. }
  11717. }
  11718. }
  11719. return type;
  11720. }
  11721. /**
  11722. *
  11723. * @param {import('./../../ast/commands/function').Function} fun
  11724. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11725. * @param {number} index
  11726. * @param {Expression[]} actualParametersList
  11727. */
  11728. }, {
  11729. key: "assertVariadicParameter",
  11730. value: function assertVariadicParameter(fun, formalParam, index, actualParametersList) {
  11731. var i;
  11732. for (i = index; i < actualParametersList.length; i += 1) {
  11733. this.assertParameter(fun, formalParam, actualParametersList[i]);
  11734. }
  11735. return i - 1;
  11736. }
  11737. /**
  11738. *
  11739. * @param {import('./../../ast/commands/function').Function} fun
  11740. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11741. * @param {Expression} actualParameter
  11742. */
  11743. }, {
  11744. key: "assertParameter",
  11745. value: function assertParameter(fun, formalParam, actualParameter) {
  11746. // const id = formalParam.id;
  11747. if (formalParam.byRef) {
  11748. if (actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  11749. var variable = this.findSymbol(actualParameter.id, this.symbolMap);
  11750. if (variable.isConst) {
  11751. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_ref_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11752. }
  11753. } else if (!(actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"] || actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"])) {
  11754. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11755. }
  11756. }
  11757. var resultType = this.evaluateExpressionType(actualParameter);
  11758. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"] && formalParam.type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11759. var shared = 0;
  11760. for (var j = 0; j < resultType.types.length; ++j) {
  11761. var element = resultType.types[j];
  11762. if (formalParam.type.types.indexOf(element) !== -1) {
  11763. shared += 1;
  11764. }
  11765. }
  11766. if (shared <= 0) {
  11767. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11768. 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)) {
  11769. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11770. }
  11771. }
  11772. }
  11773. } else if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11774. if (!resultType.isCompatible(formalParam.type)) {
  11775. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11776. 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)) {
  11777. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11778. }
  11779. }
  11780. }
  11781. } else if (!formalParam.type.isCompatible(resultType)) {
  11782. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11783. if (!_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(formalParam.type, resultType)) {
  11784. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11785. }
  11786. }
  11787. }
  11788. }
  11789. }]);
  11790. return SemanticAnalyser;
  11791. }();
  11792. /***/ }),
  11793. /***/ "./js/processor/store/store.ts":
  11794. /*!*************************************!*\
  11795. !*** ./js/processor/store/store.ts ***!
  11796. \*************************************/
  11797. /*! no static exports found */
  11798. /***/ (function(module, exports, __webpack_require__) {
  11799. "use strict";
  11800. Object.defineProperty(exports, "__esModule", { value: true });
  11801. exports.Store = void 0;
  11802. /* eslint-disable @typescript-eslint/no-non-null-assertion */
  11803. const modes_1 = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  11804. const types_1 = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  11805. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  11806. const storeObjectRef_1 = __webpack_require__(/*! ./storeObjectRef */ "./js/processor/store/storeObjectRef.ts");
  11807. const array_type_1 = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11808. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  11809. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  11810. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  11811. const store_value_1 = __webpack_require__(/*! ./value/store_value */ "./js/processor/store/value/store_value.ts");
  11812. const store_value_address_1 = __webpack_require__(/*! ./value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
  11813. const store_value_ref_1 = __webpack_require__(/*! ./value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
  11814. const array_store_value_ref_1 = __webpack_require__(/*! ./value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
  11815. const store_object_array_ref_1 = __webpack_require__(/*! ./store_object_array_ref */ "./js/processor/store/store_object_array_ref.ts");
  11816. class Store {
  11817. constructor(name) {
  11818. this.name = name;
  11819. this.store = new Map();
  11820. this.mode = modes_1.Modes.RUN;
  11821. }
  11822. static canImplicitTypeCast(castType, sourceType) {
  11823. if (castType.isCompatible(types_1.Types.INTEGER) || castType.isCompatible(types_1.Types.REAL)) {
  11824. if (sourceType.isCompatible(types_1.Types.INTEGER) || sourceType.isCompatible(types_1.Types.REAL)) {
  11825. return true;
  11826. }
  11827. }
  11828. return false;
  11829. }
  11830. static doImplicitCasting(castType, stoObj) {
  11831. if (!Store.canImplicitTypeCast(castType, stoObj.type)) {
  11832. throw new Error("!!!Critical error: attempted to type cast invalid types");
  11833. }
  11834. if (castType.isCompatible(types_1.Types.INTEGER)) {
  11835. return new store_value_1.StoreValue(types_1.Types.INTEGER, stoObj.get().trunc());
  11836. }
  11837. else {
  11838. return new store_value_1.StoreValue(types_1.Types.REAL, stoObj.get());
  11839. }
  11840. }
  11841. extendStore(nextStore) {
  11842. this.nextStore = nextStore;
  11843. }
  11844. applyStore(id) {
  11845. if (!this.store.has(id)) {
  11846. if (this.nextStore != null) {
  11847. return this.nextStore.applyStore(id);
  11848. }
  11849. else {
  11850. throw new Error(`Variable ${id} not found.`);
  11851. }
  11852. }
  11853. const val = this.store.get(id);
  11854. let result = null;
  11855. if (val.type instanceof array_type_1.ArrayType) {
  11856. const array = val;
  11857. const array_type = array.type;
  11858. let l = 0, c = 0;
  11859. const values = array.value.map(v => {
  11860. if (array.isVector) {
  11861. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l++, undefined, array.id, array.readOnly);
  11862. }
  11863. else {
  11864. if (c >= array.columns) {
  11865. c = 0;
  11866. l += 1;
  11867. }
  11868. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l, c++, array.id, array.readOnly);
  11869. }
  11870. });
  11871. result = new array_store_value_1.ArrayStoreValue(array_type, values, array.lines, array.columns, val.id, val.readOnly);
  11872. }
  11873. else {
  11874. result = new store_value_1.StoreValue(val.type, val.value, val.id, val.readOnly);
  11875. }
  11876. return result;
  11877. }
  11878. updateStore(id, stoValue) {
  11879. if (!this.store.has(id)) {
  11880. if (this.nextStore != null) {
  11881. this.nextStore.updateStore(id, stoValue);
  11882. return this;
  11883. }
  11884. else {
  11885. // TODO: better error message
  11886. throw new Error(`Variable ${id} not found.`);
  11887. }
  11888. }
  11889. else {
  11890. const oldObj = this.store.get(id);
  11891. if (oldObj.readOnly) {
  11892. // TODO: better error message
  11893. throw new Error("Cannot change value of a read only variable: " + id);
  11894. }
  11895. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  11896. const array_value = stoValue;
  11897. if (oldObj.isCompatible(array_value)) {
  11898. if (oldObj.isVector) {
  11899. array_value.get().forEach((val, index) => {
  11900. oldObj.setAt(val, index, undefined);
  11901. });
  11902. }
  11903. else {
  11904. let line = 0;
  11905. let column = 0;
  11906. array_value.get().forEach((val) => {
  11907. oldObj.setAt(val, line, column);
  11908. column += 1;
  11909. if (column >= oldObj.columns) {
  11910. line += 1;
  11911. column = 0;
  11912. }
  11913. });
  11914. }
  11915. return this;
  11916. }
  11917. }
  11918. else if (oldObj.isCompatible(stoValue)) {
  11919. const loc_address = oldObj.locAddress;
  11920. location_1.Location.updateAddress(loc_address, stoValue.get());
  11921. return this;
  11922. }
  11923. const oldType = oldObj.type;
  11924. const stoType = stoValue.type;
  11925. // TODO: better error message
  11926. throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  11927. }
  11928. }
  11929. /**
  11930. * Method used to update regions of an array (vector or matrix). The should only be used when update an specific
  11931. * possition since it will only update the required addresses.
  11932. * @param {string} id the variable id to be updated
  11933. * @param {IStoreValue} sto_value the value to be used in the update process
  11934. * @param {number} line the line address of the vector/matrix
  11935. * @param {number} column the matrix column, which can be undefined
  11936. */
  11937. updateStoreArray(id, sto_value, line, column) {
  11938. if (!this.store.has(id)) {
  11939. if (this.nextStore != null) {
  11940. this.nextStore.updateStoreArray(id, sto_value, line, column);
  11941. return this;
  11942. }
  11943. else {
  11944. // TODO: better error message
  11945. throw new Error(`Variable ${id} not found.`);
  11946. }
  11947. }
  11948. else {
  11949. const oldObj = this.store.get(id);
  11950. if (oldObj.readOnly) {
  11951. // TODO: better error message
  11952. throw new Error("Cannot change value of a read only variable: " + id);
  11953. }
  11954. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  11955. if (sto_value instanceof array_store_value_1.ArrayStoreValue) {
  11956. // this must be a vector or matrix line update
  11957. const actual_values = sto_value.get();
  11958. if (oldObj.isVector && sto_value.isVector()) {
  11959. for (let i = 0; i < sto_value.lines; i += 1) {
  11960. const val = actual_values[i];
  11961. oldObj.setAt(val, i, undefined);
  11962. }
  11963. }
  11964. else if (!oldObj.isVector && column == null && sto_value.isVector()) {
  11965. for (let i = 0; i < oldObj.columns; i += 1) {
  11966. const val = actual_values[i];
  11967. oldObj.setAt(val, line, i);
  11968. }
  11969. }
  11970. else {
  11971. // TODO: better error message
  11972. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  11973. }
  11974. }
  11975. else {
  11976. if (!oldObj.isVector && column == null) {
  11977. // TODO: better error message
  11978. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  11979. }
  11980. oldObj.setAt(sto_value, line, column);
  11981. }
  11982. }
  11983. else {
  11984. throw new Error("Cannot update a non-array variable using updateStoreArray");
  11985. }
  11986. // const oldType = oldObj.type;
  11987. // const stoType = sto_value.type;
  11988. // // TODO: better error message
  11989. // throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  11990. return this;
  11991. }
  11992. }
  11993. /**
  11994. * Inserts a new variable into the Store. This method should be used when declaring a new variable,
  11995. * including the special return variable $.
  11996. * @param id variable id
  11997. * @param stoValue the value to be used as the initial value of id
  11998. */
  11999. insertStore(id, stoValue) {
  12000. if (this.store.has(id)) {
  12001. // TODO: better error message
  12002. throw new Error(`${id} is already defined`);
  12003. }
  12004. // TODO check for array....
  12005. let newObj;
  12006. if (stoValue instanceof store_value_ref_1.StoreValueRef) {
  12007. newObj = new storeObjectRef_1.StoreObjectRef(stoValue);
  12008. }
  12009. else if (stoValue instanceof array_store_value_ref_1.ArrayStoreValueRef) {
  12010. newObj = new store_object_array_ref_1.StoreObjectArrayRef(stoValue, stoValue.lines, stoValue.columns);
  12011. }
  12012. else if (stoValue instanceof array_store_value_1.ArrayStoreValue) {
  12013. const columns = stoValue.isVector() ? 0 : stoValue.columns;
  12014. const addresses = [];
  12015. const all_values = stoValue.get();
  12016. if (all_values.length > 0) {
  12017. for (let i = 0; i < stoValue.get().length; i += 1) {
  12018. const val = all_values[i].get();
  12019. addresses.push(location_1.Location.allocate(val));
  12020. }
  12021. }
  12022. else {
  12023. let total = stoValue.lines;
  12024. total = stoValue.isVector() ? total : total * columns;
  12025. for (let i = 0; i < total; i += 1) {
  12026. addresses.push(location_1.Location.allocate(null));
  12027. }
  12028. }
  12029. newObj = new storeObjectArray_1.StoreObjectArray(stoValue.type, stoValue.lines, columns, addresses, stoValue.isConst);
  12030. }
  12031. else {
  12032. const loc_address = location_1.Location.allocate(stoValue.get());
  12033. newObj = new storeObject_1.StoreObject(stoValue.type, loc_address, stoValue.isConst);
  12034. }
  12035. newObj.setID(id);
  12036. this.store.set(id, newObj);
  12037. return this;
  12038. }
  12039. /**
  12040. * Helper function similar to applyStore. But it returns the actual object in the store be it ref or not
  12041. * applyStore will return the refferenced object if the object in the store is a ref
  12042. */
  12043. getStoreObject(id) {
  12044. if (!this.store.has(id)) {
  12045. if (this.nextStore != null) {
  12046. return this.nextStore.getStoreObject(id);
  12047. }
  12048. else {
  12049. throw new Error(`Variable ${id} not found.`);
  12050. }
  12051. }
  12052. return this.store.get(id);
  12053. }
  12054. destroy() {
  12055. this.store.forEach(sto => sto.destroy(), this);
  12056. }
  12057. isDefined(id) {
  12058. if (!this.store.has(id)) {
  12059. if (this.nextStore != null) {
  12060. return this.nextStore.isDefined(id);
  12061. }
  12062. else {
  12063. return false;
  12064. }
  12065. }
  12066. return true;
  12067. }
  12068. }
  12069. exports.Store = Store;
  12070. /***/ }),
  12071. /***/ "./js/processor/store/storeObject.ts":
  12072. /*!*******************************************!*\
  12073. !*** ./js/processor/store/storeObject.ts ***!
  12074. \*******************************************/
  12075. /*! no static exports found */
  12076. /***/ (function(module, exports, __webpack_require__) {
  12077. "use strict";
  12078. Object.defineProperty(exports, "__esModule", { value: true });
  12079. exports.StoreObject = void 0;
  12080. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  12081. class StoreObject {
  12082. /**
  12083. *
  12084. * @param {Type} type
  12085. * @param {Number} loc_address
  12086. * @param {Boolean} readOnly
  12087. */
  12088. constructor(type, loc_address, readOnly = false) {
  12089. this._loc_address = loc_address;
  12090. this._type = type;
  12091. this._readOnly = readOnly;
  12092. this._id = undefined;
  12093. }
  12094. setID(id) {
  12095. this._id = id;
  12096. }
  12097. get id() {
  12098. return this._id;
  12099. }
  12100. get inStore() {
  12101. return this.id !== null;
  12102. }
  12103. get type() {
  12104. return this._type;
  12105. }
  12106. /**
  12107. * Returns the actual value stored at the loccation address present in this object.
  12108. * The returned value is compatible with @prop{StoreObject.type}
  12109. */
  12110. get value() {
  12111. const address = location_1.Location.find(this._loc_address);
  12112. if (address != null) {
  12113. return address.value;
  12114. }
  12115. else {
  12116. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  12117. }
  12118. }
  12119. get number() {
  12120. throw new Error("DOT NOT USE THIS PROPERTY!");
  12121. }
  12122. get readOnly() {
  12123. return this._readOnly;
  12124. }
  12125. set readOnly(value) {
  12126. this._readOnly = value;
  12127. }
  12128. isCompatible(another) {
  12129. return this.type.isCompatible(another.type);
  12130. }
  12131. destroy() {
  12132. return location_1.Location.deallocate(this._loc_address);
  12133. }
  12134. get locAddress() {
  12135. return this._loc_address;
  12136. }
  12137. }
  12138. exports.StoreObject = StoreObject;
  12139. /***/ }),
  12140. /***/ "./js/processor/store/storeObjectArray.ts":
  12141. /*!************************************************!*\
  12142. !*** ./js/processor/store/storeObjectArray.ts ***!
  12143. \************************************************/
  12144. /*! no static exports found */
  12145. /***/ (function(module, exports, __webpack_require__) {
  12146. "use strict";
  12147. Object.defineProperty(exports, "__esModule", { value: true });
  12148. exports.StoreObjectArray = void 0;
  12149. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  12150. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  12151. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  12152. class StoreObjectArray extends storeObject_1.StoreObject {
  12153. constructor(type, _lines, _columns, loc_addresses, readOnly = false) {
  12154. super(type, -1, readOnly);
  12155. this._lines = _lines;
  12156. this._columns = _columns;
  12157. this.loc_addresses = loc_addresses;
  12158. }
  12159. get lines() {
  12160. return this._lines;
  12161. }
  12162. get columns() {
  12163. return this._columns;
  12164. }
  12165. isCompatible(another) {
  12166. if (another instanceof array_store_value_1.ArrayStoreValue) {
  12167. const cols = another.columns == null ? 0 : another.columns;
  12168. if (this.lines === another.lines && this.columns === cols) {
  12169. return super.isCompatible(another);
  12170. }
  12171. }
  12172. return false;
  12173. }
  12174. get isVector() {
  12175. return this.type.dimensions === 1;
  12176. }
  12177. /**@override
  12178. * Returns the list of values stored by this array.
  12179. * All returned values are compatible with @prop{StoreObject.type}
  12180. */
  12181. get value() {
  12182. const values = [];
  12183. for (let i = 0; i < this.addresses.length; i += 1) {
  12184. const address = location_1.Location.find(this.addresses[i]);
  12185. if (address != null) {
  12186. values.push(address.value);
  12187. }
  12188. else {
  12189. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  12190. }
  12191. }
  12192. return values;
  12193. }
  12194. destroy() {
  12195. let bool = true;
  12196. for (let i = 0; i < this.addresses.length; i += 1) {
  12197. bool = bool && location_1.Location.deallocate(this.addresses[i]);
  12198. }
  12199. return bool;
  12200. }
  12201. /**
  12202. * @override
  12203. *
  12204. * Returns the address that contains a list of all addresses of the values present in the array
  12205. */
  12206. get locAddress() {
  12207. throw new Error("!!!Internal Error: Cannot invoke locAddress on StoreObjectArray");
  12208. }
  12209. get addresses() {
  12210. return this.loc_addresses;
  12211. }
  12212. getAt(line, column) {
  12213. if (this.isVector) {
  12214. if (column != null) {
  12215. throw new Error(this.id + " is not a matrix!");
  12216. }
  12217. column = line;
  12218. line = 0;
  12219. }
  12220. else if (column == null) {
  12221. // this is a whole line...
  12222. const values = [];
  12223. for (let col = 0; col < this.columns; col += 1) {
  12224. const index = this.getIndexOf(line, col);
  12225. const address = location_1.Location.find(this.addresses[index]);
  12226. values.push(address.value);
  12227. }
  12228. return values;
  12229. }
  12230. const index = this.getIndexOf(line, column);
  12231. const address = location_1.Location.find(this.addresses[index]);
  12232. return address.value;
  12233. }
  12234. setAt(value, line, column) {
  12235. let used_dims = 1;
  12236. if (column != null) {
  12237. used_dims += 1;
  12238. }
  12239. if (!this.type.canAccept(value.type, used_dims)) {
  12240. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  12241. }
  12242. if (this.isVector) {
  12243. if (column != null) {
  12244. throw new Error(this.id + " is not a matrix!");
  12245. }
  12246. column = line;
  12247. line = 0;
  12248. }
  12249. else if (column == null) {
  12250. throw new Error("!!!Internal Error: Attempting to insert a line into matrix " + this.id);
  12251. }
  12252. const pos = this.getIndexOf(line, column);
  12253. location_1.Location.updateAddress(this.addresses[pos], value.get());
  12254. }
  12255. getIndexOf(line, column) {
  12256. return line * this.columns + column;
  12257. }
  12258. getLocAddressOf(line, column) {
  12259. if (this.isVector) {
  12260. if (column != null) {
  12261. throw new Error(this.id + " is not a matrix!");
  12262. }
  12263. column = line;
  12264. line = 0;
  12265. }
  12266. else if (column == null) {
  12267. // this is a whole line...
  12268. const values = [];
  12269. for (let col = 0; col < this.columns; col += 1) {
  12270. const index = this.getIndexOf(line, col);
  12271. values.push(this.addresses[index]);
  12272. }
  12273. return values;
  12274. }
  12275. const index = this.getIndexOf(line, column);
  12276. return this.addresses[index];
  12277. }
  12278. }
  12279. exports.StoreObjectArray = StoreObjectArray;
  12280. /***/ }),
  12281. /***/ "./js/processor/store/storeObjectRef.ts":
  12282. /*!**********************************************!*\
  12283. !*** ./js/processor/store/storeObjectRef.ts ***!
  12284. \**********************************************/
  12285. /*! no static exports found */
  12286. /***/ (function(module, exports, __webpack_require__) {
  12287. "use strict";
  12288. Object.defineProperty(exports, "__esModule", { value: true });
  12289. exports.StoreObjectRef = void 0;
  12290. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  12291. class StoreObjectRef extends storeObject_1.StoreObject {
  12292. /**
  12293. *
  12294. * @param {StoreObject} stoValue
  12295. */
  12296. constructor(stoValue) {
  12297. super(stoValue.type, stoValue.getRefAddress(), false);
  12298. this.refObj = stoValue.id;
  12299. this.reference_dimension = stoValue.getReferenceDimension();
  12300. }
  12301. get isRef() {
  12302. return true;
  12303. }
  12304. getRefObj() {
  12305. return this.refObj;
  12306. }
  12307. getReferenceDimension() {
  12308. return this.reference_dimension;
  12309. }
  12310. destroy() {
  12311. return false;
  12312. }
  12313. }
  12314. exports.StoreObjectRef = StoreObjectRef;
  12315. /***/ }),
  12316. /***/ "./js/processor/store/store_object_array_ref.ts":
  12317. /*!******************************************************!*\
  12318. !*** ./js/processor/store/store_object_array_ref.ts ***!
  12319. \******************************************************/
  12320. /*! no static exports found */
  12321. /***/ (function(module, exports, __webpack_require__) {
  12322. "use strict";
  12323. Object.defineProperty(exports, "__esModule", { value: true });
  12324. exports.StoreObjectArrayRef = void 0;
  12325. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  12326. class StoreObjectArrayRef extends storeObjectArray_1.StoreObjectArray {
  12327. constructor(stoValue, lines, columns) {
  12328. super(stoValue.type, lines, columns, stoValue.getAddresses(), false);
  12329. this.refObj = stoValue.id;
  12330. }
  12331. get isRef() {
  12332. return true;
  12333. }
  12334. getRefObj() {
  12335. return this.refObj;
  12336. }
  12337. destroy() {
  12338. return false;
  12339. }
  12340. }
  12341. exports.StoreObjectArrayRef = StoreObjectArrayRef;
  12342. /***/ }),
  12343. /***/ "./js/processor/store/value/array_store_value.ts":
  12344. /*!*******************************************************!*\
  12345. !*** ./js/processor/store/value/array_store_value.ts ***!
  12346. \*******************************************************/
  12347. /*! no static exports found */
  12348. /***/ (function(module, exports, __webpack_require__) {
  12349. "use strict";
  12350. Object.defineProperty(exports, "__esModule", { value: true });
  12351. exports.ArrayStoreValue = void 0;
  12352. const array_type_1 = __webpack_require__(/*! ../../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  12353. const store_value_address_1 = __webpack_require__(/*! ./store_value_address */ "./js/processor/store/value/store_value_address.ts");
  12354. class ArrayStoreValue {
  12355. constructor(type, values, lines, columns, id, isConst = false) {
  12356. this.type = type;
  12357. this.id = id;
  12358. this.isConst = isConst;
  12359. this.values = values;
  12360. this.lines = lines;
  12361. this.columns = columns;
  12362. }
  12363. get() {
  12364. return this.values;
  12365. }
  12366. /**
  12367. * @deprecated
  12368. * Potential not necessary since array access is occuring directly in the StoreObject
  12369. * @param line
  12370. * @param column
  12371. */
  12372. getAt(line, column) {
  12373. console.log("Column ", column);
  12374. if (this.isVector()) {
  12375. if (column != null) {
  12376. throw new Error(this.id + " is not a matrix!");
  12377. }
  12378. column = line;
  12379. line = 0;
  12380. }
  12381. else if (column == null) {
  12382. const values = [];
  12383. for (let col = 0; col < this.columns; col += 1) {
  12384. const index = line * this.lines + col;
  12385. values.push(this.values[index]);
  12386. }
  12387. const array_type = this.type;
  12388. const vector_type = new array_type_1.ArrayType(array_type.innerType, array_type.dimensions - 1);
  12389. return new ArrayStoreValue(vector_type, values, this.columns, 0, this.id, this.isConst);
  12390. }
  12391. const index = line * this.lines + column;
  12392. console.log("Get at: ", index);
  12393. return this.values[index];
  12394. }
  12395. setAt(value, line, column) {
  12396. let used_dims = 1;
  12397. if (column != null) {
  12398. used_dims += 1;
  12399. }
  12400. let actual_line = line;
  12401. let actual_column = column;
  12402. if (!this.type.canAccept(value.type, used_dims)) {
  12403. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  12404. }
  12405. if (this.isVector()) {
  12406. if (column != null) {
  12407. throw new Error(this.id + " is not a matrix!");
  12408. }
  12409. actual_column = actual_line;
  12410. actual_line = 0;
  12411. }
  12412. else if (column == null) {
  12413. if (!(value instanceof ArrayStoreValue)) {
  12414. throw new Error("Attempting to insert a single value as a line of matrix " + this.id);
  12415. }
  12416. const actual_values = value.get();
  12417. for (let i = 0; i < this.columns; i += 1) {
  12418. const pos = actual_line * this.columns + i;
  12419. const val = actual_values[i];
  12420. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, val.get(), actual_line, i, this.id, this.isConst);
  12421. }
  12422. }
  12423. const columns = this.columns == null ? 0 : this.columns;
  12424. const pos = actual_line * columns + actual_column;
  12425. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, value.get(), line, column, this.id, this.isConst);
  12426. }
  12427. inStore() {
  12428. return this.id != null;
  12429. }
  12430. isVector() {
  12431. return this.type.dimensions == 1;
  12432. }
  12433. }
  12434. exports.ArrayStoreValue = ArrayStoreValue;
  12435. /***/ }),
  12436. /***/ "./js/processor/store/value/array_store_value_ref.ts":
  12437. /*!***********************************************************!*\
  12438. !*** ./js/processor/store/value/array_store_value_ref.ts ***!
  12439. \***********************************************************/
  12440. /*! no static exports found */
  12441. /***/ (function(module, exports, __webpack_require__) {
  12442. "use strict";
  12443. Object.defineProperty(exports, "__esModule", { value: true });
  12444. exports.ArrayStoreValueRef = void 0;
  12445. class ArrayStoreValueRef {
  12446. constructor(type, values, addresses, lines, columns, id) {
  12447. this.type = type;
  12448. this.values = values;
  12449. this.addresses = addresses;
  12450. this.lines = lines;
  12451. this.columns = columns;
  12452. this.id = id;
  12453. this.isConst = false;
  12454. }
  12455. get() {
  12456. return this.values;
  12457. }
  12458. getAddresses() {
  12459. return this.addresses;
  12460. }
  12461. inStore() {
  12462. return this.id != null;
  12463. }
  12464. }
  12465. exports.ArrayStoreValueRef = ArrayStoreValueRef;
  12466. /***/ }),
  12467. /***/ "./js/processor/store/value/store_value.ts":
  12468. /*!*************************************************!*\
  12469. !*** ./js/processor/store/value/store_value.ts ***!
  12470. \*************************************************/
  12471. /*! no static exports found */
  12472. /***/ (function(module, exports, __webpack_require__) {
  12473. "use strict";
  12474. Object.defineProperty(exports, "__esModule", { value: true });
  12475. exports.StoreValue = void 0;
  12476. class StoreValue {
  12477. constructor(type, value, id, isConst = false) {
  12478. this.type = type;
  12479. this.id = id;
  12480. this.isConst = isConst;
  12481. this.value = value;
  12482. }
  12483. get() {
  12484. return this.value;
  12485. }
  12486. inStore() {
  12487. return this.id != null;
  12488. }
  12489. }
  12490. exports.StoreValue = StoreValue;
  12491. /***/ }),
  12492. /***/ "./js/processor/store/value/store_value_address.ts":
  12493. /*!*********************************************************!*\
  12494. !*** ./js/processor/store/value/store_value_address.ts ***!
  12495. \*********************************************************/
  12496. /*! no static exports found */
  12497. /***/ (function(module, exports, __webpack_require__) {
  12498. "use strict";
  12499. Object.defineProperty(exports, "__esModule", { value: true });
  12500. exports.StoreValueAddress = void 0;
  12501. const store_value_1 = __webpack_require__(/*! ./store_value */ "./js/processor/store/value/store_value.ts");
  12502. class StoreValueAddress extends store_value_1.StoreValue {
  12503. constructor(type, value, line, column, id, isConst = false) {
  12504. super(type, value, id, isConst);
  12505. this.line = line;
  12506. this.column = column;
  12507. }
  12508. }
  12509. exports.StoreValueAddress = StoreValueAddress;
  12510. /***/ }),
  12511. /***/ "./js/processor/store/value/store_value_ref.ts":
  12512. /*!*****************************************************!*\
  12513. !*** ./js/processor/store/value/store_value_ref.ts ***!
  12514. \*****************************************************/
  12515. /*! no static exports found */
  12516. /***/ (function(module, exports, __webpack_require__) {
  12517. "use strict";
  12518. Object.defineProperty(exports, "__esModule", { value: true });
  12519. exports.StoreValueRef = void 0;
  12520. class StoreValueRef {
  12521. constructor(type, value, loc_address, id) {
  12522. this.type = type;
  12523. this.value = value;
  12524. this.loc_address = loc_address;
  12525. this.id = id;
  12526. this.isConst = false;
  12527. this.reference_dimesion = 0;
  12528. }
  12529. get() {
  12530. return this.value;
  12531. }
  12532. getRefAddress() {
  12533. return this.loc_address;
  12534. }
  12535. inStore() {
  12536. return this.id != null;
  12537. }
  12538. getReferenceDimension() {
  12539. return this.reference_dimesion;
  12540. }
  12541. setReferenceDimension(dimension) {
  12542. this.reference_dimesion = dimension;
  12543. }
  12544. }
  12545. exports.StoreValueRef = StoreValueRef;
  12546. /***/ }),
  12547. /***/ "./js/runner.js":
  12548. /*!**********************!*\
  12549. !*** ./js/runner.js ***!
  12550. \**********************/
  12551. /*! exports provided: runner */
  12552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12553. "use strict";
  12554. __webpack_require__.r(__webpack_exports__);
  12555. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return runner; });
  12556. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast/ivprogParser */ "./js/ast/ivprogParser.js");
  12557. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  12558. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./io/domConsole */ "./js/io/domConsole.js");
  12559. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/languageService */ "./js/services/languageService.js");
  12560. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  12561. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memory/location */ "./js/memory/location.ts");
  12562. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_5__);
  12563. function runner() {
  12564. var ivprogLexer = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer(); // const lexer = new ivprogLexer(new InputStream(input));
  12565. // const stream = new CommonTokenStream(lexer);
  12566. // stream.fill();
  12567. // let i = 1;
  12568. // let token = null;
  12569. // while ((token = stream.LT(i)).type !== ivprogLexer.EOF && token.type !== ivprogLexer.WHITESPACE) {
  12570. // console.log(`${token.type}-${token.text}`);
  12571. // console.log('\n')
  12572. // i++;
  12573. // }
  12574. // const anaSin = new IVProgParser(input, ivprogLexer);
  12575. var editor = new window.JsonEditor('#json-renderer', {});
  12576. var domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"]("#console", true);
  12577. domConsole.hide(); // proc.interpretAST().then( sto => {
  12578. // console.log(sto.applyStore('a'));
  12579. // }).catch(e => console.log(e));
  12580. try {
  12581. window.$('#btn').click(function () {
  12582. var input = window.$('#input').val();
  12583. var analiser = new _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__["IVProgParser"](input, ivprogLexer);
  12584. try {
  12585. var data = analiser.parseTree();
  12586. var semAna = new _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__["SemanticAnalyser"](data);
  12587. var proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](semAna.analyseTree());
  12588. proc.registerInput(domConsole);
  12589. domConsole.clear();
  12590. proc.registerOutput(domConsole);
  12591. proc.interpretAST().then(function (sto) {
  12592. console.log(sto);
  12593. editor.load(sto.store);
  12594. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12595. })["catch"](function (e) {
  12596. alert(e);
  12597. console.log(e);
  12598. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12599. });
  12600. } catch (error) {
  12601. alert(error);
  12602. console.log(error);
  12603. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12604. }
  12605. });
  12606. } catch (a) {
  12607. console.log(a);
  12608. }
  12609. }
  12610. /***/ }),
  12611. /***/ "./js/services/i18nHelper.js":
  12612. /*!***********************************!*\
  12613. !*** ./js/services/i18nHelper.js ***!
  12614. \***********************************/
  12615. /*! exports provided: i18nHelper */
  12616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12617. "use strict";
  12618. __webpack_require__.r(__webpack_exports__);
  12619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18nHelper", function() { return i18nHelper; });
  12620. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12621. /* harmony import */ var _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localizedStringsService */ "./js/services/localizedStringsService.js");
  12622. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_0__["default"].StringTypes;
  12623. var i18nHelper = Object.freeze({
  12624. i18n: function i18n(identifier) {
  12625. var opts = identifier.split(':');
  12626. var type = opts[0].toLowerCase();
  12627. var id = opts[1];
  12628. if (StringTypes.ERROR === type) {
  12629. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getError(id);
  12630. } else if (StringTypes.MESSAGE === type) {
  12631. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getMessage(id);
  12632. } else if (StringTypes.UI === type) {
  12633. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI(id);
  12634. } else {
  12635. console.warn("A string has been passed to the i18n helper function that was not in the form type:id -> " + identifier);
  12636. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getString(identifier, type);
  12637. }
  12638. }
  12639. });
  12640. /***/ }),
  12641. /***/ "./js/services/languageService.js":
  12642. /*!****************************************!*\
  12643. !*** ./js/services/languageService.js ***!
  12644. \****************************************/
  12645. /*! exports provided: LanguageService */
  12646. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12647. "use strict";
  12648. __webpack_require__.r(__webpack_exports__);
  12649. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageService", function() { return LanguageService; });
  12650. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12651. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12652. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12653. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12654. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12655. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12656. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12657. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12658. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12659. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12660. /* harmony import */ var _grammar___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../grammar/ */ "./grammar/index.js");
  12661. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12662. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  12663. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  12664. 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); }; }
  12665. 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; } }
  12666. /* global iLMparameters*/
  12667. var LanguageServiceExtended = /*#__PURE__*/function (_line_i18n$LanguageSe) {
  12668. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(LanguageServiceExtended, _line_i18n$LanguageSe);
  12669. var _super = _createSuper(LanguageServiceExtended);
  12670. function LanguageServiceExtended() {
  12671. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, LanguageServiceExtended);
  12672. return _super.call(this, typeof iLMparameters === "undefined" ? _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].default_lang : iLMparameters.lang);
  12673. }
  12674. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(LanguageServiceExtended, [{
  12675. key: "getDefaultLang",
  12676. value: function getDefaultLang() {
  12677. return "en";
  12678. }
  12679. }, {
  12680. key: "getCurrentLexer",
  12681. value: function getCurrentLexer() {
  12682. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12683. if (langInfo === null || langInfo === undefined) {
  12684. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].lexer;
  12685. } else {
  12686. return langInfo.lexer;
  12687. }
  12688. }
  12689. }, {
  12690. key: "getCurrentLangFuncs",
  12691. value: function getCurrentLangFuncs() {
  12692. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12693. if (langInfo === null || langInfo === undefined) {
  12694. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langFuncs;
  12695. } else {
  12696. return langInfo.langFuncs;
  12697. }
  12698. }
  12699. }, {
  12700. key: "getCurrentLangLibs",
  12701. value: function getCurrentLangLibs() {
  12702. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12703. if (langInfo === null || langInfo === undefined) {
  12704. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langLibs;
  12705. }
  12706. return langInfo.langLibs;
  12707. }
  12708. }]);
  12709. return LanguageServiceExtended;
  12710. }(line_i18n__WEBPACK_IMPORTED_MODULE_6__["default"].LanguageServiceNoLS);
  12711. var LanguageService = new LanguageServiceExtended();
  12712. /***/ }),
  12713. /***/ "./js/services/localizedStringsService.js":
  12714. /*!************************************************!*\
  12715. !*** ./js/services/localizedStringsService.js ***!
  12716. \************************************************/
  12717. /*! exports provided: LocalizedStrings, getInstance */
  12718. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12719. "use strict";
  12720. __webpack_require__.r(__webpack_exports__);
  12721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  12722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInstance", function() { return getInstance; });
  12723. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12724. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12725. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12726. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12727. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12728. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12729. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12730. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12731. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12732. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12733. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12734. /* harmony import */ var _languageService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./languageService */ "./js/services/languageService.js");
  12735. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  12736. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../i18n */ "./i18n/index.ts");
  12737. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_i18n__WEBPACK_IMPORTED_MODULE_8__);
  12738. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  12739. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  12740. 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); }; }
  12741. 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; } }
  12742. var IVProgLocalizedStrings = /*#__PURE__*/function (_line_i18n$LocalizedS) {
  12743. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IVProgLocalizedStrings, _line_i18n$LocalizedS);
  12744. var _super = _createSuper(IVProgLocalizedStrings);
  12745. function IVProgLocalizedStrings(langService, langsJsons) {
  12746. var shouldListenToChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  12747. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgLocalizedStrings);
  12748. return _super.call(this, langService, langsJsons, shouldListenToChange);
  12749. }
  12750. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgLocalizedStrings, [{
  12751. key: "translateType",
  12752. value: function translateType(type, dim) {
  12753. var type_string = this.getUI("type_".concat(type));
  12754. switch (dim) {
  12755. case 0:
  12756. return type_string;
  12757. default:
  12758. if (dim > 1) return this.getUI("matrix_info_string", [type_string]);else return this.getUI("vector_info_string", [type_string]);
  12759. }
  12760. }
  12761. }, {
  12762. key: "translateOp",
  12763. value: function translateOp(op) {
  12764. switch (op.ord) {
  12765. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].AND.ord:
  12766. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].OR.ord:
  12767. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NOT.ord:
  12768. return this.getUI("logic_operator_".concat(op.value));
  12769. default:
  12770. return op.value;
  12771. }
  12772. }
  12773. }, {
  12774. key: "translateInternalFunction",
  12775. value: function translateInternalFunction(name) {
  12776. var category = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  12777. if (category == null) {
  12778. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName(name);
  12779. } else {
  12780. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName("".concat(category, ".").concat(name));
  12781. }
  12782. }
  12783. }]);
  12784. return IVProgLocalizedStrings;
  12785. }(line_i18n__WEBPACK_IMPORTED_MODULE_5__["default"].LocalizedStrings);
  12786. var LocalizedStrings = Object.freeze(new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a, true));
  12787. var _instance = null;
  12788. function getInstance() {
  12789. if (_instance == null) {
  12790. _instance = new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a);
  12791. }
  12792. return _instance;
  12793. }
  12794. /***/ }),
  12795. /***/ "./js/services/userLog.js":
  12796. /*!********************************!*\
  12797. !*** ./js/services/userLog.js ***!
  12798. \********************************/
  12799. /*! exports provided: ActionTypes, registerClick, registerUserEvent, registerSystemEvent, getLogs, setRebuildMode, getLogsAsString, parseLogs */
  12800. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12801. "use strict";
  12802. __webpack_require__.r(__webpack_exports__);
  12803. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return ActionTypes; });
  12804. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return registerClick; });
  12805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return registerUserEvent; });
  12806. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSystemEvent", function() { return registerSystemEvent; });
  12807. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return getLogs; });
  12808. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setRebuildMode", function() { return setRebuildMode; });
  12809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return getLogsAsString; });
  12810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return parseLogs; });
  12811. var clicks = [];
  12812. var inRebuildMode = false;
  12813. var ActionTypes = Object.freeze({
  12814. // registerUserEvent payload:
  12815. // (function_name, insert action)
  12816. INSERT_FUNCTION: "INSERT_FUNCTION",
  12817. // (function_name, remove action)
  12818. REMOVE_FUNCTION: "REMOVE_FUNCTION",
  12819. // (var_name,insert action, type, dim)
  12820. INSERT_GLOBAL_VAR: "INSERT_GLOBAL_VAR",
  12821. // (var name, remove action)
  12822. REMOVE_GLOBAL_VAR: "REMOVE_GLOBAL_VAR",
  12823. // (old function name, rename action, new function name)
  12824. RENAME_FUNCTION: "RENAME_FUNCTION",
  12825. // (old var name, rename action. new var name)
  12826. RENAME_GLOBAL_VAR: "RENAME_GLOBAL_VAR",
  12827. // (var name, set const action)
  12828. SET_GLOBAL_CONST: "SET_GLOBAL_CONST",
  12829. // (function name, change return action, type, dim)
  12830. CHANGE_FUNCTION_RETURN: "CHANGE_FUNCTION_RETURN",
  12831. // (var name, change type action, type, dim, rows?, columns?)
  12832. CHANGE_GLOBAL_TYPE: "CHANGE_GLOBAL_TYPE",
  12833. // (var name, change value action, value)
  12834. CHANGE_GLOBAL_VALUE: "CHANGE_GLOBAL_VALUE",
  12835. // (function name, insert param action, param varname, type, dim)
  12836. INSERT_FUNCTION_PARAM: "INSERT_FUNCTION_PARAM",
  12837. // (function name, remove param action, param varname)
  12838. REMOVE_FUNCTION_PARAM: "REMOVE_FUNCTION_PARAM",
  12839. // (function name, change param type action, type, dim)
  12840. CHANGE_PARAM_TYPE: "CHANGE_PARAM_TYPE",
  12841. // (function name, rename param action, old param name, new param name)
  12842. RENAME_FUNCTION_PARAM: "RENAME_FUNCTION_PARAM",
  12843. // (function name, insert var action, var name, type, dim)
  12844. INSERT_FUNCTION_VAR: "INSERT_FUCNTION_VAR",
  12845. // (function name, remove var action, var name)
  12846. REMOVE_FUNCTION_VAR: "REMOVE_FUNCTION_VAR",
  12847. // (function name, rename var action, old var name, new var name)
  12848. RENAME_FUNCTION_VAR: "RENAME_FUNCTION_VAR",
  12849. // (function name, change var type action, var name, type, dim, rows?, columns?)
  12850. CHANGE_VAR_TYPE: "CHANGE_VAR_TYPE",
  12851. // (function name, change var value action, var name, value)
  12852. CHANGE_VAR_VALUE: "CHANGE_VAR_VALUE",
  12853. // (function name, insert command action, command, path)
  12854. INSERT_COMMAND: "INSERT_COMMAND",
  12855. // (function name, remove command action, path)
  12856. REMOVE_COMMAND: "REMOVE_COMMAND",
  12857. // (function name, change command exp action, path, exp)
  12858. CHANGE_COMMAND_EXP: "CHANGE_COMMAND_EXP",
  12859. // (function name, change attrib exp action, path, exp)
  12860. CHANGE_ATTRIB_EXP: "CHANGE_ATTRIB_EXP",
  12861. // (function name, change attrib var action, path, var name, row_exp?, column_exp?)
  12862. CHANGE_ATTRIB_VAR: "CHANGE_ATTRIB_VAR",
  12863. // (function name, move command action, old path, new path)
  12864. MOVE_COMMAND: "MOVE_COMMAND",
  12865. // (function name, enter change name action, var name)
  12866. ENTER_CHANGE_VAR_NAME: 'ENTER_CHANGE_VAR_NAME',
  12867. // (function name, enter change value action, var name)
  12868. ENTER_CHANGE_VAR_VALUE: 'ENTER_CHANGE_VAR_VALUE',
  12869. // (var name, enter change name action)
  12870. ENTER_CHANGE_GLOBAL_NAME: 'ENTER_CHANGE_GLOBAL_NAME',
  12871. // (var name, enter change value action)
  12872. ENTER_CHANGE_GLOBAL_VALUE: 'ENTER_CHANGE_GLOBAL_VALUE',
  12873. // (function name, enter change name action, param name)
  12874. ENTER_CHANGE_PARAM_NAME: 'ENTER_CHANGE_PARAM_NAME'
  12875. });
  12876. function registerClick(x, y, details) {
  12877. if (inRebuildMode) {
  12878. return;
  12879. }
  12880. clicks.push([x, y, Date.now(), details]);
  12881. }
  12882. function registerUserEvent(command, action) {
  12883. for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  12884. params[_key - 2] = arguments[_key];
  12885. }
  12886. registerEvent('user_event', command, action, params);
  12887. }
  12888. function registerSystemEvent(command, action) {
  12889. for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  12890. params[_key2 - 2] = arguments[_key2];
  12891. }
  12892. registerEvent('system_event', command, action, params);
  12893. }
  12894. function registerEvent(tag, command, action, params) {
  12895. if (inRebuildMode) {
  12896. return;
  12897. }
  12898. var event = {
  12899. context: command,
  12900. action: action,
  12901. params: params
  12902. };
  12903. clicks.push([tag, Date.now(), event]);
  12904. }
  12905. function getLogs() {
  12906. return clicks;
  12907. }
  12908. function setRebuildMode(flag) {
  12909. inRebuildMode = flag;
  12910. }
  12911. function getLogsAsString() {
  12912. return JSON.stringify(clicks);
  12913. }
  12914. function parseLogs(logData) {
  12915. clicks = JSON.parse(logData);
  12916. }
  12917. /***/ }),
  12918. /***/ "./js/typeSystem/array_type.ts":
  12919. /*!*************************************!*\
  12920. !*** ./js/typeSystem/array_type.ts ***!
  12921. \*************************************/
  12922. /*! no static exports found */
  12923. /***/ (function(module, exports, __webpack_require__) {
  12924. "use strict";
  12925. Object.defineProperty(exports, "__esModule", { value: true });
  12926. exports.ArrayType = void 0;
  12927. class ArrayType {
  12928. constructor(type, dimensions) {
  12929. this.dimensions = dimensions;
  12930. this.innerType = type;
  12931. }
  12932. get isVector() {
  12933. return this.dimensions == 1;
  12934. }
  12935. isCompatible(another) {
  12936. if (another instanceof ArrayType) {
  12937. if (this.dimensions !== another.dimensions) {
  12938. return false;
  12939. }
  12940. return this.innerType.isCompatible(another.innerType);
  12941. }
  12942. return false;
  12943. }
  12944. stringInfo() {
  12945. const list = this.innerType.stringInfo();
  12946. list.forEach(v => {
  12947. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  12948. const tmp = v;
  12949. tmp.dim = this.dimensions;
  12950. });
  12951. return list;
  12952. }
  12953. get value() {
  12954. return undefined;
  12955. }
  12956. get ord() {
  12957. return undefined;
  12958. }
  12959. canAccept(another, used_dims) {
  12960. const free_dims = this.dimensions - used_dims;
  12961. if (another instanceof ArrayType) {
  12962. return free_dims == another.dimensions && this.innerType.isCompatible(another.innerType);
  12963. }
  12964. else {
  12965. return free_dims == 0 && this.innerType.isCompatible(another);
  12966. }
  12967. }
  12968. }
  12969. exports.ArrayType = ArrayType;
  12970. /***/ }),
  12971. /***/ "./js/typeSystem/multiType.ts":
  12972. /*!************************************!*\
  12973. !*** ./js/typeSystem/multiType.ts ***!
  12974. \************************************/
  12975. /*! no static exports found */
  12976. /***/ (function(module, exports, __webpack_require__) {
  12977. "use strict";
  12978. Object.defineProperty(exports, "__esModule", { value: true });
  12979. exports.MultiType = void 0;
  12980. class MultiType {
  12981. constructor(types) {
  12982. this.types = types;
  12983. }
  12984. get value() {
  12985. return undefined;
  12986. }
  12987. get ord() {
  12988. return undefined;
  12989. }
  12990. stringInfo() {
  12991. let list = [];
  12992. for (let i = 0; i < this.types.length; i++) {
  12993. const t = this.types[i];
  12994. list = list.concat(t.stringInfo());
  12995. }
  12996. return list;
  12997. }
  12998. isCompatible(another) {
  12999. for (let i = 0; i < this.types.length; i++) {
  13000. const t = this.types[i];
  13001. if (another.isCompatible(t)) {
  13002. return true;
  13003. }
  13004. }
  13005. return false;
  13006. }
  13007. }
  13008. exports.MultiType = MultiType;
  13009. /***/ }),
  13010. /***/ "./js/typeSystem/parsers.js":
  13011. /*!**********************************!*\
  13012. !*** ./js/typeSystem/parsers.js ***!
  13013. \**********************************/
  13014. /*! exports provided: toInt, toString, toChar, toReal, toBool, convertBoolToString, convertToString */
  13015. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13016. "use strict";
  13017. __webpack_require__.r(__webpack_exports__);
  13018. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toInt", function() { return toInt; });
  13019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return toString; });
  13020. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toChar", function() { return toChar; });
  13021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toReal", function() { return toReal; });
  13022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toBool", function() { return toBool; });
  13023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBoolToString", function() { return convertBoolToString; });
  13024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToString", function() { return convertToString; });
  13025. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  13026. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ "./js/typeSystem/types.ts");
  13027. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_1__);
  13028. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  13029. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
  13030. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  13031. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_3__);
  13032. function toInt(str) {
  13033. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(str);
  13034. }
  13035. function toString(str) {
  13036. var value = str.replace(/^"/, "");
  13037. value = value.replace(/"$/, "");
  13038. value = value.replace(/\\b/g, "\b");
  13039. value = value.replace(/\\t/g, "\t");
  13040. value = value.replace(/\\n/g, "\n");
  13041. value = value.replace(/\\r/g, "\r");
  13042. value = value.replace(/\\"/g, '"');
  13043. value = value.replace(/\\'/g, "'");
  13044. value = value.replace(/\\\\/g, "\\");
  13045. return value;
  13046. }
  13047. function toChar(str) {
  13048. console.debug(str, str.length);
  13049. var value = str.replace(/^'/, "");
  13050. value = value.replace(/'$/, "");
  13051. value = value.replace(/\\b/g, "\b");
  13052. value = value.replace(/\\t/g, "\t");
  13053. value = value.replace(/\\n/g, "\n");
  13054. value = value.replace(/\\r/g, "\r");
  13055. value = value.replace(/\\"/g, '"');
  13056. value = value.replace(/\\'/g, "'");
  13057. value = value[0];
  13058. return value;
  13059. }
  13060. function toReal(value) {
  13061. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(value);
  13062. }
  13063. function toBool(str) {
  13064. var val = "'" + str + "'";
  13065. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  13066. var instance = new lexer(null);
  13067. if (instance.literalNames[lexer.RK_TRUE] === val) {
  13068. return true;
  13069. } else if (instance.literalNames[lexer.RK_FALSE] === val) {
  13070. return false;
  13071. } else {
  13072. // TODO: better error message
  13073. throw new Error(str + "not a valid boolean");
  13074. }
  13075. }
  13076. function convertBoolToString(bool) {
  13077. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  13078. var instance = new lexer(null);
  13079. var result = null;
  13080. if (bool) {
  13081. result = instance.literalNames[lexer.RK_TRUE];
  13082. } else {
  13083. result = instance.literalNames[lexer.RK_FALSE];
  13084. }
  13085. return result.replace(/'/g, "");
  13086. }
  13087. function convertToString(value, type) {
  13088. switch (type.ord) {
  13089. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER.ord:
  13090. return value.toString();
  13091. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL.ord:
  13092. {
  13093. if (value.dp() <= 0) {
  13094. return value.toFixed(1);
  13095. } else {
  13096. return value.toFixed(_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].decimalPlaces);
  13097. }
  13098. }
  13099. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN.ord:
  13100. return convertBoolToString(value);
  13101. default:
  13102. return value;
  13103. }
  13104. }
  13105. /***/ }),
  13106. /***/ "./js/typeSystem/type.ts":
  13107. /*!*******************************!*\
  13108. !*** ./js/typeSystem/type.ts ***!
  13109. \*******************************/
  13110. /*! no static exports found */
  13111. /***/ (function(module, exports, __webpack_require__) {
  13112. "use strict";
  13113. Object.defineProperty(exports, "__esModule", { value: true });
  13114. exports.Type = void 0;
  13115. class Type {
  13116. constructor(value, ord) {
  13117. this.value = value;
  13118. this.ord = ord;
  13119. }
  13120. stringInfo() {
  13121. return [{ type: this.value, dim: 0 }];
  13122. }
  13123. isCompatible(another) {
  13124. return this.value === another.value && this.ord === another.ord;
  13125. }
  13126. }
  13127. exports.Type = Type;
  13128. /***/ }),
  13129. /***/ "./js/typeSystem/types.ts":
  13130. /*!********************************!*\
  13131. !*** ./js/typeSystem/types.ts ***!
  13132. \********************************/
  13133. /*! no static exports found */
  13134. /***/ (function(module, exports, __webpack_require__) {
  13135. "use strict";
  13136. Object.defineProperty(exports, "__esModule", { value: true });
  13137. exports.fromOrdToType = exports.Types = void 0;
  13138. const type_1 = __webpack_require__(/*! ./type */ "./js/typeSystem/type.ts");
  13139. const multiType_1 = __webpack_require__(/*! ./multiType */ "./js/typeSystem/multiType.ts");
  13140. const maybe_1 = __webpack_require__(/*! ../util/maybe */ "./js/util/maybe.ts");
  13141. const INTEGER = new type_1.Type("integer", 0);
  13142. const REAL = new type_1.Type("real", 1);
  13143. const STRING = new type_1.Type("text", 2);
  13144. const BOOLEAN = new type_1.Type("boolean", 3);
  13145. const CHAR = new type_1.Type("char", 4);
  13146. const VOID = new type_1.Type("void", 5);
  13147. const UNDEFINED = new type_1.Type("undefined", 6);
  13148. const ALL = new multiType_1.MultiType([INTEGER, REAL, STRING, CHAR, BOOLEAN]);
  13149. exports.Types = Object.freeze({
  13150. INTEGER: INTEGER,
  13151. REAL: REAL,
  13152. STRING: STRING,
  13153. CHAR: CHAR,
  13154. BOOLEAN: BOOLEAN,
  13155. VOID: VOID,
  13156. UNDEFINED: UNDEFINED,
  13157. ALL: ALL
  13158. });
  13159. function fromOrdToType(ord) {
  13160. const typeMap = exports.Types;
  13161. for (const t in typeMap) {
  13162. if (typeMap[t].ord && typeMap[t].ord === ord) {
  13163. return maybe_1.Maybe.some(typeMap[t]);
  13164. }
  13165. }
  13166. return maybe_1.Maybe.none();
  13167. }
  13168. exports.fromOrdToType = fromOrdToType;
  13169. /***/ }),
  13170. /***/ "./js/util/auto_gen_output.js":
  13171. /*!************************************!*\
  13172. !*** ./js/util/auto_gen_output.js ***!
  13173. \************************************/
  13174. /*! exports provided: autoGenerateTestCaseOutput */
  13175. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13176. "use strict";
  13177. __webpack_require__.r(__webpack_exports__);
  13178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return autoGenerateTestCaseOutput; });
  13179. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  13180. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  13181. /* harmony import */ var _inputTest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inputTest */ "./js/util/inputTest.js");
  13182. /* harmony import */ var _outputTest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./outputTest */ "./js/util/outputTest.js");
  13183. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13184. function autoGenerateTestCaseOutput(program_text, testCases) {
  13185. var copyTestCases = testCases.map(function (test) {
  13186. return Object.assign({}, test);
  13187. });
  13188. try {
  13189. var program = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__["SemanticAnalyser"].analyseFromSource(program_text);
  13190. var resultList = testCases.map(function (test, id) {
  13191. var input = new _inputTest__WEBPACK_IMPORTED_MODULE_2__["InputTest"](test.input);
  13192. var output = new _outputTest__WEBPACK_IMPORTED_MODULE_3__["OutputTest"]();
  13193. var exec = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](program);
  13194. exec.registerInput(input);
  13195. exec.registerOutput(output);
  13196. return exec.interpretAST().then(function (_) {
  13197. return {
  13198. id: id,
  13199. program: exec
  13200. };
  13201. });
  13202. });
  13203. return Promise.all(resultList).then(function (result_final) {
  13204. for (var i = 0; i < result_final.length; ++i) {
  13205. var result = result_final[i];
  13206. var output = result.program.output.list;
  13207. var input = result.program.input;
  13208. if (input.index != input.inputList.length) {
  13209. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_unused_input", [result.id + 1]));
  13210. return Promise.resolve(false);
  13211. }
  13212. if (output.length == 0) {
  13213. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_empty", [result.id + 1]));
  13214. }
  13215. copyTestCases[result.id].output = output;
  13216. }
  13217. window.outputGenerated(copyTestCases);
  13218. return Promise.resolve(true);
  13219. });
  13220. } catch (error) {
  13221. return Promise.reject(error);
  13222. }
  13223. }
  13224. /***/ }),
  13225. /***/ "./js/util/config.ts":
  13226. /*!***************************!*\
  13227. !*** ./js/util/config.ts ***!
  13228. \***************************/
  13229. /*! no static exports found */
  13230. /***/ (function(module, exports, __webpack_require__) {
  13231. "use strict";
  13232. Object.defineProperty(exports, "__esModule", { value: true });
  13233. exports.Config = void 0;
  13234. class ConfigObject {
  13235. constructor() {
  13236. this.decimalPlaces = 8;
  13237. this.intConvertRoundMode = 2;
  13238. this.default_lang = "pt";
  13239. this.enable_type_casting = true;
  13240. this.idle_input_interval = 5000;
  13241. this.suspend_threshold = 1000;
  13242. // this.max_instruction_count = 350250; - automated evaluation limit
  13243. this.max_instruction_count = Number.MAX_SAFE_INTEGER;
  13244. }
  13245. setConfig(opts) {
  13246. const otherConfig = opts;
  13247. for (const key in otherConfig) {
  13248. if (Object.prototype.hasOwnProperty.call(this, key)) {
  13249. this[key] = otherConfig[key];
  13250. }
  13251. }
  13252. }
  13253. }
  13254. const config = new ConfigObject();
  13255. exports.Config = config;
  13256. /***/ }),
  13257. /***/ "./js/util/editorMode2.js":
  13258. /*!********************************!*\
  13259. !*** ./js/util/editorMode2.js ***!
  13260. \********************************/
  13261. /*! exports provided: CodeEditorMode */
  13262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13263. "use strict";
  13264. __webpack_require__.r(__webpack_exports__);
  13265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditorMode", function() { return CodeEditorMode; });
  13266. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./js/util/utils.js");
  13267. /**
  13268. * Source: https://raw.githubusercontent.com/codemirror/CodeMirror/master/mode/clike/clike.js
  13269. * @author arijn Haverbeke and others
  13270. * @author Lucas de Souza
  13271. * @param {CodeMirror} CodeMirror
  13272. */
  13273. function CodeEditorMode(CodeMirror) {
  13274. "use strict";
  13275. function Context(indented, column, type, info, align, prev) {
  13276. this.indented = indented;
  13277. this.column = column;
  13278. this.type = type;
  13279. this.info = info;
  13280. this.align = align;
  13281. this.prev = prev;
  13282. }
  13283. function pushContext(state, col, type, info) {
  13284. var indent = state.indented;
  13285. if (state.context && state.context.type == "statement" && type != "statement") indent = state.context.indented;
  13286. return state.context = new Context(indent, col, type, info, null, state.context);
  13287. }
  13288. function popContext(state) {
  13289. var t = state.context.type;
  13290. if (t == ")" || t == "]" || t == "}") state.indented = state.context.indented;
  13291. return state.context = state.context.prev;
  13292. }
  13293. function typeBefore(stream, state, pos) {
  13294. if (state.prevToken == "variable" || state.prevToken == "type") return true;
  13295. if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
  13296. if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
  13297. }
  13298. function isTopScope(context) {
  13299. for (;;) {
  13300. if (!context || context.type == "top") return true;
  13301. if (context.type == "}" && context.prev.info != "namespace") return false;
  13302. context = context.prev;
  13303. }
  13304. }
  13305. function contains(words, word) {
  13306. if (typeof words === "function") {
  13307. return words(word);
  13308. } else {
  13309. return Object.propertyIsEnumerable.call(words, word);
  13310. }
  13311. }
  13312. function tokenComment(stream, state) {
  13313. var maybeEnd = false,
  13314. ch;
  13315. while (ch = stream.next()) {
  13316. if (ch == "/" && maybeEnd) {
  13317. state.tokenize = null;
  13318. break;
  13319. }
  13320. maybeEnd = ch == "*";
  13321. }
  13322. return "comment";
  13323. }
  13324. CodeMirror.defineMode("ivprog", function (config, parserConfig) {
  13325. var indentUnit = config.indentUnit,
  13326. statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
  13327. dontAlignCalls = parserConfig.dontAlignCalls,
  13328. keywords = parserConfig.keywords || {},
  13329. switchKeyword = parserConfig.switchKeyword,
  13330. caseKeyword = parserConfig.caseKeyword,
  13331. defaultKeyword = parserConfig.defaultKeyword,
  13332. caseRegex = new RegExp("^\\s*(?:".concat(caseKeyword, " .*?:|").concat(defaultKeyword, ":|\\{\\}?|\\})$")),
  13333. ////,
  13334. types = parserConfig.types || {},
  13335. builtin = parserConfig.builtin || {},
  13336. blockKeywords = parserConfig.blockKeywords || {},
  13337. defKeywords = parserConfig.defKeywords || {},
  13338. atoms = parserConfig.atoms || {},
  13339. hooks = parserConfig.hooks || {},
  13340. multiLineStrings = parserConfig.multiLineStrings,
  13341. indentStatements = false,
  13342. namespaceSeparator = null,
  13343. isPunctuationChar = /[[\]{}(),;:\n]/,
  13344. numberStart = /[\d.]/,
  13345. number = /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)$/i,
  13346. isOperatorChar = /[+\-*%=<>!/&]/,
  13347. isIdentifierChar = /[a-zA-Z0-9_]/,
  13348. // An optional function that takes a {string} token and returns true if it
  13349. // should be treated as a builtin.
  13350. isReservedIdentifier = parserConfig.isReservedIdentifier || false;
  13351. var curPunc, isDefKeyword;
  13352. var tokenString = function tokenString() {
  13353. /*SKIP*/
  13354. };
  13355. function tokenBase(stream, state) {
  13356. var ch = stream.next();
  13357. if (hooks[ch]) {
  13358. var result = hooks[ch](stream, state);
  13359. if (result !== false) return result;
  13360. }
  13361. if (ch == '"') {
  13362. state.tokenize = tokenString(ch);
  13363. return state.tokenize(stream, state);
  13364. }
  13365. if (isPunctuationChar.test(ch)) {
  13366. curPunc = ch;
  13367. return null;
  13368. }
  13369. if (numberStart.test(ch)) {
  13370. stream.backUp(1);
  13371. if (stream.match(number)) return "number";
  13372. stream.next();
  13373. }
  13374. if (ch == "/") {
  13375. if (stream.eat("*")) {
  13376. state.tokenize = tokenComment;
  13377. return tokenComment(stream, state);
  13378. }
  13379. if (stream.eat("/")) {
  13380. stream.skipToEnd();
  13381. return "comment";
  13382. }
  13383. }
  13384. if (isOperatorChar.test(ch)) {
  13385. while (!stream.match(/^\/[/*]/, false) && stream.eat(isOperatorChar)) {
  13386. /* SKIP */
  13387. }
  13388. return "operator";
  13389. }
  13390. stream.eatWhile(isIdentifierChar);
  13391. if (namespaceSeparator) while (stream.match(namespaceSeparator)) {
  13392. stream.eatWhile(isIdentifierChar);
  13393. }
  13394. var cur = stream.current();
  13395. if (contains(keywords, cur)) {
  13396. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  13397. if (contains(defKeywords, cur)) isDefKeyword = true;
  13398. return "keyword";
  13399. }
  13400. if (contains(types, cur)) return "type";
  13401. if (contains(builtin, cur) || isReservedIdentifier && isReservedIdentifier(cur)) {
  13402. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  13403. return "builtin";
  13404. }
  13405. if (contains(atoms, cur)) return "atom";
  13406. return "variable";
  13407. }
  13408. tokenString = function tokenString(quote) {
  13409. return function (stream, state) {
  13410. var escaped = false,
  13411. next,
  13412. end = false;
  13413. while ((next = stream.next()) != null) {
  13414. if (next == quote && !escaped) {
  13415. end = true;
  13416. break;
  13417. }
  13418. escaped = !escaped && next == "\\";
  13419. }
  13420. if (end || !(escaped || multiLineStrings)) state.tokenize = null;
  13421. return "string";
  13422. };
  13423. };
  13424. function maybeEOL(stream, state) {
  13425. if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) state.typeAtEndOfLine = typeBefore(stream, state, stream.pos);
  13426. } // Interface
  13427. return {
  13428. startState: function startState(basecolumn) {
  13429. return {
  13430. tokenize: null,
  13431. context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
  13432. indented: 0,
  13433. startOfLine: true,
  13434. prevToken: null
  13435. };
  13436. },
  13437. token: function token(stream, state) {
  13438. var ctx = state.context;
  13439. if (stream.sol()) {
  13440. if (ctx.align == null) ctx.align = false;
  13441. state.indented = stream.indentation();
  13442. state.startOfLine = true;
  13443. }
  13444. if (stream.eatSpace()) {
  13445. maybeEOL(stream, state);
  13446. return null;
  13447. }
  13448. curPunc = isDefKeyword = null;
  13449. var style = (state.tokenize || tokenBase)(stream, state);
  13450. if (style == "comment" || style == "meta") return style;
  13451. if (ctx.align == null) ctx.align = true;
  13452. if (curPunc == ";" || curPunc == ":" || curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)) while (state.context.type == "statement") {
  13453. popContext(state);
  13454. } else if (curPunc == "{") pushContext(state, stream.column(), "}");else if (curPunc == "[") pushContext(state, stream.column(), "]");else if (curPunc == "(") pushContext(state, stream.column(), ")");else if (curPunc == "}") {
  13455. while (ctx.type == "statement") {
  13456. ctx = popContext(state);
  13457. }
  13458. if (ctx.type == "}") ctx = popContext(state);
  13459. while (ctx.type == "statement") {
  13460. ctx = popContext(state);
  13461. }
  13462. } else if (curPunc == ctx.type) popContext(state);else if (indentStatements && ((ctx.type == "}" || ctx.type == "top") && curPunc != ";" || ctx.type == "statement" && curPunc == "newstatement")) {
  13463. pushContext(state, stream.column(), "statement", stream.current());
  13464. }
  13465. if (style == "variable" && (state.prevToken == "def" || parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && isTopScope(state.context) && stream.match(/^\s*\(/, false))) style = "def";
  13466. if (hooks.token) {
  13467. var result = hooks.token(stream, state, style);
  13468. if (result !== undefined) style = result;
  13469. }
  13470. if (style == "def" && parserConfig.styleDefs === false) style = "variable";
  13471. state.startOfLine = false;
  13472. state.prevToken = isDefKeyword ? "def" : style || curPunc;
  13473. maybeEOL(stream, state);
  13474. return style;
  13475. },
  13476. indent: function indent(state, textAfter) {
  13477. if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
  13478. var ctx = state.context;
  13479. var firstChar = textAfter && textAfter.charAt(0);
  13480. var closing = firstChar == ctx.type;
  13481. if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
  13482. if (parserConfig.dontIndentStatements) while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) {
  13483. ctx = ctx.prev;
  13484. }
  13485. if (hooks.indent) {
  13486. var hook = hooks.indent(state, ctx, textAfter, indentUnit);
  13487. if (typeof hook == "number") return hook;
  13488. }
  13489. var switchBlock = ctx.prev && ctx.prev.info == switchKeyword;
  13490. if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
  13491. while (ctx.type != "top" && ctx.type != "}") {
  13492. ctx = ctx.prev;
  13493. }
  13494. return ctx.indented;
  13495. }
  13496. if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
  13497. if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
  13498. if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
  13499. var caseTestRegex = new RegExp("^(?:".concat(caseKeyword, "|").concat(defaultKeyword, ")\b"));
  13500. return ctx.indented + (closing ? 0 : indentUnit) + (!closing && switchBlock && !caseTestRegex.test(textAfter) ? indentUnit : 0);
  13501. },
  13502. electricInput: caseRegex,
  13503. blockCommentStart: "/*",
  13504. blockCommentEnd: "*/",
  13505. blockCommentContinue: " * ",
  13506. lineComment: "//",
  13507. fold: "brace"
  13508. };
  13509. });
  13510. function words(str) {
  13511. var obj = {},
  13512. words = str.split(" ");
  13513. for (var i = 0; i < words.length; ++i) {
  13514. obj[words[i]] = true;
  13515. }
  13516. return obj;
  13517. }
  13518. var codeConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getCodeEditorModeConfig"])();
  13519. var ivprogKeywords = codeConfig.keywords.join(" ");
  13520. var basicTypes = words(codeConfig.types.join(" "));
  13521. function ivprogTypes(identifier) {
  13522. return contains(basicTypes, identifier);
  13523. }
  13524. var ivprogBlockKeywords = codeConfig.blocks.join(" ");
  13525. var ivprogDefKeywords = "funcao const";
  13526. function def(mimes, mode) {
  13527. if (typeof mimes == "string") mimes = [mimes];
  13528. var words = [];
  13529. function add(obj) {
  13530. if (obj) {
  13531. for (var prop in obj) {
  13532. if (Object.hasOwnProperty.call(obj, prop)) {
  13533. words.push(prop);
  13534. }
  13535. }
  13536. }
  13537. }
  13538. add(mode.keywords);
  13539. add(mode.types);
  13540. add(mode.builtin);
  13541. add(mode.atoms);
  13542. if (words.length) {
  13543. mode.helperType = mimes[0];
  13544. CodeMirror.registerHelper("hintWords", mimes[0], words);
  13545. }
  13546. for (var i = 0; i < mimes.length; ++i) {
  13547. CodeMirror.defineMIME(mimes[i], mode);
  13548. }
  13549. }
  13550. def(["text/x-ivprog"], {
  13551. name: "ivprog",
  13552. keywords: words(ivprogKeywords),
  13553. types: ivprogTypes,
  13554. blockKeywords: words(ivprogBlockKeywords),
  13555. defKeywords: words(ivprogDefKeywords),
  13556. typeFirstDefinitions: true,
  13557. atoms: words(codeConfig.atoms.join(" ")),
  13558. switchKeyword: codeConfig.switchString,
  13559. caseKeyword: codeConfig.case_default[0],
  13560. defaultKeyword: codeConfig.case_default[1],
  13561. modeProps: {
  13562. fold: ["brace"]
  13563. }
  13564. });
  13565. }
  13566. /***/ }),
  13567. /***/ "./js/util/iassignHelpers.js":
  13568. /*!***********************************!*\
  13569. !*** ./js/util/iassignHelpers.js ***!
  13570. \***********************************/
  13571. /*! exports provided: prepareActivityToStudentHelper, autoEval */
  13572. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13573. "use strict";
  13574. __webpack_require__.r(__webpack_exports__);
  13575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return prepareActivityToStudentHelper; });
  13576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return autoEval; });
  13577. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../visualUI/functions */ "./js/visualUI/functions.js");
  13578. /* harmony import */ var _visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../visualUI/code_generator */ "./js/visualUI/code_generator.js");
  13579. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  13580. /* harmony import */ var _testConsole__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./testConsole */ "./js/util/testConsole.js");
  13581. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  13582. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  13583. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./maybe */ "./js/util/maybe.ts");
  13584. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_maybe__WEBPACK_IMPORTED_MODULE_6__);
  13585. function parseActivityData(data) {
  13586. var algorithm_in_ilm = null;
  13587. if (data.split("\n::algorithm::")[1]) {
  13588. algorithm_in_ilm = data.split("\n::algorithm::")[1].split("\n::logs::")[0];
  13589. var logs = data.split("\n::algorithm::")[1].split("\n::logs::")[1];
  13590. if (logs != null) {
  13591. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"])(logs);
  13592. }
  13593. }
  13594. var content;
  13595. try {
  13596. content = JSON.parse(data.split("\n::algorithm::")[0]);
  13597. content["algorithm_in_ilm"] = algorithm_in_ilm;
  13598. } catch (e) {
  13599. console.error(e);
  13600. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].none();
  13601. }
  13602. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].some(content);
  13603. }
  13604. function prepareActivityToStudentHelper(ilm_cont) {
  13605. var maybe_content = parseActivityData(ilm_cont);
  13606. return maybe_content.map(function (content) {
  13607. var testCases = content.testcases;
  13608. Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["setTestCases"])(testCases);
  13609. var prog_type = null;
  13610. if (content.settings_programming_type) {
  13611. prog_type = content.settings_programming_type[0].value;
  13612. } else {
  13613. prog_type = "visual";
  13614. }
  13615. return {
  13616. settingsProgrammingType: prog_type,
  13617. settingsDataTypes: content.settings_data_types,
  13618. settingsCommands: content.settings_commands,
  13619. settingsFunctions: content.settings_functions,
  13620. algorithmInIlm: content.algorithm_in_ilm,
  13621. settingsFilter: content.settings_filter
  13622. };
  13623. });
  13624. }
  13625. function compareArray(a, b) {
  13626. for (var i = 0; i < a.length; ++i) {
  13627. var elementA = a[i];
  13628. var elementB = b[i];
  13629. if (elementA != elementB) {
  13630. return false;
  13631. }
  13632. }
  13633. return true;
  13634. }
  13635. function compareTestcases(original, student) {
  13636. if (original.length != student.length) {
  13637. return false;
  13638. }
  13639. for (var i = 0; i < original.length; ++i) {
  13640. var elementO = original[i];
  13641. var elementS = student[i];
  13642. if (!compareArray(elementO.input, elementS.input)) {
  13643. return false;
  13644. }
  13645. if (!compareArray(elementO.output, elementS.output)) {
  13646. return false;
  13647. }
  13648. }
  13649. return true;
  13650. }
  13651. function autoEval(originalData, callback) {
  13652. var code = Object(_visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__["generate"])(); //console.debug(code);
  13653. var original = parseActivityData(originalData).getOrElse(undefined);
  13654. if (original == null) {
  13655. alert("iAssign did not provide the original activity data!");
  13656. return callback(null);
  13657. }
  13658. if (code == null) {
  13659. return callback(-1); // @FeedbackConvention Casos de teste vazios
  13660. } else {
  13661. if (!compareTestcases(original.testcases, Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["getTestCases"])())) {
  13662. return callback(-2); // @FeedbackConvention Casos de teste alterados pelo aluno
  13663. }
  13664. try {
  13665. var ast_code = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__["SemanticAnalyser"].analyseFromSource(code);
  13666. var con = new _testConsole__WEBPACK_IMPORTED_MODULE_3__["TestConsole"]([]);
  13667. var autoAssessment = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__["IVProgAssessment"](ast_code, original.testcases, con);
  13668. autoAssessment.runTest().then(function (grade) {
  13669. return callback(grade);
  13670. })["catch"](function (err) {
  13671. console.log(err);
  13672. callback(-5); // @FeedbackConvention Falha na execução
  13673. });
  13674. } catch (e) {
  13675. console.error(e);
  13676. callback(-5);
  13677. }
  13678. }
  13679. }
  13680. /***/ }),
  13681. /***/ "./js/util/inputTest.js":
  13682. /*!******************************!*\
  13683. !*** ./js/util/inputTest.js ***!
  13684. \******************************/
  13685. /*! exports provided: InputTest */
  13686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13687. "use strict";
  13688. __webpack_require__.r(__webpack_exports__);
  13689. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputTest", function() { return InputTest; });
  13690. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13691. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13692. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13693. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13694. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13695. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13696. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13697. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13698. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13699. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13700. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13701. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13702. 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); }; }
  13703. 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; } }
  13704. var InputTest = /*#__PURE__*/function (_Input) {
  13705. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputTest, _Input);
  13706. var _super = _createSuper(InputTest);
  13707. function InputTest(inputList) {
  13708. var _this;
  13709. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputTest);
  13710. _this = _super.call(this);
  13711. _this.index = 0;
  13712. _this.inputList = inputList;
  13713. return _this;
  13714. }
  13715. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputTest, [{
  13716. key: "requestInput",
  13717. value: function requestInput() {
  13718. var _this2 = this;
  13719. var promise = new Promise(function (resolve, reject) {
  13720. if (_this2.index < _this2.inputList.length) {
  13721. resolve(_this2.inputList[_this2.index]);
  13722. _this2.index++;
  13723. } else {
  13724. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13725. }
  13726. });
  13727. return promise;
  13728. }
  13729. }]);
  13730. return InputTest;
  13731. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13732. /***/ }),
  13733. /***/ "./js/util/input_assessment.js":
  13734. /*!*************************************!*\
  13735. !*** ./js/util/input_assessment.js ***!
  13736. \*************************************/
  13737. /*! exports provided: InputAssessment */
  13738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13739. "use strict";
  13740. __webpack_require__.r(__webpack_exports__);
  13741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputAssessment", function() { return InputAssessment; });
  13742. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13743. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13744. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13745. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13746. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13747. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13748. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13749. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13750. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13751. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13752. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13753. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13754. 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); }; }
  13755. 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; } }
  13756. var InputAssessment = /*#__PURE__*/function (_Input) {
  13757. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputAssessment, _Input);
  13758. var _super = _createSuper(InputAssessment);
  13759. function InputAssessment(input_list) {
  13760. var _this;
  13761. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputAssessment);
  13762. _this = _super.call(this);
  13763. _this.index = 0;
  13764. _this.input_list = input_list.map(function (val) {
  13765. return {
  13766. "value": val,
  13767. "read": false
  13768. };
  13769. });
  13770. return _this;
  13771. }
  13772. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputAssessment, [{
  13773. key: "requestInput",
  13774. value: function requestInput() {
  13775. var _this2 = this;
  13776. var promise = new Promise(function (resolve, reject) {
  13777. if (_this2.index < _this2.input_list.length) {
  13778. var input = _this2.input_list[_this2.index];
  13779. input.read = true;
  13780. _this2.index += 1;
  13781. resolve(input.value);
  13782. } else {
  13783. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13784. }
  13785. });
  13786. return promise;
  13787. }
  13788. }, {
  13789. key: "isInputAvailable",
  13790. value: function isInputAvailable() {
  13791. return this.index < this.input_list.length;
  13792. }
  13793. }]);
  13794. return InputAssessment;
  13795. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13796. /***/ }),
  13797. /***/ "./js/util/maybe.ts":
  13798. /*!**************************!*\
  13799. !*** ./js/util/maybe.ts ***!
  13800. \**************************/
  13801. /*! no static exports found */
  13802. /***/ (function(module, exports, __webpack_require__) {
  13803. "use strict";
  13804. Object.defineProperty(exports, "__esModule", { value: true });
  13805. exports.Maybe = void 0;
  13806. /**
  13807. *
  13808. * Maybe Monad
  13809. * @Source: https://codewithstyle.info/advanced-functional-programming-in-typescript-maybe-monad/
  13810. * @Modified by: @lucascalion - 28/08/2019
  13811. *
  13812. **/
  13813. class Maybe {
  13814. constructor(value) {
  13815. this.value = value;
  13816. }
  13817. static some(value) {
  13818. if (!value) {
  13819. throw Error("Provided value must not be empty");
  13820. }
  13821. return new Maybe(value);
  13822. }
  13823. static none() {
  13824. return new Maybe(null);
  13825. }
  13826. static fromValue(value) {
  13827. return value ? Maybe.some(value) : Maybe.none();
  13828. }
  13829. getOrElse(defaultValue) {
  13830. return this.value === null ? defaultValue : this.value;
  13831. }
  13832. map(f) {
  13833. if (this.value === null) {
  13834. return Maybe.none();
  13835. }
  13836. else {
  13837. return Maybe.fromValue(f(this.value));
  13838. }
  13839. }
  13840. }
  13841. exports.Maybe = Maybe;
  13842. /***/ }),
  13843. /***/ "./js/util/outputTest.js":
  13844. /*!*******************************!*\
  13845. !*** ./js/util/outputTest.js ***!
  13846. \*******************************/
  13847. /*! exports provided: OutputTest */
  13848. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13849. "use strict";
  13850. __webpack_require__.r(__webpack_exports__);
  13851. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputTest", function() { return OutputTest; });
  13852. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13853. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13854. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13855. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13856. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13857. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13858. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13859. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13860. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13861. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13862. /* harmony import */ var _io_output__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/output */ "./js/io/output.js");
  13863. 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); }; }
  13864. 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; } }
  13865. var OutputTest = /*#__PURE__*/function (_Output) {
  13866. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(OutputTest, _Output);
  13867. var _super = _createSuper(OutputTest);
  13868. function OutputTest() {
  13869. var _this;
  13870. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputTest);
  13871. _this = _super.call(this);
  13872. _this.list = [];
  13873. _this.currentLine = null;
  13874. return _this;
  13875. }
  13876. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputTest, [{
  13877. key: "write",
  13878. value: function write(text) {
  13879. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13880. if (this.currentLine == null) {
  13881. this.currentLine = this.list.push("") - 1;
  13882. }
  13883. this.list[this.currentLine] += text;
  13884. if (newLine) {
  13885. this.currentLine = null;
  13886. }
  13887. }
  13888. }, {
  13889. key: "sendOutput",
  13890. value: function sendOutput(text) {
  13891. var _this2 = this;
  13892. var output = "" + text;
  13893. if (output.indexOf("\n") !== -1) {
  13894. var outputList = output.split("\n");
  13895. var last = outputList.pop();
  13896. outputList.forEach(function (t) {
  13897. //t = t.replace(/\t/g, '&#x0020;&#x0020;');
  13898. //t = t.replace(/\s/g, "&#x0020;");
  13899. if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
  13900. }); //last = last.replace(/\t/g, '&#x0020;&#x0020;');
  13901. //last = last.replace(/\s/g, "&#x0020;");
  13902. if (last.length != 0) this.write(last);
  13903. } else {
  13904. //output = output.replace(/\t/g, '&#x0020;&#x0020;');
  13905. //output = output.replace(/\s/g, "&#x0020;");
  13906. this.write(output);
  13907. }
  13908. }
  13909. }]);
  13910. return OutputTest;
  13911. }(_io_output__WEBPACK_IMPORTED_MODULE_5__["Output"]);
  13912. /***/ }),
  13913. /***/ "./js/util/parseFromVisual.js":
  13914. /*!************************************!*\
  13915. !*** ./js/util/parseFromVisual.js ***!
  13916. \************************************/
  13917. /*! exports provided: parseExpression */
  13918. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13919. "use strict";
  13920. __webpack_require__.r(__webpack_exports__);
  13921. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseExpression", function() { return parseExpression; });
  13922. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  13923. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  13924. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  13925. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ast/expressions */ "./js/ast/expressions/index.js");
  13926. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  13927. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  13928. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  13929. var TYPES = {
  13930. VARIABLE: "var",
  13931. CONST: "const",
  13932. FUNCTION: "function",
  13933. RELATIONAL: "relational",
  13934. LOGIC: "logic",
  13935. ARITHMETIC: "arithmetic"
  13936. };
  13937. function translateOp(type, op) {
  13938. switch (type) {
  13939. case TYPES.ARITHMETIC:
  13940. return op.value;
  13941. case TYPES.RELATIONAL:
  13942. return op.value;
  13943. case TYPES.LOGIC:
  13944. {
  13945. if (op.ord === 11) {
  13946. return "and";
  13947. } else if (op.ord === 12) {
  13948. return "or";
  13949. } else {
  13950. return "not";
  13951. }
  13952. }
  13953. }
  13954. }
  13955. function getOpType(op) {
  13956. switch (op.ord) {
  13957. case 0:
  13958. case 1:
  13959. case 2:
  13960. case 3:
  13961. case 4:
  13962. return TYPES.ARITHMETIC;
  13963. case 5:
  13964. case 6:
  13965. case 7:
  13966. case 8:
  13967. case 9:
  13968. case 10:
  13969. return TYPES.RELATIONAL;
  13970. default:
  13971. return TYPES.LOGIC;
  13972. }
  13973. }
  13974. function expressionWalker(expression) {
  13975. var result;
  13976. if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["VariableLiteral"]) {
  13977. result = [{
  13978. instance: "expression",
  13979. type: TYPES.VARIABLE,
  13980. value: expression.id
  13981. }];
  13982. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["FunctionCall"]) {
  13983. var funcObj = {
  13984. instance: "expression",
  13985. type: TYPES.FUNCTION,
  13986. value: expression.id
  13987. };
  13988. var paramsList = expression.actualParameters.map(function (e) {
  13989. return expressionWalker(e);
  13990. }); //const params = Array.prototype.concat.apply([], paramsList);
  13991. funcObj.params = paramsList;
  13992. result = [funcObj];
  13993. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["UnaryApp"]) {
  13994. var left = expressionWalker(expression.left);
  13995. var opType = getOpType(expression.op);
  13996. var opValue = translateOp(opType, expression.op);
  13997. result = [{
  13998. instance: "operator",
  13999. type: opType,
  14000. value: opValue
  14001. }].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(left));
  14002. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["InfixApp"]) {
  14003. var _left = expressionWalker(expression.left);
  14004. var right = expressionWalker(expression.right);
  14005. var _opType = getOpType(expression.op);
  14006. var _opValue = translateOp(_opType, expression.op);
  14007. result = [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(_left), [{
  14008. instance: "operator",
  14009. type: _opType,
  14010. value: _opValue
  14011. }], _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(right));
  14012. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["ArrayAccess"]) {
  14013. var line = expressionWalker(expression.line);
  14014. var arrayClass = "vector";
  14015. var column = null;
  14016. if (expression.column) {
  14017. arrayClass = "matrix";
  14018. column = expressionWalker(expression.column);
  14019. }
  14020. result = [{
  14021. instance: "expression",
  14022. type: TYPES.VARIABLE,
  14023. "class": arrayClass,
  14024. column: column,
  14025. line: line,
  14026. value: expression.id
  14027. }];
  14028. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["BoolLiteral"]) {
  14029. var value = expression.value;
  14030. result = [{
  14031. instance: "expression",
  14032. "class": "simple",
  14033. type: TYPES.CONST,
  14034. value: Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertBoolToString"])(value)
  14035. }];
  14036. } else {
  14037. var _value = expression.value;
  14038. if (expression.value.toNumber) {
  14039. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.isCompatible(expression.type) && expression.value.decimalPlaces() == 0) {
  14040. _value = expression.value.toFixed(2);
  14041. } else {
  14042. _value = expression.value.toNumber();
  14043. }
  14044. }
  14045. result = [{
  14046. instance: "expression",
  14047. "class": "simple",
  14048. type: TYPES.CONST,
  14049. value: _value
  14050. }];
  14051. }
  14052. if (expression.parenthesis) return ["("].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(result), [")"]);else return result;
  14053. }
  14054. function parseExpression(text) {
  14055. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_1__["IVProgParser"].createParser(text);
  14056. var expressionAST = parser.parseExpressionOR();
  14057. return expressionWalker(expressionAST);
  14058. }
  14059. /***/ }),
  14060. /***/ "./js/util/string_diff.js":
  14061. /*!********************************!*\
  14062. !*** ./js/util/string_diff.js ***!
  14063. \********************************/
  14064. /*! exports provided: default */
  14065. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14066. "use strict";
  14067. __webpack_require__.r(__webpack_exports__);
  14068. /**
  14069. * Author: @jhchen - https://github.com/jhchen
  14070. * Modified by: @lucascalion - 23/07/2019
  14071. * This library modifies the diff-patch-match library by Neil Fraser
  14072. * by removing the patch and match functionality and certain advanced
  14073. * options in the diff function. The original license is as follows:
  14074. *
  14075. * ===
  14076. *
  14077. * Diff Match and Patch
  14078. *
  14079. * Copyright 2006 Google Inc.
  14080. * http://code.google.com/p/google-diff-match-patch/
  14081. *
  14082. * Licensed under the Apache License, Version 2.0 (the "License");
  14083. * you may not use this file except in compliance with the License.
  14084. * You may obtain a copy of the License at
  14085. *
  14086. * http://www.apache.org/licenses/LICENSE-2.0
  14087. *
  14088. * Unless required by applicable law or agreed to in writing, software
  14089. * distributed under the License is distributed on an "AS IS" BASIS,
  14090. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14091. * See the License for the specific language governing permissions and
  14092. * limitations under the License.
  14093. */
  14094. /**
  14095. * The data structure representing a diff is an array of tuples:
  14096. * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
  14097. * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
  14098. */
  14099. var DIFF_DELETE = -1;
  14100. var DIFF_INSERT = 1;
  14101. var DIFF_EQUAL = 0;
  14102. /**
  14103. * Find the differences between two texts. Simplifies the problem by stripping
  14104. * any common prefix or suffix off the texts before diffing.
  14105. * @param {string} text1 Old string to be diffed.
  14106. * @param {string} text2 New string to be diffed.
  14107. * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info
  14108. * @return {Array} Array of diff tuples.
  14109. */
  14110. function diff_main(text1, text2, cursor_pos, _fix_unicode) {
  14111. // Check for equality
  14112. if (text1 === text2) {
  14113. if (text1) {
  14114. return [[DIFF_EQUAL, text1]];
  14115. }
  14116. return [];
  14117. }
  14118. if (cursor_pos != null) {
  14119. var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
  14120. if (editdiff) {
  14121. return editdiff;
  14122. }
  14123. } // Trim off common prefix (speedup).
  14124. var commonlength = diff_commonPrefix(text1, text2);
  14125. var commonprefix = text1.substring(0, commonlength);
  14126. text1 = text1.substring(commonlength);
  14127. text2 = text2.substring(commonlength); // Trim off common suffix (speedup).
  14128. commonlength = diff_commonSuffix(text1, text2);
  14129. var commonsuffix = text1.substring(text1.length - commonlength);
  14130. text1 = text1.substring(0, text1.length - commonlength);
  14131. text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block.
  14132. var diffs = diff_compute_(text1, text2); // Restore the prefix and suffix.
  14133. if (commonprefix) {
  14134. diffs.unshift([DIFF_EQUAL, commonprefix]);
  14135. }
  14136. if (commonsuffix) {
  14137. diffs.push([DIFF_EQUAL, commonsuffix]);
  14138. }
  14139. diff_cleanupMerge(diffs, _fix_unicode);
  14140. return diffs;
  14141. }
  14142. /**
  14143. * Find the differences between two texts. Assumes that the texts do not
  14144. * have any common prefix or suffix.
  14145. * @param {string} text1 Old string to be diffed.
  14146. * @param {string} text2 New string to be diffed.
  14147. * @return {Array} Array of diff tuples.
  14148. */
  14149. function diff_compute_(text1, text2) {
  14150. var diffs;
  14151. if (!text1) {
  14152. // Just add some text (speedup).
  14153. return [[DIFF_INSERT, text2]];
  14154. }
  14155. if (!text2) {
  14156. // Just delete some text (speedup).
  14157. return [[DIFF_DELETE, text1]];
  14158. }
  14159. var longtext = text1.length > text2.length ? text1 : text2;
  14160. var shorttext = text1.length > text2.length ? text2 : text1;
  14161. var i = longtext.indexOf(shorttext);
  14162. if (i !== -1) {
  14163. // Shorter text is inside the longer text (speedup).
  14164. 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.
  14165. if (text1.length > text2.length) {
  14166. diffs[0][0] = diffs[2][0] = DIFF_DELETE;
  14167. }
  14168. return diffs;
  14169. }
  14170. if (shorttext.length === 1) {
  14171. // Single character string.
  14172. // After the previous speedup, the character can't be an equality.
  14173. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  14174. } // Check to see if the problem can be split in two.
  14175. var hm = diff_halfMatch_(text1, text2);
  14176. if (hm) {
  14177. // A half-match was found, sort out the return data.
  14178. var text1_a = hm[0];
  14179. var text1_b = hm[1];
  14180. var text2_a = hm[2];
  14181. var text2_b = hm[3];
  14182. var mid_common = hm[4]; // Send both pairs off for separate processing.
  14183. var diffs_a = diff_main(text1_a, text2_a);
  14184. var diffs_b = diff_main(text1_b, text2_b); // Merge the results.
  14185. return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
  14186. }
  14187. return diff_bisect_(text1, text2);
  14188. }
  14189. /**
  14190. * Find the 'middle snake' of a diff, split the problem in two
  14191. * and return the recursively constructed diff.
  14192. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
  14193. * @param {string} text1 Old string to be diffed.
  14194. * @param {string} text2 New string to be diffed.
  14195. * @return {Array} Array of diff tuples.
  14196. * @private
  14197. */
  14198. function diff_bisect_(text1, text2) {
  14199. // Cache the text lengths to prevent multiple calls.
  14200. var text1_length = text1.length;
  14201. var text2_length = text2.length;
  14202. var max_d = Math.ceil((text1_length + text2_length) / 2);
  14203. var v_offset = max_d;
  14204. var v_length = 2 * max_d;
  14205. var v1 = new Array(v_length);
  14206. var v2 = new Array(v_length); // Setting all elements to -1 is faster in Chrome & Firefox than mixing
  14207. // integers and undefined.
  14208. for (var x = 0; x < v_length; x++) {
  14209. v1[x] = -1;
  14210. v2[x] = -1;
  14211. }
  14212. v1[v_offset + 1] = 0;
  14213. v2[v_offset + 1] = 0;
  14214. var delta = text1_length - text2_length; // If the total number of characters is odd, then the front path will collide
  14215. // with the reverse path.
  14216. var front = delta % 2 !== 0; // Offsets for start and end of k loop.
  14217. // Prevents mapping of space beyond the grid.
  14218. var k1start = 0;
  14219. var k1end = 0;
  14220. var k2start = 0;
  14221. var k2end = 0;
  14222. for (var d = 0; d < max_d; d++) {
  14223. // Walk the front path one step.
  14224. for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
  14225. var k1_offset = v_offset + k1;
  14226. var x1 = void 0;
  14227. if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
  14228. x1 = v1[k1_offset + 1];
  14229. } else {
  14230. x1 = v1[k1_offset - 1] + 1;
  14231. }
  14232. var y1 = x1 - k1;
  14233. while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
  14234. x1++;
  14235. y1++;
  14236. }
  14237. v1[k1_offset] = x1;
  14238. if (x1 > text1_length) {
  14239. // Ran off the right of the graph.
  14240. k1end += 2;
  14241. } else if (y1 > text2_length) {
  14242. // Ran off the bottom of the graph.
  14243. k1start += 2;
  14244. } else if (front) {
  14245. var k2_offset = v_offset + delta - k1;
  14246. if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
  14247. // Mirror x2 onto top-left coordinate system.
  14248. var x2 = text1_length - v2[k2_offset];
  14249. if (x1 >= x2) {
  14250. // Overlap detfrontected.
  14251. return diff_bisectSplit_(text1, text2, x1, y1);
  14252. }
  14253. }
  14254. }
  14255. } // Walk the reverse path one step.
  14256. for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
  14257. var _k2_offset = v_offset + k2;
  14258. var _x = void 0;
  14259. if (k2 === -d || k2 !== d && v2[_k2_offset - 1] < v2[_k2_offset + 1]) {
  14260. _x = v2[_k2_offset + 1];
  14261. } else {
  14262. _x = v2[_k2_offset - 1] + 1;
  14263. }
  14264. var y2 = _x - k2;
  14265. while (_x < text1_length && y2 < text2_length && text1.charAt(text1_length - _x - 1) === text2.charAt(text2_length - y2 - 1)) {
  14266. _x++;
  14267. y2++;
  14268. }
  14269. v2[_k2_offset] = _x;
  14270. if (_x > text1_length) {
  14271. // Ran off the left of the graph.
  14272. k2end += 2;
  14273. } else if (y2 > text2_length) {
  14274. // Ran off the top of the graph.
  14275. k2start += 2;
  14276. } else if (!front) {
  14277. var _k1_offset = v_offset + delta - k2;
  14278. if (_k1_offset >= 0 && _k1_offset < v_length && v1[_k1_offset] !== -1) {
  14279. var _x2 = v1[_k1_offset];
  14280. var _y = v_offset + _x2 - _k1_offset; // Mirror x2 onto top-left coordinate system.
  14281. _x = text1_length - _x;
  14282. if (_x2 >= _x) {
  14283. // Overlap detected.
  14284. return diff_bisectSplit_(text1, text2, _x2, _y);
  14285. }
  14286. }
  14287. }
  14288. }
  14289. } // Diff took too long and hit the deadline or
  14290. // number of diffs equals number of characters, no commonality at all.
  14291. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  14292. }
  14293. /**
  14294. * Given the location of the 'middle snake', split the diff in two parts
  14295. * and recurse.
  14296. * @param {string} text1 Old string to be diffed.
  14297. * @param {string} text2 New string to be diffed.
  14298. * @param {number} x Index of split point in text1.
  14299. * @param {number} y Index of split point in text2.
  14300. * @return {Array} Array of diff tuples.
  14301. */
  14302. function diff_bisectSplit_(text1, text2, x, y) {
  14303. var text1a = text1.substring(0, x);
  14304. var text2a = text2.substring(0, y);
  14305. var text1b = text1.substring(x);
  14306. var text2b = text2.substring(y); // Compute both diffs serially.
  14307. var diffs = diff_main(text1a, text2a);
  14308. var diffsb = diff_main(text1b, text2b);
  14309. return diffs.concat(diffsb);
  14310. }
  14311. /**
  14312. * Determine the common prefix of two strings.
  14313. * @param {string} text1 First string.
  14314. * @param {string} text2 Second string.
  14315. * @return {number} The number of characters common to the start of each
  14316. * string.
  14317. */
  14318. function diff_commonPrefix(text1, text2) {
  14319. // Quick check for common null cases.
  14320. if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
  14321. return 0;
  14322. } // Binary search.
  14323. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  14324. var pointermin = 0;
  14325. var pointermax = Math.min(text1.length, text2.length);
  14326. var pointermid = pointermax;
  14327. var pointerstart = 0;
  14328. while (pointermin < pointermid) {
  14329. if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
  14330. pointermin = pointermid;
  14331. pointerstart = pointermin;
  14332. } else {
  14333. pointermax = pointermid;
  14334. }
  14335. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  14336. }
  14337. if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
  14338. pointermid--;
  14339. }
  14340. return pointermid;
  14341. }
  14342. /**
  14343. * Determine the common suffix of two strings.
  14344. * @param {string} text1 First string.
  14345. * @param {string} text2 Second string.
  14346. * @return {number} The number of characters common to the end of each string.
  14347. */
  14348. function diff_commonSuffix(text1, text2) {
  14349. // Quick check for common null cases.
  14350. if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
  14351. return 0;
  14352. } // Binary search.
  14353. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  14354. var pointermin = 0;
  14355. var pointermax = Math.min(text1.length, text2.length);
  14356. var pointermid = pointermax;
  14357. var pointerend = 0;
  14358. while (pointermin < pointermid) {
  14359. if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
  14360. pointermin = pointermid;
  14361. pointerend = pointermin;
  14362. } else {
  14363. pointermax = pointermid;
  14364. }
  14365. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  14366. }
  14367. if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
  14368. pointermid--;
  14369. }
  14370. return pointermid;
  14371. }
  14372. /**
  14373. * Do the two texts share a substring which is at least half the length of the
  14374. * longer text?
  14375. * This speedup can produce non-minimal diffs.
  14376. * @param {string} text1 First string.
  14377. * @param {string} text2 Second string.
  14378. * @return {Array.<string>} Five element Array, containing the prefix of
  14379. * text1, the suffix of text1, the prefix of text2, the suffix of
  14380. * text2 and the common middle. Or null if there was no match.
  14381. */
  14382. function diff_halfMatch_(text1, text2) {
  14383. var longtext = text1.length > text2.length ? text1 : text2;
  14384. var shorttext = text1.length > text2.length ? text2 : text1;
  14385. if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
  14386. return null; // Pointless.
  14387. }
  14388. /**
  14389. * Does a substring of shorttext exist within longtext such that the substring
  14390. * is at least half the length of longtext?
  14391. * Closure, but does not reference any external variables.
  14392. * @param {string} longtext Longer string.
  14393. * @param {string} shorttext Shorter string.
  14394. * @param {number} i Start index of quarter length substring within longtext.
  14395. * @return {Array.<string>} Five element Array, containing the prefix of
  14396. * longtext, the suffix of longtext, the prefix of shorttext, the suffix
  14397. * of shorttext and the common middle. Or null if there was no match.
  14398. * @private
  14399. */
  14400. function diff_halfMatchI_(longtext, shorttext, i) {
  14401. // Start with a 1/4 length substring at position i as a seed.
  14402. var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
  14403. var j = -1;
  14404. var best_common = '';
  14405. var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
  14406. while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {
  14407. var prefixLength = diff_commonPrefix(longtext.substring(i), shorttext.substring(j));
  14408. var suffixLength = diff_commonSuffix(longtext.substring(0, i), shorttext.substring(0, j));
  14409. if (best_common.length < suffixLength + prefixLength) {
  14410. best_common = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength);
  14411. best_longtext_a = longtext.substring(0, i - suffixLength);
  14412. best_longtext_b = longtext.substring(i + prefixLength);
  14413. best_shorttext_a = shorttext.substring(0, j - suffixLength);
  14414. best_shorttext_b = shorttext.substring(j + prefixLength);
  14415. }
  14416. }
  14417. if (best_common.length * 2 >= longtext.length) {
  14418. return [best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common];
  14419. } else {
  14420. return null;
  14421. }
  14422. } // First check if the second quarter is the seed for a half-match.
  14423. var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter.
  14424. var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
  14425. var hm;
  14426. if (!hm1 && !hm2) {
  14427. return null;
  14428. } else if (!hm2) {
  14429. hm = hm1;
  14430. } else if (!hm1) {
  14431. hm = hm2;
  14432. } else {
  14433. // Both matched. Select the longest.
  14434. hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
  14435. } // A half-match was found, sort out the return data.
  14436. var text1_a, text1_b, text2_a, text2_b;
  14437. if (text1.length > text2.length) {
  14438. text1_a = hm[0];
  14439. text1_b = hm[1];
  14440. text2_a = hm[2];
  14441. text2_b = hm[3];
  14442. } else {
  14443. text2_a = hm[0];
  14444. text2_b = hm[1];
  14445. text1_a = hm[2];
  14446. text1_b = hm[3];
  14447. }
  14448. var mid_common = hm[4];
  14449. return [text1_a, text1_b, text2_a, text2_b, mid_common];
  14450. }
  14451. /**
  14452. * Reorder and merge like edit sections. Merge equalities.
  14453. * Any edit section can move as long as it doesn't cross an equality.
  14454. * @param {Array} diffs Array of diff tuples.
  14455. * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff
  14456. */
  14457. function diff_cleanupMerge(diffs, fix_unicode) {
  14458. diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
  14459. var pointer = 0;
  14460. var count_delete = 0;
  14461. var count_insert = 0;
  14462. var text_delete = '';
  14463. var text_insert = '';
  14464. var commonlength;
  14465. var previous_equality;
  14466. while (pointer < diffs.length) {
  14467. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  14468. diffs.splice(pointer, 1);
  14469. continue;
  14470. }
  14471. switch (diffs[pointer][0]) {
  14472. case DIFF_INSERT:
  14473. count_insert++;
  14474. text_insert += diffs[pointer][1];
  14475. pointer++;
  14476. break;
  14477. case DIFF_DELETE:
  14478. count_delete++;
  14479. text_delete += diffs[pointer][1];
  14480. pointer++;
  14481. break;
  14482. case DIFF_EQUAL:
  14483. previous_equality = pointer - count_insert - count_delete - 1;
  14484. if (fix_unicode) {
  14485. // prevent splitting of unicode surrogate pairs. when fix_unicode is true,
  14486. // we assume that the old and new text in the diff are complete and correct
  14487. // unicode-encoded JS strings, but the tuple boundaries may fall between
  14488. // surrogate pairs. we fix this by shaving off stray surrogates from the end
  14489. // of the previous equality and the beginning of this equality. this may create
  14490. // empty equalities or a common prefix or suffix. for example, if AB and AC are
  14491. // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and
  14492. // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this
  14493. // particular case, both equalities go away, we absorb any previous inequalities,
  14494. // and we keep scanning for the next equality before rewriting the tuples.
  14495. if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
  14496. var stray = diffs[previous_equality][1].slice(-1);
  14497. diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
  14498. text_delete = stray + text_delete;
  14499. text_insert = stray + text_insert;
  14500. if (!diffs[previous_equality][1]) {
  14501. // emptied out previous equality, so delete it and include previous delete/insert
  14502. diffs.splice(previous_equality, 1);
  14503. pointer--;
  14504. var k = previous_equality - 1;
  14505. if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
  14506. count_insert++;
  14507. text_insert = diffs[k][1] + text_insert;
  14508. k--;
  14509. }
  14510. if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
  14511. count_delete++;
  14512. text_delete = diffs[k][1] + text_delete;
  14513. k--;
  14514. }
  14515. previous_equality = k;
  14516. }
  14517. }
  14518. if (starts_with_pair_end(diffs[pointer][1])) {
  14519. var _stray = diffs[pointer][1].charAt(0);
  14520. diffs[pointer][1] = diffs[pointer][1].slice(1);
  14521. text_delete += _stray;
  14522. text_insert += _stray;
  14523. }
  14524. }
  14525. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  14526. // for empty equality not at end, wait for next equality
  14527. diffs.splice(pointer, 1);
  14528. break;
  14529. }
  14530. if (text_delete.length > 0 || text_insert.length > 0) {
  14531. // note that diff_commonPrefix and diff_commonSuffix are unicode-aware
  14532. if (text_delete.length > 0 && text_insert.length > 0) {
  14533. // Factor out any common prefixes.
  14534. commonlength = diff_commonPrefix(text_insert, text_delete);
  14535. if (commonlength !== 0) {
  14536. if (previous_equality >= 0) {
  14537. diffs[previous_equality][1] += text_insert.substring(0, commonlength);
  14538. } else {
  14539. diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
  14540. pointer++;
  14541. }
  14542. text_insert = text_insert.substring(commonlength);
  14543. text_delete = text_delete.substring(commonlength);
  14544. } // Factor out any common suffixes.
  14545. commonlength = diff_commonSuffix(text_insert, text_delete);
  14546. if (commonlength !== 0) {
  14547. diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
  14548. text_insert = text_insert.substring(0, text_insert.length - commonlength);
  14549. text_delete = text_delete.substring(0, text_delete.length - commonlength);
  14550. }
  14551. } // Delete the offending records and add the merged ones.
  14552. var n = count_insert + count_delete;
  14553. if (text_delete.length === 0 && text_insert.length === 0) {
  14554. diffs.splice(pointer - n, n);
  14555. pointer = pointer - n;
  14556. } else if (text_delete.length === 0) {
  14557. diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
  14558. pointer = pointer - n + 1;
  14559. } else if (text_insert.length === 0) {
  14560. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
  14561. pointer = pointer - n + 1;
  14562. } else {
  14563. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
  14564. pointer = pointer - n + 2;
  14565. }
  14566. }
  14567. if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
  14568. // Merge this equality with the previous one.
  14569. diffs[pointer - 1][1] += diffs[pointer][1];
  14570. diffs.splice(pointer, 1);
  14571. } else {
  14572. pointer++;
  14573. }
  14574. count_insert = 0;
  14575. count_delete = 0;
  14576. text_delete = '';
  14577. text_insert = '';
  14578. break;
  14579. }
  14580. }
  14581. if (diffs[diffs.length - 1][1] === '') {
  14582. diffs.pop(); // Remove the dummy entry at the end.
  14583. } // Second pass: look for single edits surrounded on both sides by equalities
  14584. // which can be shifted sideways to eliminate an equality.
  14585. // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
  14586. var changes = false;
  14587. pointer = 1; // Intentionally ignore the first and last element (don't need checking).
  14588. while (pointer < diffs.length - 1) {
  14589. if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
  14590. // This is a single edit surrounded by equalities.
  14591. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
  14592. // Shift the edit over the previous equality.
  14593. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
  14594. diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
  14595. diffs.splice(pointer - 1, 1);
  14596. changes = true;
  14597. } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
  14598. // Shift the edit over the next equality.
  14599. diffs[pointer - 1][1] += diffs[pointer + 1][1];
  14600. diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
  14601. diffs.splice(pointer + 1, 1);
  14602. changes = true;
  14603. }
  14604. }
  14605. pointer++;
  14606. } // If shifts were made, the diff needs reordering and another shift sweep.
  14607. if (changes) {
  14608. diff_cleanupMerge(diffs, fix_unicode);
  14609. }
  14610. }
  14611. function is_surrogate_pair_start(charCode) {
  14612. return charCode >= 0xD800 && charCode <= 0xDBFF;
  14613. }
  14614. function is_surrogate_pair_end(charCode) {
  14615. return charCode >= 0xDC00 && charCode <= 0xDFFF;
  14616. }
  14617. function starts_with_pair_end(str) {
  14618. return is_surrogate_pair_end(str.charCodeAt(0));
  14619. }
  14620. function ends_with_pair_start(str) {
  14621. return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
  14622. }
  14623. function remove_empty_tuples(tuples) {
  14624. var ret = [];
  14625. for (var i = 0; i < tuples.length; i++) {
  14626. if (tuples[i][1].length > 0) {
  14627. ret.push(tuples[i]);
  14628. }
  14629. }
  14630. return ret;
  14631. }
  14632. function make_edit_splice(before, oldMiddle, newMiddle, after) {
  14633. if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
  14634. return null;
  14635. }
  14636. return remove_empty_tuples([[DIFF_EQUAL, before], [DIFF_DELETE, oldMiddle], [DIFF_INSERT, newMiddle], [DIFF_EQUAL, after]]);
  14637. }
  14638. function find_cursor_edit_diff(oldText, newText, cursor_pos) {
  14639. // note: this runs after equality check has ruled out exact equality
  14640. var oldRange = typeof cursor_pos === 'number' ? {
  14641. index: cursor_pos,
  14642. length: 0
  14643. } : cursor_pos.oldRange;
  14644. var newRange = typeof cursor_pos === 'number' ? null : cursor_pos.newRange; // take into account the old and new selection to generate the best diff
  14645. // possible for a text edit. for example, a text change from "xxx" to "xx"
  14646. // could be a delete or forwards-delete of any one of the x's, or the
  14647. // result of selecting two of the x's and typing "x".
  14648. var oldLength = oldText.length;
  14649. var newLength = newText.length;
  14650. if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
  14651. // see if we have an insert or delete before or after cursor
  14652. var oldCursor = oldRange.index;
  14653. var oldBefore = oldText.slice(0, oldCursor);
  14654. var oldAfter = oldText.slice(oldCursor);
  14655. var maybeNewCursor = newRange ? newRange.index : null;
  14656. editBefore: {
  14657. // is this an insert or delete right before oldCursor?
  14658. var newCursor = oldCursor + newLength - oldLength;
  14659. if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
  14660. break editBefore;
  14661. }
  14662. if (newCursor < 0 || newCursor > newLength) {
  14663. break editBefore;
  14664. }
  14665. var newBefore = newText.slice(0, newCursor);
  14666. var newAfter = newText.slice(newCursor);
  14667. if (newAfter !== oldAfter) {
  14668. break editBefore;
  14669. }
  14670. var prefixLength = Math.min(oldCursor, newCursor);
  14671. var oldPrefix = oldBefore.slice(0, prefixLength);
  14672. var newPrefix = newBefore.slice(0, prefixLength);
  14673. if (oldPrefix !== newPrefix) {
  14674. break editBefore;
  14675. }
  14676. var oldMiddle = oldBefore.slice(prefixLength);
  14677. var newMiddle = newBefore.slice(prefixLength);
  14678. return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
  14679. }
  14680. editAfter: {
  14681. // is this an insert or delete right after oldCursor?
  14682. if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
  14683. break editAfter;
  14684. }
  14685. var cursor = oldCursor;
  14686. var _newBefore = newText.slice(0, cursor);
  14687. var _newAfter = newText.slice(cursor);
  14688. if (_newBefore !== oldBefore) {
  14689. break editAfter;
  14690. }
  14691. var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
  14692. var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
  14693. var newSuffix = _newAfter.slice(_newAfter.length - suffixLength);
  14694. if (oldSuffix !== newSuffix) {
  14695. break editAfter;
  14696. }
  14697. var _oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
  14698. var _newMiddle = _newAfter.slice(0, _newAfter.length - suffixLength);
  14699. return make_edit_splice(oldBefore, _oldMiddle, _newMiddle, oldSuffix);
  14700. }
  14701. }
  14702. if (oldRange.length > 0 && newRange && newRange.length === 0) {
  14703. replaceRange: {
  14704. // see if diff could be a splice of the old selection range
  14705. var _oldPrefix = oldText.slice(0, oldRange.index);
  14706. var _oldSuffix = oldText.slice(oldRange.index + oldRange.length);
  14707. var _prefixLength = _oldPrefix.length;
  14708. var _suffixLength = _oldSuffix.length;
  14709. if (newLength < _prefixLength + _suffixLength) {
  14710. break replaceRange;
  14711. }
  14712. var _newPrefix = newText.slice(0, _prefixLength);
  14713. var _newSuffix = newText.slice(newLength - _suffixLength);
  14714. if (_oldPrefix !== _newPrefix || _oldSuffix !== _newSuffix) {
  14715. break replaceRange;
  14716. }
  14717. var _oldMiddle2 = oldText.slice(_prefixLength, oldLength - _suffixLength);
  14718. var _newMiddle2 = newText.slice(_prefixLength, newLength - _suffixLength);
  14719. return make_edit_splice(_oldPrefix, _oldMiddle2, _newMiddle2, _oldSuffix);
  14720. }
  14721. }
  14722. return null;
  14723. }
  14724. function diff(text1, text2, cursor_pos) {
  14725. // only pass fix_unicode=true at the top level, not when diff_main is
  14726. // recursively invoked
  14727. return diff_main(text1, text2, cursor_pos, true);
  14728. }
  14729. diff.INSERT = DIFF_INSERT;
  14730. diff.DELETE = DIFF_DELETE;
  14731. diff.EQUAL = DIFF_EQUAL;
  14732. /* harmony default export */ __webpack_exports__["default"] = (diff);
  14733. /***/ }),
  14734. /***/ "./js/util/testConsole.js":
  14735. /*!********************************!*\
  14736. !*** ./js/util/testConsole.js ***!
  14737. \********************************/
  14738. /*! exports provided: TestConsole */
  14739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14740. "use strict";
  14741. __webpack_require__.r(__webpack_exports__);
  14742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestConsole", function() { return TestConsole; });
  14743. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  14744. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  14745. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  14746. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  14747. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../io/domConsole */ "./js/io/domConsole.js");
  14748. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14749. var LocalizedStrings = Object(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["getInstance"])();
  14750. var TestConsole = /*#__PURE__*/function () {
  14751. function TestConsole(inputList) {
  14752. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, TestConsole);
  14753. this.index = 0;
  14754. this.inputList = inputList;
  14755. this.list = [];
  14756. this.currentLine = null;
  14757. }
  14758. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(TestConsole, [{
  14759. key: "writeRawHTML",
  14760. value: function writeRawHTML(text) {
  14761. this._appendTextLn(text);
  14762. }
  14763. }, {
  14764. key: "write",
  14765. value: function write(text) {
  14766. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14767. this._appendText(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER, newLine);
  14768. }
  14769. }, {
  14770. key: "info",
  14771. value: function info(text) {
  14772. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO);
  14773. }
  14774. }, {
  14775. key: "err",
  14776. value: function err(text) {
  14777. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR);
  14778. }
  14779. }, {
  14780. key: "_appendText",
  14781. value: function _appendText(text, _type) {
  14782. var newLine = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14783. if (this.currentLine == null) {
  14784. this.currentLine = this.list.push('') - 1;
  14785. }
  14786. this.list[this.currentLine] += text;
  14787. if (newLine) {
  14788. this.currentLine = null;
  14789. }
  14790. }
  14791. }, {
  14792. key: "_appendTextLn",
  14793. value: function _appendTextLn(text) {
  14794. this.list.push(text);
  14795. this.currentLine = null;
  14796. }
  14797. }, {
  14798. key: "getClassForType",
  14799. value: function getClassForType(type) {
  14800. switch (type) {
  14801. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER:
  14802. return "ivprog-term-userText";
  14803. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO:
  14804. return "ivprog-term-info";
  14805. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR:
  14806. return "ivprog-term-error";
  14807. }
  14808. }
  14809. }, {
  14810. key: "requestInput",
  14811. value: function requestInput() {
  14812. var _this = this;
  14813. var promise = new Promise(function (resolve, reject) {
  14814. if (_this.index < _this.inputList.length) {
  14815. resolve(_this.inputList[_this.index]);
  14816. _this.index++;
  14817. } else {
  14818. reject(new Error(LocalizedStrings.getError("exceeded_input_request")));
  14819. }
  14820. });
  14821. return promise;
  14822. }
  14823. }, {
  14824. key: "sendOutput",
  14825. value: function sendOutput(text) {
  14826. var _this2 = this;
  14827. var output = '' + text;
  14828. if (output.indexOf('\n') !== -1) {
  14829. var outputList = output.split('\n');
  14830. var last = outputList.pop();
  14831. outputList.forEach(function (t) {
  14832. t = t.replace(/\t/g, '&#x0020;&#x0020;');
  14833. t = t.replace(/\s/g, "&#x0020;");
  14834. if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
  14835. });
  14836. last = last.replace(/\t/g, '&#x0020;&#x0020;');
  14837. last = last.replace(/\s/g, "&#x0020;");
  14838. if (last.length != 0) this.write(last);
  14839. } else {
  14840. output = output.replace(/\t/g, '&#x0020;&#x0020;');
  14841. output = output.replace(/\s/g, "&#x0020;");
  14842. this.write(output);
  14843. }
  14844. }
  14845. }]);
  14846. return TestConsole;
  14847. }();
  14848. /***/ }),
  14849. /***/ "./js/util/utils.js":
  14850. /*!**************************!*\
  14851. !*** ./js/util/utils.js ***!
  14852. \**************************/
  14853. /*! exports provided: scrollIt, isElementInViewport, isKeyword, isValidIdentifier, getCodeEditorModeConfig, levenshteinDistance, openAssessmentDetail, range, sleep */
  14854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14855. "use strict";
  14856. __webpack_require__.r(__webpack_exports__);
  14857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollIt", function() { return scrollIt; });
  14858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementInViewport", function() { return isElementInViewport; });
  14859. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyword", function() { return isKeyword; });
  14860. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidIdentifier", function() { return isValidIdentifier; });
  14861. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeEditorModeConfig", function() { return getCodeEditorModeConfig; });
  14862. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "levenshteinDistance", function() { return levenshteinDistance; });
  14863. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return openAssessmentDetail; });
  14864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
  14865. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sleep", function() { return sleep; });
  14866. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  14867. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  14868. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  14869. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  14870. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  14871. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);
  14872. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../services/languageService */ "./js/services/languageService.js");
  14873. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14874. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  14875. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_5__);
  14876. /**
  14877. * source: https://pawelgrzybek.com/page-scroll-in-vanilla-javascript/
  14878. *
  14879. */
  14880. function scrollIt(destination) {
  14881. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
  14882. var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'linear';
  14883. var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  14884. var easings = {
  14885. linear: function linear(t) {
  14886. return t;
  14887. },
  14888. easeInQuad: function easeInQuad(t) {
  14889. return t * t;
  14890. },
  14891. easeOutQuad: function easeOutQuad(t) {
  14892. return t * (2 - t);
  14893. },
  14894. easeInOutQuad: function easeInOutQuad(t) {
  14895. return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
  14896. },
  14897. easeInCubic: function easeInCubic(t) {
  14898. return t * t * t;
  14899. },
  14900. easeOutCubic: function easeOutCubic(t) {
  14901. return --t * t * t + 1;
  14902. },
  14903. easeInOutCubic: function easeInOutCubic(t) {
  14904. return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
  14905. },
  14906. easeInQuart: function easeInQuart(t) {
  14907. return t * t * t * t;
  14908. },
  14909. easeOutQuart: function easeOutQuart(t) {
  14910. return 1 - --t * t * t * t;
  14911. },
  14912. easeInOutQuart: function easeInOutQuart(t) {
  14913. return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
  14914. },
  14915. easeInQuint: function easeInQuint(t) {
  14916. return t * t * t * t * t;
  14917. },
  14918. easeOutQuint: function easeOutQuint(t) {
  14919. return 1 + --t * t * t * t * t;
  14920. },
  14921. easeInOutQuint: function easeInOutQuint(t) {
  14922. return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
  14923. }
  14924. };
  14925. var start = window.pageYOffset;
  14926. var startTime = 'now' in window.performance ? performance.now() : new Date().getTime();
  14927. var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
  14928. var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
  14929. var destinationOffset = typeof destination === 'number' ? destination : destination.offsetTop;
  14930. var destinationOffsetToScroll = Math.round(documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset);
  14931. if ('requestAnimationFrame' in window === false) {
  14932. window.scroll(0, destinationOffsetToScroll);
  14933. if (callback) {
  14934. callback();
  14935. }
  14936. return;
  14937. }
  14938. function scroll() {
  14939. var now = 'now' in window.performance ? performance.now() : new Date().getTime();
  14940. var time = Math.min(1, (now - startTime) / duration);
  14941. var timeFunction = easings[easing](time);
  14942. window.scroll(0, Math.ceil(timeFunction * (destinationOffsetToScroll - start) + start));
  14943. if (window.pageYOffset === destinationOffsetToScroll) {
  14944. if (callback) {
  14945. callback();
  14946. }
  14947. return;
  14948. }
  14949. requestAnimationFrame(scroll);
  14950. }
  14951. scroll();
  14952. }
  14953. /**
  14954. *
  14955. * source: https://stackoverflow.com/a/16270434
  14956. */
  14957. function isElementInViewport(el) {
  14958. var rect = el.getBoundingClientRect();
  14959. return rect.bottom > 0 && rect.right > 0 && rect.left < (window.innerWidth || document.documentElement.clientWidth) && rect.top < (window.innerHeight || document.documentElement.clientHeight);
  14960. }
  14961. var cacheMainList = null;
  14962. var cacheOp = null;
  14963. function fillCache() {
  14964. if (cacheMainList == null) {
  14965. cacheMainList = [];
  14966. 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"];
  14967. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  14968. var nullLexer = new lexerClass();
  14969. for (var key = 0; key < mainList.length; ++key) {
  14970. var word = mainList[key];
  14971. var keyword = nullLexer.literalNames[lexerClass[word]];
  14972. cacheMainList.push(keyword.substring(1, keyword.length - 1));
  14973. }
  14974. }
  14975. if (cacheOp == null) {
  14976. cacheOp = [];
  14977. 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];
  14978. for (var op = 0; op < logicOpList.length; ++op) {
  14979. var lOp = "logic_operator_".concat(logicOpList[op]);
  14980. cacheOp.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp));
  14981. }
  14982. }
  14983. }
  14984. function isKeyword(text) {
  14985. fillCache();
  14986. for (var key = 0; key < cacheMainList.length; ++key) {
  14987. var keyword = cacheMainList[key];
  14988. if (keyword == text) {
  14989. return true;
  14990. }
  14991. } // not in main list, check op
  14992. for (var op = 0; op < cacheOp.length; op++) {
  14993. var lOp = cacheOp[op];
  14994. if (lOp == text) {
  14995. return true;
  14996. }
  14997. }
  14998. return false;
  14999. }
  15000. function isValidIdentifier(identifier_str) {
  15001. var validRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  15002. if (!validRegex) {
  15003. return false;
  15004. }
  15005. return !isKeyword(identifier_str);
  15006. }
  15007. function getCodeEditorModeConfig() {
  15008. 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"];
  15009. var keywordsList = ["RK_CONST", "RK_RETURN", "RK_BREAK", "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS", "RK_DO_UNTIL"];
  15010. var typeList = ["RK_REAL", "RK_VOID", "RK_BOOLEAN", "RK_STRING", "RK_INTEGER", "RK_CHARACTER"];
  15011. var atomList = ["RK_FALSE", "RK_TRUE"];
  15012. var case_default = [];
  15013. var blocks = [];
  15014. var keywords = [];
  15015. var types = [];
  15016. var atoms = [];
  15017. var switchString = "";
  15018. cacheMainList = [];
  15019. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  15020. var nullLexer = new lexerClass();
  15021. blockList.forEach(function (v) {
  15022. var keyword = nullLexer.literalNames[lexerClass[v]];
  15023. var value = keyword.substring(1, keyword.length - 1);
  15024. cacheMainList.push(value);
  15025. keywords.push(value);
  15026. blocks.push(value);
  15027. if (v == "RK_SWITCH") {
  15028. switchString = value;
  15029. } else if (v == "RK_CASE" || v == "RK_DEFAULT") {
  15030. case_default.push(value);
  15031. }
  15032. });
  15033. keywordsList.forEach(function (v) {
  15034. var keyword = nullLexer.literalNames[lexerClass[v]];
  15035. var value = keyword.substring(1, keyword.length - 1);
  15036. cacheMainList.push(value);
  15037. keywords.push(value);
  15038. });
  15039. typeList.forEach(function (v) {
  15040. var keyword = nullLexer.literalNames[lexerClass[v]];
  15041. var value = keyword.substring(1, keyword.length - 1);
  15042. cacheMainList.push(value);
  15043. types.push(value);
  15044. });
  15045. atomList.forEach(function (v) {
  15046. var keyword = nullLexer.literalNames[lexerClass[v]];
  15047. var value = keyword.substring(1, keyword.length - 1);
  15048. cacheMainList.push(value);
  15049. atoms.push(value);
  15050. });
  15051. cacheOp = [];
  15052. 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];
  15053. for (var op = 0; op < logicOpList.length; ++op) {
  15054. var lOp = "logic_operator_".concat(logicOpList[op]);
  15055. var value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp);
  15056. cacheOp.push(value);
  15057. keywords.push(value);
  15058. }
  15059. return {
  15060. case_default: case_default,
  15061. atoms: atoms,
  15062. keywords: keywords,
  15063. switchString: switchString,
  15064. types: types,
  15065. blocks: blocks
  15066. };
  15067. }
  15068. /**
  15069. * Source: https://gist.github.com/andrei-m/982927
  15070. * @param {string} a
  15071. * @param {string} b
  15072. */
  15073. function levenshteinDistance(a, b) {
  15074. if (a.length == 0) return b.length;
  15075. if (b.length == 0) return a.length;
  15076. var matrix = []; // increment along the first column of each row
  15077. var i;
  15078. for (i = 0; i <= b.length; i++) {
  15079. matrix[i] = [i];
  15080. } // increment each column in the first row
  15081. var j;
  15082. for (j = 0; j <= a.length; j++) {
  15083. matrix[0][j] = j;
  15084. } // Fill in the rest of the matrix
  15085. for (i = 1; i <= b.length; i++) {
  15086. for (j = 1; j <= a.length; j++) {
  15087. if (b.charCodeAt(i - 1) == a.charCodeAt(j - 1)) {
  15088. matrix[i][j] = matrix[i - 1][j - 1];
  15089. } else {
  15090. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
  15091. Math.min(matrix[i][j - 1] + 1, // insertion
  15092. matrix[i - 1][j] + 1)); // deletion
  15093. }
  15094. }
  15095. }
  15096. return matrix[b.length][a.length];
  15097. }
  15098. var win = null;
  15099. function openAssessmentDetail(event) {
  15100. event.preventDefault();
  15101. var page_code = event.currentTarget.dataset.page;
  15102. if (win != null) {
  15103. win.close();
  15104. }
  15105. win = window.open("", "DetailWindow", "width=550,height=600");
  15106. win.document.open();
  15107. win.document.write(page_code);
  15108. win.document.close();
  15109. }
  15110. function range(size) {
  15111. var startAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  15112. return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(Array(size).keys()).map(function (i) {
  15113. return i + startAt;
  15114. });
  15115. }
  15116. /**
  15117. *
  15118. * @param {number} ms
  15119. */
  15120. function sleep(_x) {
  15121. return _sleep.apply(this, arguments);
  15122. }
  15123. function _sleep() {
  15124. _sleep = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(ms) {
  15125. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  15126. while (1) {
  15127. switch (_context.prev = _context.next) {
  15128. case 0:
  15129. return _context.abrupt("return", new Promise(function (res, _) {
  15130. return setTimeout(res, ms);
  15131. }));
  15132. case 1:
  15133. case "end":
  15134. return _context.stop();
  15135. }
  15136. }
  15137. }, _callee);
  15138. }));
  15139. return _sleep.apply(this, arguments);
  15140. }
  15141. /***/ }),
  15142. /***/ "./js/visualUI/algorithm.js":
  15143. /*!**********************************!*\
  15144. !*** ./js/visualUI/algorithm.js ***!
  15145. \**********************************/
  15146. /*! exports provided: renderAlgorithm */
  15147. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15148. "use strict";
  15149. __webpack_require__.r(__webpack_exports__);
  15150. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderAlgorithm", function() { return renderAlgorithm; });
  15151. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  15152. /* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions */ "./js/visualUI/functions.js");
  15153. window.block_render = false;
  15154. function renderAlgorithm() {
  15155. if (window.block_render) {
  15156. return;
  15157. }
  15158. if (window.draging) {
  15159. return;
  15160. }
  15161. window.block_render = true;
  15162. $('.all_functions').children().off();
  15163. $('.all_functions').empty();
  15164. $('.list_globals').children().off();
  15165. $('.list_globals').empty();
  15166. for (var i = 0; i < window.program_obj.functions.length; i++) {
  15167. _functions__WEBPACK_IMPORTED_MODULE_1__["renderFunction"](window.program_obj.functions[i]);
  15168. }
  15169. for (var i = 0; i < window.program_obj.globals.length; i++) {
  15170. _globals__WEBPACK_IMPORTED_MODULE_0__["renderGlobal"](window.program_obj.globals[i]);
  15171. }
  15172. setTimeout(function () {
  15173. window.block_render = false;
  15174. }, 100);
  15175. if (settingsFilter && settingsFilter[0]) {
  15176. blockAllEditingOptions();
  15177. }
  15178. $('.command_drag').popup({
  15179. content: LocalizedStrings.getUI("text_move_command"),
  15180. delay: {
  15181. show: 1000,
  15182. hide: 0
  15183. }
  15184. });
  15185. }
  15186. /***/ }),
  15187. /***/ "./js/visualUI/code_generator.js":
  15188. /*!***************************************!*\
  15189. !*** ./js/visualUI/code_generator.js ***!
  15190. \***************************************/
  15191. /*! exports provided: generate, repeatNtimesHeader, elementExpressionCode, variableValueMenuCode */
  15192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15193. "use strict";
  15194. __webpack_require__.r(__webpack_exports__);
  15195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
  15196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeatNtimesHeader", function() { return repeatNtimesHeader; });
  15197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementExpressionCode", function() { return elementExpressionCode; });
  15198. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "variableValueMenuCode", function() { return variableValueMenuCode; });
  15199. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  15200. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15201. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15202. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  15203. /* eslint-disable @typescript-eslint/no-use-before-define */
  15204. /* globals $*/
  15205. function generate() {
  15206. $(".ivprog_visual_panel").find(".error_icon").remove();
  15207. var code = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("program") + " { ";
  15208. code += globalsCode();
  15209. code += "\n";
  15210. var has_error = false;
  15211. for (var i = 0; i < window.program_obj.functions.length; i++) {
  15212. var n_code = functionsCode(window.program_obj.functions[i]);
  15213. if (n_code == null) {
  15214. has_error = true;
  15215. }
  15216. code += n_code;
  15217. code += "\n";
  15218. }
  15219. code += "\n}";
  15220. if (has_error) {
  15221. return null;
  15222. } else {
  15223. return code;
  15224. }
  15225. }
  15226. function functionsCode(function_obj) {
  15227. var ret = "\n\t" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + " ";
  15228. var has_error = false;
  15229. switch (function_obj.return_type) {
  15230. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15231. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  15232. break;
  15233. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15234. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  15235. break;
  15236. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15237. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  15238. break;
  15239. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15240. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  15241. break;
  15242. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15243. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  15244. break;
  15245. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID:
  15246. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_void");
  15247. break;
  15248. }
  15249. ret += " ";
  15250. if (function_obj.return_dimensions == 1) {
  15251. ret += "[] ";
  15252. } else if (function_obj.return_dimensions == 2) {
  15253. ret += "[][] ";
  15254. }
  15255. if (function_obj.is_main) {
  15256. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("start");
  15257. } else {
  15258. ret += function_obj.name;
  15259. }
  15260. ret += " ( ";
  15261. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  15262. ret += parametersCode(function_obj.parameters_list[j]);
  15263. if (j + 1 < function_obj.parameters_list.length) {
  15264. ret += ", ";
  15265. }
  15266. }
  15267. ret += " ) {";
  15268. for (var _j = 0; _j < function_obj.variables_list.length; _j++) {
  15269. ret += variablesCode(function_obj.variables_list[_j]);
  15270. }
  15271. for (var _j2 = 0; _j2 < function_obj.commands.length; _j2++) {
  15272. //try {
  15273. ret += commandsCode(function_obj.commands[_j2]);
  15274. /*} catch (err) {
  15275. has_error = true;
  15276. console.error(err.message);
  15277. var todos = $('body').find('.command_container');
  15278. for (var i = 0; i < todos.length; i++) {
  15279. if ($(todos[i]).data('command') == function_obj.commands[j]) {
  15280. $( todos[i] ).prepend( ' <i class="ui icon red exclamation triangle error_icon"></i> ' );
  15281. break;
  15282. }
  15283. }
  15284. }*/
  15285. }
  15286. ret += "\n\t}";
  15287. if (has_error) {
  15288. return null;
  15289. } else {
  15290. return ret;
  15291. }
  15292. }
  15293. function commandsCode(command_obj) {
  15294. var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  15295. switch (command_obj.type) {
  15296. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["break"]:
  15297. return breaksCode(command_obj, indentation);
  15298. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].comment:
  15299. return commentsCode(command_obj, indentation);
  15300. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].reader:
  15301. return readersCode(command_obj, indentation);
  15302. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer:
  15303. return writersCode(command_obj, indentation);
  15304. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].functioncall:
  15305. return functioncallsCode(command_obj, indentation);
  15306. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution:
  15307. return attributionsCode(command_obj, indentation);
  15308. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].whiletrue:
  15309. return whiletruesCode(command_obj, indentation);
  15310. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].dowhiletrue:
  15311. return doWhilesCode(command_obj, indentation);
  15312. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].iftrue:
  15313. return iftruesCode(command_obj, indentation);
  15314. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].repeatNtimes:
  15315. return repeatNtimesCode(command_obj, indentation);
  15316. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["switch"]:
  15317. return switchsCode(command_obj, indentation);
  15318. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["return"]:
  15319. return returnsCode(command_obj, indentation);
  15320. }
  15321. }
  15322. function returnsCode(command_obj, indentation) {
  15323. var ret = "\n";
  15324. for (var i = 0; i < indentation; i++) {
  15325. ret += "\t";
  15326. }
  15327. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_return");
  15328. if (command_obj.variable_value_menu) {
  15329. try {
  15330. ret += " " + elementExpressionCode(command_obj.variable_value_menu); //ret += ' ' + variableValueMenuCode(command_obj.variable_value_menu, true);
  15331. } catch (err) {//Empty block
  15332. }
  15333. }
  15334. return ret;
  15335. }
  15336. function breaksCode(_command_obj, indentation) {
  15337. var ret = "\n";
  15338. for (var i = 0; i < indentation; i++) {
  15339. ret += "\t";
  15340. }
  15341. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_break");
  15342. return ret;
  15343. }
  15344. function switchsCode(command_obj, indentation) {
  15345. var ret = "\n";
  15346. for (var i = 0; i < indentation; i++) {
  15347. ret += "\t";
  15348. }
  15349. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_switch") + " ( ";
  15350. ret += variableValueMenuCode(command_obj.variable);
  15351. ret += " ) { ";
  15352. if (command_obj.cases) {
  15353. for (var _i = 0; _i < command_obj.cases.length; _i++) {
  15354. ret += switchcasesCode(command_obj.cases[_i], indentation + 1);
  15355. }
  15356. }
  15357. ret += "\n";
  15358. for (var _i2 = 0; _i2 < indentation; _i2++) {
  15359. ret += "\t";
  15360. }
  15361. ret += "} ";
  15362. return ret;
  15363. }
  15364. function switchcasesCode(switchcase, indentation) {
  15365. var ret = "\n";
  15366. for (var i = 0; i < indentation; i++) {
  15367. ret += "\t";
  15368. }
  15369. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_case") + " ";
  15370. ret += variableValueMenuCode(switchcase.variable_value_menu);
  15371. ret += " :";
  15372. if (switchcase.commands_block) {
  15373. for (var _i3 = 0; _i3 < switchcase.commands_block.length; _i3++) {
  15374. ret += commandsCode(switchcase.commands_block[_i3], indentation + 1);
  15375. }
  15376. }
  15377. return ret;
  15378. }
  15379. function repeatNtimesHeader(command_obj) {
  15380. var ret = "";
  15381. if (command_obj.var_attribution) {
  15382. ret += '<span class="repeatN_text_par_1">';
  15383. ret += variableValueMenuCode(command_obj.var_attribution);
  15384. ret += '</span>';
  15385. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
  15386. ret += '<span class="repeatN_text_par_2">';
  15387. ret += variableValueMenuCode(command_obj.expression1);
  15388. ret += '</span>';
  15389. }
  15390. if (command_obj.expression2) {
  15391. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
  15392. ret += '<span class="repeatN_text_par_3">';
  15393. ret += variableValueMenuCode(command_obj.expression2);
  15394. ret += '</span>';
  15395. }
  15396. if (command_obj.expression3) {
  15397. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
  15398. ret += '<span class="repeatN_text_par_4">';
  15399. switch (command_obj.expression3.itens[1]) {
  15400. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15401. ret += " +";
  15402. break;
  15403. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15404. ret += " -";
  15405. break;
  15406. }
  15407. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  15408. ret += '</span>';
  15409. }
  15410. return ret;
  15411. }
  15412. function repeatNtimesCode(command_obj, indentation) {
  15413. var ret = "\n";
  15414. for (var i = 0; i < indentation; i++) {
  15415. ret += "\t";
  15416. }
  15417. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_for") + " ";
  15418. if (command_obj.var_attribution) {
  15419. ret += variableValueMenuCode(command_obj.var_attribution);
  15420. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
  15421. ret += variableValueMenuCode(command_obj.expression1);
  15422. }
  15423. if (command_obj.expression2) {
  15424. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
  15425. ret += variableValueMenuCode(command_obj.expression2);
  15426. }
  15427. if (command_obj.expression3) {
  15428. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
  15429. switch (command_obj.expression3.itens[1]) {
  15430. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15431. ret += " +";
  15432. break;
  15433. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15434. ret += " -";
  15435. break;
  15436. }
  15437. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  15438. }
  15439. ret += " { ";
  15440. if (command_obj.commands_block) {
  15441. for (var _i4 = 0; _i4 < command_obj.commands_block.length; _i4++) {
  15442. ret += commandsCode(command_obj.commands_block[_i4], indentation + 1);
  15443. }
  15444. }
  15445. ret += "\n";
  15446. for (var _i5 = 0; _i5 < indentation; _i5++) {
  15447. ret += "\t";
  15448. }
  15449. ret += "}";
  15450. return ret;
  15451. }
  15452. function iftruesCode(command_obj, indentation) {
  15453. var ret = "\n";
  15454. for (var i = 0; i < indentation; i++) {
  15455. ret += "\t";
  15456. }
  15457. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_if");
  15458. if (!command_obj.expression) {
  15459. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  15460. } else {
  15461. ret += " ( ";
  15462. ret += elementExpressionCode(command_obj.expression);
  15463. ret += " ) ";
  15464. }
  15465. /*switch (command_obj.expression.expression.type) {
  15466. case Models.EXPRESSION_TYPES.exp_logic:
  15467. ret += logicExpressionCode(command_obj.expression.expression);
  15468. break;
  15469. case Models.EXPRESSION_TYPES.exp_arithmetic:
  15470. ret += arithmeticExpressionCode(command_obj.expression.expression);
  15471. break;
  15472. }*/
  15473. ret += " { ";
  15474. if (command_obj.commands_block) {
  15475. for (var _i6 = 0; _i6 < command_obj.commands_block.length; _i6++) {
  15476. ret += commandsCode(command_obj.commands_block[_i6], indentation + 1);
  15477. }
  15478. }
  15479. ret += "\n";
  15480. for (var _i7 = 0; _i7 < indentation; _i7++) {
  15481. ret += "\t";
  15482. }
  15483. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_else") + " {";
  15484. if (command_obj.commands_else) {
  15485. for (var _i8 = 0; _i8 < command_obj.commands_else.length; _i8++) {
  15486. ret += commandsCode(command_obj.commands_else[_i8], indentation + 1);
  15487. }
  15488. }
  15489. ret += "\n";
  15490. for (var _i9 = 0; _i9 < indentation; _i9++) {
  15491. ret += "\t";
  15492. }
  15493. ret += "}";
  15494. return ret;
  15495. }
  15496. function doWhilesCode(command_obj, indentation) {
  15497. var ret = "\n";
  15498. for (var i = 0; i < indentation; i++) {
  15499. ret += "\t";
  15500. }
  15501. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do") + " { ";
  15502. if (command_obj.commands_block) {
  15503. for (var _i10 = 0; _i10 < command_obj.commands_block.length; _i10++) {
  15504. ret += commandsCode(command_obj.commands_block[_i10], indentation + 1);
  15505. }
  15506. }
  15507. ret += "\n";
  15508. for (var _i11 = 0; _i11 < indentation; _i11++) {
  15509. ret += "\t";
  15510. }
  15511. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do_until");
  15512. if (!command_obj.expression) {
  15513. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  15514. }
  15515. /*switch (command_obj.expression.expression.type) {
  15516. case Models.EXPRESSION_TYPES.exp_logic:
  15517. ret += logicExpressionCode(command_obj.expression.expression);
  15518. break;
  15519. case Models.EXPRESSION_TYPES.exp_arithmetic:
  15520. ret += arithmeticExpressionCode(command_obj.expression.expression);
  15521. break;
  15522. }*/
  15523. if (command_obj.expression) {
  15524. ret += " ( ";
  15525. ret += elementExpressionCode(command_obj.expression);
  15526. ret += " ) ";
  15527. }
  15528. return ret;
  15529. }
  15530. function whiletruesCode(command_obj, indentation) {
  15531. var ret = "\n";
  15532. for (var i = 0; i < indentation; i++) {
  15533. ret += "\t";
  15534. }
  15535. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_while");
  15536. if (!command_obj.expression) {
  15537. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  15538. }
  15539. /*switch (command_obj.expression.expression.type) {
  15540. case Models.EXPRESSION_TYPES.exp_logic:
  15541. ret += logicExpressionCode(command_obj.expression.expression);
  15542. break;
  15543. case Models.EXPRESSION_TYPES.exp_arithmetic:
  15544. ret += arithmeticExpressionCode(command_obj.expression.expression);
  15545. break;
  15546. }*/
  15547. if (command_obj.expression) {
  15548. ret += " ( ";
  15549. ret += elementExpressionCode(command_obj.expression);
  15550. ret += " ) ";
  15551. }
  15552. ret += " { ";
  15553. if (command_obj.commands_block) {
  15554. for (var _i12 = 0; _i12 < command_obj.commands_block.length; _i12++) {
  15555. ret += commandsCode(command_obj.commands_block[_i12], indentation + 1);
  15556. }
  15557. }
  15558. ret += "\n";
  15559. for (var _i13 = 0; _i13 < indentation; _i13++) {
  15560. ret += "\t";
  15561. }
  15562. ret += "}";
  15563. return ret;
  15564. }
  15565. function logicExpressionCode(expression) {
  15566. var ret = " ( ";
  15567. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15568. ret += logicExpressionCode(expression.first_operand);
  15569. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15570. ret += arithmeticExpressionCode(expression.first_operand);
  15571. } else {
  15572. ret += variableValueMenuCode(expression.first_operand);
  15573. }
  15574. if (expression.operator) {
  15575. switch (expression.operator) {
  15576. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  15577. ret += " == ";
  15578. break;
  15579. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  15580. ret += " != ";
  15581. break;
  15582. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15583. ret += " && ";
  15584. break;
  15585. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15586. ret += " || ";
  15587. break;
  15588. }
  15589. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15590. ret += logicExpressionCode(expression.second_operand);
  15591. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15592. ret += arithmeticExpressionCode(expression.second_operand);
  15593. } else {
  15594. ret += variableValueMenuCode(expression.second_operand);
  15595. }
  15596. }
  15597. ret += " ) ";
  15598. return ret;
  15599. }
  15600. function arithmeticExpressionCode(expression) {
  15601. var ret = " ( ";
  15602. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15603. ret += logicExpressionCode(expression.first_operand);
  15604. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15605. ret += arithmeticExpressionCode(expression.first_operand);
  15606. } else {
  15607. ret += variableValueMenuCode(expression.first_operand);
  15608. }
  15609. switch (expression.operator) {
  15610. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15611. ret += " > ";
  15612. break;
  15613. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15614. ret += " < ";
  15615. break;
  15616. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to:
  15617. ret += " == ";
  15618. break;
  15619. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to:
  15620. ret += " != ";
  15621. break;
  15622. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15623. ret += " >= ";
  15624. break;
  15625. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15626. ret += " <= ";
  15627. break;
  15628. }
  15629. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15630. ret += logicExpressionCode(expression.second_operand);
  15631. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15632. ret += arithmeticExpressionCode(expression.second_operand);
  15633. } else {
  15634. ret += variableValueMenuCode(expression.second_operand);
  15635. }
  15636. ret += " ) ";
  15637. return ret;
  15638. }
  15639. function attributionsCode(command_obj, indentation) {
  15640. var ret = "\n";
  15641. for (var i = 0; i < indentation; i++) {
  15642. ret += "\t";
  15643. }
  15644. ret += variableValueMenuCode(command_obj.variable) + " <- ";
  15645. /*for (var i = 0; i < command_obj.expression.length; i++) {
  15646. ret += elementExpressionCode(command_obj.expression[i]);
  15647. }*/
  15648. ret += elementExpressionCode(command_obj.expression);
  15649. return ret;
  15650. }
  15651. function elementExpressionCode(expression_obj) {
  15652. var ret = "";
  15653. for (var i = 0; i < expression_obj.length; i++) {
  15654. if (expression_obj[i].type) {
  15655. ret += variableValueMenuCode(expression_obj[i]);
  15656. } else if (expression_obj[i].type_op) {
  15657. switch (expression_obj[i].item) {
  15658. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15659. ret += " + ";
  15660. break;
  15661. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15662. ret += " - ";
  15663. break;
  15664. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication:
  15665. ret += " * ";
  15666. break;
  15667. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division:
  15668. ret += " / ";
  15669. break;
  15670. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module:
  15671. ret += " % ";
  15672. break;
  15673. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  15674. ret += " == ";
  15675. break;
  15676. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  15677. ret += " != ";
  15678. break;
  15679. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15680. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + " ";
  15681. break;
  15682. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15683. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_or") + " ";
  15684. break;
  15685. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not:
  15686. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_not") + " ";
  15687. break;
  15688. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15689. ret += " > ";
  15690. break;
  15691. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15692. ret += " < ";
  15693. break;
  15694. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15695. ret += " >= ";
  15696. break;
  15697. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15698. ret += " <= ";
  15699. break;
  15700. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep:
  15701. ret += ', " ", ';
  15702. break;
  15703. }
  15704. } else {
  15705. ret += " " + expression_obj[i] + " ";
  15706. }
  15707. }
  15708. return ret;
  15709. }
  15710. function functioncallsCode(command_obj, indentation) {
  15711. var ret = "\n";
  15712. for (var i = 0; i < indentation; i++) {
  15713. ret += "\t";
  15714. }
  15715. ret += variableValueMenuCode(command_obj.function_called);
  15716. return ret;
  15717. }
  15718. function readersCode(command_obj, indentation) {
  15719. var ret = "\n";
  15720. for (var i = 0; i < indentation; i++) {
  15721. ret += "\t";
  15722. }
  15723. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_read") + " ( ";
  15724. ret += variableValueMenuCode(command_obj.variable_value_menu);
  15725. ret += " ) ";
  15726. return ret;
  15727. }
  15728. function variableValueMenuCode(variable_obj) {
  15729. var is_return = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  15730. var ret = "";
  15731. try {
  15732. if (variable_obj.function_called) {
  15733. if (variable_obj.function_called.name) {
  15734. ret += variable_obj.function_called.name + " ( ";
  15735. } else {
  15736. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + " ( ";
  15737. }
  15738. if (variable_obj.parameters_list) {
  15739. for (var i = 0; i < variable_obj.parameters_list.length; i++) {
  15740. ret += variableValueMenuCode(variable_obj.parameters_list[i]);
  15741. if (i + 1 < variable_obj.parameters_list.length) {
  15742. ret += ", ";
  15743. }
  15744. }
  15745. }
  15746. ret += " )";
  15747. } else if (variable_obj.content.type) {
  15748. ret += variable_obj.content.name;
  15749. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  15750. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15751. }
  15752. if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2 && variable_obj.reference_dimensions == 1) {
  15753. ret += " [ " + variableValueMenuCode(variable_obj.row) + " ] ";
  15754. } else if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  15755. ret += " [ " + variableValueMenuCode(variable_obj.row) + " ] ";
  15756. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15757. }
  15758. } else {
  15759. var content = String(variable_obj.content);
  15760. if (isNaN(content)) {
  15761. // console.debug("Content length: ", content.length);
  15762. // console.debug("Char code at 0", content.charCodeAt(0));
  15763. var isBackslash = content.charCodeAt(0) === 92;
  15764. if (content.length === 1 || content.length === 2 && isBackslash) {
  15765. ret += "'".concat(content, "'");
  15766. } else {
  15767. ret += '"' + variable_obj.content + '"';
  15768. }
  15769. } else if (content.length == 0) {
  15770. ret += '""';
  15771. } else if (content.trim().length == 0) {
  15772. ret += '"' + content + '"';
  15773. } else {
  15774. ret += variable_obj.content;
  15775. }
  15776. }
  15777. } catch (err) {
  15778. if (!is_return) {
  15779. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_content"));
  15780. throw err;
  15781. }
  15782. }
  15783. return ret;
  15784. }
  15785. function writersCode(command_obj, indentation) {
  15786. var ret = "\n";
  15787. for (var i = 0; i < indentation; i++) {
  15788. ret += "\t";
  15789. }
  15790. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_write") + " ( ";
  15791. /*for (var i = 0; i < command_obj.content.length; i++) {
  15792. ret += variableValueMenuCode(command_obj.content[i]);
  15793. if ((i + 1) < command_obj.content.length) {
  15794. ret += ' + ';
  15795. }
  15796. }*/
  15797. ret += elementExpressionCode(command_obj.content);
  15798. if (command_obj.newline) {
  15799. ret += ', "\\n"';
  15800. }
  15801. ret += " ) ";
  15802. return ret;
  15803. }
  15804. function commentsCode(command_obj, indentation) {
  15805. var ret = "\n";
  15806. for (var i = 0; i < indentation; i++) {
  15807. ret += "\t";
  15808. }
  15809. ret += "// ";
  15810. ret += command_obj.comment_text.content;
  15811. return ret;
  15812. }
  15813. function parametersCode(parameter_obj) {
  15814. var ret = "";
  15815. switch (parameter_obj.type) {
  15816. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15817. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15818. break;
  15819. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15820. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15821. break;
  15822. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15823. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15824. break;
  15825. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15826. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15827. break;
  15828. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15829. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15830. break;
  15831. }
  15832. if (parameter_obj.reference) ret += "&";
  15833. ret += parameter_obj.name + "";
  15834. if (parameter_obj.dimensions == 1) {
  15835. ret += " []";
  15836. } else if (parameter_obj.dimensions == 2) {
  15837. ret += " [][]";
  15838. }
  15839. return ret;
  15840. }
  15841. function variablesCode(variable_obj) {
  15842. var ret = "";
  15843. var temp = variable_obj;
  15844. ret += "\n\t\t";
  15845. if (temp.is_constant) {
  15846. ret += "const ";
  15847. }
  15848. switch (temp.type) {
  15849. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15850. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15851. break;
  15852. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15853. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15854. break;
  15855. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15856. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15857. break;
  15858. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15859. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15860. break;
  15861. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15862. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15863. break;
  15864. }
  15865. ret += temp.name + " ";
  15866. if (temp.dimensions == 1) {
  15867. ret += "[" + temp.columns + "] ";
  15868. switch (temp.type) {
  15869. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15870. ret += "<- {";
  15871. for (var j = 0; j < temp.value.length; j++) {
  15872. ret += temp.value[j];
  15873. if (j + 1 < temp.value.length) {
  15874. ret += ", ";
  15875. }
  15876. }
  15877. ret += "}";
  15878. break;
  15879. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15880. ret += "<- {";
  15881. for (var _j3 = 0; _j3 < temp.value.length; _j3++) {
  15882. ret += temp.value[_j3].toFixed(2);
  15883. if (_j3 + 1 < temp.value.length) {
  15884. ret += ", ";
  15885. }
  15886. }
  15887. ret += "}";
  15888. break;
  15889. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15890. ret += "<- {";
  15891. for (var _j4 = 0; _j4 < temp.value.length; _j4++) {
  15892. ret += '"' + temp.value[_j4] + '"';
  15893. if (_j4 + 1 < temp.value.length) {
  15894. ret += ", ";
  15895. }
  15896. }
  15897. ret += "}";
  15898. break;
  15899. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15900. ret += "<- {";
  15901. for (var _j5 = 0; _j5 < temp.value.length; _j5++) {
  15902. if (temp.value[_j5]) {
  15903. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15904. } else {
  15905. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15906. }
  15907. if (_j5 + 1 < temp.value.length) {
  15908. ret += ", ";
  15909. }
  15910. }
  15911. ret += "}";
  15912. break;
  15913. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15914. ret += "<- {";
  15915. for (var _j6 = 0; _j6 < temp.value.length; _j6++) {
  15916. ret += "'" + temp.value[_j6] + "'";
  15917. if (_j6 + 1 < temp.value.length) {
  15918. ret += ", ";
  15919. }
  15920. }
  15921. ret += "}";
  15922. break;
  15923. }
  15924. } else if (temp.dimensions == 2) {
  15925. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  15926. switch (temp.type) {
  15927. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15928. ret += "<- {";
  15929. for (var _j7 = 0; _j7 < temp.rows; _j7++) {
  15930. ret += "{";
  15931. for (var k = 0; k < temp.columns; k++) {
  15932. ret += temp.value[_j7][k];
  15933. if (k + 1 < temp.columns) {
  15934. ret += ", ";
  15935. }
  15936. }
  15937. ret += "}";
  15938. if (_j7 + 1 < temp.rows) {
  15939. ret += ", ";
  15940. }
  15941. }
  15942. ret += "}";
  15943. break;
  15944. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15945. ret += "<- {";
  15946. for (var _j8 = 0; _j8 < temp.rows; _j8++) {
  15947. ret += "{";
  15948. for (var _k = 0; _k < temp.columns; _k++) {
  15949. ret += temp.value[_j8][_k].toFixed(2);
  15950. if (_k + 1 < temp.columns) {
  15951. ret += ", ";
  15952. }
  15953. }
  15954. ret += "}";
  15955. if (_j8 + 1 < temp.rows) {
  15956. ret += ", ";
  15957. }
  15958. }
  15959. ret += "}";
  15960. break;
  15961. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15962. ret += "<- {";
  15963. for (var _j9 = 0; _j9 < temp.rows; _j9++) {
  15964. ret += "{";
  15965. for (var _k2 = 0; _k2 < temp.columns; _k2++) {
  15966. ret += '"' + temp.value[_j9][_k2] + '"';
  15967. if (_k2 + 1 < temp.columns) {
  15968. ret += ", ";
  15969. }
  15970. }
  15971. ret += "}";
  15972. if (_j9 + 1 < temp.rows) {
  15973. ret += ", ";
  15974. }
  15975. }
  15976. ret += "}";
  15977. break;
  15978. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15979. ret += "<- {";
  15980. for (var _j10 = 0; _j10 < temp.rows; _j10++) {
  15981. ret += "{";
  15982. for (var _k3 = 0; _k3 < temp.columns; _k3++) {
  15983. if (temp.value[_j10][_k3]) {
  15984. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15985. } else {
  15986. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15987. }
  15988. if (_k3 + 1 < temp.columns) {
  15989. ret += ", ";
  15990. }
  15991. }
  15992. ret += "}";
  15993. if (_j10 + 1 < temp.rows) {
  15994. ret += ", ";
  15995. }
  15996. }
  15997. ret += "}";
  15998. break;
  15999. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16000. ret += "<- {";
  16001. for (var _j11 = 0; _j11 < temp.rows; _j11++) {
  16002. ret += "{";
  16003. for (var _k4 = 0; _k4 < temp.columns; _k4++) {
  16004. ret += "'" + temp.value[_j11][_k4] + "'";
  16005. if (_k4 + 1 < temp.columns) {
  16006. ret += ", ";
  16007. }
  16008. }
  16009. ret += "}";
  16010. if (_j11 + 1 < temp.rows) {
  16011. ret += ", ";
  16012. }
  16013. }
  16014. ret += "}";
  16015. break;
  16016. }
  16017. } else {
  16018. switch (temp.type) {
  16019. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16020. ret += "<- " + temp.value;
  16021. break;
  16022. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16023. ret += "<- " + temp.value.toFixed(2);
  16024. break;
  16025. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16026. ret += '<- "' + temp.value + '"';
  16027. break;
  16028. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16029. ret += "<- ";
  16030. if (temp.value) {
  16031. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16032. } else {
  16033. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16034. }
  16035. break;
  16036. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16037. ret += "<- '" + temp.value + "'";
  16038. break;
  16039. }
  16040. }
  16041. return ret;
  16042. }
  16043. function globalsCode() {
  16044. var ret = "";
  16045. if (window.program_obj.globals) {
  16046. for (var i = 0; i < window.program_obj.globals.length; i++) {
  16047. var temp = window.program_obj.globals[i];
  16048. ret += "\n\t";
  16049. if (temp.is_constant) {
  16050. ret += "const ";
  16051. }
  16052. switch (temp.type) {
  16053. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16054. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  16055. break;
  16056. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16057. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  16058. break;
  16059. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16060. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  16061. break;
  16062. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16063. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  16064. break;
  16065. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16066. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  16067. break;
  16068. }
  16069. ret += " " + temp.name + " ";
  16070. if (temp.dimensions == 1) {
  16071. ret += "[" + temp.columns + "] ";
  16072. switch (temp.type) {
  16073. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16074. ret += "<- {";
  16075. for (var j = 0; j < temp.value.length; j++) {
  16076. ret += temp.value[j];
  16077. if (j + 1 < temp.value.length) {
  16078. ret += ", ";
  16079. }
  16080. }
  16081. ret += "}";
  16082. break;
  16083. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16084. ret += "<- {";
  16085. for (var _j12 = 0; _j12 < temp.value.length; _j12++) {
  16086. ret += temp.value[_j12].toFixed(2);
  16087. if (_j12 + 1 < temp.value.length) {
  16088. ret += ", ";
  16089. }
  16090. }
  16091. ret += "}";
  16092. break;
  16093. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16094. ret += "<- {";
  16095. for (var _j13 = 0; _j13 < temp.value.length; _j13++) {
  16096. ret += '"' + temp.value[_j13] + '"';
  16097. if (_j13 + 1 < temp.value.length) {
  16098. ret += ", ";
  16099. }
  16100. }
  16101. ret += "}";
  16102. break;
  16103. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16104. ret += "<- {";
  16105. for (var _j14 = 0; _j14 < temp.value.length; _j14++) {
  16106. if (temp.value[_j14]) {
  16107. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16108. } else {
  16109. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16110. }
  16111. if (_j14 + 1 < temp.value.length) {
  16112. ret += ", ";
  16113. }
  16114. }
  16115. ret += "}";
  16116. break;
  16117. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16118. ret += "<- {";
  16119. for (var _j15 = 0; _j15 < temp.value.length; _j15++) {
  16120. ret += "'" + temp.value[_j15] + "'";
  16121. if (_j15 + 1 < temp.value.length) {
  16122. ret += ", ";
  16123. }
  16124. }
  16125. ret += "}";
  16126. break;
  16127. }
  16128. } else if (temp.dimensions == 2) {
  16129. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  16130. switch (temp.type) {
  16131. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16132. ret += "<- {";
  16133. for (var _j16 = 0; _j16 < temp.rows; _j16++) {
  16134. ret += "{";
  16135. for (var k = 0; k < temp.columns; k++) {
  16136. ret += temp.value[_j16][k];
  16137. if (k + 1 < temp.columns) {
  16138. ret += ", ";
  16139. }
  16140. }
  16141. ret += "}";
  16142. if (_j16 + 1 < temp.rows) {
  16143. ret += ", ";
  16144. }
  16145. }
  16146. ret += "}";
  16147. break;
  16148. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16149. ret += "<- {";
  16150. for (var _j17 = 0; _j17 < temp.rows; _j17++) {
  16151. ret += "{";
  16152. for (var _k5 = 0; _k5 < temp.columns; _k5++) {
  16153. ret += temp.value[_j17][_k5].toFixed(2);
  16154. if (_k5 + 1 < temp.columns) {
  16155. ret += ", ";
  16156. }
  16157. }
  16158. ret += "}";
  16159. if (_j17 + 1 < temp.rows) {
  16160. ret += ", ";
  16161. }
  16162. }
  16163. ret += "}";
  16164. break;
  16165. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16166. ret += "<- {";
  16167. for (var _j18 = 0; _j18 < temp.rows; _j18++) {
  16168. ret += "{";
  16169. for (var _k6 = 0; _k6 < temp.columns; _k6++) {
  16170. ret += '"' + temp.value[_j18][_k6] + '"';
  16171. if (_k6 + 1 < temp.columns) {
  16172. ret += ", ";
  16173. }
  16174. }
  16175. ret += "}";
  16176. if (_j18 + 1 < temp.rows) {
  16177. ret += ", ";
  16178. }
  16179. }
  16180. ret += "}";
  16181. break;
  16182. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16183. ret += "<- {";
  16184. for (var _j19 = 0; _j19 < temp.rows; _j19++) {
  16185. ret += "{";
  16186. for (var _k7 = 0; _k7 < temp.columns; _k7++) {
  16187. if (temp.value[_j19][_k7]) {
  16188. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16189. } else {
  16190. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16191. }
  16192. if (_k7 + 1 < temp.columns) {
  16193. ret += ", ";
  16194. }
  16195. }
  16196. ret += "}";
  16197. if (_j19 + 1 < temp.rows) {
  16198. ret += ", ";
  16199. }
  16200. }
  16201. ret += "}";
  16202. break;
  16203. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16204. ret += "<- {";
  16205. for (var _j20 = 0; _j20 < temp.rows; _j20++) {
  16206. ret += "{";
  16207. for (var _k8 = 0; _k8 < temp.columns; _k8++) {
  16208. ret += "'" + temp.value[_j20][_k8] + "'";
  16209. if (_k8 + 1 < temp.columns) {
  16210. ret += ", ";
  16211. }
  16212. }
  16213. ret += "}";
  16214. if (_j20 + 1 < temp.rows) {
  16215. ret += ", ";
  16216. }
  16217. }
  16218. ret += "}";
  16219. break;
  16220. }
  16221. } else {
  16222. switch (temp.type) {
  16223. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16224. ret += "<- " + temp.value;
  16225. break;
  16226. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16227. ret += "<- " + temp.value.toFixed(2);
  16228. break;
  16229. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16230. ret += '<- "' + temp.value + '"';
  16231. break;
  16232. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16233. ret += "<- ";
  16234. if (temp.value) {
  16235. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16236. } else {
  16237. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16238. }
  16239. break;
  16240. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16241. ret += "<- '" + temp.value + "'";
  16242. break;
  16243. }
  16244. }
  16245. }
  16246. }
  16247. return ret;
  16248. }
  16249. /***/ }),
  16250. /***/ "./js/visualUI/commands.js":
  16251. /*!*********************************!*\
  16252. !*** ./js/visualUI/commands.js ***!
  16253. \*********************************/
  16254. /*! exports provided: removeCommand, createFloatingCommand, renderCommand, genericCreateCommand */
  16255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16256. "use strict";
  16257. __webpack_require__.r(__webpack_exports__);
  16258. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCommand", function() { return removeCommand; });
  16259. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16260. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16261. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericCreateCommand", function() { return genericCreateCommand; });
  16262. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  16263. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16264. /* harmony import */ var _commands_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commands/comment */ "./js/visualUI/commands/comment.js");
  16265. /* harmony import */ var _commands_reader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/reader */ "./js/visualUI/commands/reader.js");
  16266. /* harmony import */ var _commands_writer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/writer */ "./js/visualUI/commands/writer.js");
  16267. /* harmony import */ var _commands_attribution__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/attribution */ "./js/visualUI/commands/attribution.js");
  16268. /* harmony import */ var _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/iftrue */ "./js/visualUI/commands/iftrue.js");
  16269. /* harmony import */ var _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  16270. /* harmony import */ var _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/whiletrue */ "./js/visualUI/commands/whiletrue.js");
  16271. /* harmony import */ var _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/dowhiletrue */ "./js/visualUI/commands/dowhiletrue.js");
  16272. /* harmony import */ var _commands_switch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/switch */ "./js/visualUI/commands/switch.js");
  16273. /* harmony import */ var _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/functioncall */ "./js/visualUI/commands/functioncall.js");
  16274. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16275. /* harmony import */ var _commands_break__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/break */ "./js/visualUI/commands/break.js");
  16276. /* harmony import */ var _commands_return__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/return */ "./js/visualUI/commands/return.js");
  16277. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  16278. // let has_element_created_draged = false;
  16279. // let which_element_is_draged = null;
  16280. function removeCommand(command, function_obj, dom_obj) {
  16281. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_COMMAND, command.type, '/', 0);
  16282. if (function_obj.commands.indexOf(command) > -1) {
  16283. function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  16284. return true;
  16285. } // Utilize dois parantNode, pois o primeiro é o div de comandos
  16286. try {
  16287. if (dom_obj.parent().parent().data('command').commands_block.indexOf(command) > -1) {
  16288. dom_obj.parent().parent().data('command').commands_block.splice(dom_obj.parent().parent().data('command').commands_block.indexOf(command), 1);
  16289. return true;
  16290. }
  16291. } catch (err) {}
  16292. try {
  16293. if (dom_obj.parent().parent().data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16294. if (dom_obj.parent().parent().data('command').commands_else.indexOf(command) > -1) {
  16295. dom_obj.parent().parent().data('command').commands_else.splice(dom_obj.parent().parent().data('command').commands_else.indexOf(command), 1);
  16296. return true;
  16297. }
  16298. }
  16299. } catch (err) {}
  16300. if (dom_obj.parent().data('switchcase')) {
  16301. dom_obj.parent().data('switchcase').commands_block.splice(dom_obj.parent().data('switchcase').commands_block.indexOf(command), 1);
  16302. return true;
  16303. }
  16304. return false;
  16305. }
  16306. window.function_container_active = null;
  16307. function createFloatingCommand(function_obj, function_container, command_type, mouse_event) {
  16308. var floatingObject;
  16309. switch (command_type) {
  16310. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16311. floatingObject = _commands_break__WEBPACK_IMPORTED_MODULE_13__["createFloatingCommand"]();
  16312. break;
  16313. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16314. floatingObject = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"]();
  16315. break;
  16316. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16317. floatingObject = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["createFloatingCommand"]();
  16318. break;
  16319. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16320. floatingObject = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["createFloatingCommand"]();
  16321. break;
  16322. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16323. floatingObject = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"]();
  16324. break;
  16325. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16326. floatingObject = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["createFloatingCommand"]();
  16327. break;
  16328. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16329. floatingObject = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["createFloatingCommand"]();
  16330. break;
  16331. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16332. floatingObject = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["createFloatingCommand"]();
  16333. break;
  16334. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16335. floatingObject = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["createFloatingCommand"]();
  16336. break;
  16337. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16338. floatingObject = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["createFloatingCommand"]();
  16339. break;
  16340. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16341. floatingObject = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["createFloatingCommand"]();
  16342. break;
  16343. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16344. floatingObject = _commands_return__WEBPACK_IMPORTED_MODULE_14__["createFloatingCommand"]();
  16345. break;
  16346. }
  16347. floatingObject.draggable().appendTo("body");
  16348. $('body').mouseup(function (evt) {
  16349. manageCommand(function_obj, function_container, evt, command_type);
  16350. $('body').off('mouseup');
  16351. $('body').off('mouseover');
  16352. });
  16353. if (!function_container.hasClass('function_div') || function_container.length < 1) {
  16354. window.mouse_event = mouse_event;
  16355. function_container = $(mouse_event.originalEvent.srcElement.closest('.function_div'));
  16356. }
  16357. function_container_active = function_container;
  16358. function_container.find('.commands_list_div').on('mousemove', function (evt) {
  16359. addGhostDiv(evt);
  16360. });
  16361. function_container.find('.commands_list_div').find("*").on('mousemove', function (evt) {
  16362. addGhostDiv(evt);
  16363. });
  16364. function_container.on('mouseout', function (event) {
  16365. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16366. if (el.closest('.commands_list_div').length < 1) {
  16367. window.ghostDiv.remove();
  16368. }
  16369. });
  16370. floatingObject.css("position", "absolute");
  16371. mouse_event.type = "mousedown.draggable";
  16372. mouse_event.target = floatingObject[0];
  16373. floatingObject.css("left", mouse_event.pageX - window.divx);
  16374. floatingObject.css("top", mouse_event.pageY);
  16375. floatingObject.trigger(mouse_event);
  16376. }
  16377. window.divx = 100;
  16378. window.ghostDiv = $('<div class="ghost_div">');
  16379. window.active_container = null;
  16380. function addGhostToEmptyBlock(element, evt) {
  16381. $('.ghost_div').remove();
  16382. var container = element.closest('.command_container');
  16383. if (container.hasClass('switch')) {
  16384. container = $(evt.target).closest('.case_div');
  16385. }
  16386. if (!container.hasClass('dowhiletrue') && !container.hasClass('iftrue') && !container.hasClass('repeatNtimes') && !container.hasClass('case_div') && !container.hasClass('whiletrue')) {
  16387. addGhostToNotEmptyBlock(element, evt);
  16388. return;
  16389. }
  16390. if (window.active_container != null) {
  16391. if (window.active_container.is(container)) {//console.log('é o mesmo, não mudou!');
  16392. } else {
  16393. if (container.length < 1) {
  16394. container = element.closest('.commands_list_div');
  16395. if (window.active_container.is(container)) {//console.log('é o mesmo command list');
  16396. } else {
  16397. //console.log('mudou para um command list');
  16398. window.active_container = container;
  16399. }
  16400. } else {//console.log('mudou para um outro container?');
  16401. }
  16402. }
  16403. }
  16404. window.active_container = container;
  16405. if (container.hasClass('iftrue')) {
  16406. var containerIf = container.find('.commands_if').get(0);
  16407. var containerElse = container.find('.commands_else').get(0);
  16408. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  16409. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  16410. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  16411. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  16412. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  16413. $(containerIf).append(window.ghostDiv);
  16414. } else {
  16415. $(containerElse).append(window.ghostDiv);
  16416. }
  16417. } else if (container.hasClass('case_div')) {
  16418. container.find('.case_commands_block').append(window.ghostDiv);
  16419. } else {
  16420. container.find('.block_commands').append(window.ghostDiv);
  16421. }
  16422. }
  16423. function addGhostToNotEmptyBlock(element, evt) {
  16424. $('.ghost_div').remove();
  16425. var container = element.closest('.dowhiletrue, .iftrue, .repeatNtimes, .case_div, .whiletrue'); //console.log("\n\nNOT EMPTY: ", container);
  16426. //if (window.active_container != null) {
  16427. //}
  16428. if (container.length < 1) {
  16429. container = element.closest('.commands_list_div');
  16430. window.active_container = container;
  16431. addGhostToFunctionArea(element, evt);
  16432. } else {//console.log('mudou para um outro container?');
  16433. }
  16434. window.active_container = container; // quem está mais próximo? // Essa regra se aplica somente quando o over está sobre um comando
  16435. var allfilhos;
  16436. if (container.hasClass('iftrue')) {
  16437. if ($(evt.target).closest('.data_block_if').length > 0) {
  16438. allfilhos = container.find('.commands_if').children('.command_container');
  16439. } else if ($(evt.target).closest('.data_block_else').length > 0) {
  16440. allfilhos = container.find('.commands_else').children('.command_container');
  16441. } else {
  16442. var containerIf = container.find('.commands_if').get(0);
  16443. var containerElse = container.find('.commands_else').get(0);
  16444. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  16445. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  16446. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  16447. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  16448. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  16449. allfilhos = $(containerIf).children('.command_container');
  16450. } else {
  16451. allfilhos = $(containerElse).children('.command_container');
  16452. }
  16453. }
  16454. } else if (container.hasClass('case_div')) {
  16455. allfilhos = container.children('.case_commands_block').children('.command_container');
  16456. } else if (container.hasClass('commands_list_div')) {
  16457. allfilhos = container.children('.command_container');
  16458. } else {
  16459. allfilhos = container.children('.block_commands').children('.command_container');
  16460. }
  16461. var topDistances = [];
  16462. var bottomDistances = [];
  16463. for (var i = 0; i < allfilhos.length; i++) {
  16464. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  16465. topDistances.push(topD);
  16466. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  16467. bottomDistances.push(botD);
  16468. }
  16469. var menorTop = Math.min.apply(null, topDistances);
  16470. var indiceTop = topDistances.indexOf(menorTop);
  16471. var menorBot = Math.min.apply(null, bottomDistances);
  16472. var indiceBot = bottomDistances.indexOf(menorBot);
  16473. if (menorTop < menorBot) {
  16474. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  16475. } else {
  16476. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  16477. }
  16478. }
  16479. function addGhostToFunctionArea(undermouse, evt) {
  16480. $('.ghost_div').remove();
  16481. var allfilhos = undermouse.closest('.commands_list_div').children('.command_container');
  16482. var topDistances = [];
  16483. var bottomDistances = [];
  16484. for (var i = 0; i < allfilhos.length; i++) {
  16485. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  16486. topDistances.push(topD);
  16487. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  16488. bottomDistances.push(botD);
  16489. }
  16490. var menorTop = Math.min.apply(null, topDistances);
  16491. var indiceTop = topDistances.indexOf(menorTop);
  16492. var menorBot = Math.min.apply(null, bottomDistances);
  16493. var indiceBot = bottomDistances.indexOf(menorBot);
  16494. if (menorTop < menorBot) {
  16495. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  16496. } else {
  16497. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  16498. }
  16499. }
  16500. function addGhostDiv(evt) {
  16501. var undermouse = $(evt.target);
  16502. if (undermouse.hasClass('ghost_div')) {
  16503. return;
  16504. } else if (undermouse.hasClass('commands_list_div')) {
  16505. addGhostToFunctionArea(undermouse, evt);
  16506. return;
  16507. } else if (undermouse.hasClass('block_commands')) {
  16508. if (undermouse.find('.command_container').length > 0) {
  16509. addGhostToNotEmptyBlock(undermouse, evt);
  16510. } else {
  16511. addGhostToEmptyBlock(undermouse, evt);
  16512. }
  16513. } else if (undermouse.hasClass('case_div')) {
  16514. if (undermouse.find('.case_commands_block').find('.command_container').length > 0) {
  16515. addGhostToNotEmptyBlock(undermouse, evt);
  16516. } else {
  16517. addGhostToEmptyBlock(undermouse, evt);
  16518. }
  16519. } else {
  16520. addGhostToNotEmptyBlock(undermouse, evt);
  16521. }
  16522. }
  16523. function borderMouseDragCommand(function_obj, function_container, evt) {
  16524. function_container.find('.over_command_drag').each(function (index) {
  16525. $(this).removeClass('over_command_drag');
  16526. });
  16527. var prev = null;
  16528. function_container.find('.commands_list_div').each(function (index) {
  16529. prev = $(this);
  16530. if (prev) {
  16531. var objLeft = prev.offset().left;
  16532. var objTop = prev.offset().top;
  16533. var objRight = objLeft + prev.width();
  16534. var objBottom = objTop + prev.height();
  16535. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  16536. prev.addClass("over_command_drag");
  16537. }
  16538. }
  16539. });
  16540. function_container.find('.command_container').each(function (index) {
  16541. var obj = $(this);
  16542. var objLeft = obj.offset().left;
  16543. var objTop = obj.offset().top;
  16544. var objRight = objLeft + obj.width();
  16545. var objBottom = objTop + obj.height();
  16546. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  16547. if (prev) {
  16548. prev.removeClass('over_command_drag');
  16549. }
  16550. obj.addClass("over_command_drag");
  16551. return;
  16552. }
  16553. });
  16554. } // before_after_inside: 1 -> before, 2 -> after, 3 -> inside
  16555. function renderCommand(command, element_reference, before_after_inside, function_obj) {
  16556. var createdElement;
  16557. switch (command.type) {
  16558. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16559. createdElement = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command, function_obj);
  16560. break;
  16561. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16562. createdElement = _commands_break__WEBPACK_IMPORTED_MODULE_13__["renderCommand"](command, function_obj);
  16563. break;
  16564. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16565. createdElement = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["renderCommand"](command, function_obj);
  16566. break;
  16567. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16568. createdElement = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["renderCommand"](command, function_obj);
  16569. break;
  16570. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16571. createdElement = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](command, function_obj);
  16572. break;
  16573. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16574. createdElement = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["renderCommand"](command, function_obj);
  16575. break;
  16576. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16577. createdElement = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["renderCommand"](command, function_obj);
  16578. break;
  16579. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16580. createdElement = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["renderCommand"](command, function_obj);
  16581. break;
  16582. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16583. createdElement = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["renderCommand"](command, function_obj);
  16584. break;
  16585. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16586. createdElement = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["renderCommand"](command, function_obj);
  16587. break;
  16588. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16589. createdElement = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["renderCommand"](command, function_obj);
  16590. break;
  16591. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16592. createdElement = _commands_return__WEBPACK_IMPORTED_MODULE_14__["renderCommand"](command, function_obj);
  16593. break;
  16594. }
  16595. switch (before_after_inside) {
  16596. case 1:
  16597. createdElement.insertBefore(element_reference);
  16598. break;
  16599. case 2:
  16600. createdElement.insertAfter(element_reference);
  16601. break;
  16602. case 3:
  16603. element_reference.append(createdElement);
  16604. break;
  16605. }
  16606. }
  16607. function genericCreateCommand(command_type) {
  16608. switch (command_type) {
  16609. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16610. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Break"]();
  16611. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16612. 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));
  16613. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16614. 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));
  16615. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16616. 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)]);
  16617. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16618. 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), []);
  16619. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16620. 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);
  16621. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16622. 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)]);
  16623. //(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block)
  16624. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16625. 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);
  16626. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16627. 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);
  16628. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16629. 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);
  16630. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16631. 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))];
  16632. 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);
  16633. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16634. 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)]);
  16635. }
  16636. }
  16637. function dragTrash(event) {
  16638. $('.ghost_div').remove();
  16639. var trash = $('<i class="ui icon trash alternate outline"></i>');
  16640. $('body').append(trash);
  16641. trash.css('position', 'absolute');
  16642. trash.css('top', event.clientY);
  16643. trash.css('left', event.clientX - 20);
  16644. trash.css('font-size', '3em');
  16645. trash.css('display', 'none');
  16646. function_container_active.find('.commands_list_div').off('mousemove');
  16647. function_container_active.find('.commands_list_div').find("*").off('mousemove');
  16648. trash.fadeIn(200, function () {
  16649. trash.fadeOut(200, function () {
  16650. trash.remove();
  16651. });
  16652. });
  16653. }
  16654. function findSingleElement(searching, query) {
  16655. if (!searching || !query) {
  16656. return '';
  16657. }
  16658. 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) {
  16659. if (searching.commands_block) {
  16660. return '' + searching.commands_block.indexOf(query);
  16661. } else {
  16662. return '0';
  16663. }
  16664. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16665. if (searching.commands_block == null) {
  16666. searching.commands_block = [];
  16667. }
  16668. if (searching.commands_else == null) {
  16669. searching.commands_else = [];
  16670. }
  16671. if (searching.commands_block.indexOf(query) >= 0) {
  16672. return 'if[' + searching.commands_block.indexOf(query) + ']';
  16673. } else {
  16674. return 'else[' + searching.commands_else.indexOf(query) + ']';
  16675. }
  16676. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16677. for (var i = 0; i < searching.cases.length; i++) {
  16678. if (searching.cases[i].commands_block.indexOf(query) >= 0) {
  16679. return 'case[' + searching.cases[i].commands_block.indexOf(query) + ']';
  16680. }
  16681. }
  16682. }
  16683. }
  16684. function findPathRecursive(starter_index, hierarquia_bottom_up, function_obj) {
  16685. var index_command = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
  16686. var actual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  16687. var full_path = '';
  16688. for (var i = 0; i <= hierarquia_bottom_up.length; i++) {
  16689. full_path += findSingleElement(hierarquia_bottom_up[i], hierarquia_bottom_up[i + 1]) + '-';
  16690. }
  16691. return full_path;
  16692. }
  16693. function manageCommand(function_obj, function_container, event, command_type) {
  16694. $(".created_element").each(function (index) {
  16695. $(this).remove();
  16696. });
  16697. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16698. if (el.hasClass('ghost_div')) {
  16699. if (el.closest('.command_container').length < 1) {
  16700. el.closest('.commands_list_div').css('height', el.closest('.commands_list_div').css('height') + 30); //$('.ghost_div').remove();
  16701. el = el.closest('.commands_list_div');
  16702. }
  16703. } // Primeiro verificar se ele soltou no espaço da função correta:
  16704. var hier = el.parentsUntil(".all_functions");
  16705. var esta_correto = false;
  16706. var esta_na_div_correta = false;
  16707. if (el.hasClass("commands_list_div")) {
  16708. esta_na_div_correta = true;
  16709. }
  16710. for (var i = 0; i < hier.length; i++) {
  16711. var temp = $(hier[i]);
  16712. if (temp.hasClass("commands_list_div")) {
  16713. esta_na_div_correta = true;
  16714. }
  16715. if (temp.data('fun') == function_obj) {
  16716. esta_correto = true;
  16717. break;
  16718. }
  16719. }
  16720. if (!esta_correto) {
  16721. // has_element_created_draged = false;
  16722. // which_element_is_draged = null;
  16723. dragTrash(event);
  16724. return;
  16725. } else {
  16726. if (!esta_na_div_correta) {
  16727. // has_element_created_draged = false;
  16728. // which_element_is_draged = null;
  16729. dragTrash(event);
  16730. return;
  16731. }
  16732. }
  16733. var hierarquia_bottom_up = null; // Agora é descobrir qual o escopo para adicionar o comando:
  16734. // Se o elemento clicado possuir o atributo "fun", então, é direto na div dos comandos:
  16735. if (typeof el.data('fun') !== 'undefined') {
  16736. // Se a lista de comandos estiver vazia, então é o primeiro.
  16737. // Portanto, ele deve soltar o elemento obrigatoriamente no objeto vazio
  16738. if (el.data('fun').commands == null || el.data('fun').commands.length == 0) {
  16739. // pode adicionar
  16740. el.data('fun').commands = [];
  16741. var new_cmd = genericCreateCommand(command_type);
  16742. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', 0);
  16743. el.data('fun').commands.push(new_cmd);
  16744. renderCommand(new_cmd, $(function_container).find('.commands_list_div'), 3, function_obj);
  16745. } else {
  16746. // Entra nesse else, caso já existam outros comandos no bloco:
  16747. findNearbyCommandToAddInFunctionScope(el, event, $(function_container).find('.commands_list_div'), function_obj, command_type);
  16748. }
  16749. } else {
  16750. // descobrir em qual comando ele soltou:
  16751. var hier_find = el.parentsUntil(".commands_list_div");
  16752. hierarquia_bottom_up = [];
  16753. if (typeof el.data('command') !== 'undefined') {
  16754. hierarquia_bottom_up.push(el.data('command'));
  16755. }
  16756. for (var i = 0; i < hier_find.length; i++) {
  16757. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16758. hierarquia_bottom_up.push($(hier_find[i]).data('command'));
  16759. }
  16760. } // Se for do tipo break, verificar se está no contexto correto:
  16761. // Caso não esteja no contexto, apenas retorna sem dar continuidade:
  16762. var is_correct_context = false;
  16763. if (command_type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]) {
  16764. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  16765. 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"]) {
  16766. is_correct_context = true;
  16767. break;
  16768. }
  16769. }
  16770. if (!is_correct_context) {
  16771. console.error("Context not allowed to insert BREAK COMMAND!");
  16772. return;
  16773. }
  16774. } // se a hierarquia possuir apenas um elemento, então está na raiz dos comandos:
  16775. if (hierarquia_bottom_up.length == 1) {
  16776. var sub_elemento = false;
  16777. for (var i = 0; i < hier_find.length; i++) {
  16778. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16779. findBeforeOrAfterCommandToAdd(hier_find[i], event, function_obj, command_type);
  16780. sub_elemento = true;
  16781. break;
  16782. }
  16783. }
  16784. if (!sub_elemento) {
  16785. findBeforeOrAfterCommandToAdd(el[0], event, function_obj, command_type);
  16786. }
  16787. } else {
  16788. // caso exista mais de um elemento na hierarquia:
  16789. if (typeof $(el).data('command') !== 'undefined') {
  16790. insertCommandInBlockHierar(el[0], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16791. } else {
  16792. var sub_elemento = false;
  16793. for (var i = 0; i < hier_find.length; i++) {
  16794. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16795. insertCommandInBlockHierar(hier_find[i], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16796. sub_elemento = true;
  16797. break;
  16798. }
  16799. }
  16800. }
  16801. }
  16802. } // has_element_created_draged = false;
  16803. // which_element_is_draged = null;
  16804. if (hierarquia_bottom_up) {
  16805. var i = hierarquia_bottom_up.length - 1;
  16806. var starter_index = window.program_obj.functions[window.program_obj.functions.indexOf(function_obj)].commands.indexOf(hierarquia_bottom_up[i]);
  16807. var all_str_path = starter_index + '-' + findPathRecursive(starter_index, hierarquia_bottom_up, function_obj);
  16808. 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);
  16809. }
  16810. renderAlgorithm();
  16811. }
  16812. function insertCommandInBlockHierar(el, event, function_obj, command_type, hier_dom, hier_obj) {
  16813. var el_jq = $(el);
  16814. var command_parent = el_jq.data('command');
  16815. 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"]) {
  16816. 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) {
  16817. // Se não tiver outro comando ainda no bloco, só adiciona:
  16818. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16819. command_parent.commands_block = [];
  16820. var recentComand = genericCreateCommand(command_type);
  16821. command_parent.commands_block.push(recentComand);
  16822. 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);
  16823. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  16824. } else {
  16825. // Se já tem algum comando no bloco:
  16826. findNearbyCommandToAddInBlockScope(el, event, el, function_obj, command_type, command_parent);
  16827. }
  16828. } else {
  16829. // QUANDO FOR BLOCO DO TIPO IF OU SWITCH/CASE:
  16830. addCommandToSwitchCase(event, function_obj, command_type);
  16831. }
  16832. } else {
  16833. // entra neste bloco, se soltou o comando sobre outro comando dentro de um subbloco:
  16834. findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type);
  16835. }
  16836. }
  16837. function findNearbyCommandToAddInBlockScope(el, event, node_list_commands, function_obj, command_type, command_parent) {
  16838. var all_sub = $(node_list_commands).find('div.command_container');
  16839. var menor_distancia = 999999999;
  16840. var elemento_menor_distancia = null;
  16841. var antes = true;
  16842. var t_bot;
  16843. var t_top; // Descobrindo o elemento mais próximo:
  16844. for (var i = 0; i < all_sub.length; i++) {
  16845. t_top = all_sub[i].getBoundingClientRect().top;
  16846. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16847. if (t_top - event.clientY < menor_distancia) {
  16848. menor_distancia = event.clientY - t_top;
  16849. elemento_menor_distancia = all_sub[i];
  16850. }
  16851. }
  16852. 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:
  16853. if (borda_inferior - event.clientY < menor_distancia) {
  16854. var recentComand = genericCreateCommand(command_type);
  16855. command_parent.commands_block.push(recentComand); //
  16856. renderCommand(recentComand, node_list_commands, 3, function_obj);
  16857. } else {
  16858. var recentComand = genericCreateCommand(command_type);
  16859. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16860. if (index > -1) {
  16861. command_parent.commands_block.splice(index, 0, recentComand);
  16862. }
  16863. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16864. }
  16865. }
  16866. function findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type) {
  16867. var el_jq = $(el);
  16868. var command_parent = $(el.parentNode.parentNode).data('command');
  16869. var command_target = el_jq.data('command');
  16870. var temp_parent = $(el.parentNode.parentNode);
  16871. var is_in_else = false;
  16872. if (!command_parent) {
  16873. command_parent = el_jq.data('command');
  16874. temp_parent = el_jq;
  16875. var hier = el_jq.parentsUntil(".command_container");
  16876. for (var i = 0; i < hier.length; i++) {
  16877. var temp = $(hier[i]);
  16878. if (typeof temp.data('else') != 'undefined') {
  16879. is_in_else = true;
  16880. }
  16881. if (typeof temp.data('command') != 'undefined') {
  16882. command_parent = temp.data('command');
  16883. temp_parent = temp;
  16884. }
  16885. }
  16886. }
  16887. var hier = el_jq.parentsUntil(".command_container");
  16888. for (var i = 0; i < hier.length; i++) {
  16889. var temp = $(hier[i]);
  16890. if (typeof temp.data('else') != 'undefined') {
  16891. is_in_else = true;
  16892. }
  16893. }
  16894. if (command_parent == command_target) {
  16895. var hier = el_jq.parentsUntil(".command_container");
  16896. for (var i = 0; i < hier.length; i++) {
  16897. var temp = $(hier[i]);
  16898. if (typeof temp.data('else') !== 'undefined') {
  16899. is_in_else = true;
  16900. break;
  16901. }
  16902. }
  16903. }
  16904. 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"]) {
  16905. var hier = temp_parent.parentsUntil(".all_cases_div");
  16906. for (var i = 0; i < hier.length; i++) {
  16907. var temp = $(hier[i]);
  16908. if (typeof temp.data('switchcase') !== 'undefined') {
  16909. command_parent = temp.data('switchcase');
  16910. is_in_else = false;
  16911. break;
  16912. }
  16913. }
  16914. }
  16915. var menor_distancia = 999999999;
  16916. var antes = true;
  16917. var t_bot;
  16918. var t_top;
  16919. t_top = el.getBoundingClientRect().top;
  16920. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  16921. var d_top = event.clientY - t_top; // distancia topo
  16922. var d_bot = t_bot - event.clientY; // distancia baixo
  16923. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16924. if (d_top < d_bot) {
  16925. var recentComand = genericCreateCommand(command_type);
  16926. if (is_in_else) {
  16927. if (command_parent == command_target) {
  16928. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16929. command_parent.commands_else = [];
  16930. var recentComand = genericCreateCommand(command_type);
  16931. command_parent.commands_else.push(recentComand);
  16932. renderCommand(recentComand, el_jq, 3, function_obj);
  16933. } else {
  16934. // Se já tem algum comando no bloco:
  16935. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16936. }
  16937. return;
  16938. }
  16939. var index = command_parent.commands_else.indexOf(command_target);
  16940. if (index > -1) {
  16941. command_parent.commands_else.splice(index, 0, recentComand);
  16942. }
  16943. renderCommand(recentComand, el, 1, function_obj);
  16944. } else {
  16945. if (command_parent == command_target) {
  16946. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16947. command_parent.commands_block = [];
  16948. var recentComand = genericCreateCommand(command_type);
  16949. command_parent.commands_block.push(recentComand);
  16950. renderCommand(recentComand, el_jq, 3, function_obj);
  16951. } else {
  16952. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16953. }
  16954. return;
  16955. }
  16956. var index = command_parent.commands_block.indexOf(command_target);
  16957. if (index > -1) {
  16958. command_parent.commands_block.splice(index, 0, recentComand);
  16959. }
  16960. renderCommand(recentComand, el, 1, function_obj);
  16961. }
  16962. } else {
  16963. var recentComand = genericCreateCommand(command_type);
  16964. if (is_in_else) {
  16965. if (command_parent == command_target) {
  16966. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16967. command_parent.commands_else = [];
  16968. var recentComand = genericCreateCommand(command_type);
  16969. command_parent.commands_else.push(recentComand);
  16970. renderCommand(recentComand, el_jq, 3, function_obj);
  16971. } else {
  16972. // Se já tem algum comando no bloco:
  16973. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16974. }
  16975. return;
  16976. }
  16977. var index = command_parent.commands_else.indexOf(command_target);
  16978. if (index > -1) {
  16979. command_parent.commands_else.splice(index + 1, 0, recentComand);
  16980. }
  16981. renderCommand(recentComand, el, 2, function_obj);
  16982. } else {
  16983. if (command_parent == command_target) {
  16984. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16985. command_parent.commands_block = [];
  16986. var recentComand = genericCreateCommand(command_type);
  16987. command_parent.commands_block.push(recentComand);
  16988. renderCommand(recentComand, el_jq, 3, function_obj);
  16989. } else {
  16990. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16991. }
  16992. return;
  16993. }
  16994. var index = command_parent.commands_block.indexOf(command_target);
  16995. if (index > -1) {
  16996. command_parent.commands_block.splice(index + 1, 0, recentComand);
  16997. }
  16998. renderCommand(recentComand, el, 2, function_obj);
  16999. }
  17000. }
  17001. }
  17002. function insertCommandInBlock(el, event, function_obj, command_type) {
  17003. var el_jq = $(el);
  17004. var command_parent = el_jq.data('command');
  17005. 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) {
  17006. // Se não tiver outro comando ainda no bloco, só adiciona:
  17007. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  17008. command_parent.commands_block = [];
  17009. var recentComand = genericCreateCommand(command_type);
  17010. command_parent.commands_block.push(recentComand);
  17011. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  17012. } else {
  17013. // Se já tem algum comando no bloco:
  17014. findInBlockCorrectPlace(el, event, function_obj, command_type);
  17015. }
  17016. } else if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  17017. // no if ou no else?
  17018. var correct_div = $(document.elementFromPoint(event.pageX, event.pageY));
  17019. var is_in_if = true;
  17020. if (correct_div.data('if')) {
  17021. is_in_if = true;
  17022. } else if (correct_div.data('else')) {
  17023. is_in_if = false;
  17024. } else {
  17025. var hier = correct_div.parentsUntil(".command_container");
  17026. for (var i = 0; i < hier.length; i++) {
  17027. var temp = $(hier[i]);
  17028. if (typeof temp.data('if') !== 'undefined') {
  17029. is_in_if = true;
  17030. break;
  17031. }
  17032. if (typeof temp.data('else') !== 'undefined') {
  17033. is_in_if = false;
  17034. break;
  17035. }
  17036. }
  17037. }
  17038. if (is_in_if) {
  17039. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  17040. command_parent.commands_block = [];
  17041. var recentComand = genericCreateCommand(command_type);
  17042. command_parent.commands_block.push(recentComand);
  17043. renderCommand(recentComand, el_jq.find('.commands_if'), 3, function_obj);
  17044. } else {
  17045. // Se já tem algum comando no bloco:
  17046. findInBlockCorrectPlace(el_jq.find('.commands_if'), event, function_obj, command_type);
  17047. }
  17048. } else {
  17049. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  17050. command_parent.commands_else = [];
  17051. var recentComand = genericCreateCommand(command_type);
  17052. command_parent.commands_else.push(recentComand);
  17053. renderCommand(recentComand, el_jq.find('.commands_else'), 3, function_obj);
  17054. } else {
  17055. // Se já tem algum comando no bloco:
  17056. findInBlockCorrectPlace(el_jq.find('.commands_else'), event, function_obj, command_type, true);
  17057. }
  17058. }
  17059. } else {
  17060. // é do tipo switch
  17061. addCommandToSwitchCase(event, function_obj, command_type);
  17062. }
  17063. }
  17064. function addCommandToSwitchCase(event, function_obj, command_type) {
  17065. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  17066. var which_case = el.data('switchcase');
  17067. var case_div = el;
  17068. if (!which_case) {
  17069. var hier_find = el.parentsUntil(".all_cases_div");
  17070. for (var i = 0; i < hier_find.length; i++) {
  17071. if (typeof $(hier_find[i]).data('switchcase') !== 'undefined') {
  17072. which_case = $(hier_find[i]).data('switchcase');
  17073. case_div = $(hier_find[i]);
  17074. break;
  17075. }
  17076. }
  17077. }
  17078. if (which_case.commands_block == null || which_case.commands_block.length < 1) {
  17079. which_case.commands_block = [];
  17080. var recentComand = genericCreateCommand(command_type);
  17081. which_case.commands_block.push(recentComand);
  17082. renderCommand(recentComand, case_div.find('.case_commands_block'), 3, function_obj);
  17083. } else {
  17084. findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type);
  17085. }
  17086. }
  17087. function findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type) {
  17088. var all_sub = case_div.find('div.command_container');
  17089. var menor_distancia = 999999999;
  17090. var elemento_menor_distancia = null;
  17091. var antes = true;
  17092. var t_bot;
  17093. var t_top; // Descobrindo o elemento mais próximo:
  17094. for (var i = 0; i < all_sub.length; i++) {
  17095. t_top = all_sub[i].getBoundingClientRect().top;
  17096. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  17097. if (t_top - event.clientY < menor_distancia) {
  17098. menor_distancia = event.clientY - t_top;
  17099. elemento_menor_distancia = all_sub[i];
  17100. }
  17101. }
  17102. 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:
  17103. if (borda_inferior - event.clientY < menor_distancia) {
  17104. var recentComand = genericCreateCommand(command_type);
  17105. which_case.commands_block.push(recentComand);
  17106. renderCommand(recentComand, $(case_div.find('.case_commands_block')[0]), 3, function_obj);
  17107. } else {
  17108. var recentComand = genericCreateCommand(command_type);
  17109. var index = which_case.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  17110. if (index > -1) {
  17111. which_case.commands_block.splice(index, 0, recentComand);
  17112. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17113. }
  17114. }
  17115. }
  17116. function findInBlockCorrectPlace(el, event, function_obj, command_type) {
  17117. var is_in_else = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  17118. var el_jq = $(el);
  17119. var all_sub = el_jq.find('div.command_container');
  17120. var menor_distancia = 999999999;
  17121. var elemento_menor_distancia = null;
  17122. var antes = true;
  17123. var t_bot;
  17124. var t_top; // Descobrindo o elemento mais próximo:
  17125. for (var i = 0; i < all_sub.length; i++) {
  17126. t_top = all_sub[i].getBoundingClientRect().top;
  17127. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  17128. if (t_top - event.clientY < menor_distancia) {
  17129. menor_distancia = event.clientY - t_top;
  17130. elemento_menor_distancia = all_sub[i];
  17131. }
  17132. }
  17133. 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:
  17134. if (borda_inferior - event.clientY < menor_distancia) {
  17135. var recentComand = genericCreateCommand(command_type);
  17136. var command_parent = el_jq.data('command');
  17137. if (is_in_else) {
  17138. command_parent.commands_else.push(recentComand);
  17139. renderCommand(recentComand, el_jq, 3, function_obj);
  17140. } else {
  17141. command_parent.commands_block.push(recentComand);
  17142. renderCommand(recentComand, $(el_jq.find('.block_commands')[0]), 3, function_obj);
  17143. }
  17144. } else {
  17145. var recentComand = genericCreateCommand(command_type);
  17146. var command_parent = el_jq.data('command');
  17147. if (is_in_else) {
  17148. var index = command_parent.commands_else.indexOf($(elemento_menor_distancia).data('command'));
  17149. if (index > -1) {
  17150. command_parent.commands_else.splice(index, 0, recentComand);
  17151. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17152. }
  17153. } else {
  17154. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  17155. if (index > -1) {
  17156. command_parent.commands_block.splice(index, 0, recentComand);
  17157. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17158. }
  17159. }
  17160. }
  17161. }
  17162. function findBeforeOrAfterCommandToAdd(el, event, function_obj, command_type) {
  17163. switch ($(el).data('command').type) {
  17164. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  17165. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  17166. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  17167. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  17168. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  17169. insertCommandInBlock(el, event, function_obj, command_type);
  17170. return;
  17171. }
  17172. var menor_distancia = 999999999;
  17173. var antes = true;
  17174. var t_bot;
  17175. var t_top;
  17176. t_top = el.getBoundingClientRect().top;
  17177. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  17178. var d_top = event.clientY - t_top; // distancia topo
  17179. var d_bot = t_bot - event.clientY; // distancia baixo
  17180. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  17181. if (d_top < d_bot) {
  17182. var recentComand = genericCreateCommand(command_type);
  17183. var index = function_obj.commands.indexOf($(el).data('command'));
  17184. if (index > -1) {
  17185. function_obj.commands.splice(index, 0, recentComand);
  17186. }
  17187. renderCommand(recentComand, el, 1, function_obj);
  17188. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  17189. } else {
  17190. var recentComand = genericCreateCommand(command_type);
  17191. var index = function_obj.commands.indexOf($(el).data('command'));
  17192. if (index > -1) {
  17193. function_obj.commands.splice(index + 1, 0, recentComand);
  17194. }
  17195. renderCommand(recentComand, el, 2, function_obj);
  17196. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  17197. }
  17198. }
  17199. function findNearbyCommandToAddInFunctionScope(el, event, node_list_commands, function_obj, command_type) {
  17200. var all_sub = $(node_list_commands).find('div.command_container');
  17201. var menor_distancia = 999999999;
  17202. var elemento_menor_distancia = null;
  17203. var antes = true;
  17204. var t_bot;
  17205. var t_top; // Descobrindo o elemento mais próximo:
  17206. for (var i = 0; i < all_sub.length; i++) {
  17207. t_top = all_sub[i].getBoundingClientRect().top;
  17208. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  17209. if (t_top - event.clientY < menor_distancia) {
  17210. menor_distancia = event.clientY - t_top;
  17211. elemento_menor_distancia = all_sub[i];
  17212. }
  17213. }
  17214. 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:
  17215. if (borda_inferior - event.clientY < menor_distancia) {
  17216. var recentComand = genericCreateCommand(command_type);
  17217. function_obj.commands.push(recentComand); //
  17218. renderCommand(recentComand, node_list_commands, 3, function_obj);
  17219. 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);
  17220. } else {
  17221. var recentComand = genericCreateCommand(command_type);
  17222. var index = function_obj.commands.indexOf($(elemento_menor_distancia).data('command'));
  17223. if (index > -1) {
  17224. function_obj.commands.splice(index, 0, recentComand);
  17225. }
  17226. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17227. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  17228. }
  17229. }
  17230. /***/ }),
  17231. /***/ "./js/visualUI/commands/attribution.js":
  17232. /*!*********************************************!*\
  17233. !*** ./js/visualUI/commands/attribution.js ***!
  17234. \*********************************************/
  17235. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, renderMenuOperations */
  17236. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17237. "use strict";
  17238. __webpack_require__.r(__webpack_exports__);
  17239. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17240. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17241. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  17242. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenuOperations", function() { return renderMenuOperations; });
  17243. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17244. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17245. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17246. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17247. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  17248. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  17249. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../algorithm */ "./js/visualUI/algorithm.js");
  17250. function createFloatingCommand() {
  17251. return $('<div class="ui attribution created_element"> <i class="ui icon small arrow left"></i> <span> x <&#8212; 1 + 1 </span></div>');
  17252. }
  17253. function renderCommand(command, function_obj) {
  17254. var el = $('<div class="ui attribution command_container"><i class="ui icon small arrow left command_drag"></i> <i class="ui icon times red button_remove_command"></i> <div class="var_attributed"></div> <span class="text_attr_receives span_command_spec">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_receives') + '</span> ' + '<div class="expression_elements"></div> <span class="textual_expression"></span> <i class="ui icon i cursor button_write_expression"></i> <i class="ui icon unlock button_alternate_expression"></i> </div>');
  17255. el.data('command', command);
  17256. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.var_attributed'), function_obj);
  17257. if (!command.expression || command.expression.length < 1) {
  17258. 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);
  17259. command.expression.push(exp);
  17260. }
  17261. addHandlers(command, function_obj, el);
  17262. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.expression);
  17263. if (command.lockexpression) {
  17264. if (command.expression) {
  17265. try {
  17266. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  17267. if (text) {
  17268. $(el.find('.expression_elements')[0]).toggle();
  17269. $(el.find('.textual_expression')[0]).text(text);
  17270. $(el.find('.textual_expression')[0]).toggle();
  17271. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  17272. }
  17273. } catch (e) {
  17274. command.lockexpression = false;
  17275. }
  17276. }
  17277. }
  17278. el.find('.unlock').popup({
  17279. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  17280. delay: {
  17281. show: 750,
  17282. hide: 0
  17283. }
  17284. });
  17285. el.find('.lock').popup({
  17286. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  17287. delay: {
  17288. show: 750,
  17289. hide: 0
  17290. }
  17291. });
  17292. el.find('.button_write_expression').popup({
  17293. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression"),
  17294. delay: {
  17295. show: 750,
  17296. hide: 0
  17297. }
  17298. });
  17299. return el;
  17300. }
  17301. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, selectedItem, expression_element) {
  17302. var index_to_move = expression_element.itens.indexOf(ref_object);
  17303. switch (selectedItem.data('exp')) {
  17304. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  17305. 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)]);
  17306. expression_element.itens[index_to_move] = exp;
  17307. break;
  17308. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  17309. 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]]);
  17310. expression_element.itens[index_to_move] = exp;
  17311. break;
  17312. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  17313. 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]]);
  17314. expression_element.itens[index_to_move] = exp;
  17315. break;
  17316. }
  17317. renderExpressionElements(command, function_obj, dom_object);
  17318. }
  17319. function renderExpressionElements(command, function_obj, el) {
  17320. var expression_div = el.find('.expression_elements');
  17321. var command_container;
  17322. if (el.hasClass("command_container") == false) {
  17323. var hier = el.parentsUntil(".command_container");
  17324. for (var i = 0; i < hier.length; i++) {
  17325. if ($(hier[i]).hasClass("command_container")) {
  17326. command_container = $(hier[i]);
  17327. break;
  17328. }
  17329. if ($(hier[i]).hasClass("expression_elements")) {
  17330. expression_div = $(hier[i]);
  17331. break;
  17332. }
  17333. }
  17334. }
  17335. if (command_container) {
  17336. expression_div = command_container.find('.expression_elements');
  17337. }
  17338. expression_div.text('');
  17339. for (var i = 0; i < command.expression.length; i++) {
  17340. var temp = $('<div class="expression_element"></div>');
  17341. temp.data('ref_element', command.expression[i]);
  17342. temp.data('ref_index', i);
  17343. expression_div.append(temp);
  17344. renderElement(command, function_obj, temp, command.expression[i]);
  17345. }
  17346. }
  17347. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  17348. var context_menu = '<div class="ui dropdown"><div class="text">';
  17349. switch (expression_element.itens[index_op]) {
  17350. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  17351. context_menu += '+';
  17352. break;
  17353. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  17354. context_menu += '-';
  17355. break;
  17356. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  17357. context_menu += '*';
  17358. break;
  17359. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  17360. context_menu += '/';
  17361. break;
  17362. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  17363. context_menu += '%';
  17364. break;
  17365. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none:
  17366. context_menu += '...';
  17367. break;
  17368. }
  17369. context_menu += '</div><div class="menu">';
  17370. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus + '">+</div>';
  17371. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus + '">-</div>';
  17372. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  17373. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division + '">/</div>';
  17374. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module + '">%</div>';
  17375. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none + '" data-text="...">Nenhum</div>';
  17376. context_menu += '</div></div>';
  17377. context_menu = $(context_menu);
  17378. temp_op.append(context_menu);
  17379. context_menu.dropdown({
  17380. onChange: function onChange(value, text, $selectedItem) {
  17381. expression_element.itens[index_op] = value;
  17382. }
  17383. });
  17384. }
  17385. function renderMenuAddExpression(command, function_obj, el, dom_append_menu, expression_append_new_expression) {
  17386. if (el.hasClass("command_container") == false) {
  17387. var hier = el.parentsUntil(".commands_list_div");
  17388. for (var i = 0; i < hier.length; i++) {
  17389. if ($(hier[i]).hasClass("command_container")) {
  17390. el = $(hier[i]);
  17391. break;
  17392. }
  17393. }
  17394. }
  17395. if (dom_append_menu.hasClass("expression_elements") == false) {
  17396. var hier = el.parentsUntil(".commands_list_div");
  17397. for (var i = 0; i < hier.length; i++) {
  17398. if ($(hier[i]).hasClass("expression_elements")) {
  17399. dom_append_menu = $(hier[i]);
  17400. break;
  17401. }
  17402. }
  17403. }
  17404. var context_menu = '<div class="ui dropdown"><div class="text"></div><i class="ui icon arrow alternate circle right outline"></i><div class="menu">';
  17405. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp + '">EXP OP EXP</div>';
  17406. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp + '">OP EXP</div>';
  17407. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par + '">( EXP )</div>';
  17408. context_menu += '</div></div>';
  17409. context_menu = $(context_menu);
  17410. dom_append_menu.append(context_menu);
  17411. context_menu.dropdown({
  17412. onChange: function onChange(value, text, $selectedItem) {
  17413. switch (value) {
  17414. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  17415. 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)]);
  17416. expression_append_new_expression.push(exp);
  17417. break;
  17418. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  17419. 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)]);
  17420. expression_append_new_expression.push(exp);
  17421. break;
  17422. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  17423. 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)]);
  17424. expression_append_new_expression.push(exp);
  17425. break;
  17426. }
  17427. renderExpressionElements(command, function_obj, el);
  17428. }
  17429. });
  17430. }
  17431. function renderElement(command, function_obj, el, expression_element) {
  17432. switch (expression_element.type_exp) {
  17433. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  17434. var temp_op = $('<div class="component_element"></div>');
  17435. var temp_exp_1 = $('<div class="component_element"></div>');
  17436. var temp_exp_2 = $('<div class="component_element"></div>');
  17437. el.append(temp_exp_1);
  17438. el.append(temp_op);
  17439. el.append(temp_exp_2);
  17440. if (expression_element.itens[0].type) {
  17441. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[0], temp_exp_1, function_obj, 2, expression_element);
  17442. } else {
  17443. renderElement(command, function_obj, temp_exp_1, expression_element.itens[0]);
  17444. }
  17445. renderOperator(command, function_obj, temp_op, expression_element, 1);
  17446. if (expression_element.itens[2].type) {
  17447. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[2], temp_exp_2, function_obj, 2, expression_element);
  17448. } else {
  17449. renderElement(command, function_obj, temp_exp_2, expression_element.itens[2]);
  17450. }
  17451. break;
  17452. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  17453. var temp_op = $('<div class="component_element"></div>');
  17454. var temp_exp = $('<div class="component_element"></div>');
  17455. el.append(temp_op);
  17456. el.append(temp_exp);
  17457. renderOperator(command, function_obj, temp_op, expression_element, 0);
  17458. if (expression_element.itens[1].type) {
  17459. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[1], temp_exp, function_obj, 2, expression_element);
  17460. } else {
  17461. renderElement(command, function_obj, temp_exp, expression_element.itens[1]);
  17462. }
  17463. break;
  17464. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  17465. var temp_par_1 = $('<div class="component_element"> ( </div>');
  17466. var temp_exp = $('<div class="component_element"></div>');
  17467. var temp_par_2 = $('<div class="component_element"> ) </div>');
  17468. el.append(temp_par_1);
  17469. el.append(temp_exp);
  17470. for (var j = 0; j < expression_element.itens.length; j++) {
  17471. if (expression_element.itens[j].type) {
  17472. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[j], temp_exp, function_obj, 2, expression_element);
  17473. } else {
  17474. renderElement(command, function_obj, temp_exp, expression_element.itens[j]);
  17475. }
  17476. } //renderMenuAddExpression(command, function_obj, el, el, expression_element.itens);
  17477. el.append(temp_par_2);
  17478. break;
  17479. }
  17480. }
  17481. function renderExpression(command, function_obj, el) {
  17482. var expression_div = el.find('.expression_elements');
  17483. expression_div.text('');
  17484. var menu_add_item = $('<div class="menu_add_item"></div>');
  17485. menu_add_item.data('index_add', 0);
  17486. expression_div.append(menu_add_item);
  17487. for (var i = 0; i < command.expression.length; i++) {
  17488. if (command.expression[i].type) {
  17489. var temp = $('<div class="expression_element"></div>');
  17490. temp.data('ref_element', command.expression[i]);
  17491. temp.data('ref_index', i);
  17492. expression_div.append(temp);
  17493. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.expression[i], temp, function_obj);
  17494. } else if (command.expression[i] == "(" || command.expression[i] == ")") {
  17495. var temp = $('<div class="expression_element">' + command.expression[i] + '</div>');
  17496. temp.data('ref_element', command.expression[i]);
  17497. temp.data('ref_index', i);
  17498. expression_div.append(temp);
  17499. } else {
  17500. var temp = '<div class="expression_element">';
  17501. switch (command.expression[i]) {
  17502. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  17503. temp += '+';
  17504. break;
  17505. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  17506. temp += '-';
  17507. break;
  17508. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  17509. temp += '*';
  17510. break;
  17511. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  17512. temp += '/';
  17513. break;
  17514. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  17515. temp += '%';
  17516. break;
  17517. }
  17518. temp += '</div>';
  17519. temp = $(temp);
  17520. temp.data('ref_element', command.expression[i]);
  17521. temp.data('ref_index', i);
  17522. expression_div.append(temp);
  17523. }
  17524. var menu_add_item_seq = $('<div class="menu_add_item"></div>');
  17525. var index_temp = i + 1;
  17526. menu_add_item_seq.data('index_add', index_temp);
  17527. expression_div.append(menu_add_item_seq);
  17528. }
  17529. addMenuItens(command, function_obj, el);
  17530. }
  17531. function addMenuItens(command, function_obj, expression_div) {
  17532. var divs_expression = expression_div.find('.menu_add_item');
  17533. for (var i = 0; i < divs_expression.length; i++) {
  17534. var temp = $(divs_expression[i]).data('index_add');
  17535. var context_menu = '<div class="ui dropdown context_menu_clear"><i class="ui icon plus square outline"></i><div class="menu">';
  17536. context_menu += '<div class="item" data-option="value" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_value') + '</div>';
  17537. context_menu += '<div class="item" data-option="operator" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_operator') + '</div>';
  17538. context_menu += '<div class="item" data-option="parentheses" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_parentheses') + '</div>';
  17539. context_menu += '</div></div>';
  17540. context_menu = $(context_menu);
  17541. $(divs_expression[i]).append(context_menu);
  17542. context_menu.dropdown({
  17543. on: 'hover',
  17544. onChange: function onChange(value, text, $selectedItem) {
  17545. switch ($selectedItem.data('option')) {
  17546. case "value":
  17547. 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));
  17548. renderExpression(command, function_obj, expression_div);
  17549. break;
  17550. case "operator":
  17551. command.expression.splice($selectedItem.data('index'), 0, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus);
  17552. renderExpression(command, function_obj, expression_div);
  17553. break;
  17554. case "parentheses":
  17555. command.expression.splice($selectedItem.data('index'), 0, "(");
  17556. 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));
  17557. command.expression.splice($selectedItem.data('index') + 2, 0, ")");
  17558. renderExpression(command, function_obj, expression_div);
  17559. break;
  17560. }
  17561. }
  17562. });
  17563. }
  17564. }
  17565. function addHandlers(command, function_obj, attribution_dom) {
  17566. attribution_dom.find('.button_write_expression').on('click', function () {
  17567. window.expressionEdition = true;
  17568. window.inputExpression = null;
  17569. var afterWhichElement;
  17570. var lockButton = $(attribution_dom.find('.button_alternate_expression')[0]);
  17571. var editButton = $(this);
  17572. afterWhichElement = attribution_dom.find('.expression_elements');
  17573. if (command.lockexpression) {
  17574. afterWhichElement = attribution_dom.find('.textual_expression');
  17575. }
  17576. var text = "";
  17577. if (command.expression) {
  17578. if (command.expression.length == 1 && command.expression[0].content == null && !command.expression[0].function_called) {
  17579. text = "";
  17580. } else {
  17581. try {
  17582. text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  17583. } catch (ex) {
  17584. text = "";
  17585. }
  17586. }
  17587. }
  17588. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  17589. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  17590. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  17591. input.val(text);
  17592. input.focusout(function (evt) {
  17593. console.log('focosout event!');
  17594. ok_button.click();
  17595. evt.preventDefault();
  17596. return true;
  17597. });
  17598. input.keyup(function (evt) {
  17599. if (evt.keyCode == 27) {
  17600. // esc
  17601. cancel_button.click();
  17602. }
  17603. if (evt.keyCode == 13) {
  17604. // enter
  17605. ok_button.click();
  17606. }
  17607. });
  17608. ok_button.click(function () {
  17609. var parsed = null;
  17610. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](input.val(), function_obj, input);
  17611. if (parsed) {
  17612. window.expressionEdition = false;
  17613. command.expression = parsed;
  17614. Object(_algorithm__WEBPACK_IMPORTED_MODULE_6__["renderAlgorithm"])();
  17615. }
  17616. });
  17617. cancel_button.mousedown(function (evt) {
  17618. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](text, function_obj, input);
  17619. if (parsed) {
  17620. window.expressionEdition = false;
  17621. command.expression = parsed;
  17622. Object(_algorithm__WEBPACK_IMPORTED_MODULE_6__["renderAlgorithm"])();
  17623. }
  17624. });
  17625. input.insertAfter(afterWhichElement);
  17626. input.focus();
  17627. cancel_button.insertAfter(input);
  17628. ok_button.insertAfter(input);
  17629. var len = text.length;
  17630. input[0].setSelectionRange(len, len);
  17631. afterWhichElement.css('display', 'none');
  17632. lockButton.css('display', 'none');
  17633. editButton.css('display', 'none');
  17634. ok_button.popup({
  17635. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  17636. delay: {
  17637. show: 750,
  17638. hide: 0
  17639. }
  17640. });
  17641. cancel_button.popup({
  17642. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  17643. delay: {
  17644. show: 750,
  17645. hide: 0
  17646. }
  17647. });
  17648. });
  17649. $(attribution_dom.find('.textual_expression')[0]).toggle();
  17650. attribution_dom.find('.button_alternate_expression').on('click', function () {
  17651. if (command.expression) {
  17652. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  17653. if (text) {
  17654. $(attribution_dom.find('.expression_elements')[0]).toggle();
  17655. $(attribution_dom.find('.textual_expression')[0]).text(text);
  17656. $(attribution_dom.find('.textual_expression')[0]).toggle();
  17657. $(this).toggleClass('unlock').toggleClass('lock');
  17658. command.lockexpression = !command.lockexpression;
  17659. }
  17660. if (command.lockexpression) {
  17661. attribution_dom.find('.lock').popup({
  17662. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  17663. delay: {
  17664. show: 750,
  17665. hide: 0
  17666. }
  17667. });
  17668. } else {
  17669. attribution_dom.find('.unlock').popup({
  17670. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  17671. delay: {
  17672. show: 750,
  17673. hide: 0
  17674. }
  17675. });
  17676. }
  17677. }
  17678. });
  17679. attribution_dom.find('.button_remove_command').on('click', function () {
  17680. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, attribution_dom)) {
  17681. attribution_dom.fadeOut(400, function () {
  17682. attribution_dom.remove();
  17683. });
  17684. }
  17685. });
  17686. attribution_dom.find('.button_refresh_attribution').on('click', function () {
  17687. renderExpressionElements(command, function_obj, attribution_dom);
  17688. });
  17689. }
  17690. function renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected) {
  17691. /*console.log("recebido o seguinte DOM: ");
  17692. console.log(dom_object);
  17693. if (dom_object.hasClass('var_attributed')) {
  17694. return;
  17695. } else {
  17696. var hier = dom_object.parentsUntil(".command_container");
  17697. for (var i = 0; i < hier.length; i++) {
  17698. if ($(hier[i]).hasClass('var_attributed') || $(hier[i]).hasClass('parameters_function_called')) {
  17699. return;
  17700. }
  17701. }
  17702. }
  17703. dom_object.find('.context_menu_clear').remove();
  17704. var menu_operations = '<div class="ui dropdown menu_operations"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17705. for (var tm in Models.ARITHMETIC_TYPES) {
  17706. menu_operations += '<div class="item" data-option="'+tm+'">'+LocalizedStrings.getUI('btn_arithmetic_' + tm)+'</div>';
  17707. }
  17708. menu_operations += '<div class="item" data-option="clear">'+LocalizedStrings.getUI('btn_clear')+'</div>';
  17709. menu_operations += '</div></div>';
  17710. menu_operations = $(menu_operations);
  17711. dom_object.append(menu_operations);
  17712. menu_operations.dropdown({
  17713. onChange: function(value, text, $selectedItem) {
  17714. switch ($($selectedItem).data('option')) {
  17715. case "clear":
  17716. $(dom_object).text('');
  17717. VariableValueMenu.renderMenu(command, ref_object, dom_object, function_obj);
  17718. break;
  17719. default:
  17720. createExpressionAround(command, ref_object, dom_object, function_obj);
  17721. menu_operations.find('.text').text('');
  17722. }
  17723. }
  17724. });*/
  17725. }
  17726. function createExpressionAround(command, ref_object, dom_object, function_obj) {
  17727. $('<span> ( </span>').insertBefore(dom_object);
  17728. $('<span> ) </span>').insertAfter(dom_object);
  17729. _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);
  17730. }
  17731. /***/ }),
  17732. /***/ "./js/visualUI/commands/break.js":
  17733. /*!***************************************!*\
  17734. !*** ./js/visualUI/commands/break.js ***!
  17735. \***************************************/
  17736. /*! exports provided: createFloatingCommand, renderCommand */
  17737. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17738. "use strict";
  17739. __webpack_require__.r(__webpack_exports__);
  17740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17742. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17743. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17744. function createFloatingCommand() {
  17745. 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>');
  17746. }
  17747. function renderCommand(command, function_obj) {
  17748. 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>');
  17749. el.data('command', command);
  17750. addHandlers(command, function_obj, el);
  17751. return el;
  17752. }
  17753. function addHandlers(command, function_obj, break_dom) {
  17754. break_dom.find('.button_remove_command').on('click', function () {
  17755. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, break_dom)) {
  17756. break_dom.fadeOut(400, function () {
  17757. break_dom.remove();
  17758. });
  17759. }
  17760. });
  17761. }
  17762. /***/ }),
  17763. /***/ "./js/visualUI/commands/comment.js":
  17764. /*!*****************************************!*\
  17765. !*** ./js/visualUI/commands/comment.js ***!
  17766. \*****************************************/
  17767. /*! exports provided: createFloatingCommand, renderCommand */
  17768. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17769. "use strict";
  17770. __webpack_require__.r(__webpack_exports__);
  17771. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17772. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17773. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17774. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17775. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17776. function createFloatingCommand() {
  17777. 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>');
  17778. }
  17779. function renderCommand(command, function_obj) {
  17780. 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>');
  17781. el.data('command', command);
  17782. addHandlers(command, function_obj, el);
  17783. renderTextComment(command, function_obj, el);
  17784. return el;
  17785. }
  17786. function renderTextComment(command, function_obj, el) {
  17787. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.comment_text, el.find('.var_value_menu_div'), function_obj, 20);
  17788. }
  17789. function addHandlers(command, function_obj, comment_dom) {
  17790. comment_dom.find('.button_remove_command').on('click', function () {
  17791. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, comment_dom)) {
  17792. comment_dom.fadeOut(400, function () {
  17793. comment_dom.remove();
  17794. });
  17795. }
  17796. });
  17797. }
  17798. /***/ }),
  17799. /***/ "./js/visualUI/commands/conditional_expression.js":
  17800. /*!********************************************************!*\
  17801. !*** ./js/visualUI/commands/conditional_expression.js ***!
  17802. \********************************************************/
  17803. /*! exports provided: renderExpression */
  17804. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17805. "use strict";
  17806. __webpack_require__.r(__webpack_exports__);
  17807. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17808. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17809. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17810. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17811. function renderExpression(command, expression, function_obj, initial_el_to_render) {
  17812. expression.dom_object = initial_el_to_render;
  17813. if (expression.expression == null || expression.expression.length < 1) {
  17814. renderStartMenu(command, expression, function_obj, initial_el_to_render);
  17815. } else {
  17816. var main_div = $('<div class="expression_elements"></div>');
  17817. switch (expression.expression.type) {
  17818. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17819. renderLogicExpression(command, expression, expression.expression, function_obj, main_div, initial_el_to_render);
  17820. break;
  17821. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17822. renderArithmeticExpression(command, expression, expression.expression, function_obj, main_div);
  17823. break;
  17824. }
  17825. initial_el_to_render.append(main_div);
  17826. var restartMenu = $('<div class="ui restart_expression"><i class="ui icon undo"></i></div>');
  17827. initial_el_to_render.append(restartMenu);
  17828. restartMenu.on('click', function (e) {
  17829. expression.expression = null;
  17830. initial_el_to_render.empty();
  17831. renderExpression(command, expression, function_obj, initial_el_to_render);
  17832. });
  17833. }
  17834. }
  17835. function renderArithmeticOperator(command, all_expression, expression_arithmetic, arithmetic_operator, function_obj, element_to_append) {
  17836. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17837. menu_operator.dropdown({
  17838. values: [{
  17839. name: '>',
  17840. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than,
  17841. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than
  17842. }, {
  17843. name: '<',
  17844. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than,
  17845. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than
  17846. }, {
  17847. name: '==',
  17848. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to,
  17849. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to
  17850. }, {
  17851. name: '!=',
  17852. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to,
  17853. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to
  17854. }, {
  17855. name: '>=',
  17856. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to,
  17857. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to
  17858. }, {
  17859. name: '<=',
  17860. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to,
  17861. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to
  17862. }],
  17863. onChange: function onChange(value, text, $selectedItem) {
  17864. expression_arithmetic.operator = value;
  17865. }
  17866. });
  17867. element_to_append.append(menu_operator);
  17868. }
  17869. function renderLogicOperator(command, all_expression, expression_logic, logic_operator, function_obj, element_to_append, initial_el_to_render) {
  17870. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17871. menu_operator.dropdown({
  17872. values: [{
  17873. name: '==',
  17874. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to,
  17875. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to
  17876. }, {
  17877. name: '!=',
  17878. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to,
  17879. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to
  17880. }, {
  17881. name: '&&',
  17882. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and,
  17883. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and
  17884. }, {
  17885. name: '||',
  17886. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or,
  17887. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or
  17888. }],
  17889. onChange: function onChange(value, text, $selectedItem) {
  17890. if ($selectedItem) {
  17891. expression_logic.operator = value;
  17892. if (expression_logic.second_operand == null) {
  17893. 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);
  17894. initial_el_to_render.empty();
  17895. renderExpression(command, all_expression, function_obj, initial_el_to_render);
  17896. }
  17897. }
  17898. }
  17899. });
  17900. element_to_append.append(menu_operator);
  17901. }
  17902. function renderLogicExpression(command, all_expression, expression_logic, function_obj, element_to_append, initial_el_to_render) {
  17903. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17904. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17905. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17906. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17907. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17908. if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17909. renderLogicExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17910. } else if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17911. renderArithmeticExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17912. } else {
  17913. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.first_operand, exp_el_expr_el_1, function_obj);
  17914. }
  17915. element_to_append.append(exp_el_par_1);
  17916. element_to_append.append(exp_el_expr_el_1);
  17917. renderLogicOperator(command, all_expression, expression_logic, expression_logic.operator, function_obj, exp_el_expr_operand, initial_el_to_render);
  17918. element_to_append.append(exp_el_expr_operand);
  17919. if (expression_logic.second_operand) {
  17920. if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17921. renderLogicExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17922. } else if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17923. renderArithmeticExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17924. } else {
  17925. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.second_operand, exp_el_expr_el_2, function_obj);
  17926. }
  17927. element_to_append.append(exp_el_expr_el_2);
  17928. }
  17929. element_to_append.append(exp_el_par_2);
  17930. }
  17931. function renderArithmeticExpression(command, all_expression, expression_arithmetic, function_obj, element_to_append) {
  17932. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17933. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17934. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17935. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17936. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17937. if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17938. renderLogicExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17939. } else if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17940. renderArithmeticExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17941. } else {
  17942. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.first_operand, exp_el_expr_el_1, function_obj);
  17943. }
  17944. if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17945. renderLogicExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17946. } else if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17947. renderArithmeticExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17948. } else {
  17949. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.second_operand, exp_el_expr_el_2, function_obj);
  17950. }
  17951. renderArithmeticOperator(command, all_expression, expression_arithmetic, expression_arithmetic.operator, function_obj, exp_el_expr_operand);
  17952. element_to_append.append(exp_el_par_1);
  17953. element_to_append.append(exp_el_expr_el_1);
  17954. element_to_append.append(exp_el_expr_operand);
  17955. element_to_append.append(exp_el_expr_el_2);
  17956. element_to_append.append(exp_el_par_2);
  17957. }
  17958. function renderStartMenu(command, expression, function_obj, initial_el_to_render) {
  17959. var start_menu = '';
  17960. 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">';
  17961. 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>';
  17962. 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>';
  17963. start_menu += '</div></div>';
  17964. start_menu = $(start_menu);
  17965. start_menu.dropdown({
  17966. onChange: function onChange(value, text, $selectedItem) {
  17967. switch ($selectedItem.data('exp')) {
  17968. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17969. 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));
  17970. break;
  17971. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17972. 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);
  17973. break;
  17974. }
  17975. initial_el_to_render.html('');
  17976. renderExpression(command, expression, function_obj, initial_el_to_render);
  17977. },
  17978. selectOnKeydown: false
  17979. });
  17980. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17981. initial_el_to_render.append(start_menu);
  17982. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17983. }
  17984. /***/ }),
  17985. /***/ "./js/visualUI/commands/contextualized_menu.js":
  17986. /*!*****************************************************!*\
  17987. !*** ./js/visualUI/commands/contextualized_menu.js ***!
  17988. \*****************************************************/
  17989. /*! exports provided: renderMenu */
  17990. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17991. "use strict";
  17992. __webpack_require__.r(__webpack_exports__);
  17993. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  17994. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17995. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17996. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17997. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17998. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./switch */ "./js/visualUI/commands/switch.js");
  17999. function renderMenu(command, dom_where_render, function_obj, dom_command) {
  18000. var menu_div = '<div class="ui dropdown menu_commands pause" ><button><i class="icon code"></i></button> <div class="menu"> ';
  18001. 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) {
  18002. 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>';
  18003. } else {
  18004. 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>';
  18005. menu_div += '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase + '"><i class="plus icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_case') + ' </a>';
  18006. }
  18007. menu_div += '</div></div>';
  18008. menu_div = $(menu_div);
  18009. dom_where_render.append(menu_div);
  18010. addHandlers(command, dom_where_render, function_obj, dom_command);
  18011. if (command.collapsed) {
  18012. dom_command.children('.ui.block_commands').toggle();
  18013. }
  18014. }
  18015. function addHandlers(command, dom_where_render, function_obj, dom_command) {
  18016. dom_where_render.find('.menu_commands').dropdown({
  18017. on: 'hover'
  18018. });
  18019. dom_where_render.find('.menu_commands a').on('click', function (evt) {
  18020. 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) {
  18021. if (command.commands_block == null || command.commands_block.length == 0) {
  18022. command.commands_block = [];
  18023. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_2__["genericCreateCommand"]($(this).data('command'));
  18024. command.commands_block.push(new_cmd);
  18025. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](new_cmd, dom_command.find('.block_commands'), 3, function_obj);
  18026. } else {
  18027. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  18028. }
  18029. } else {
  18030. switch ($(this).data('command')) {
  18031. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  18032. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  18033. break;
  18034. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase:
  18035. addCaseToSwitch(command, dom_where_render, function_obj, dom_command);
  18036. break;
  18037. }
  18038. }
  18039. });
  18040. }
  18041. function addCaseToSwitch(command, dom_where_render, function_obj, dom_command) {
  18042. if (command.cases == null) {
  18043. command.cases = [];
  18044. }
  18045. 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));
  18046. command.cases.push(sc);
  18047. _switch__WEBPACK_IMPORTED_MODULE_4__["renderCase"](sc, command, function_obj, dom_command.find('.all_cases_div'));
  18048. }
  18049. /***/ }),
  18050. /***/ "./js/visualUI/commands/dowhiletrue.js":
  18051. /*!*********************************************!*\
  18052. !*** ./js/visualUI/commands/dowhiletrue.js ***!
  18053. \*********************************************/
  18054. /*! exports provided: createFloatingCommand, renderCommand */
  18055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18056. "use strict";
  18057. __webpack_require__.r(__webpack_exports__);
  18058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18059. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18060. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18061. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18062. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  18063. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18064. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18065. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  18066. function createFloatingCommand() {
  18067. 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>');
  18068. }
  18069. function renderCommand(command, function_obj) {
  18070. var ret = '';
  18071. ret += '<div class="ui dowhiletrue command_container"> <i class="ui icon small sync command_drag"></i> <i class="ui icon times red button_remove_command"></i> <button class="ui icon button minimize_block_button tiny"><i class="icon window minimize"></i></button> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_do') + ' </span>';
  18072. ret += '<div class="ui block_commands" data-subblock="" data-idcommand="">';
  18073. ret += '</div>';
  18074. ret += ' <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_do_until') + ' </span> <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="textual_expression"></span> <span class="span_command_spec"> ) </span>';
  18075. ret += ' <i class="ui icon i cursor button_write_expression" style="display: inline !important;"></i> <i class="ui icon unlock button_alternate_expression" style="margin-left: 1rem !important;"></i> <div class="ui context_menu"></div> ';
  18076. ret += '</div>';
  18077. var el = $(ret);
  18078. el.data('command', command);
  18079. el.find('.block_commands').data('command', command);
  18080. addHandlers(command, function_obj, el);
  18081. _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'));
  18082. if (command.expression) {
  18083. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  18084. }
  18085. if (command.commands_block) {
  18086. for (var j = 0; j < command.commands_block.length; j++) {
  18087. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  18088. }
  18089. }
  18090. if (command.lockexpression) {
  18091. if (command.expression) {
  18092. try {
  18093. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  18094. if (text) {
  18095. $(el.find('.conditional_expression')[el.find('.conditional_expression').length - 1]).toggle();
  18096. $(el.find('.textual_expression')[el.find('.textual_expression').length - 1]).text(text);
  18097. $(el.find('.textual_expression')[el.find('.textual_expression').length - 1]).toggle();
  18098. $(el.find('.button_alternate_expression')[el.find('.button_alternate_expression').length - 1]).toggleClass('unlock').toggleClass('lock');
  18099. }
  18100. } catch (e) {
  18101. command.lockexpression = false;
  18102. }
  18103. }
  18104. }
  18105. el.find('.unlock').popup({
  18106. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  18107. delay: {
  18108. show: 750,
  18109. hide: 0
  18110. }
  18111. });
  18112. el.find('.lock').popup({
  18113. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  18114. delay: {
  18115. show: 750,
  18116. hide: 0
  18117. }
  18118. });
  18119. el.find('.button_write_expression').popup({
  18120. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression"),
  18121. delay: {
  18122. show: 750,
  18123. hide: 0
  18124. }
  18125. });
  18126. return el;
  18127. }
  18128. function addHandlers(command, function_obj, dowhiletrue_dom) {
  18129. dowhiletrue_dom.find('.button_write_expression').on('click', function () {
  18130. window.expressionEdition = true;
  18131. window.inputExpression = null;
  18132. var afterWhichElement;
  18133. var lockButton = $(dowhiletrue_dom.find('.button_write_expression')[dowhiletrue_dom.find('.button_write_expression').length - 1]);
  18134. var editButton = $(this);
  18135. afterWhichElement = $(dowhiletrue_dom.find('.conditional_expression')[dowhiletrue_dom.find('.conditional_expression').length - 1]);
  18136. if (command.lockexpression) {
  18137. afterWhichElement = $(dowhiletrue_dom.find('.textual_expression')[dowhiletrue_dom.find('.textual_expression').length - 1]);
  18138. }
  18139. var text = "";
  18140. if (command.expression) {
  18141. if (command.expression.length == 1 && command.expression[0].content == null && !command.expression[0].function_called) {
  18142. text = "";
  18143. } else {
  18144. try {
  18145. text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  18146. } catch (ex) {
  18147. text = "";
  18148. }
  18149. }
  18150. }
  18151. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  18152. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  18153. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  18154. input.val(text);
  18155. input.focusout(function (evt) {
  18156. ok_button.click();
  18157. evt.preventDefault();
  18158. return true;
  18159. });
  18160. input.keyup(function (evt) {
  18161. if (evt.keyCode == 27) {
  18162. // esc
  18163. cancel_button.click();
  18164. }
  18165. if (evt.keyCode == 13) {
  18166. // enter
  18167. ok_button.click();
  18168. }
  18169. });
  18170. ok_button.click(function () {
  18171. var parsed = null;
  18172. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](input.val(), function_obj, input);
  18173. if (parsed) {
  18174. window.expressionEdition = false;
  18175. command.expression = parsed;
  18176. renderAlgorithm();
  18177. }
  18178. });
  18179. cancel_button.mousedown(function (evt) {
  18180. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](text, function_obj, input);
  18181. if (parsed) {
  18182. window.expressionEdition = false;
  18183. command.expression = parsed;
  18184. renderAlgorithm();
  18185. }
  18186. });
  18187. input.insertAfter(afterWhichElement);
  18188. input.focus();
  18189. cancel_button.insertAfter(input);
  18190. ok_button.insertAfter(input);
  18191. var len = text.length;
  18192. input[0].setSelectionRange(len, len);
  18193. afterWhichElement.css('display', 'none');
  18194. lockButton.css('display', 'none');
  18195. editButton.css('display', 'none');
  18196. ok_button.popup({
  18197. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  18198. delay: {
  18199. show: 750,
  18200. hide: 0
  18201. }
  18202. });
  18203. cancel_button.popup({
  18204. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  18205. delay: {
  18206. show: 750,
  18207. hide: 0
  18208. }
  18209. });
  18210. });
  18211. dowhiletrue_dom.find('.minimize_block_button').on('click', function (evt) {
  18212. dowhiletrue_dom.children('.ui.block_commands').toggle();
  18213. command.collapsed = !command.collapsed;
  18214. });
  18215. $(dowhiletrue_dom.find('.textual_expression')[0]).toggle();
  18216. dowhiletrue_dom.find('.button_alternate_expression').on('click', function () {
  18217. if (command.expression) {
  18218. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  18219. if (text) {
  18220. $(dowhiletrue_dom.find('.conditional_expression')[dowhiletrue_dom.find('.conditional_expression').length - 1]).toggle();
  18221. $(dowhiletrue_dom.find('.textual_expression')[dowhiletrue_dom.find('.textual_expression').length - 1]).text(text);
  18222. $(dowhiletrue_dom.find('.textual_expression')[dowhiletrue_dom.find('.textual_expression').length - 1]).toggle();
  18223. $(this).toggleClass('unlock').toggleClass('lock');
  18224. command.lockexpression = !command.lockexpression;
  18225. }
  18226. }
  18227. if (command.lockexpression) {
  18228. dowhiletrue_dom.find('.lock').popup({
  18229. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  18230. delay: {
  18231. show: 750,
  18232. hide: 0
  18233. }
  18234. });
  18235. } else {
  18236. dowhiletrue_dom.find('.unlock').popup({
  18237. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  18238. delay: {
  18239. show: 750,
  18240. hide: 0
  18241. }
  18242. });
  18243. }
  18244. });
  18245. dowhiletrue_dom.find('.button_remove_command').on('click', function () {
  18246. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, dowhiletrue_dom)) {
  18247. dowhiletrue_dom.fadeOut(400, function () {
  18248. dowhiletrue_dom.remove();
  18249. });
  18250. }
  18251. });
  18252. }
  18253. /***/ }),
  18254. /***/ "./js/visualUI/commands/functioncall.js":
  18255. /*!**********************************************!*\
  18256. !*** ./js/visualUI/commands/functioncall.js ***!
  18257. \**********************************************/
  18258. /*! exports provided: createFloatingCommand, renderCommand */
  18259. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18260. "use strict";
  18261. __webpack_require__.r(__webpack_exports__);
  18262. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18263. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18264. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18265. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18266. function createFloatingCommand() {
  18267. return $('<div class="ui functioncall created_element"> <i class="hand point right icon"></i> <span> funcao() </span></div>');
  18268. }
  18269. function renderCommand(command, function_obj) {
  18270. 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>');
  18271. el.data('command', command);
  18272. _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__["renderMenu"](command, command.function_called, el.find('.var_value_menu_div'), function_obj);
  18273. addHandlers(command, function_obj, el);
  18274. return el;
  18275. }
  18276. function addHandlers(command, function_obj, functioncall_dom) {
  18277. functioncall_dom.find('.button_remove_command').on('click', function () {
  18278. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, functioncall_dom)) {
  18279. functioncall_dom.fadeOut(400, function () {
  18280. functioncall_dom.remove();
  18281. });
  18282. }
  18283. });
  18284. }
  18285. /***/ }),
  18286. /***/ "./js/visualUI/commands/generic_expression.js":
  18287. /*!****************************************************!*\
  18288. !*** ./js/visualUI/commands/generic_expression.js ***!
  18289. \****************************************************/
  18290. /*! exports provided: renderExpression, expressionParserToVisual */
  18291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18292. "use strict";
  18293. __webpack_require__.r(__webpack_exports__);
  18294. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  18295. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expressionParserToVisual", function() { return expressionParserToVisual; });
  18296. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  18297. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  18298. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  18299. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18300. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18301. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18302. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../services/userLog */ "./js/services/userLog.js");
  18303. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  18304. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_6__);
  18305. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils */ "./js/visualUI/utils.js");
  18306. window.timer = false;
  18307. function renderExpression(command, function_obj, div_to_render, expression_array) {
  18308. div_to_render.empty();
  18309. melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default.a.unwatch(command, "expression");
  18310. melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default.a.watch(command, "expression", function () {
  18311. if (window.timer) return;
  18312. var m = div_to_render.find(".single_element_expression").not(".mouse_distance").not(".add_parentheses");
  18313. var s = "";
  18314. m.each(function (e) {
  18315. if ($(this).hasClass("parentheses_in_expression")) {
  18316. s += $(this).text() + " ";
  18317. } else {
  18318. s += $(this).find(".text").text();
  18319. s += $(this).find(".var_name").text();
  18320. s += $(this).find(".parameters_function_called").text();
  18321. s += $(this).find(".value_rendered").text();
  18322. s += " ";
  18323. }
  18324. });
  18325. if (s) {
  18326. window.timer = true;
  18327. } else {
  18328. return;
  18329. }
  18330. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_5__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_5__["ActionTypes"].CHANGE_COMMAND_EXP, command.type, "/", s);
  18331. setTimeout(function () {
  18332. window.timer = false;
  18333. }, 200);
  18334. }, 20, true);
  18335. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["COMMAND_TYPES"].attribution) {
  18336. melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default.a.unwatch(command.variable);
  18337. melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default.a.watch(command.variable, function () {
  18338. renderExpression(command, function_obj, div_to_render, expression_array);
  18339. }, 0);
  18340. if (command.variable.content) {
  18341. var types_included = [];
  18342. if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER || command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL) {
  18343. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic);
  18344. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN) {
  18345. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional);
  18346. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic);
  18347. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic);
  18348. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_1__["Types"].TEXT) {
  18349. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional);
  18350. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic);
  18351. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic);
  18352. } else {//console.log("NÃO RECONHECI! VEJA: ", command.variable.content.type);
  18353. }
  18354. renderElements(command, function_obj, div_to_render, expression_array, types_included);
  18355. } else {
  18356. div_to_render.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("var_menu_select_var").toLowerCase());
  18357. }
  18358. } else {
  18359. var _types_included = [];
  18360. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional);
  18361. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic);
  18362. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["COMMAND_TYPES"].writer) _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].write_sep);
  18363. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic);
  18364. renderElements(command, function_obj, div_to_render, expression_array, _types_included);
  18365. }
  18366. div_to_render.children(".mouse_distance").addClass("mouse_distance_hidden");
  18367. div_to_render.children(".higher_element").on("mousemove", function (evt) {
  18368. if (!window.open_or_close) {
  18369. $(this).css("position", "relative", "!important");
  18370. $(this).children(".mouse_distance").css("opacity", "1");
  18371. }
  18372. });
  18373. div_to_render.children(".higher_element").on("mouseout", function (evt) {
  18374. if (!window.open_or_close) {
  18375. $(this).css("position", "absolute", "!important");
  18376. $(this).children(".mouse_distance").css("opacity", "0");
  18377. }
  18378. });
  18379. var lixeira = $('<div class="lixeira" draggable="true"></div>');
  18380. div_to_render.find(".single_element_expression").on("mousedown", function (evt) {
  18381. window.posX = evt.clientX;
  18382. window.posY = evt.clientY;
  18383. });
  18384. Sortable.create(div_to_render[0], {
  18385. animation: 100,
  18386. ghostClass: "ghost",
  18387. group: {
  18388. name: "shared",
  18389. put: false // Do not allow items to be put into this list
  18390. },
  18391. draggable: ".single_element_expression",
  18392. sort: false,
  18393. filter: ".not_allowed",
  18394. onStart: function onStart() {
  18395. $("body").append(lixeira);
  18396. lixeira.css("display", "block");
  18397. lixeira.css("top", window.posY + 70, "!important");
  18398. lixeira.css("left", window.posX - 20, "!important");
  18399. },
  18400. onMove: function onMove() {
  18401. lixeira.addClass("color_test");
  18402. },
  18403. onEnd: function onEnd() {
  18404. lixeira.remove();
  18405. div_to_render.find(".ghost").removeClass("ghost");
  18406. }
  18407. });
  18408. new Sortable(lixeira[0], {
  18409. group: "shared",
  18410. animation: 150,
  18411. onAdd: function onAdd(evt) {
  18412. lixeira.css("display", "none");
  18413. lixeira.find(".single_element_expression").remove();
  18414. lixeira.css("background-color", "");
  18415. lixeira.remove();
  18416. removeElement(evt, expression_array);
  18417. renderExpression(command, function_obj, div_to_render, expression_array);
  18418. }
  18419. });
  18420. }
  18421. function removeElement(event, expression_array) {
  18422. var indice = $(event.item).data("index");
  18423. var first = expression_array[0];
  18424. if (expression_array[indice].type) {
  18425. // if is alone in expression:
  18426. if (expression_array.length == 1) {
  18427. //function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  18428. expression_array.splice(0, 1);
  18429. } else if (expression_array.length > 1) {
  18430. if (indice > 0 && expression_array[indice - 1].type_op) {
  18431. if (indice < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice + 1].type_op) {
  18432. expression_array.splice(indice + 1, 1);
  18433. }
  18434. expression_array.splice(indice, 1);
  18435. expression_array.splice(indice - 1, 1);
  18436. if (indice - 2 < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice - 1] == ")") {
  18437. expression_array.splice(indice - 1, 1);
  18438. expression_array.splice(indice - 2, 1);
  18439. if (indice - 3 >= 0 && indice - 3 < expression_array.length && expression_array[indice - 3].type_op) {
  18440. expression_array.splice(indice - 3, 1);
  18441. }
  18442. }
  18443. } else if (indice < expression_array.length - 1 && expression_array[indice + 1].type_op) {
  18444. expression_array.splice(indice + 1, 1);
  18445. expression_array.splice(indice, 1);
  18446. } else if (indice < expression_array.length - 1 && indice > 0 && expression_array[indice - 1] == "(" && expression_array[indice + 1] == ")") {
  18447. if (indice > 1 && expression_array[indice - 2].type_op) {
  18448. expression_array.splice(indice + 1, 1);
  18449. expression_array.splice(indice, 1);
  18450. expression_array.splice(indice - 1, 1);
  18451. expression_array.splice(indice - 2, 1);
  18452. } else if (indice < expression_array.length - 2 && expression_array[indice + 2].type_op) {
  18453. expression_array.splice(indice + 1, 1);
  18454. expression_array.splice(indice, 1);
  18455. expression_array.splice(indice - 1, 1);
  18456. } else {
  18457. expression_array.splice(indice + 1, 1);
  18458. expression_array.splice(indice, 1);
  18459. expression_array.splice(indice - 1, 1);
  18460. }
  18461. }
  18462. }
  18463. } else if (expression_array[indice].type_op) {// iVProg doesn't support operator remove
  18464. } else {
  18465. var opening = -1;
  18466. var closing = -1;
  18467. if (expression_array[indice] == "(") {
  18468. opening = indice;
  18469. for (var i = indice + 1; i < expression_array.length; i++) {
  18470. if (expression_array[i] == ")") {
  18471. closing = i;
  18472. break;
  18473. }
  18474. }
  18475. } else {
  18476. closing = indice;
  18477. for (var i = indice - 1; i >= 0; i--) {
  18478. if (expression_array[i] == "(") {
  18479. opening = i;
  18480. break;
  18481. }
  18482. }
  18483. }
  18484. if (expression_array[opening + 1].type_op) {
  18485. expression_array.splice(closing, 1);
  18486. expression_array.splice(opening + 1, 1);
  18487. expression_array.splice(opening, 1);
  18488. } else {
  18489. expression_array.splice(closing, 1);
  18490. expression_array.splice(opening, 1);
  18491. }
  18492. } // if expression is empty, add a new var value:
  18493. if (expression_array.length == 0) {
  18494. expression_array.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18495. }
  18496. if (first != expression_array[0] && expression_array[0].type_op) {
  18497. expression_array.splice(0, 1);
  18498. }
  18499. }
  18500. function renderElements(command, function_obj, div_to_render, expression_array, types_included) {
  18501. /*if (expression_array.length > 0) {
  18502. if (!expression_array[0].type_op) {
  18503. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  18504. }
  18505. }*/
  18506. var i = 0;
  18507. for (i = 0; i < expression_array.length; i++) {
  18508. if (expression_array[i].type == "var_value") {
  18509. var div_temp = $('<div class="single_element_expression" data-index="' + i + '"></div>');
  18510. if (i == 0) {
  18511. if (expression_array.length > 0 && !expression_array[0].type_op) {//renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  18512. }
  18513. }
  18514. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, expression_array[i], div_temp, function_obj);
  18515. div_to_render.append(div_temp);
  18516. } else if (expression_array[i] == "(" || expression_array[i] == ")") {
  18517. if (expression_array[i] == ")") {
  18518. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i);
  18519. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  18520. } else if (expression_array[i] == "(" && !expression_array[i + 1].type_op) {
  18521. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  18522. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, i + 1);
  18523. } else {
  18524. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  18525. }
  18526. } else {
  18527. if (i == 0) {} else if (expression_array[i - 1] == "(") {}
  18528. renderOperatorMenu(command, function_obj, div_to_render, expression_array[i], types_included, i, expression_array);
  18529. }
  18530. }
  18531. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i, true);
  18532. renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included);
  18533. }
  18534. window.parentheses_activate = false;
  18535. window.open_or_close = null;
  18536. function renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included) {
  18537. 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>');
  18538. div_to_render.append(addParentheses);
  18539. addParentheses.popup({
  18540. content: "Adicionar parênteses",
  18541. delay: {
  18542. show: 750,
  18543. hide: 0
  18544. }
  18545. });
  18546. addParentheses.on("click", function (mouse_event) {
  18547. // verificar se já está ativado
  18548. if (window.parentheses_activate) {
  18549. return;
  18550. }
  18551. div_to_render.find(".usepointer").off("click");
  18552. window.parentheses_activate = true;
  18553. window.open_or_close = "open";
  18554. div_to_render.find(".dropdown").addClass("disabled");
  18555. div_to_render.find(".ghost_element").addClass("temp_class");
  18556. div_to_render.find(".ghost_element").removeClass("ghost_element");
  18557. var floatingObject = $('<div class="floating_parenthesis"> ( </div>');
  18558. floatingObject.draggable().appendTo("body");
  18559. floatingObject.css("position", "absolute");
  18560. mouse_event.type = "mousedown.draggable";
  18561. mouse_event.target = floatingObject[0];
  18562. floatingObject.css("left", mouse_event.pageX + 10);
  18563. floatingObject.css("top", mouse_event.pageY + 10);
  18564. floatingObject.trigger(mouse_event);
  18565. div_to_render.on("mousemove", function (evt) {
  18566. var actual_target = null;
  18567. if ($(evt.target).hasClass("single_element_expression")) {
  18568. actual_target = $(evt.target);
  18569. } else {
  18570. actual_target = $(evt.target).closest(".single_element_expression");
  18571. }
  18572. 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")) {
  18573. return;
  18574. }
  18575. renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array);
  18576. });
  18577. div_to_render.on("mouseleave", function () {
  18578. /*window.open_parentheses.remove();
  18579. window.close_parentheses.remove();*/
  18580. });
  18581. var floating;
  18582. $("body").on("mouseup", function (evt) {
  18583. if (window.open_or_close == "open") {
  18584. window.open_or_close = "close";
  18585. floatingObject.remove();
  18586. var comando_que_esta = $(evt.target).closest(".command_container");
  18587. var comando_certo = div_to_render.closest(".command_container");
  18588. if (!comando_que_esta.is(comando_certo)) {
  18589. window.parentheses_activate = false;
  18590. div_to_render.find(".temp_class").addClass("ghost_element");
  18591. div_to_render.find(".temp_class").removeClass("temp_class");
  18592. div_to_render.off("mousemove");
  18593. div_to_render.off("mouseleave");
  18594. $("body").off("mouseup");
  18595. window.open_parentheses.remove();
  18596. window.close_parentheses.remove();
  18597. window.inserir_open = -1;
  18598. window.inserir_close = -1;
  18599. window.open_or_close = null;
  18600. renderExpression(command, function_obj, div_to_render, expression_array);
  18601. return;
  18602. }
  18603. window.open_parentheses.addClass("parentheses_fixed");
  18604. floating = $('<div class="floating_parenthesis"> ) </div>');
  18605. floating.draggable().appendTo("body");
  18606. floating.css("position", "absolute");
  18607. floating.css("left", evt.pageX + 10);
  18608. floating.css("top", evt.pageY + 10);
  18609. $("body").on("mousemove", function (evts) {
  18610. floating.css("left", evts.pageX + 10);
  18611. floating.css("top", evts.pageY + 10);
  18612. });
  18613. } else {
  18614. floating.remove();
  18615. window.open_parentheses.removeClass("parentheses_fixed");
  18616. div_to_render.off("mousemove");
  18617. div_to_render.off("mouseleave");
  18618. $("body").off("mouseup");
  18619. setTimeout(function () {
  18620. window.parentheses_activate = false;
  18621. }, 50);
  18622. var comando_que_esta = $(evt.target).closest(".command_container");
  18623. var comando_certo = div_to_render.closest(".command_container");
  18624. var is_correct = false;
  18625. if (comando_que_esta.is(comando_certo)) {
  18626. is_correct = true;
  18627. }
  18628. if (is_correct) {
  18629. expression_array.splice(window.inserir_open, 0, "(");
  18630. expression_array.splice(window.inserir_close, 0, ")");
  18631. }
  18632. window.inserir_open = -1;
  18633. window.inserir_close = -1;
  18634. window.open_or_close = null;
  18635. renderExpression(command, function_obj, div_to_render, expression_array);
  18636. }
  18637. });
  18638. });
  18639. }
  18640. window.open_parentheses = $('<div class="parentheses_ghost">(</div>');
  18641. window.close_parentheses = $('<div class="parentheses_ghost">)</div>');
  18642. window.inserir_open = -1;
  18643. window.inserir_close = -1;
  18644. function renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array) {
  18645. /*window.open_parentheses.remove();
  18646. window.close_parentheses.remove();*/
  18647. var index_in_array = actual_target.data("index");
  18648. if (expression_array[index_in_array] == "(" || expression_array[index_in_array] == ")") {
  18649. return;
  18650. }
  18651. if (window.open_or_close == "close") {
  18652. if (index_in_array < window.inserir_open) {
  18653. return;
  18654. }
  18655. } // Tratando a situação quando é na primeira posição:
  18656. if (index_in_array == 0) {
  18657. if (expression_array[index_in_array].type == "var_value") {
  18658. if (window.open_or_close == "open") {
  18659. window.open_parentheses.insertBefore(actual_target);
  18660. window.inserir_open = index_in_array;
  18661. }
  18662. /*if (expression_array.length == 1) {
  18663. if (window.open_or_close == "close") {
  18664. window.close_parentheses.insertAfter(actual_target);
  18665. window.inserir_close = index_in_array + 2;
  18666. }*/
  18667. //} else {
  18668. var count_opened = 0;
  18669. var count_closed = 0;
  18670. for (var i = 0; i < expression_array.length; i++) {
  18671. if (expression_array[i] == "(") {
  18672. count_opened++;
  18673. }
  18674. if (expression_array[i] == ")") {
  18675. count_closed++;
  18676. }
  18677. if (count_opened != count_closed) {} else {
  18678. if (count_opened > 0) {
  18679. if (window.open_or_close == "close") {
  18680. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18681. window.inserir_close = i + 2;
  18682. }
  18683. break;
  18684. } else {
  18685. if (expression_array[i].type == "var_value") {
  18686. if (window.open_or_close == "close") {
  18687. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18688. window.inserir_close = i + 2;
  18689. }
  18690. break;
  18691. }
  18692. }
  18693. }
  18694. } //}
  18695. } else if (expression_array[index_in_array].type_op) {
  18696. if (window.open_or_close == "open") {
  18697. window.open_parentheses.insertBefore(actual_target);
  18698. window.inserir_open = index_in_array;
  18699. }
  18700. var count_opened = 0;
  18701. var count_closed = 0;
  18702. for (var i = 1; i < expression_array.length; i++) {
  18703. // $('.slide-link[data-slide="0"]')
  18704. if (expression_array[i] == "(") {
  18705. count_opened++;
  18706. }
  18707. if (expression_array[i] == ")") {
  18708. count_closed++;
  18709. }
  18710. if (count_opened != count_closed) {} else {
  18711. if (count_opened > 0) {
  18712. if (expression_array[i].type == "var_value") {
  18713. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18714. window.inserir_close = i + 2;
  18715. }
  18716. break;
  18717. } else {
  18718. if (expression_array[i].type == "var_value") {
  18719. if (expression_array[i].type == "var_value") {
  18720. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18721. window.inserir_close = i + 2;
  18722. }
  18723. break;
  18724. }
  18725. }
  18726. }
  18727. }
  18728. }
  18729. return;
  18730. } // Tratando quando não é no índice 0:
  18731. if (expression_array[index_in_array].type == "var_value") {
  18732. if (window.open_or_close == "open") {
  18733. window.open_parentheses.insertBefore(actual_target);
  18734. window.inserir_open = index_in_array;
  18735. }
  18736. if (window.open_or_close == "close") {
  18737. window.close_parentheses.insertAfter(actual_target);
  18738. window.inserir_close = index_in_array + 2;
  18739. }
  18740. return;
  18741. }
  18742. if (expression_array[index_in_array].type_op) {
  18743. // buscar para a esquerda primeiro:
  18744. if (expression_array[index_in_array - 1] == "(") {
  18745. if (window.open_or_close == "open") {
  18746. window.open_parentheses.insertBefore(actual_target);
  18747. window.inserir_open = index_in_array;
  18748. }
  18749. } else if (expression_array[index_in_array - 1] == ")") {
  18750. // buscar a abertura
  18751. var count_opened = 0;
  18752. var count_closed = 0;
  18753. for (var j = index_in_array - 1; j >= 0; j--) {
  18754. if (expression_array[j] == "(") {
  18755. count_opened++;
  18756. }
  18757. if (expression_array[j] == ")") {
  18758. count_closed++;
  18759. }
  18760. if (count_opened != count_closed) {} else {
  18761. if (count_closed > 0) {
  18762. if (window.open_or_close == "open") {
  18763. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  18764. window.inserir_open = j;
  18765. }
  18766. break;
  18767. }
  18768. }
  18769. }
  18770. } else if (expression_array[index_in_array - 1].type == "var_value") {
  18771. if (window.open_or_close == "open") {
  18772. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + (index_in_array - 1) + '"]'));
  18773. window.inserir_open = index_in_array - 1;
  18774. }
  18775. } // buscar para a direita agora:
  18776. if (expression_array[index_in_array + 1] == "(") {
  18777. // buscar o fechamento:
  18778. var count_opened = 0;
  18779. var count_closed = 0;
  18780. for (var j = index_in_array + 1; j < expression_array.length; j++) {
  18781. if (expression_array[j] == "(") {
  18782. count_opened++;
  18783. }
  18784. if (expression_array[j] == ")") {
  18785. count_closed++;
  18786. }
  18787. if (count_opened != count_closed) {} else {
  18788. if (count_opened > 0) {
  18789. if (window.open_or_close == "close") {
  18790. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  18791. window.inserir_close = j + 2;
  18792. }
  18793. break;
  18794. }
  18795. }
  18796. }
  18797. } else if (expression_array[index_in_array + 1].type == "var_value") {
  18798. if (window.open_or_close == "close") {
  18799. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + (index_in_array + 1) + '"]'));
  18800. window.inserir_close = index_in_array + 3;
  18801. }
  18802. }
  18803. }
  18804. }
  18805. function renderParenthesis(div_to_render, expression_content, command, function_obj, position, expression_array) {
  18806. var ghost_parenthesis = $('<div class="single_element_expression parentheses_in_expression" data-index="' + position + '">' + expression_content + "</div>");
  18807. div_to_render.append(ghost_parenthesis);
  18808. }
  18809. function renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, position) {
  18810. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18811. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18812. if (types_included.length > 1) {
  18813. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18814. menu_final += getArithmeticOperators();
  18815. menu_final += "</div></div>";
  18816. } else {
  18817. menu_final += getArithmeticOperators();
  18818. }
  18819. }
  18820. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18821. if (types_included.length > 1) {
  18822. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18823. menu_final += getLogicOperators();
  18824. menu_final += "</div></div>";
  18825. } else {
  18826. menu_final += getLogicOperators();
  18827. }
  18828. }
  18829. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18830. if (types_included.length > 1) {
  18831. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18832. menu_final += getRelationalOperators();
  18833. menu_final += "</div></div>";
  18834. } else {
  18835. menu_final += getRelationalOperators();
  18836. }
  18837. }
  18838. menu_final += "</div></div>";
  18839. menu_final = $(menu_final);
  18840. var div_temp = $('<div class="single_element_expression ghost_element mouse_distance"></div>');
  18841. div_temp.append(menu_final);
  18842. var div_higher = $('<div class="higher_element"></div>');
  18843. div_higher.append(div_temp);
  18844. div_to_render.append(div_higher);
  18845. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].minus);
  18846. div_temp.on("click", function () {
  18847. if (!window.open_or_close) {
  18848. var sera = position;
  18849. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18850. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].minus));
  18851. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18852. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].equals_to));
  18853. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18854. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].greater_than));
  18855. }
  18856. renderExpression(command, function_obj, div_to_render, expression_array);
  18857. }
  18858. });
  18859. }
  18860. function renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, position) {
  18861. var is_last = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
  18862. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18863. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18864. if (types_included.length > 1) {
  18865. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18866. menu_final += getArithmeticOperators();
  18867. menu_final += "</div></div>";
  18868. } else {
  18869. menu_final += getArithmeticOperators();
  18870. }
  18871. }
  18872. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18873. if (types_included.length > 1) {
  18874. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18875. menu_final += getLogicOperators();
  18876. menu_final += "</div></div>";
  18877. } else {
  18878. menu_final += getLogicOperators();
  18879. }
  18880. }
  18881. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18882. if (types_included.length > 1) {
  18883. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18884. menu_final += getRelationalOperators();
  18885. menu_final += "</div></div>";
  18886. } else {
  18887. menu_final += getRelationalOperators();
  18888. }
  18889. }
  18890. menu_final += "</div></div>";
  18891. menu_final = $(menu_final);
  18892. var div_temp = $('<div class="simple_add mouse_distance"></div>');
  18893. var div_higher = $('<div class="higher_element"></div>');
  18894. var button = $('<button class="ui button green add_expression"><i class="plus circle inverted icon"></i></button>');
  18895. div_temp.append(button);
  18896. if (!is_last) {
  18897. div_higher.append(div_temp);
  18898. div_to_render.append(div_higher); //div_temp.append(menu_final);
  18899. div_temp.css("opacity", "0", "!important");
  18900. } else {
  18901. div_temp.removeClass("mouse_distance");
  18902. div_temp.css("opacity", "1", "!important"); //div_temp.append(menu_final);
  18903. div_to_render.append(div_temp);
  18904. }
  18905. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].plus);
  18906. div_temp.on("click", function () {
  18907. var sera = position;
  18908. if (expression_array[sera] == ")" && expression_array[sera - 1] == "(") {
  18909. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18910. renderExpression(command, function_obj, div_to_render, expression_array);
  18911. return;
  18912. }
  18913. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18914. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].plus));
  18915. expression_array.splice(sera + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18916. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18917. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].equals_to));
  18918. expression_array.splice(sera + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18919. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18920. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].greater_than));
  18921. expression_array.splice(sera + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18922. }
  18923. renderExpression(command, function_obj, div_to_render, expression_array);
  18924. });
  18925. }
  18926. function renderOperatorMenu(command, function_obj, div_to_render, expression_element, types_included, position, expression_array) {
  18927. var menu_final = '<div class="ui dropdown"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18928. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].write_sep) >= 0) {
  18929. menu_final += getSeparator();
  18930. }
  18931. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18932. if (types_included.length > 1) {
  18933. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18934. menu_final += getArithmeticOperators();
  18935. menu_final += "</div></div>";
  18936. } else {
  18937. menu_final += getArithmeticOperators();
  18938. }
  18939. }
  18940. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18941. if (types_included.length > 1) {
  18942. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18943. menu_final += getLogicOperators();
  18944. menu_final += "</div></div>";
  18945. } else {
  18946. menu_final += getLogicOperators();
  18947. }
  18948. }
  18949. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18950. if (types_included.length > 1) {
  18951. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18952. menu_final += getRelationalOperators();
  18953. menu_final += "</div></div>";
  18954. } else {
  18955. menu_final += getRelationalOperators();
  18956. }
  18957. }
  18958. menu_final += "</div></div>";
  18959. menu_final = $(menu_final);
  18960. menu_final.find(".ivprog-write-sep").popup({
  18961. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("write_seprator_menu_tooltip"),
  18962. delay: {
  18963. show: 500,
  18964. hide: 0
  18965. }
  18966. });
  18967. var div_temp = $('<div class="single_element_expression not_allowed" data-index="' + position + '"></div>');
  18968. div_temp.append(menu_final);
  18969. div_to_render.append(div_temp);
  18970. menu_final.dropdown({
  18971. onChange: function onChange(_value, _text, $selectedItem) {
  18972. expression_element.item = $selectedItem.data("value");
  18973. expression_element.type_op = $selectedItem.data("type");
  18974. }
  18975. });
  18976. menu_final.dropdown("set selected", expression_element.item);
  18977. }
  18978. function getArithmeticOperators() {
  18979. var arithmetic_operators;
  18980. arithmetic_operators = '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].plus + '">+</div>';
  18981. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].minus + '">-</div>';
  18982. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  18983. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].division + '">/</div>';
  18984. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].module + '">%</div>';
  18985. return arithmetic_operators;
  18986. }
  18987. function getLogicOperators() {
  18988. var logic_operators;
  18989. logic_operators = '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].equals_to + '">==</div>';
  18990. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].not_equals_to + '">!=</div>';
  18991. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].and + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("logic_operator_and") + "</div>";
  18992. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].or + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("logic_operator_or") + "</div>";
  18993. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].not + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("logic_operator_not") + "</div>";
  18994. return logic_operators;
  18995. }
  18996. function getRelationalOperators() {
  18997. var relational_operators;
  18998. relational_operators = '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].greater_than + '">></div>';
  18999. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].less_than + '"><</div>';
  19000. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].equals_to + '">==</div>';
  19001. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].not_equals_to + '">!=</div>';
  19002. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to + '">>=</div>';
  19003. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].less_than_or_equals_to + '"><=</div>';
  19004. return relational_operators;
  19005. }
  19006. function getSeparator() {
  19007. return "<div class=\"item ivprog-write-sep\" data-type=\"".concat(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].write_sep, "\" data-value=\"").concat(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].write_sep, "\">").concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("write_seprator_menu_text"), "</div>");
  19008. }
  19009. function getVariable(function_obj, search) {
  19010. if (search == ")" || search == "(") {
  19011. return search;
  19012. }
  19013. if (search.instance == "operator") {
  19014. var obj;
  19015. switch (search.value) {
  19016. case '+':
  19017. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].plus);
  19018. break;
  19019. case '-':
  19020. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].minus);
  19021. break;
  19022. case '*':
  19023. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].multiplication);
  19024. break;
  19025. case '/':
  19026. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].division);
  19027. break;
  19028. case '%':
  19029. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].module);
  19030. break;
  19031. case '>':
  19032. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].greater_than);
  19033. break;
  19034. case '<':
  19035. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].less_than);
  19036. break;
  19037. case '>=':
  19038. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to);
  19039. break;
  19040. case '<=':
  19041. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].less_than_or_equals_to);
  19042. break;
  19043. case '==':
  19044. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].equals_to);
  19045. break;
  19046. case '!=':
  19047. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_COMPARISON"].not_equals_to);
  19048. break;
  19049. case 'and':
  19050. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].and);
  19051. break;
  19052. case 'or':
  19053. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].or);
  19054. break;
  19055. case 'not':
  19056. obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["LOGIC_COMPARISON"].not);
  19057. break;
  19058. }
  19059. return obj;
  19060. }
  19061. if (search.instance == "expression" && search.type == "const") {
  19062. if (search.value === true) {
  19063. var obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('logic_value_true'), null, null, true);
  19064. return obj;
  19065. }
  19066. if (search.value === false) {
  19067. var obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('logic_value_false'), null, null, true);
  19068. return obj;
  19069. }
  19070. var obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, search.value, null, null, true);
  19071. return obj;
  19072. }
  19073. var variavel = null;
  19074. if (search.instance == "expression" && search.type == "var") {
  19075. // 1. Procurar a variável na função:
  19076. for (var j = 0; j < function_obj.variables_list.length; j++) {
  19077. if (function_obj.variables_list[j].name == search.value) {
  19078. variavel = function_obj.variables_list[j];
  19079. break;
  19080. }
  19081. } // 2. Procurar a variável nas gloais:
  19082. if (!variavel) for (var j = 0; j < program_obj.globals.length; j++) {
  19083. if (program_obj.globals[j].name == search.value) {
  19084. variavel = program_obj.globals[j];
  19085. break;
  19086. }
  19087. } // 3. Procurar na lista de parâmetros:
  19088. if (!variavel) for (var j = 0; j < function_obj.parameters_list.length; j++) {
  19089. if (function_obj.parameters_list[j].name == search.value) {
  19090. variavel = function_obj.parameters_list[j];
  19091. break;
  19092. }
  19093. }
  19094. }
  19095. if (search.instance == "expression" && search.type == "var" && !search.line) {
  19096. var obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, variavel, null, null, true);
  19097. return obj;
  19098. }
  19099. if (search.instance == "expression" && search.type == "var" && search["class"] == "vector") {
  19100. var obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, variavel, null, getVariable(function_obj, search.line[0]), true);
  19101. return obj;
  19102. }
  19103. if (search.instance == "expression" && search.type == "var" && search["class"] == "matrix") {
  19104. var obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, variavel, getVariable(function_obj, search.line[0]), getVariable(function_obj, search.column[0]), true);
  19105. return obj;
  19106. }
  19107. if (search.instance == "expression" && search.type == "function") {
  19108. var obj = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, variavel, null, null, true); // Procurar a função para referência:
  19109. for (var i = 0; i < program_obj.functions.length; i++) {
  19110. if (program_obj.functions[i].name == search.value) {
  19111. obj.function_called = program_obj.functions[i];
  19112. }
  19113. } // Se ainda não foi encontrada, procurar na biblioteca do iVProg:
  19114. if (!obj.function_called) {
  19115. for (var i = 0; i < window.system_functions.length; i++) {
  19116. if (search.value.split(".")[1] && search.value.split(".")[1] == window.system_functions[i].identifier) {
  19117. obj.function_called = window.system_functions[i];
  19118. } else if (search.value == window.system_functions[i].identifier) {
  19119. obj.function_called = window.system_functions[i];
  19120. }
  19121. }
  19122. }
  19123. obj.parameters_list = [];
  19124. for (var i = 0; i < search.params.length; i++) {
  19125. obj.parameters_list.push(getVariable(function_obj, search.params[i][0]));
  19126. }
  19127. return obj;
  19128. }
  19129. }
  19130. function expressionParserToVisual(text, function_obj, input_field) {
  19131. if (text.trim().length == 0) {
  19132. return [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)];
  19133. }
  19134. var var_not_found = [];
  19135. var fun_not_found = [];
  19136. var parsed;
  19137. try {
  19138. parsed = ivprogCore.parseExpression(text);
  19139. } catch (ex) {
  19140. _utils__WEBPACK_IMPORTED_MODULE_7__["renderErrorMessage"](input_field, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('expression_invalid'));
  19141. }
  19142. if (!parsed) return null;
  19143. for (var i = 0; i < parsed.length; i++) {
  19144. var variavel = null;
  19145. if (parsed[i].instance == "expression" && parsed[i].type == "var") {
  19146. // 1. Procurar a variável na função:
  19147. for (var j = 0; j < function_obj.variables_list.length; j++) {
  19148. if (function_obj.variables_list[j].name == parsed[i].value) {
  19149. variavel = function_obj.variables_list[j];
  19150. break;
  19151. }
  19152. } // 2. Procurar a variável nas globais:
  19153. if (!variavel) for (var j = 0; j < program_obj.globals.length; j++) {
  19154. if (program_obj.globals[j].name == parsed[i].value) {
  19155. variavel = program_obj.globals[j];
  19156. break;
  19157. }
  19158. } // 3. Procurar a variável nos parâmetros:
  19159. if (!variavel) for (var j = 0; j < function_obj.parameters_list.length; j++) {
  19160. if (function_obj.parameters_list[j].name == parsed[i].value) {
  19161. variavel = function_obj.parameters_list[j];
  19162. break;
  19163. }
  19164. }
  19165. if (!variavel) var_not_found.push(parsed[i].value);
  19166. }
  19167. var funcao;
  19168. if (parsed[i].instance == "expression" && parsed[i].type == "function") {
  19169. // Procurar a função para referência:
  19170. for (var j = 0; j < program_obj.functions.length; j++) {
  19171. if (program_obj.functions[j].name == parsed[i].value) {
  19172. funcao = program_obj.functions[j];
  19173. }
  19174. } // Se ainda não encontrou, procurar na biblioteca do iVProg:
  19175. if (!funcao) {
  19176. for (var j = 0; j < window.system_functions.length; j++) {
  19177. if (parsed[i].value.split(".")[1] && parsed[i].value.split(".")[1] == window.system_functions[j].identifier) {
  19178. funcao = window.system_functions[j];
  19179. } else if (parsed[i].value == window.system_functions[j].identifier) {
  19180. funcao = window.system_functions[j];
  19181. }
  19182. }
  19183. }
  19184. if (!funcao) {
  19185. fun_not_found.push(parsed[i].value);
  19186. }
  19187. }
  19188. }
  19189. if (fun_not_found.length > 0) {
  19190. var uniqueWords = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(new Set(fun_not_found));
  19191. _utils__WEBPACK_IMPORTED_MODULE_7__["renderErrorMessage"](input_field, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('expression_undeclared_function') + " " + uniqueWords.join(", "));
  19192. return null;
  19193. }
  19194. if (var_not_found.length > 0) {
  19195. var _uniqueWords = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(new Set(var_not_found));
  19196. _utils__WEBPACK_IMPORTED_MODULE_7__["renderErrorMessage"](input_field, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('expression_undelcared_variable') + " " + _uniqueWords.join(", "));
  19197. return null;
  19198. }
  19199. var exp_obj = [];
  19200. for (var i = 0; i < parsed.length; i++) {
  19201. exp_obj.push(getVariable(function_obj, parsed[i]));
  19202. }
  19203. return exp_obj;
  19204. }
  19205. /***/ }),
  19206. /***/ "./js/visualUI/commands/iftrue.js":
  19207. /*!****************************************!*\
  19208. !*** ./js/visualUI/commands/iftrue.js ***!
  19209. \****************************************/
  19210. /*! exports provided: createFloatingCommand, renderCommand */
  19211. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19212. "use strict";
  19213. __webpack_require__.r(__webpack_exports__);
  19214. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19216. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19217. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19218. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19219. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  19220. function createFloatingCommand() {
  19221. return $('<div class="ui iftrue created_element"> <i class="ui icon small random"></i> <span> if (x < 1) { } </span></div>');
  19222. }
  19223. function renderCommand(command, function_obj) {
  19224. var ret = '';
  19225. 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>';
  19226. ret += '<span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_if') + '</span>';
  19227. ret += ' <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="textual_expression"></span> <span class="span_command_spec"> ) </span> ';
  19228. ret += ' <i class="ui icon i cursor button_write_expression" style="margin-right: 1rem !important;"></i> ';
  19229. ret += '<i class="ui icon unlock button_alternate_expression"></i>';
  19230. ret += '<span> </span> ';
  19231. ret += '<div class="ui block_commands commands_if conditional_comands_block" data-if="true">';
  19232. ret += '</div></div>';
  19233. 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>';
  19234. ret += '<div class="ui block_commands commands_else conditional_comands_block" data-else="true">';
  19235. ret += '</div>';
  19236. ret += '<span></span></div>';
  19237. ret += '</div>';
  19238. var el = $(ret);
  19239. el.data('command', command);
  19240. el.find('.block_commands').data('command', command);
  19241. el.find('.data_block_if').data('command', command);
  19242. el.find('.data_block_else').data('command', command);
  19243. el.find('.commands_if').data('command', command);
  19244. addHandlers(command, function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
  19245. _generic_expression__WEBPACK_IMPORTED_MODULE_2__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  19246. if (command.commands_block) {
  19247. for (var j = 0; j < command.commands_block.length; j++) {
  19248. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.commands_if')[0]), 3, function_obj);
  19249. }
  19250. }
  19251. if (command.commands_else) {
  19252. for (var j = 0; j < command.commands_else.length; j++) {
  19253. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_else[j], $(el.find('.commands_else')[0]), 3, function_obj);
  19254. }
  19255. }
  19256. if (command.collapsed) {
  19257. el.children('.data_block_else').toggle();
  19258. $(el.find('.block_commands')[0]).toggle();
  19259. }
  19260. if (command.lockexpression) {
  19261. if (command.expression) {
  19262. try {
  19263. var text = _code_generator__WEBPACK_IMPORTED_MODULE_3__["elementExpressionCode"](command.expression);
  19264. if (text) {
  19265. $(el.find('.conditional_expression')[0]).toggle();
  19266. $(el.find('.textual_expression')[0]).text(text);
  19267. $(el.find('.textual_expression')[0]).toggle();
  19268. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19269. }
  19270. } catch (e) {
  19271. command.lockexpression = false;
  19272. }
  19273. }
  19274. }
  19275. el.find('.unlock').popup({
  19276. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  19277. delay: {
  19278. show: 750,
  19279. hide: 0
  19280. }
  19281. });
  19282. el.find('.lock').popup({
  19283. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  19284. delay: {
  19285. show: 750,
  19286. hide: 0
  19287. }
  19288. });
  19289. el.find('.button_write_expression').popup({
  19290. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression"),
  19291. delay: {
  19292. show: 750,
  19293. hide: 0
  19294. }
  19295. });
  19296. return el;
  19297. }
  19298. function addHandlers(command, function_obj, iftrue_dom) {
  19299. iftrue_dom.find('.button_write_expression').on('click', function () {
  19300. window.expressionEdition = true;
  19301. window.inputExpression = null;
  19302. var afterWhichElement;
  19303. var lockButton = $(iftrue_dom.find('.button_alternate_expression')[0]);
  19304. var editButton = $(this);
  19305. afterWhichElement = $(iftrue_dom.find('.conditional_expression')[0]);
  19306. if (command.lockexpression) {
  19307. afterWhichElement = $(iftrue_dom.find('.textual_expression')[0]);
  19308. }
  19309. var text = "";
  19310. if (command.expression) {
  19311. if (command.expression.length == 1 && command.expression[0].content == null && !command.expression[0].function_called) {
  19312. text = "";
  19313. } else {
  19314. try {
  19315. text = _code_generator__WEBPACK_IMPORTED_MODULE_3__["elementExpressionCode"](command.expression);
  19316. } catch (ex) {
  19317. text = "";
  19318. }
  19319. }
  19320. }
  19321. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  19322. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  19323. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  19324. input.val(text);
  19325. input.focusout(function (evt) {
  19326. ok_button.click();
  19327. evt.preventDefault();
  19328. return true;
  19329. });
  19330. input.keyup(function (evt) {
  19331. if (evt.keyCode == 27) {
  19332. // esc
  19333. cancel_button.click();
  19334. }
  19335. if (evt.keyCode == 13) {
  19336. // enter
  19337. ok_button.click();
  19338. }
  19339. });
  19340. ok_button.click(function () {
  19341. var parsed = null;
  19342. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_2__["expressionParserToVisual"](input.val(), function_obj, input);
  19343. if (parsed) {
  19344. window.expressionEdition = false;
  19345. command.expression = parsed;
  19346. renderAlgorithm();
  19347. }
  19348. });
  19349. cancel_button.mousedown(function (evt) {
  19350. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_2__["expressionParserToVisual"](text, function_obj, input);
  19351. if (parsed) {
  19352. window.expressionEdition = false;
  19353. command.expression = parsed;
  19354. renderAlgorithm();
  19355. }
  19356. });
  19357. input.insertAfter(afterWhichElement);
  19358. input.focus();
  19359. cancel_button.insertAfter(input);
  19360. ok_button.insertAfter(input);
  19361. var len = text.length;
  19362. input[0].setSelectionRange(len, len);
  19363. afterWhichElement.css('display', 'none');
  19364. lockButton.css('display', 'none');
  19365. editButton.css('display', 'none');
  19366. ok_button.popup({
  19367. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  19368. delay: {
  19369. show: 750,
  19370. hide: 0
  19371. }
  19372. });
  19373. cancel_button.popup({
  19374. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  19375. delay: {
  19376. show: 750,
  19377. hide: 0
  19378. }
  19379. });
  19380. });
  19381. $(iftrue_dom.find('.textual_expression')[0]).toggle();
  19382. iftrue_dom.find('.button_alternate_expression').on('click', function () {
  19383. if (command.expression) {
  19384. var text = _code_generator__WEBPACK_IMPORTED_MODULE_3__["elementExpressionCode"](command.expression);
  19385. if (text) {
  19386. $(iftrue_dom.find('.conditional_expression')[0]).toggle();
  19387. $(iftrue_dom.find('.textual_expression')[0]).text(text);
  19388. $(iftrue_dom.find('.textual_expression')[0]).toggle();
  19389. $(this).toggleClass('unlock').toggleClass('lock');
  19390. command.lockexpression = !command.lockexpression;
  19391. }
  19392. }
  19393. if (command.lockexpression) {
  19394. iftrue_dom.find('.lock').popup({
  19395. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  19396. delay: {
  19397. show: 750,
  19398. hide: 0
  19399. }
  19400. });
  19401. } else {
  19402. iftrue_dom.find('.unlock').popup({
  19403. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  19404. delay: {
  19405. show: 750,
  19406. hide: 0
  19407. }
  19408. });
  19409. }
  19410. });
  19411. iftrue_dom.find('.button_remove_command').on('click', function () {
  19412. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, iftrue_dom)) {
  19413. iftrue_dom.fadeOut(400, function () {
  19414. iftrue_dom.remove();
  19415. });
  19416. }
  19417. });
  19418. iftrue_dom.find('.minimize_block_button').on('click', function () {
  19419. iftrue_dom.children('.data_block_else').toggle();
  19420. $(iftrue_dom.find('.block_commands')[0]).toggle();
  19421. command.collapsed = !command.collapsed;
  19422. });
  19423. }
  19424. /***/ }),
  19425. /***/ "./js/visualUI/commands/reader.js":
  19426. /*!****************************************!*\
  19427. !*** ./js/visualUI/commands/reader.js ***!
  19428. \****************************************/
  19429. /*! exports provided: createFloatingCommand, renderCommand */
  19430. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19431. "use strict";
  19432. __webpack_require__.r(__webpack_exports__);
  19433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19434. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19435. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19436. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19437. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19438. function createFloatingCommand() {
  19439. 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>');
  19440. }
  19441. function renderCommand(command, function_obj) {
  19442. 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>';
  19443. el = $(el);
  19444. el.data('command', command);
  19445. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
  19446. addHandlers(command, function_obj, el);
  19447. return el;
  19448. }
  19449. function addHandlers(command, function_obj, reader_dom) {
  19450. reader_dom.find('.button_remove_command').on('click', function () {
  19451. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, reader_dom)) {
  19452. reader_dom.fadeOut(400, function () {
  19453. reader_dom.remove();
  19454. });
  19455. }
  19456. });
  19457. }
  19458. /***/ }),
  19459. /***/ "./js/visualUI/commands/repeatNtimes.js":
  19460. /*!**********************************************!*\
  19461. !*** ./js/visualUI/commands/repeatNtimes.js ***!
  19462. \**********************************************/
  19463. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, manageClearExpressionElements */
  19464. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19465. "use strict";
  19466. __webpack_require__.r(__webpack_exports__);
  19467. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19468. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  19470. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageClearExpressionElements", function() { return manageClearExpressionElements; });
  19471. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19472. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19473. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19474. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  19475. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19476. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  19477. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19478. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  19479. function createFloatingCommand() {
  19480. 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>');
  19481. }
  19482. function renderCommand(command, function_obj) {
  19483. var ret = "<div class=\"ui repeatNtimes command_container\"> \n\t\t<i class=\"ui icon small sync command_drag\"></i>\n\t\t<i class=\"ui icon times red button_remove_command\"></i>\n\t\t<button class=\"ui icon button minimize_block_button tiny\"><i class=\"icon window minimize\"></i></button>\n\t\t<span class=\"span_command_spec\"> ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_for'), "\n\t\t</span> <div class=\"ui attribution_expression\">\n\t\t<div class=\"ui variable_attribution\"></div>\n\t\t<span class=\"text_receives span_command_spec\" style=\"margin-left: 10px;margin-right: 20px;\"></span>\n\t\t<div class=\"ui var_value_expression div_expression_st\"></div>\n\t\t</div>\n\t\t<span class=\"span_command_spec separator_character\" style=\"margin-left: 25px; margin-right: 15px;\">\n\t\t").concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_to"), " </span>\n\t\t<div class=\"conditional_expression\"></div> <div class=\"pass_button\"></div> \n\t\t<div class=\"ui incrementation_field\"><span class=\"text_inc_receives span_command_spec\"></span>\n\t\t<div class=\"ui first_operand\"></div><div class=\"ui operator\"></div>\n\t\t<div class=\"ui second_operand\"></div></div> <span class=\"span_command_spec\"> </span>\n\t\t<span class=\"textual_expression\"></span> <i class=\"ui icon unlock button_alternate_expression\"></i>\n\t\t<div class=\"ui context_menu\"></div>");
  19484. ret += '<div class="ui block_commands">';
  19485. ret += '</div>';
  19486. ret += '<span> </span>';
  19487. ret += '</div>';
  19488. var el = $(ret);
  19489. el.data('command', command);
  19490. el.find('.block_commands').data('command', command);
  19491. addHandlers(command, function_obj, el);
  19492. _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  19493. _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'));
  19494. _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);
  19495. //VariableValueMenu.renderMenu(command, command.var_incrementation, el.find('.incrementation_variable'), function_obj);
  19496. //angle double right
  19497. if (!command.expression1) {
  19498. 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);
  19499. }
  19500. el.find('.text_receives').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_from"));
  19501. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, el.find('.var_value_expression'), function_obj);
  19502. if (!command.expression3) {
  19503. 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>');
  19504. el.find('.pass_button').find('button').on('click', function () {
  19505. togglePasso(command);
  19506. });
  19507. /*var exp = new Models.ExpressionElement(Models.EXPRESSION_ELEMENTS.exp_op_exp,
  19508. [command.var_attribution,
  19509. Models.ARITHMETIC_TYPES.plus,
  19510. new Models.VariableValueMenu(VariableValueMenu.VAR_OR_VALUE_TYPES.all, "1", null, null, true)]);
  19511. command.expression3 = exp;
  19512. command.var_incrementation = command.var_attribution;*/
  19513. } else {
  19514. 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>');
  19515. el.find('.pass_button').find('button').on('click', function () {
  19516. togglePasso(command);
  19517. });
  19518. renderOperator(command, function_obj, el.find('.operator'), command.expression3, 1);
  19519. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], el.find('.second_operand'), function_obj);
  19520. }
  19521. if (command.commands_block) {
  19522. for (var j = 0; j < command.commands_block.length; j++) {
  19523. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  19524. }
  19525. }
  19526. if (command.lockexpression) {
  19527. try {
  19528. var text = _code_generator__WEBPACK_IMPORTED_MODULE_7__["repeatNtimesHeader"](command);
  19529. if (text) {
  19530. $(el.find('.textual_expression')[0]).html(text);
  19531. $(el.find('.textual_expression')[0]).toggle();
  19532. $(el.find('.attribution_expression')[0]).toggle();
  19533. $(el.find('.span_command_spec.separator_character')[0]).toggle();
  19534. $(el.find('.conditional_expression')[0]).toggle();
  19535. $(el.find('.pass_button')[0]).toggle();
  19536. $(el.find('.incrementation_field')[0]).toggle();
  19537. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19538. }
  19539. } catch (e) {
  19540. command.lockexpression = false;
  19541. }
  19542. }
  19543. el.find('.unlock').popup({
  19544. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  19545. delay: {
  19546. show: 750,
  19547. hide: 0
  19548. }
  19549. });
  19550. el.find('.lock').popup({
  19551. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  19552. delay: {
  19553. show: 750,
  19554. hide: 0
  19555. }
  19556. });
  19557. return el;
  19558. }
  19559. function togglePasso(command) {
  19560. if (!command.expression3) {
  19561. 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)]);
  19562. command.expression3 = exp;
  19563. command.var_incrementation = command.var_attribution;
  19564. } else {
  19565. command.expression3 = null;
  19566. }
  19567. renderAlgorithm();
  19568. }
  19569. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  19570. if (dom_object.hasClass('variable_attribution')) {
  19571. if (!command.expression3) {
  19572. 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)]);
  19573. command.expression3 = exp;
  19574. command.var_incrementation = command.var_attribution;
  19575. 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);
  19576. command.expression2.expression = cond_exp;
  19577. }
  19578. dom_object.parent().find('.text_receives').text('de');
  19579. 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);
  19580. dom_object.parent().find('.var_value_expression').empty();
  19581. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, dom_object.parent().find('.var_value_expression'), function_obj);
  19582. renderAlgorithm();
  19583. }
  19584. if (dom_object.hasClass('incrementation_variable')) {
  19585. dom_object.parent().find('.text_inc_receives').text('de');
  19586. 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)]);
  19587. command.expression3 = exp;
  19588. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[0], dom_object.parent().find('.first_operand'), function_obj);
  19589. renderOperator(command, function_obj, dom_object.parent().find('.operator'), command.expression3, 1);
  19590. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], dom_object.parent().find('.second_operand'), function_obj);
  19591. }
  19592. }
  19593. function manageClearExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  19594. if (dom_object.hasClass('variable_attribution')) {
  19595. $(dom_object).parent().find('.text_receives').text('');
  19596. command.expression1 = null;
  19597. $(dom_object).parent().find('.var_value_expression').empty();
  19598. }
  19599. if (dom_object.hasClass('incrementation_variable')) {
  19600. $(dom_object).parent().find('.text_inc_receives').text('');
  19601. command.expression3 = null;
  19602. $(dom_object).parent().find('.first_operand').empty();
  19603. $(dom_object).parent().find('.operator').empty();
  19604. $(dom_object).parent().find('.second_operand').empty();
  19605. }
  19606. }
  19607. function addHandlers(command, function_obj, repeatNtimes_dom) {
  19608. repeatNtimes_dom.find('.minimize_block_button').on('click', function (evt) {
  19609. repeatNtimes_dom.children('.ui.block_commands').toggle();
  19610. command.collapsed = !command.collapsed;
  19611. });
  19612. $(repeatNtimes_dom.find('.textual_expression')[0]).toggle();
  19613. repeatNtimes_dom.find('.button_alternate_expression').on('click', function () {
  19614. var text = _code_generator__WEBPACK_IMPORTED_MODULE_7__["repeatNtimesHeader"](command);
  19615. if (text) {
  19616. $(repeatNtimes_dom.find('.textual_expression')[0]).html(text);
  19617. $(repeatNtimes_dom.find('.textual_expression')[0]).toggle();
  19618. $(repeatNtimes_dom.find('.attribution_expression')[0]).toggle();
  19619. $(repeatNtimes_dom.find('.span_command_spec.separator_character')[0]).toggle();
  19620. $(repeatNtimes_dom.find('.conditional_expression')[0]).toggle();
  19621. $(repeatNtimes_dom.find('.pass_button')[0]).toggle();
  19622. $(repeatNtimes_dom.find('.incrementation_field')[0]).toggle();
  19623. $(repeatNtimes_dom.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19624. command.lockexpression = !command.lockexpression;
  19625. }
  19626. if (command.lockexpression) {
  19627. repeatNtimes_dom.find('.lock').popup({
  19628. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  19629. delay: {
  19630. show: 750,
  19631. hide: 0
  19632. }
  19633. });
  19634. } else {
  19635. repeatNtimes_dom.find('.unlock').popup({
  19636. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  19637. delay: {
  19638. show: 750,
  19639. hide: 0
  19640. }
  19641. });
  19642. }
  19643. });
  19644. repeatNtimes_dom.find('.button_remove_command').on('click', function () {
  19645. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, repeatNtimes_dom)) {
  19646. repeatNtimes_dom.fadeOut(400, function () {
  19647. repeatNtimes_dom.remove();
  19648. });
  19649. }
  19650. });
  19651. }
  19652. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  19653. var menu_operator = $('<div class="ui dropdown"><div class="text"></div></div>');
  19654. menu_operator.dropdown({
  19655. values: [{
  19656. name: '+',
  19657. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus,
  19658. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus
  19659. }, {
  19660. name: '-',
  19661. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus,
  19662. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus
  19663. }],
  19664. onChange: function onChange(value, text, $selectedItem) {
  19665. expression_element.itens[index_op] = value;
  19666. }
  19667. });
  19668. temp_op.append(menu_operator);
  19669. }
  19670. /***/ }),
  19671. /***/ "./js/visualUI/commands/return.js":
  19672. /*!****************************************!*\
  19673. !*** ./js/visualUI/commands/return.js ***!
  19674. \****************************************/
  19675. /*! exports provided: createFloatingCommand, renderCommand */
  19676. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19677. "use strict";
  19678. __webpack_require__.r(__webpack_exports__);
  19679. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19680. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19681. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  19682. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19683. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19684. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19685. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19686. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19687. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  19688. function createFloatingCommand() {
  19689. 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>');
  19690. }
  19691. function renderCommand(command, function_obj) {
  19692. var el = $('<div class="ui return command_container"> <i class="ui icon small reply command_drag"></i> <i class="ui icon times red button_remove_command"></i> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_return') + ' </span> <div class="expression_elements"></div><span class="textual_expression" style="display: none; margin-left: 1rem;"></span></div>');
  19693. el.data('command', command);
  19694. if (function_obj.return_type != _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID) {
  19695. if (!command.variable_value_menu) {
  19696. 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)];
  19697. }
  19698. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.variable_value_menu);
  19699. el.append($('<i class="ui icon unlock button_alternate_expression" style="margin-left: 1rem;"></i>'));
  19700. if (command.lockexpression) {
  19701. if (command.variable_value_menu) {
  19702. try {
  19703. var text = _code_generator__WEBPACK_IMPORTED_MODULE_6__["elementExpressionCode"](command.variable_value_menu);
  19704. if (text) {
  19705. $(el.find('.expression_elements')[0]).toggle();
  19706. $(el.find('.textual_expression')[0]).text(text);
  19707. $(el.find('.textual_expression')[0]).toggle();
  19708. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19709. }
  19710. } catch (e) {
  19711. command.lockexpression = false;
  19712. }
  19713. }
  19714. }
  19715. } else {
  19716. el.find('.expression_elements').remove();
  19717. command.variable_value_menu = null;
  19718. }
  19719. addHandlers(command, function_obj, el);
  19720. return el;
  19721. }
  19722. function addHandlers(command, function_obj, return_dom) {
  19723. return_dom.find('.button_alternate_expression').on('click', function () {
  19724. if (command.variable_value_menu) {
  19725. var text = _code_generator__WEBPACK_IMPORTED_MODULE_6__["elementExpressionCode"](command.variable_value_menu);
  19726. if (text) {
  19727. $(return_dom.find('.expression_elements')[0]).toggle();
  19728. $(return_dom.find('.textual_expression')[0]).text(text);
  19729. $(return_dom.find('.textual_expression')[0]).toggle();
  19730. $(this).toggleClass('unlock').toggleClass('lock');
  19731. command.lockexpression = !command.lockexpression;
  19732. }
  19733. }
  19734. });
  19735. return_dom.find('.button_remove_command').on('click', function () {
  19736. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, return_dom)) {
  19737. return_dom.fadeOut(400, function () {
  19738. return_dom.remove();
  19739. });
  19740. }
  19741. });
  19742. }
  19743. /***/ }),
  19744. /***/ "./js/visualUI/commands/switch.js":
  19745. /*!****************************************!*\
  19746. !*** ./js/visualUI/commands/switch.js ***!
  19747. \****************************************/
  19748. /*! exports provided: createFloatingCommand, renderCommand, renderCase */
  19749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19750. "use strict";
  19751. __webpack_require__.r(__webpack_exports__);
  19752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19754. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCase", function() { return renderCase; });
  19755. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19756. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19757. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19758. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  19759. function createFloatingCommand() {
  19760. 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>');
  19761. }
  19762. function renderCommand(command, function_obj) {
  19763. var ret = '';
  19764. ret += '<div class="ui switch command_container"> <i class="ui icon small random command_drag" ></i> <i class="ui icon times red button_remove_command"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_code_switch') + ' ( <div class="ui variable_to_switch"></div> ) <div class="ui context_menu"></div> <div class="ui all_cases_div"></div></span>';
  19765. ret += '</div>';
  19766. var el = $(ret);
  19767. el.data('command', command);
  19768. addHandlers(command, function_obj, el);
  19769. _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  19770. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.variable_to_switch'), function_obj);
  19771. if (command.cases) {
  19772. for (var i = 0; i < command.cases.length; i++) {
  19773. renderCase(command.cases[i], command, function_obj, el.find('.all_cases_div'));
  19774. }
  19775. }
  19776. return el;
  19777. }
  19778. function renderCase(switchcase, command, function_obj, el) {
  19779. 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>');
  19780. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, switchcase.variable_value_menu, casediv.find('.variable_case'), function_obj);
  19781. casediv.data('switchcase', switchcase);
  19782. casediv.find('.case_commands_block').data('switchcase', switchcase);
  19783. el.append(casediv);
  19784. if (switchcase.commands_block) {
  19785. for (var j = 0; j < switchcase.commands_block.length; j++) {
  19786. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](switchcase.commands_block[j], $(casediv.find('.case_commands_block')[0]), 3, function_obj);
  19787. }
  19788. }
  19789. casediv.find('.button_remove_command').on('click', function () {
  19790. for (var i = 0; i < command.cases.length; i++) {
  19791. if (switchcase == command.cases[i]) {
  19792. delete command.cases[i];
  19793. command.cases.splice(i, 1);
  19794. casediv.remove();
  19795. break;
  19796. }
  19797. }
  19798. });
  19799. }
  19800. function addHandlers(command, function_obj, switch_dom) {
  19801. switch_dom.find('.button_remove_command').on('click', function () {
  19802. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, switch_dom)) {
  19803. switch_dom.fadeOut(400, function () {
  19804. switch_dom.remove();
  19805. });
  19806. }
  19807. });
  19808. }
  19809. /***/ }),
  19810. /***/ "./js/visualUI/commands/variable_value_menu.js":
  19811. /*!*****************************************************!*\
  19812. !*** ./js/visualUI/commands/variable_value_menu.js ***!
  19813. \*****************************************************/
  19814. /*! exports provided: VAR_OR_VALUE_TYPES, renderMenu */
  19815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19816. "use strict";
  19817. __webpack_require__.r(__webpack_exports__);
  19818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VAR_OR_VALUE_TYPES", function() { return VAR_OR_VALUE_TYPES; });
  19819. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  19820. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19821. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19822. /* harmony import */ var _attribution__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attribution */ "./js/visualUI/commands/attribution.js");
  19823. /* harmony import */ var _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  19824. var VAR_OR_VALUE_TYPES = Object.freeze({
  19825. only_variable: 1,
  19826. only_value: 2,
  19827. only_function: 3,
  19828. variable_and_function: 4,
  19829. variable_and_value_opt: 5,
  19830. value_and_function: 6,
  19831. all: 7
  19832. });
  19833. function renderMenu(command, ref_object, dom_object, function_obj) {
  19834. var size_field = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
  19835. var expression_element = arguments.length > 5 ? arguments[5] : undefined;
  19836. // Verificar se o objeto atual trata-se de uma chamada de função e conferir se possui a quantidade correta de parâmetros
  19837. // Caso não possua, tem que adicionar as variáveis que servirão de parâmetros:
  19838. if (ref_object.function_called) {
  19839. if (ref_object.function_called.parameters_list) {
  19840. while (ref_object.function_called.parameters_list.length != ref_object.parameters_list.length) {
  19841. if (ref_object.parameters_list.length > ref_object.function_called.parameters_list.length) {
  19842. ref_object.parameters_list.pop();
  19843. } else {
  19844. ref_object.parameters_list.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true));
  19845. }
  19846. }
  19847. }
  19848. } // Verificar agora, quando trata-se de chamada de função, se a passagem de parâmetro é
  19849. // por referência ou por cópia:
  19850. var index_references = [];
  19851. if (ref_object.function_called) {
  19852. if (ref_object.function_called.parameters_list) {
  19853. for (var i = 0; i < ref_object.function_called.parameters_list.length; i++) {
  19854. if (ref_object.function_called.parameters_list[i].reference) {
  19855. index_references.push(i);
  19856. ref_object.parameters_list[i].reference = true;
  19857. ref_object.parameters_list[i].variable_and_value = VAR_OR_VALUE_TYPES.only_variable;
  19858. if (ref_object.parameters_list[i].column) ref_object.parameters_list[i].column.reference_parent = true;
  19859. if (ref_object.parameters_list[i].row) ref_object.parameters_list[i].row.reference_parent = true;
  19860. } else {
  19861. ref_object.parameters_list[i].reference = false;
  19862. ref_object.parameters_list[i].variable_and_value = VAR_OR_VALUE_TYPES.all;
  19863. if (ref_object.parameters_list[i].column) ref_object.parameters_list[i].column.reference_parent = false;
  19864. if (ref_object.parameters_list[i].row) ref_object.parameters_list[i].row.reference_parent = false;
  19865. }
  19866. ref_object.parameters_list[i].reference_dimensions = ref_object.function_called.parameters_list[i].dimensions;
  19867. }
  19868. }
  19869. }
  19870. 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">';
  19871. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_variable) {
  19872. 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">';
  19873. menu_var_or_value += "</div>";
  19874. }
  19875. 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) {
  19876. 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");
  19877. menu_var_or_value += '<div class="menu menu_only_vars">';
  19878. menu_var_or_value += "</div></div>";
  19879. }
  19880. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_value) {
  19881. menu_var_or_value = '<input type="text" class="width-dynamic" size="' + size_field + '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />';
  19882. }
  19883. 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) {
  19884. 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>";
  19885. }
  19886. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_function) {
  19887. 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">';
  19888. menu_var_or_value += "</div>";
  19889. }
  19890. 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) {
  19891. 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");
  19892. menu_var_or_value += '<div class="menu menu_only_functions">';
  19893. menu_var_or_value += "</div></div>";
  19894. /* if (command.type == Models.COMMAND_TYPES.attribution) {
  19895. menu_var_or_value += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19896. menu_var_or_value += '<div class="menu">';
  19897. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19898. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19899. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19900. menu_var_or_value += '</div></div>';
  19901. }*/
  19902. }
  19903. menu_var_or_value += "</div></div>";
  19904. menu_var_or_value = $(menu_var_or_value);
  19905. menu_var_or_value.find('.width-dynamic').on('input', function () {
  19906. var input_field = $(this);
  19907. var inputWidth = input_field.textWidth() + 10;
  19908. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  19909. input_field.css({
  19910. width: inputWidth
  19911. });
  19912. }).trigger('input');
  19913. dom_object.append(menu_var_or_value);
  19914. ref_object.dom_object = menu_var_or_value;
  19915. addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19916. addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  19917. addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  19918. addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  19919. if (ref_object.content || ref_object.function_called) {
  19920. if (ref_object.content) {
  19921. // Verificar se a variável ainda existe:
  19922. var variable_fun = isVarInProgram(ref_object.content, function_obj);
  19923. if (variable_fun) {
  19924. ref_object.content = variable_fun;
  19925. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  19926. } else {
  19927. if (ref_object.content && ref_object.content.type) {
  19928. ref_object.content = null;
  19929. appendSelectText(ref_object, menu_var_or_value);
  19930. } else {
  19931. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  19932. }
  19933. }
  19934. } else if (ref_object.function_called) {
  19935. // Verificar se a função ainda existe:
  19936. var ret_function = isFunctionInProgram(ref_object.function_called);
  19937. if (ret_function) {
  19938. ref_object.function_called = ret_function;
  19939. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  19940. } else {
  19941. ref_object.content = null;
  19942. ref_object.row = null;
  19943. ref_object.column = null;
  19944. delete ref_object.function_called;
  19945. delete ref_object.parameters_list;
  19946. appendSelectText(ref_object, menu_var_or_value);
  19947. }
  19948. }
  19949. } else {
  19950. appendSelectText(ref_object, menu_var_or_value);
  19951. }
  19952. }
  19953. function appendSelectText(ref_object, menu_var_or_value) {
  19954. // if (ref_object.reference_parent) {
  19955. // menu_var_or_value
  19956. // .find(".text")
  19957. // .append("<i>Opcional</i>");
  19958. // return;
  19959. // }
  19960. switch (ref_object.variable_and_value) {
  19961. case VAR_OR_VALUE_TYPES.only_variable:
  19962. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_var") + "</i>");
  19963. break;
  19964. case VAR_OR_VALUE_TYPES.all:
  19965. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  19966. break;
  19967. case VAR_OR_VALUE_TYPES.variable_and_function:
  19968. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  19969. break;
  19970. case VAR_OR_VALUE_TYPES.only_function:
  19971. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_function") + "</i>");
  19972. break;
  19973. }
  19974. }
  19975. function isFunctionInProgram(function_called_obj) {
  19976. if (function_called_obj.name) {
  19977. if (window.program_obj.functions) {
  19978. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19979. if (window.program_obj.functions[i] == function_called_obj) {
  19980. return window.program_obj.functions[i];
  19981. }
  19982. }
  19983. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19984. if (window.program_obj.functions[i].name == function_called_obj.name) {
  19985. return window.program_obj.functions[i];
  19986. }
  19987. }
  19988. }
  19989. } else if (function_called_obj.identifier) {
  19990. for (var i = 0; i < window.system_functions.length; i++) {
  19991. if (window.system_functions[i].identifier == function_called_obj.identifier) {
  19992. return window.system_functions[i];
  19993. }
  19994. }
  19995. }
  19996. return null;
  19997. }
  19998. function isVarInProgram(var_obj, function_obj) {
  19999. // Verify in locals:
  20000. if (function_obj.variables_list) {
  20001. for (var i = 0; i < function_obj.variables_list.length; i++) {
  20002. if (function_obj.variables_list[i] == var_obj) {
  20003. return function_obj.variables_list[i];
  20004. }
  20005. }
  20006. } // Verify in parameters:
  20007. if (function_obj.parameters_list) {
  20008. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  20009. if (function_obj.parameters_list[i] == var_obj) {
  20010. return function_obj.parameters_list[i];
  20011. }
  20012. }
  20013. } // Verify in globals:
  20014. if (window.program_obj.globals) {
  20015. for (var i = 0; i < window.program_obj.globals.length; i++) {
  20016. if (window.program_obj.globals[i] == var_obj) {
  20017. return window.program_obj.globals[i];
  20018. }
  20019. }
  20020. } // If not found, verify if the reference was lost
  20021. if (var_obj) {
  20022. if (function_obj.variables_list) {
  20023. for (var i = 0; i < function_obj.variables_list.length; i++) {
  20024. if (function_obj.variables_list[i].name == var_obj.name) {
  20025. return function_obj.variables_list[i];
  20026. }
  20027. }
  20028. }
  20029. if (function_obj.parameters_list) {
  20030. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  20031. if (function_obj.parameters_list[i].name == var_obj.name) {
  20032. return function_obj.parameters_list[i];
  20033. }
  20034. }
  20035. }
  20036. if (window.program_obj.globals) {
  20037. for (var i = 0; i < window.program_obj.globals.length; i++) {
  20038. if (window.program_obj.globals[i].name == var_obj.name) {
  20039. return window.program_obj.globals[i];
  20040. }
  20041. }
  20042. }
  20043. }
  20044. return null;
  20045. }
  20046. function renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element) {
  20047. if (ref_object.function_called) {
  20048. menu_var_or_value.remove();
  20049. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  20050. } else if (ref_object.content.type) {
  20051. menu_var_or_value.remove();
  20052. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  20053. } else {
  20054. menu_var_or_value.remove();
  20055. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  20056. }
  20057. }
  20058. function variableValueMenuCode(command, variable_obj, dom_object, function_obj, menu_var_or_value, expression_element) {
  20059. if (variable_obj.content || variable_obj.function_called) {
  20060. // Verificar se a variável ainda existe:
  20061. var var_fun = isVarInProgram(variable_obj.content, function_obj);
  20062. if (var_fun) {
  20063. variable_obj.content = var_fun;
  20064. } else {
  20065. if (variable_obj.content && variable_obj.content.type) {
  20066. variable_obj.content = null;
  20067. appendSelectText(variable_obj, menu_var_or_value);
  20068. }
  20069. }
  20070. } else {
  20071. appendSelectText(variable_obj, menu_var_or_value);
  20072. }
  20073. if (variable_obj.content == null && variable_obj.function_called == null) {
  20074. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20075. return;
  20076. }
  20077. var ret = "";
  20078. if (variable_obj.function_called) {
  20079. if (variable_obj.function_called.parameters_list == null || variable_obj.function_called.length == 0) {
  20080. menu_var_or_value.find(".text").text(" ");
  20081. dom_object.find(".menu_var_or_value_dom").remove();
  20082. var parameters_menu;
  20083. if (variable_obj.function_called.name) {
  20084. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  20085. } else {
  20086. 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>";
  20087. }
  20088. parameters_menu += "<span> ) </span></div>";
  20089. parameters_menu = $(parameters_menu);
  20090. dom_object.append(parameters_menu);
  20091. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20092. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20093. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20094. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20095. context_menu += '<div class="menu">';
  20096. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20097. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20098. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20099. context_menu += '</div></div>';
  20100. }*/
  20101. context_menu += "</div></div>";
  20102. context_menu = $(context_menu);
  20103. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  20104. context_menu.dropdown({
  20105. onChange: function onChange(value, text, $selectedItem) {
  20106. if ($selectedItem.data("clear")) {
  20107. dom_object.text("");
  20108. variable_obj.content = null;
  20109. variable_obj.row = null;
  20110. variable_obj.column = null;
  20111. delete variable_obj.function_called;
  20112. delete variable_obj.parameters_list;
  20113. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20114. }
  20115. if ($selectedItem.data("exp")) {
  20116. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20117. }
  20118. },
  20119. selectOnKeydown: false
  20120. });
  20121. } else {
  20122. menu_var_or_value.find(".text").text(" ");
  20123. dom_object.find(".menu_var_or_value_dom").remove();
  20124. var parameters_menu;
  20125. if (variable_obj.function_called.name) {
  20126. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  20127. } else {
  20128. 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>";
  20129. }
  20130. for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
  20131. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  20132. if (j + 1 != variable_obj.function_called.parameters_list.length) {
  20133. parameters_menu += " , ";
  20134. }
  20135. }
  20136. parameters_menu += "<span> ) </span></div>";
  20137. parameters_menu = $(parameters_menu);
  20138. dom_object.append(parameters_menu);
  20139. for (var _j = 0; _j < variable_obj.function_called.parameters_list.length; _j++) {
  20140. renderMenu(command, variable_obj.parameters_list[_j], parameters_menu.find(".parameter_" + _j), function_obj, 2, expression_element);
  20141. }
  20142. var _context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20143. _context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20144. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20145. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20146. context_menu += '<div class="menu">';
  20147. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20148. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20149. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20150. context_menu += '</div></div>';
  20151. }*/
  20152. _context_menu += "</div></div>";
  20153. _context_menu = $(_context_menu);
  20154. _context_menu.insertAfter(parameters_menu);
  20155. _context_menu.dropdown({
  20156. onChange: function onChange(value, text, $selectedItem) {
  20157. if ($selectedItem.data("clear")) {
  20158. dom_object.text("");
  20159. variable_obj.content = null;
  20160. variable_obj.row = null;
  20161. variable_obj.column = null;
  20162. delete variable_obj.function_called;
  20163. delete variable_obj.parameters_list;
  20164. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20165. }
  20166. if ($selectedItem.data("exp")) {
  20167. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20168. }
  20169. },
  20170. selectOnKeydown: false
  20171. });
  20172. }
  20173. } else if (variable_obj.content.type) {
  20174. var variable_render = "";
  20175. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  20176. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  20177. if (variable_obj.reference_dimensions >= 1) variable_render += '';else variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  20178. variable_render += "</div>";
  20179. variable_render = $(variable_render);
  20180. dom_object.append(variable_render);
  20181. var _context_menu2 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20182. _context_menu2 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20183. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20184. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20185. context_menu += '<div class="menu">';
  20186. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20187. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20188. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20189. context_menu += '</div></div>';
  20190. }*/
  20191. _context_menu2 += "</div></div>";
  20192. _context_menu2 = $(_context_menu2);
  20193. variable_render.append(_context_menu2);
  20194. _context_menu2.dropdown({
  20195. onChange: function onChange(value, text, $selectedItem) {
  20196. if ($selectedItem.data("clear")) {
  20197. dom_object.text("");
  20198. variable_obj.content = null;
  20199. variable_obj.row = null;
  20200. variable_obj.column = null;
  20201. delete variable_obj.function_called;
  20202. delete variable_obj.parameters_list;
  20203. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20204. }
  20205. if ($selectedItem.data("exp")) {
  20206. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20207. }
  20208. },
  20209. selectOnKeydown: false
  20210. });
  20211. if (!variable_obj.column) {
  20212. var temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20213. if (variable_obj.reference) temp.reference_parent = true;
  20214. variable_obj.column = temp;
  20215. }
  20216. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  20217. } else if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  20218. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  20219. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span>';
  20220. if (variable_obj.reference_dimensions == 0) variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ] </span>';
  20221. variable_render += "</div>";
  20222. variable_render = $(variable_render);
  20223. dom_object.append(variable_render);
  20224. var _context_menu3 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20225. _context_menu3 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20226. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20227. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20228. context_menu += '<div class="menu">';
  20229. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20230. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20231. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20232. context_menu += '</div></div>';
  20233. }*/
  20234. _context_menu3 += "</div></div>";
  20235. _context_menu3 = $(_context_menu3);
  20236. variable_render.append(_context_menu3);
  20237. _context_menu3.dropdown({
  20238. onChange: function onChange(value, text, $selectedItem) {
  20239. if ($selectedItem.data("clear")) {
  20240. dom_object.text("");
  20241. variable_obj.content = null;
  20242. variable_obj.row = null;
  20243. variable_obj.column = null;
  20244. delete variable_obj.function_called;
  20245. delete variable_obj.parameters_list;
  20246. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20247. }
  20248. if ($selectedItem.data("exp")) {
  20249. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20250. }
  20251. },
  20252. selectOnKeydown: false
  20253. });
  20254. if (!variable_obj.column) {
  20255. var temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20256. if (variable_obj.reference) temp.reference_parent = true;
  20257. variable_obj.column = temp;
  20258. }
  20259. if (!variable_obj.row) {
  20260. var temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20261. if (variable_obj.reference) temp.reference_parent = true;
  20262. variable_obj.row = temp;
  20263. }
  20264. variableValueMenuCode(command, variable_obj.row, $(variable_render.find(".row_container")), function_obj, menu_var_or_value, expression_element);
  20265. if (variable_obj.reference_dimensions == 1) {
  20266. variable_obj.column = null;
  20267. } else {
  20268. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  20269. }
  20270. } else {
  20271. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  20272. variable_render += "</div>";
  20273. variable_render = $(variable_render);
  20274. dom_object.append(variable_render);
  20275. var _context_menu4 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20276. _context_menu4 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20277. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  20278. console.log('dom_object6');
  20279. console.log(dom_object);
  20280. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20281. context_menu += '<div class="menu">';
  20282. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20283. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20284. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20285. context_menu += '</div></div>';
  20286. }*/
  20287. _context_menu4 += "</div></div>";
  20288. _context_menu4 = $(_context_menu4);
  20289. variable_render.append(_context_menu4);
  20290. _context_menu4.dropdown({
  20291. onChange: function onChange(value, text, $selectedItem) {
  20292. if ($selectedItem.data("clear")) {
  20293. dom_object.text("");
  20294. variable_obj.content = null;
  20295. variable_obj.row = null;
  20296. variable_obj.column = null;
  20297. delete variable_obj.function_called;
  20298. delete variable_obj.parameters_list;
  20299. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20300. }
  20301. if ($selectedItem.data("exp")) {
  20302. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20303. }
  20304. },
  20305. selectOnKeydown: false
  20306. });
  20307. }
  20308. } else {
  20309. var _variable_render;
  20310. _variable_render = '<div class="variable_rendered"> <span class="var_name">';
  20311. if (isNaN(variable_obj.content)) {
  20312. _variable_render += variable_obj.content.split(" ").join("&nbsp;");
  20313. } else {
  20314. _variable_render += variable_obj.content;
  20315. }
  20316. _variable_render += "</span>";
  20317. _variable_render += "</div>";
  20318. _variable_render = $(_variable_render);
  20319. dom_object.append(_variable_render);
  20320. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20321. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20322. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20323. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20324. context_menu += '<div class="menu">';
  20325. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20326. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20327. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20328. context_menu += '</div></div>';
  20329. }*/
  20330. context_menu += "</div></div>";
  20331. context_menu = $(context_menu);
  20332. if (variable_obj.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  20333. context_menu.insertAfter(_variable_render);
  20334. }
  20335. context_menu.dropdown({
  20336. onChange: function onChange(value, text, $selectedItem) {
  20337. if ($selectedItem.data("clear")) {
  20338. dom_object.text("");
  20339. variable_obj.content = null;
  20340. variable_obj.row = null;
  20341. variable_obj.column = null;
  20342. delete variable_obj.function_called;
  20343. delete variable_obj.parameters_list;
  20344. dom_object.find(".value_rendered").remove();
  20345. dom_object.find(".context_menu_clear").remove();
  20346. dom_object.find(".width-dynamic-minus").remove();
  20347. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20348. }
  20349. if ($selectedItem.data("exp")) {
  20350. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20351. }
  20352. },
  20353. selectOnKeydown: false
  20354. });
  20355. _variable_render.on("click", function (e) {
  20356. _variable_render.remove();
  20357. _variable_render.empty();
  20358. _variable_render.remove();
  20359. dom_object.empty();
  20360. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  20361. openInputToValue(command, variable_obj, dom_object, menu_var_or_value, function_obj, expression_element);
  20362. });
  20363. }
  20364. }
  20365. function addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  20366. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  20367. sub_menu.append('<div class="divider"></div><div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_header_ivprog_functions") + "</div>");
  20368. 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>');
  20369. 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>');
  20370. 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>');
  20371. 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:
  20372. for (var i = 0; i < window.system_functions.length; i++) {
  20373. var t = $('<div class="item"></div>');
  20374. t.data("function_reference", window.system_functions[i]);
  20375. t.data("option", VAR_OR_VALUE_TYPES.only_function);
  20376. t.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(window.system_functions[i].identifier));
  20377. switch (window.system_functions[i].category) {
  20378. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].math:
  20379. sub_menu.find(".menu_math_functions").append(t);
  20380. break;
  20381. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].text:
  20382. sub_menu.find(".menu_text_functions").append(t);
  20383. break;
  20384. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement:
  20385. sub_menu.find(".menu_arrangement_functions").append(t);
  20386. break;
  20387. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion:
  20388. sub_menu.find(".menu_conversion_functions").append(t);
  20389. break;
  20390. }
  20391. }
  20392. }
  20393. function addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  20394. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  20395. sub_menu.text("");
  20396. for (var i = 0; i < window.program_obj.functions.length; i++) {
  20397. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_function + '">' + window.program_obj.functions[i].name + " </div>");
  20398. temp.data("function_reference", window.program_obj.functions[i]);
  20399. sub_menu.append(temp);
  20400. }
  20401. }
  20402. function addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  20403. var sub_menu = menu_var_or_value.find(".menu_only_vars");
  20404. sub_menu.text("");
  20405. var is_there = false;
  20406. if (window.program_obj.globals) {
  20407. if (ref_object.include_constant) {
  20408. for (var i = 0; i < window.program_obj.globals.length; i++) {
  20409. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  20410. temp.data("variable_reference", window.program_obj.globals[i]);
  20411. sub_menu.append(temp);
  20412. is_there = true;
  20413. }
  20414. } else {
  20415. for (var i = 0; i < window.program_obj.globals.length; i++) {
  20416. if (!window.program_obj.globals[i].is_constant) {
  20417. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  20418. temp.data("variable_reference", window.program_obj.globals[i]);
  20419. sub_menu.append(temp);
  20420. is_there = true;
  20421. }
  20422. }
  20423. }
  20424. }
  20425. if (function_obj.parameters_list) {
  20426. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  20427. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.parameters_list[i].name + " </div>");
  20428. temp.data("variable_reference", function_obj.parameters_list[i]);
  20429. sub_menu.append(temp);
  20430. is_there = true;
  20431. }
  20432. }
  20433. if (function_obj.variables_list) {
  20434. for (var i = 0; i < function_obj.variables_list.length; i++) {
  20435. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.variables_list[i].name + " </div>");
  20436. temp.data("variable_reference", function_obj.variables_list[i]);
  20437. sub_menu.append(temp);
  20438. is_there = true;
  20439. }
  20440. }
  20441. if (!is_there) {
  20442. sub_menu.append($('<div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable") + "</div>"));
  20443. sub_menu.append($('<div class="item disabled">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable_instruction") + "</div>"));
  20444. }
  20445. }
  20446. function addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  20447. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  20448. menu_var_or_value.dropdown({
  20449. onChange: function onChange(value, text, $selectedItem) {
  20450. dom_object.find(".var_name").remove();
  20451. switch ($selectedItem.data("option")) {
  20452. case VAR_OR_VALUE_TYPES.only_function:
  20453. openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("function_reference"), expression_element);
  20454. break;
  20455. case VAR_OR_VALUE_TYPES.only_value:
  20456. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  20457. break;
  20458. case VAR_OR_VALUE_TYPES.only_variable:
  20459. openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("variable_reference"), expression_element);
  20460. break;
  20461. }
  20462. if ($selectedItem.data("exp")) {
  20463. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20464. }
  20465. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  20466. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20467. }
  20468. },
  20469. selectOnKeydown: false
  20470. });
  20471. }
  20472. dom_object.find(".width-dynamic").on("input", function () {
  20473. var inputWidth = $(this).textWidth() + 10;
  20474. $(this).focus();
  20475. var tmpStr = $(this).val();
  20476. $(this).val("");
  20477. $(this).val(tmpStr);
  20478. $(this).css({
  20479. width: inputWidth
  20480. });
  20481. }).trigger("input");
  20482. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  20483. dom_object.parent().on("click", function (e) {
  20484. dom_object.find(".value_rendered").remove();
  20485. dom_object.find(".value_rendered").empty();
  20486. dom_object.find(".value_rendered").remove();
  20487. dom_object.empty();
  20488. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  20489. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  20490. });
  20491. }
  20492. }
  20493. function openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, function_selected, expression_element) {
  20494. ref_object.function_called = function_selected;
  20495. ref_object.parameters_list = [];
  20496. if (function_selected.parameters_list != null && function_selected.parameters_list.length > 0) {
  20497. menu_var_or_value.find(".text").text(" ");
  20498. dom_object.find(".menu_var_or_value_dom").remove();
  20499. var parameters_menu;
  20500. if (function_selected.name) {
  20501. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  20502. } else {
  20503. 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>";
  20504. }
  20505. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  20506. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  20507. if (j + 1 != function_selected.parameters_list.length) {
  20508. parameters_menu += " , ";
  20509. }
  20510. }
  20511. parameters_menu += "<span> ) </span></div>";
  20512. parameters_menu = $(parameters_menu);
  20513. dom_object.append(parameters_menu);
  20514. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  20515. var temp;
  20516. if (function_selected.parameters_list[j].dimensions > 0) {
  20517. 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);
  20518. } else {
  20519. temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20520. }
  20521. if (function_selected.parameters_list[j].reference == true) {
  20522. temp.reference = true;
  20523. temp.variable_and_value = VAR_OR_VALUE_TYPES.only_variable;
  20524. } else {
  20525. temp.reference = false;
  20526. temp.variable_and_value = VAR_OR_VALUE_TYPES.all;
  20527. }
  20528. temp.reference_dimensions = function_selected.parameters_list[j].dimensions;
  20529. ref_object.parameters_list.push(temp);
  20530. renderMenu(command, temp, parameters_menu.find(".parameter_" + j), function_obj, 2, expression_element);
  20531. }
  20532. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20533. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20534. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20535. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20536. context_menu += '<div class="menu">';
  20537. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20538. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20539. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20540. context_menu += '</div></div>';
  20541. }*/
  20542. context_menu += "</div></div>";
  20543. context_menu = $(context_menu);
  20544. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  20545. context_menu.dropdown({
  20546. onChange: function onChange(value, text, $selectedItem) {
  20547. if ($selectedItem.data("clear")) {
  20548. dom_object.text("");
  20549. ref_object.content = null;
  20550. ref_object.row = null;
  20551. ref_object.column = null;
  20552. delete ref_object.function_called;
  20553. delete ref_object.parameters_list;
  20554. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  20555. }
  20556. if ($selectedItem.data("exp")) {
  20557. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20558. }
  20559. },
  20560. selectOnKeydown: false
  20561. });
  20562. } else {
  20563. menu_var_or_value.find(".text").text(" ");
  20564. dom_object.find(".menu_var_or_value_dom").remove();
  20565. var parameters_menu;
  20566. if (function_selected.name) {
  20567. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  20568. } else {
  20569. 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>";
  20570. }
  20571. parameters_menu += "<span> ) </span></div>";
  20572. parameters_menu = $(parameters_menu);
  20573. dom_object.append(parameters_menu);
  20574. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20575. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20576. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20577. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20578. context_menu += '<div class="menu">';
  20579. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20580. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20581. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20582. context_menu += '</div></div>';
  20583. }*/
  20584. context_menu += "</div></div>";
  20585. context_menu = $(context_menu);
  20586. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  20587. context_menu.dropdown({
  20588. onChange: function onChange(value, text, $selectedItem) {
  20589. if ($selectedItem.data("clear")) {
  20590. dom_object.text("");
  20591. ref_object.content = null;
  20592. ref_object.row = null;
  20593. ref_object.column = null;
  20594. delete ref_object.function_called;
  20595. delete ref_object.parameters_list;
  20596. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  20597. }
  20598. if ($selectedItem.data("exp")) {
  20599. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20600. }
  20601. },
  20602. selectOnKeydown: false
  20603. });
  20604. }
  20605. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20606. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  20607. }*/
  20608. }
  20609. function openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected, expression_element) {
  20610. ref_object.content = variable_selected;
  20611. menu_var_or_value.find(".text").text(" ");
  20612. dom_object.find(".menu_var_or_value_dom").remove();
  20613. var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_selected.name + "</span>";
  20614. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  20615. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  20616. }
  20617. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  20618. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span> ';
  20619. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  20620. }
  20621. variable_render += "</div>";
  20622. variable_render = $(variable_render);
  20623. dom_object.append(variable_render);
  20624. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  20625. var temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20626. if (ref_object.reference) temp.reference_parent = true;
  20627. ref_object.column = temp;
  20628. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  20629. }
  20630. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  20631. var temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20632. if (ref_object.reference) temp.reference_parent = true;
  20633. ref_object.row = temp;
  20634. renderMenu(command, ref_object.row, variable_render.find(".row_container"), function_obj, 2, expression_element);
  20635. var temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20636. if (ref_object.reference) temp.reference_parent = true;
  20637. ref_object.column = temp;
  20638. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  20639. }
  20640. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20641. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20642. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  20643. console.log("dom_object 10: ");
  20644. console.log(dom_object);
  20645. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20646. context_menu += '<div class="menu">';
  20647. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20648. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20649. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20650. context_menu += '</div></div>';
  20651. }*/
  20652. context_menu += "</div></div>";
  20653. context_menu = $(context_menu);
  20654. context_menu.insertAfter(dom_object.find(".variable_rendered"));
  20655. context_menu.dropdown({
  20656. onChange: function onChange(value, text, $selectedItem) {
  20657. if ($selectedItem.data("clear")) {
  20658. dom_object.text("");
  20659. ref_object.content = null;
  20660. ref_object.row = null;
  20661. ref_object.column = null;
  20662. delete ref_object.function_called;
  20663. delete ref_object.parameters_list;
  20664. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  20665. }
  20666. if ($selectedItem.data("exp")) {
  20667. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20668. }
  20669. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  20670. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageClearExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20671. }
  20672. },
  20673. selectOnKeydown: false
  20674. });
  20675. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20676. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected);
  20677. }*/
  20678. }
  20679. function openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  20680. if (ref_object.content == null) {
  20681. ref_object.content = "";
  20682. }
  20683. menu_var_or_value.find(".text").text(" ");
  20684. var field = $('<input type="text" size="2" class="width-dynamic-minus" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />');
  20685. field.insertBefore(dom_object.find(".menu_var_or_value_dom"));
  20686. field.on('input', function () {
  20687. var input_field = $(this);
  20688. var inputWidth = input_field.textWidth() + 10;
  20689. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  20690. input_field.css({
  20691. width: inputWidth
  20692. });
  20693. }).trigger('input');
  20694. var rendered = $('<div class="value_rendered"></div>');
  20695. rendered.insertBefore(field);
  20696. field.focus();
  20697. field.val(ref_object.content);
  20698. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20699. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20700. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20701. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20702. context_menu += '<div class="menu">';
  20703. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20704. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20705. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20706. context_menu += '</div></div>';
  20707. }*/
  20708. context_menu += "</div></div>";
  20709. context_menu = $(context_menu);
  20710. dom_object.find(".menu_var_or_value_dom").remove();
  20711. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  20712. context_menu.insertAfter(field);
  20713. }
  20714. context_menu.dropdown({
  20715. onChange: function onChange(value, text, $selectedItem) {
  20716. if ($selectedItem.data("clear")) {
  20717. dom_object.text("");
  20718. dom_object.find(".value_rendered").remove();
  20719. dom_object.find(".context_menu_clear").remove();
  20720. dom_object.find(".width-dynamic-minus").remove();
  20721. ref_object.content = null;
  20722. ref_object.row = null;
  20723. ref_object.column = null;
  20724. delete ref_object.function_called;
  20725. delete ref_object.parameters_list;
  20726. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  20727. }
  20728. if ($selectedItem.data("exp")) {
  20729. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20730. }
  20731. },
  20732. selectOnKeydown: false
  20733. });
  20734. dom_object.find(".width-dynamic-minus").focusout(function () {
  20735. /*if (
  20736. $(this)
  20737. .val()
  20738. .trim()
  20739. ) {
  20740. ref_object.content = $(this)
  20741. .val()
  20742. .trim();
  20743. }*/
  20744. ref_object.content = $(this).val();
  20745. if (isNaN(ref_object.content)) {
  20746. rendered.html(ref_object.content.split(" ").join("&nbsp;"));
  20747. } else {
  20748. rendered.text(ref_object.content);
  20749. }
  20750. $(this).remove();
  20751. });
  20752. dom_object.find(".width-dynamic-minus").on("keydown", function (e) {
  20753. var code = e.keyCode || e.which;
  20754. if (code == 13) {
  20755. /*if (
  20756. $(this)
  20757. .val()
  20758. .trim()
  20759. ) {
  20760. ref_object.content = $(this)
  20761. .val()
  20762. .trim();
  20763. }*/
  20764. ref_object.content = $(this).val();
  20765. if (isNaN(ref_object.content)) {
  20766. rendered.html(ref_object.content.split(" ").join("&nbsp;"));
  20767. } else {
  20768. rendered.text(ref_object.content);
  20769. }
  20770. $(this).remove();
  20771. }
  20772. if (code == 27) {
  20773. if (isNaN(ref_object.content)) {
  20774. rendered.html(ref_object.content.split(" ").join("&nbsp;"));
  20775. } else {
  20776. rendered.text(ref_object.content);
  20777. }
  20778. $(this).remove();
  20779. }
  20780. });
  20781. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  20782. /*rendered.parent().on('click', function(e) {
  20783. rendered.parent().off();
  20784. console.log("TTT14");
  20785. rendered.remove();
  20786. rendered.empty();
  20787. rendered.remove();
  20788. dom_object.empty();
  20789. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  20790. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element)
  20791. });*/
  20792. }
  20793. rendered.on("click", function (e) {
  20794. rendered.empty();
  20795. rendered.remove();
  20796. dom_object.empty();
  20797. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  20798. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  20799. });
  20800. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20801. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  20802. }*/
  20803. }
  20804. $.fn.textWidth = function (text, font) {
  20805. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $("<span>").hide().appendTo(document.body);
  20806. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr("placeholder")).css("font", font || this.css("font"));
  20807. return $.fn.textWidth.fakeEl.width();
  20808. };
  20809. /***/ }),
  20810. /***/ "./js/visualUI/commands/whiletrue.js":
  20811. /*!*******************************************!*\
  20812. !*** ./js/visualUI/commands/whiletrue.js ***!
  20813. \*******************************************/
  20814. /*! exports provided: createFloatingCommand, renderCommand */
  20815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20816. "use strict";
  20817. __webpack_require__.r(__webpack_exports__);
  20818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  20819. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  20820. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  20821. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  20822. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  20823. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  20824. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  20825. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  20826. function createFloatingCommand() {
  20827. 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>');
  20828. }
  20829. function renderCommand(command, function_obj) {
  20830. var ret = '';
  20831. ret += '<div class="ui whiletrue command_container"> <i class="ui icon small sync command_drag"></i> <i class="ui icon times red button_remove_command"></i><button class="ui icon button minimize_block_button tiny"><i class="icon window minimize"></i></button> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_while') + ' </span>';
  20832. ret += '<span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="textual_expression"></span> <span class="span_command_spec"> ) </span>';
  20833. ret += ' </span>';
  20834. ret += ' <i class="ui icon i cursor button_write_expression" style="margin-right: 1rem !important;"></i> <i class="ui icon unlock button_alternate_expression"></i> <div class="ui context_menu"></div>';
  20835. ret += '<div class="ui block_commands">';
  20836. ret += '</div>';
  20837. ret += '<span> </span>';
  20838. ret += '</div>';
  20839. var el = $(ret);
  20840. el.data('command', command);
  20841. el.find('.block_commands').data('command', command);
  20842. addHandlers(command, function_obj, el);
  20843. _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'));
  20844. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  20845. if (command.commands_block) {
  20846. for (var j = 0; j < command.commands_block.length; j++) {
  20847. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  20848. }
  20849. }
  20850. if (command.lockexpression) {
  20851. if (command.expression) {
  20852. try {
  20853. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  20854. if (text) {
  20855. $(el.find('.conditional_expression')[0]).toggle();
  20856. $(el.find('.textual_expression')[0]).text(text);
  20857. $(el.find('.textual_expression')[0]).toggle();
  20858. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  20859. }
  20860. } catch (e) {
  20861. command.lockexpression = false;
  20862. }
  20863. }
  20864. }
  20865. el.find('.unlock').popup({
  20866. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  20867. delay: {
  20868. show: 750,
  20869. hide: 0
  20870. }
  20871. });
  20872. el.find('.lock').popup({
  20873. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  20874. delay: {
  20875. show: 750,
  20876. hide: 0
  20877. }
  20878. });
  20879. el.find('.button_write_expression').popup({
  20880. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression"),
  20881. delay: {
  20882. show: 750,
  20883. hide: 0
  20884. }
  20885. });
  20886. return el;
  20887. }
  20888. function addHandlers(command, function_obj, whiletrue_dom) {
  20889. whiletrue_dom.find('.button_write_expression').on('click', function () {
  20890. window.expressionEdition = true;
  20891. window.inputExpression = null;
  20892. var afterWhichElement;
  20893. var lockButton = $(whiletrue_dom.find('.button_alternate_expression')[0]);
  20894. var editButton = $(this);
  20895. afterWhichElement = $(whiletrue_dom.find('.conditional_expression')[0]);
  20896. if (command.lockexpression) {
  20897. afterWhichElement = $(whiletrue_dom.find('.textual_expression')[0]);
  20898. }
  20899. var text = "";
  20900. if (command.expression) {
  20901. if (command.expression.length == 1 && command.expression[0].content == null && !command.expression[0].function_called) {
  20902. text = "";
  20903. } else {
  20904. try {
  20905. text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  20906. } catch (ex) {
  20907. text = "";
  20908. }
  20909. }
  20910. }
  20911. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  20912. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  20913. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  20914. input.val(text);
  20915. input.focusout(function (evt) {
  20916. console.log('focosout event!');
  20917. ok_button.click();
  20918. evt.preventDefault();
  20919. return true;
  20920. });
  20921. input.keyup(function (evt) {
  20922. if (evt.keyCode == 27) {
  20923. // esc
  20924. cancel_button.click();
  20925. }
  20926. if (evt.keyCode == 13) {
  20927. // enter
  20928. ok_button.click();
  20929. }
  20930. });
  20931. ok_button.click(function () {
  20932. var parsed = null;
  20933. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](input.val(), function_obj, input);
  20934. if (parsed) {
  20935. window.expressionEdition = false;
  20936. command.expression = parsed;
  20937. renderAlgorithm();
  20938. }
  20939. });
  20940. cancel_button.mousedown(function (evt) {
  20941. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](text, function_obj, input);
  20942. if (parsed) {
  20943. window.expressionEdition = false;
  20944. command.expression = parsed;
  20945. renderAlgorithm();
  20946. }
  20947. });
  20948. input.insertAfter(afterWhichElement);
  20949. input.focus();
  20950. cancel_button.insertAfter(input);
  20951. ok_button.insertAfter(input);
  20952. var len = text.length;
  20953. input[0].setSelectionRange(len, len);
  20954. afterWhichElement.css('display', 'none');
  20955. lockButton.css('display', 'none');
  20956. editButton.css('display', 'none');
  20957. ok_button.popup({
  20958. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  20959. delay: {
  20960. show: 750,
  20961. hide: 0
  20962. }
  20963. });
  20964. cancel_button.popup({
  20965. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  20966. delay: {
  20967. show: 750,
  20968. hide: 0
  20969. }
  20970. });
  20971. });
  20972. whiletrue_dom.find('.minimize_block_button').on('click', function (evt) {
  20973. whiletrue_dom.children('.ui.block_commands').toggle();
  20974. command.collapsed = !command.collapsed;
  20975. });
  20976. $(whiletrue_dom.find('.textual_expression')[0]).toggle();
  20977. whiletrue_dom.find('.button_alternate_expression').on('click', function () {
  20978. if (command.expression) {
  20979. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  20980. if (text) {
  20981. $(whiletrue_dom.find('.conditional_expression')[0]).toggle();
  20982. $(whiletrue_dom.find('.textual_expression')[0]).text(text);
  20983. $(whiletrue_dom.find('.textual_expression')[0]).toggle();
  20984. $(this).toggleClass('unlock').toggleClass('lock');
  20985. command.lockexpression = !command.lockexpression;
  20986. }
  20987. }
  20988. if (command.lockexpression) {
  20989. whiletrue_dom.find('.lock').popup({
  20990. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  20991. delay: {
  20992. show: 750,
  20993. hide: 0
  20994. }
  20995. });
  20996. } else {
  20997. whiletrue_dom.find('.unlock').popup({
  20998. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  20999. delay: {
  21000. show: 750,
  21001. hide: 0
  21002. }
  21003. });
  21004. }
  21005. });
  21006. whiletrue_dom.find('.button_remove_command').on('click', function () {
  21007. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, whiletrue_dom)) {
  21008. whiletrue_dom.fadeOut(400, function () {
  21009. whiletrue_dom.remove();
  21010. });
  21011. }
  21012. });
  21013. }
  21014. /***/ }),
  21015. /***/ "./js/visualUI/commands/writer.js":
  21016. /*!****************************************!*\
  21017. !*** ./js/visualUI/commands/writer.js ***!
  21018. \****************************************/
  21019. /*! exports provided: createFloatingCommand, renderCommand, addContent */
  21020. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21021. "use strict";
  21022. __webpack_require__.r(__webpack_exports__);
  21023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  21024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  21025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContent", function() { return addContent; });
  21026. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  21027. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  21028. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  21029. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  21030. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  21031. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  21032. function createFloatingCommand() {
  21033. 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>");
  21034. }
  21035. function renderCommand(command, function_obj) {
  21036. var ret = "<div class=\"ui writer command_container\">\n <i class=\"ui icon small upload command_drag\"></i>\n <i class=\"ui icon times red button_remove_command\"></i>\n <span class=\"span_command_spec\">".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_command_write"), "\n ( </span><div class=\"all_elements_write\"></div> <span class=\"textual_expression\"></span>\n <span class=\"close_parentheses span_command_spec\">)</span>\n <img data-state=\"").concat(command.newline ? "on" : "false", "\" src=\"").concat(command.newline ? "img/new_line.svg" : "img/no_new_line.svg", "\" class=\"ivprog_newline_btn\"/> \n <i class=\"ui icon i cursor button_write_expression\" style=\"margin-left: 3rem !important; margin-right: -1.1rem !important;\"></i> \n <i class=\"ui icon unlock button_alternate_expression\"></i>\n </div>");
  21037. var el = $(ret);
  21038. el.data("command", command); //renderExpression (command, function_obj, div_to_render, expression_array)
  21039. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find(".all_elements_write"), command.content);
  21040. addHandlers(command, function_obj, el);
  21041. if (command.content && command.lockexpression) {
  21042. try {
  21043. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.content);
  21044. if (text) {
  21045. $(el.find('.all_elements_write')[0]).toggle();
  21046. $(el.find('.textual_expression')[0]).text(text);
  21047. $(el.find('.textual_expression')[0]).toggle();
  21048. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  21049. }
  21050. } catch (e) {
  21051. command.lockexpression = false;
  21052. }
  21053. }
  21054. el.find('.unlock').popup({
  21055. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  21056. delay: {
  21057. show: 750,
  21058. hide: 0
  21059. }
  21060. });
  21061. el.find('.lock').popup({
  21062. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  21063. delay: {
  21064. show: 750,
  21065. hide: 0
  21066. }
  21067. });
  21068. el.find('.button_write_expression').popup({
  21069. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression"),
  21070. delay: {
  21071. show: 750,
  21072. hide: 0
  21073. }
  21074. });
  21075. return el;
  21076. }
  21077. function addHandlersManager(command, _function_obj, _writer_dom, item_div, content_element) {
  21078. item_div.find(".times").on("click", function () {
  21079. for (var i = 0; i < command.content.length; i++) {
  21080. if (command.content[i] == content_element) {
  21081. delete command.content[i];
  21082. command.content.splice(i, 1);
  21083. item_div.children().off();
  21084. item_div.off();
  21085. item_div.fadeOut();
  21086. if (command.content.length > 0) {
  21087. item_div.next(".icon_add_item_to_writer").fadeOut();
  21088. }
  21089. break;
  21090. }
  21091. }
  21092. });
  21093. }
  21094. function addHandlers(command, function_obj, writer_dom) {
  21095. $(writer_dom.find('.textual_expression')[0]).toggle();
  21096. writer_dom.find('.button_write_expression').on('click', function () {
  21097. window.expressionEdition = true;
  21098. window.inputExpression = null;
  21099. var afterWhichElement;
  21100. var lockButton = $(writer_dom.find('.button_alternate_expression')[0]);
  21101. var editButton = $(this);
  21102. afterWhichElement = writer_dom.find('.all_elements_write');
  21103. if (command.lockexpression) {
  21104. afterWhichElement = writer_dom.find('.textual_expression');
  21105. }
  21106. var text = "";
  21107. if (command.content) {
  21108. if (command.content.length == 1 && command.content[0].content == null && !command.content[0].function_called) {
  21109. text = "";
  21110. } else {
  21111. try {
  21112. text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.content);
  21113. } catch (ex) {
  21114. text = "";
  21115. }
  21116. }
  21117. }
  21118. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  21119. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  21120. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  21121. input.val(text);
  21122. input.focusout(function (evt) {
  21123. ok_button.click();
  21124. evt.preventDefault();
  21125. return true;
  21126. });
  21127. input.keyup(function (evt) {
  21128. if (evt.keyCode == 27) {
  21129. // esc
  21130. cancel_button.click();
  21131. }
  21132. if (evt.keyCode == 13) {
  21133. // enter
  21134. ok_button.click();
  21135. }
  21136. });
  21137. ok_button.click(function () {
  21138. var parsed = null;
  21139. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](input.val(), function_obj, input);
  21140. if (parsed) {
  21141. window.expressionEdition = false;
  21142. command.content = parsed;
  21143. renderAlgorithm();
  21144. }
  21145. });
  21146. cancel_button.mousedown(function (evt) {
  21147. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](text, function_obj, input);
  21148. if (parsed) {
  21149. window.expressionEdition = false;
  21150. command.content = parsed;
  21151. renderAlgorithm();
  21152. }
  21153. });
  21154. input.insertAfter(afterWhichElement);
  21155. input.focus();
  21156. cancel_button.insertAfter(input);
  21157. ok_button.insertAfter(input);
  21158. var len = text.length;
  21159. input[0].setSelectionRange(len, len);
  21160. afterWhichElement.css('display', 'none');
  21161. lockButton.css('display', 'none');
  21162. editButton.css('display', 'none');
  21163. ok_button.popup({
  21164. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  21165. delay: {
  21166. show: 750,
  21167. hide: 0
  21168. }
  21169. });
  21170. cancel_button.popup({
  21171. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  21172. delay: {
  21173. show: 750,
  21174. hide: 0
  21175. }
  21176. });
  21177. });
  21178. writer_dom.find('.button_alternate_expression').on('click', function () {
  21179. if (command.content) {
  21180. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.content);
  21181. if (text) {
  21182. $(writer_dom.find('.all_elements_write')[0]).toggle();
  21183. $(writer_dom.find('.textual_expression')[0]).text(text);
  21184. $(writer_dom.find('.textual_expression')[0]).toggle();
  21185. $(this).toggleClass('unlock').toggleClass('lock');
  21186. command.lockexpression = !command.lockexpression;
  21187. }
  21188. if (command.lockexpression) {
  21189. writer_dom.find('.lock').popup({
  21190. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  21191. delay: {
  21192. show: 750,
  21193. hide: 0
  21194. }
  21195. });
  21196. } else {
  21197. writer_dom.find('.unlock').popup({
  21198. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  21199. delay: {
  21200. show: 750,
  21201. hide: 0
  21202. }
  21203. });
  21204. }
  21205. }
  21206. });
  21207. writer_dom.find(".button_remove_command").on("click", function () {
  21208. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, writer_dom)) {
  21209. writer_dom.fadeOut(400, function () {
  21210. writer_dom.remove();
  21211. });
  21212. }
  21213. });
  21214. Sortable.create(writer_dom.find(".all_elements_write")[0], {
  21215. handle: ".ellipsis",
  21216. animation: 100,
  21217. ghostClass: "ghost",
  21218. group: "writer_" + Math.floor(Math.random() * 10000000),
  21219. draggable: ".div_parent_handler",
  21220. onEnd: function onEnd(evt) {
  21221. command.content.splice(evt.newIndex, 0, command.content.splice(evt.oldIndex, 1)[0]);
  21222. writer_dom.empty();
  21223. writer_dom.replaceWith(renderCommand(command, function_obj));
  21224. }
  21225. }); // Attach event handles for the newline button
  21226. var newlineBtn = writer_dom.find(".ivprog_newline_btn");
  21227. newlineBtn.on("click", function () {
  21228. var state = this.dataset.state;
  21229. if (state === "on") {
  21230. this.dataset.state = "off";
  21231. command.newline = false;
  21232. this.setAttribute("src", "img/no_new_line.svg");
  21233. } else {
  21234. this.dataset.state = "on";
  21235. command.newline = true;
  21236. this.setAttribute("src", "img/new_line.svg");
  21237. }
  21238. writer_dom.data("command", command);
  21239. setPopup(newlineBtn, command.newline);
  21240. }); // Attach jquery popup
  21241. setPopup(newlineBtn, command.newline);
  21242. }
  21243. function setPopup(element, state) {
  21244. if (element.popup("exists")) {
  21245. element.popup("destroy");
  21246. }
  21247. 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");
  21248. element.popup({
  21249. content: content,
  21250. delay: {
  21251. show: 750,
  21252. hide: 0
  21253. }
  21254. });
  21255. }
  21256. function _addHandlerIconAdd(dom_object, command, function_obj) {
  21257. var insert_after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  21258. var after_which = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  21259. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  21260. if (!insert_after) {
  21261. dom_object.append(icon_add_item);
  21262. } else {
  21263. icon_add_item.insertAfter(after_which);
  21264. }
  21265. icon_add_item.on("click", function (_event) {
  21266. var div_parent_with_handler = $('<div class="div_parent_handler" style="display:none;"></div>');
  21267. var new_div_item = $('<div class="var_value_menu_div"></div>');
  21268. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  21269. div_parent_with_handler.append(new_div_item);
  21270. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  21271. div_parent_with_handler.insertAfter(icon_add_item);
  21272. 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);
  21273. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  21274. addHandlerIconAdd(dom_object, command, function_obj, true, div_parent_with_handler);
  21275. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  21276. var pos = 1;
  21277. dom_object.find(".icon_add_item_to_writer").each(function () {
  21278. if ($(this).get(0) === icon_add_item.get(0)) {
  21279. command.content.splice(pos, 0, new_related_menu);
  21280. } else {
  21281. pos++;
  21282. }
  21283. });
  21284. if (command.content.length == 1) {
  21285. icon_add_item.remove();
  21286. }
  21287. div_parent_with_handler.fadeIn();
  21288. });
  21289. }
  21290. function addContent(command, _ref_object, dom_object, _menu_var_or_value, function_obj, _ref_object_content) {
  21291. if (dom_object.hasClass("var_value_menu_div")) {
  21292. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  21293. icon_add_item.insertAfter(dom_object);
  21294. icon_add_item.on("click", function (_event) {
  21295. var div_parent_with_handler = $('<div class="div_parent_handler"></div>');
  21296. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  21297. div_parent_with_handler.append(new_div_item);
  21298. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  21299. div_parent_with_handler.insertAfter(icon_add_item);
  21300. 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);
  21301. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  21302. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  21303. command.content.push(new_related_menu);
  21304. if (command.content.length == 1) {
  21305. icon_add_item.remove();
  21306. }
  21307. });
  21308. }
  21309. }
  21310. /***/ }),
  21311. /***/ "./js/visualUI/functions.js":
  21312. /*!**********************************!*\
  21313. !*** ./js/visualUI/functions.js ***!
  21314. \**********************************/
  21315. /*! exports provided: renderFunction, initVisualUI, setTestCases, getTestCases, addFunctionChangeListener, addGlobalChangeListener, removeGlobalListener, removeFunctionListener */
  21316. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21317. "use strict";
  21318. __webpack_require__.r(__webpack_exports__);
  21319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderFunction", function() { return renderFunction; });
  21320. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return initVisualUI; });
  21321. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestCases", function() { return setTestCases; });
  21322. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return getTestCases; });
  21323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return addFunctionChangeListener; });
  21324. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return addGlobalChangeListener; });
  21325. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return removeGlobalListener; });
  21326. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return removeFunctionListener; });
  21327. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  21328. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  21329. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  21330. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  21331. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variables */ "./js/visualUI/variables.js");
  21332. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands */ "./js/visualUI/commands.js");
  21333. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./code_generator */ "./js/visualUI/code_generator.js");
  21334. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  21335. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  21336. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  21337. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  21338. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__);
  21339. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  21340. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  21341. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  21342. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  21343. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  21344. /* harmony import */ var _ima_version_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../.ima_version.json */ "./.ima_version.json");
  21345. var _ima_version_json__WEBPACK_IMPORTED_MODULE_16___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./../../.ima_version.json */ "./.ima_version.json", 1);
  21346. /* harmony import */ var _text_editor__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./text_editor */ "./js/visualUI/text_editor.js");
  21347. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  21348. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../processor/modes */ "./js/processor/modes.ts");
  21349. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_processor_modes__WEBPACK_IMPORTED_MODULE_19__);
  21350. var counter_new_functions = 0;
  21351. var counter_new_parameters = 0;
  21352. var ivprog_version = _ima_version_json__WEBPACK_IMPORTED_MODULE_16__.version;
  21353. var globalChangeListeners = [];
  21354. var functionsChangeListeners = [];
  21355. var proc = null;
  21356. var domConsole = null;
  21357. var _testCases = [];
  21358. var isRunning = false;
  21359. window.studentGrade = null;
  21360. window.LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"];
  21361. var program = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Program"]();
  21362. window.system_functions = []; // Adding math functions:
  21363. 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));
  21364. 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));
  21365. 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));
  21366. 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));
  21367. 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));
  21368. 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));
  21369. 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));
  21370. 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));
  21371. 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));
  21372. 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));
  21373. 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));
  21374. 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:
  21375. 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));
  21376. 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));
  21377. 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));
  21378. 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));
  21379. 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:
  21380. 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));
  21381. 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));
  21382. 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:
  21383. 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));
  21384. 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));
  21385. 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));
  21386. 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));
  21387. 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));
  21388. 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));
  21389. 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));
  21390. 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));
  21391. 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');
  21392. 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);
  21393. mainFunction.function_comment = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Comment"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment_main'));
  21394. program.addFunction(mainFunction);
  21395. window.program_obj = program;
  21396. window.generator = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"];
  21397. window.runCodeAssessment = runCodeAssessment;
  21398. window.renderAlgorithm = _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"];
  21399. window.insertContext = false;
  21400. window.watchW = melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a;
  21401. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.globals, function () {
  21402. if (window.insertContext) {
  21403. setTimeout(function () {
  21404. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  21405. globalChangeListeners.forEach(function (x) {
  21406. return x();
  21407. });
  21408. }, 300);
  21409. window.insertContext = false;
  21410. } else {
  21411. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  21412. globalChangeListeners.forEach(function (x) {
  21413. return x();
  21414. });
  21415. }
  21416. }, 1);
  21417. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.functions, function () {
  21418. if (window.insertContext) {
  21419. setTimeout(function () {
  21420. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  21421. functionsChangeListeners.forEach(function (x) {
  21422. return x();
  21423. });
  21424. }, 300);
  21425. window.insertContext = false;
  21426. } else {
  21427. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  21428. functionsChangeListeners.forEach(function (x) {
  21429. return x();
  21430. });
  21431. }
  21432. }, 1);
  21433. function addFunctionHandler() {
  21434. 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')));
  21435. program.addFunction(new_function);
  21436. counter_new_functions++;
  21437. window.insertContext = true;
  21438. 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);
  21439. renderFunction(new_function);
  21440. /*newe.css('display', 'none');
  21441. newe.fadeIn();*/
  21442. }
  21443. function addParameter(function_obj, function_container
  21444. /*, is_from_click = false*/
  21445. ) {
  21446. if (function_obj.parameters_list == null) {
  21447. function_obj.parameters_list = [];
  21448. }
  21449. 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);
  21450. function_obj.parameters_list.push(new_parameter);
  21451. counter_new_parameters++;
  21452. 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);
  21453. renderParameter(function_obj, new_parameter, function_container); // if (is_from_click) {
  21454. // newe.css('display', 'none');
  21455. // newe.fadeIn();
  21456. // }
  21457. }
  21458. function updateReturnType(function_obj, new_type) {
  21459. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  21460. 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);
  21461. function_obj.return_type = new_type;
  21462. function_obj.return_dimensions = new_dimensions;
  21463. }
  21464. function removeFunction(function_obj) {
  21465. var index = program.functions.indexOf(function_obj);
  21466. if (index > -1) {
  21467. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION);
  21468. program.functions.splice(index, 1);
  21469. }
  21470. }
  21471. function minimizeFunction(function_obj) {
  21472. function_obj.is_hidden = !function_obj.is_hidden;
  21473. }
  21474. function addHandlers(function_obj, function_container) {
  21475. function_container.find('.ui.dropdown.function_return').dropdown({
  21476. onChange: function onChange(value, text, $selectedItem) {
  21477. if ($selectedItem.data('dimensions')) {
  21478. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  21479. } else {
  21480. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  21481. }
  21482. },
  21483. selectOnKeydown: false
  21484. });
  21485. function_container.find(".name_function_updated").on('click', function (e) {
  21486. enableNameFunctionUpdate(function_obj, function_container);
  21487. });
  21488. function_container.find(".add_parameter_button").on('click', function (e) {
  21489. window.insertContext = true;
  21490. addParameter(function_obj, function_container, true);
  21491. });
  21492. function_container.find('.menu_commands').dropdown({
  21493. on: 'hover'
  21494. });
  21495. function_container.find('.menu_commands a').on('click', function (evt) {
  21496. if (function_obj.commands == null || function_obj.commands.length == 0) {
  21497. function_obj.commands = [];
  21498. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_5__["genericCreateCommand"]($(this).data('command'));
  21499. function_obj.commands.push(new_cmd);
  21500. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](new_cmd, function_container.find('.commands_list_div'), 3, function_obj);
  21501. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, $(this).data('command'), '/', 0);
  21502. } else {
  21503. _commands__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"](function_obj, function_container, $(this).data('command'), evt);
  21504. }
  21505. });
  21506. function_container.find('.add_var_button_function').on('click', function (e) {
  21507. window.insertContext = true;
  21508. _variables__WEBPACK_IMPORTED_MODULE_4__["addVariable"](function_obj, function_container, true);
  21509. });
  21510. function_container.find('.remove_function_button').on('click', function (e) {
  21511. removeFunction(function_obj);
  21512. function_container.fadeOut();
  21513. });
  21514. function_container.find('.minimize_function_button').on('click', function (e) {
  21515. minimizeFunction(function_obj);
  21516. if (function_obj.is_hidden) {
  21517. function_container.find(".add_var_button_function").toggle();
  21518. function_container.find(".inline_add_command").toggle();
  21519. function_container.find(".function_area").slideToggle();
  21520. } else {
  21521. function_container.find(".function_area").slideToggle(function () {
  21522. function_container.find(".add_var_button_function").toggle();
  21523. function_container.find(".inline_add_command").toggle();
  21524. });
  21525. }
  21526. });
  21527. } // Essa função imprime o tipo de retorno da função e cria o menu do tipo 'select' para alteração
  21528. function renderFunctionReturn(function_obj, function_element) {
  21529. var ret = '<div class="ui dropdown function_return">';
  21530. if (function_obj.return_dimensions == 1) {
  21531. 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()));
  21532. ret += ' [ ] </div>';
  21533. } else if (function_obj.return_dimensions == 2) {
  21534. 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()));
  21535. ret += ' [ ] [ ] </div>';
  21536. } else {
  21537. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase())) + '</div>';
  21538. }
  21539. ret += '<div class="menu">';
  21540. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21541. 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>';
  21542. }
  21543. 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">';
  21544. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21545. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21546. continue;
  21547. }
  21548. 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>';
  21549. }
  21550. ret += '</div></div>';
  21551. 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">';
  21552. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21553. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21554. continue;
  21555. }
  21556. 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>';
  21557. }
  21558. ret += '</div></div>';
  21559. ret += '</div></div>';
  21560. ret = $(ret);
  21561. function_element.find('.function_return').append(ret);
  21562. }
  21563. var cont = 0;
  21564. function renderFunction(function_obj) {
  21565. var appender = '<div class="ui secondary segment function_div list-group-item function_cont_' + cont + '">';
  21566. if (function_obj.function_comment) {//appender += renderComment(function_obj.function_comment, sequence, true, -1);
  21567. }
  21568. appender += '<span class="glyphicon glyphicon-move move_function" aria-hidden="true"><i class="icon sort alternate vertical"></i></span>';
  21569. 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>';
  21570. appender += '<div class="function_signature_div">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + ' ';
  21571. if (function_obj.is_main) {
  21572. 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">';
  21573. } else {
  21574. appender += '<div class="ui function_return"></div>';
  21575. 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">';
  21576. }
  21577. appender += '</div> <span class="parethesis_function"> ) </span> </div>' + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ');
  21578. appender += '<div class="ui add_var_context add_var_button_function" style="float: left;"> <div class="ui icon button purple"> ';
  21579. 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>';
  21580. appender += '</div></div>';
  21581. appender += '<div class="ui top attached segment variables_list_div"></div>';
  21582. 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;">';
  21583. 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"> ';
  21584. 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>';
  21585. appender += '</div></div>' + '</div>';
  21586. appender += '</div></div>';
  21587. appender = $(appender);
  21588. $('.all_functions').append(appender);
  21589. appender.data('fun', function_obj);
  21590. appender.find('.commands_list_div').data('fun', function_obj);
  21591. renderFunctionReturn(function_obj, appender);
  21592. addHandlers(function_obj, appender); // Rendering parameters:
  21593. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  21594. renderParameter(function_obj, function_obj.parameters_list[j], appender);
  21595. } // Rendering variables:
  21596. for (var j = 0; j < function_obj.variables_list.length; j++) {
  21597. _variables__WEBPACK_IMPORTED_MODULE_4__["renderVariable"](appender, function_obj.variables_list[j], function_obj);
  21598. } // Rendering commands:
  21599. for (var j = 0; j < function_obj.commands.length; j++) {
  21600. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](function_obj.commands[j], $(appender.find('.commands_list_div')[0]), 3, function_obj);
  21601. }
  21602. appender.find('.minimize_function_button').popup({
  21603. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_hide_function"),
  21604. delay: {
  21605. show: 750,
  21606. hide: 0
  21607. }
  21608. });
  21609. appender.find('.move_function').popup({
  21610. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("btn_drag_and_drop_function"),
  21611. delay: {
  21612. show: 1000,
  21613. hide: 0
  21614. }
  21615. });
  21616. appender.find('.remove_function_button').popup({
  21617. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("btn_delete_function"),
  21618. delay: {
  21619. show: 750,
  21620. hide: 0
  21621. }
  21622. });
  21623. appender.find('.add_var_button_function').popup({
  21624. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("btn_add_var"),
  21625. delay: {
  21626. show: 750,
  21627. hide: 0
  21628. }
  21629. });
  21630. appender.find('a[data-command="attribution"]').popup({
  21631. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_attribution"),
  21632. position: 'right center',
  21633. delay: {
  21634. show: 750,
  21635. hide: 0
  21636. }
  21637. });
  21638. appender.find('a[data-command="functioncall"]').popup({
  21639. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_call_function"),
  21640. position: 'right center',
  21641. delay: {
  21642. show: 750,
  21643. hide: 0
  21644. }
  21645. });
  21646. appender.find('a[data-command="iftrue"]').popup({
  21647. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_if_else"),
  21648. position: 'right center',
  21649. delay: {
  21650. show: 750,
  21651. hide: 0
  21652. }
  21653. });
  21654. appender.find('a[data-command="comment"]').popup({
  21655. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_comments"),
  21656. position: 'right center',
  21657. delay: {
  21658. show: 750,
  21659. hide: 0
  21660. }
  21661. });
  21662. appender.find('a[data-command="reader"]').popup({
  21663. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_read"),
  21664. position: 'right center',
  21665. delay: {
  21666. show: 750,
  21667. hide: 0
  21668. }
  21669. });
  21670. appender.find('a[data-command="writer"]').popup({
  21671. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_write"),
  21672. position: 'right center',
  21673. delay: {
  21674. show: 750,
  21675. hide: 0
  21676. }
  21677. });
  21678. appender.find('a[data-command="repeatNtimes"]').popup({
  21679. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_repeat_n_times"),
  21680. position: 'right center',
  21681. delay: {
  21682. show: 750,
  21683. hide: 0
  21684. }
  21685. });
  21686. appender.find('a[data-command="whiletrue"]').popup({
  21687. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_repeat_whiletrue"),
  21688. position: 'right center',
  21689. delay: {
  21690. show: 750,
  21691. hide: 0
  21692. }
  21693. });
  21694. appender.find('a[data-command="dowhiletrue"]').popup({
  21695. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_repeat_dowhiletrue"),
  21696. position: 'right center',
  21697. delay: {
  21698. show: 750,
  21699. hide: 0
  21700. }
  21701. });
  21702. appender.find('a[data-command="switch"]').popup({
  21703. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_repeat_switch"),
  21704. position: 'right center',
  21705. delay: {
  21706. show: 750,
  21707. hide: 0
  21708. }
  21709. });
  21710. appender.find('a[data-command="return"]').popup({
  21711. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_menu_repeat_return"),
  21712. position: 'right center',
  21713. delay: {
  21714. show: 750,
  21715. hide: 0
  21716. }
  21717. });
  21718. var function_index = program.functions.indexOf(function_obj);
  21719. Sortable.create(appender.find(".variables_list_div")[0], {
  21720. handle: '.ellipsis',
  21721. animation: 100,
  21722. ghostClass: 'ghost',
  21723. group: 'local_vars_drag_' + function_index,
  21724. onEnd: function onEnd(evt) {
  21725. updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
  21726. }
  21727. });
  21728. addSortableHandler(appender.find(".commands_list_div")[0], function_index);
  21729. if (!function_obj.is_main) {
  21730. Sortable.create(appender.find(".container_parameters_list")[0], {
  21731. handle: '.ellipsis',
  21732. animation: 100,
  21733. ghostClass: 'ghost',
  21734. group: 'parameters_drag_' + program.functions.indexOf(function_obj),
  21735. onEnd: function onEnd(evt) {
  21736. updateSequenceParameters(evt.oldIndex, evt.newIndex, function_obj);
  21737. }
  21738. });
  21739. }
  21740. if (function_obj.commands.length > 0) {
  21741. var teste = '.ui.sticky.sticky_cont_' + cont;
  21742. $(teste).sticky({
  21743. context: '.ui.bottom.attached.segment.commands_list_div.commands_cont_' + cont,
  21744. scrollContext: '.ivprog_visual_panel',
  21745. observeChanges: true,
  21746. offset: 40,
  21747. onStick: function onStick(evt) {
  21748. $(teste).css('top', '20px', 'important');
  21749. },
  21750. onBottom: function onBottom(evt) {
  21751. $(teste).css('top', '20px', 'important');
  21752. },
  21753. onUnstick: function onUnstick(evt) {
  21754. $(teste).css('top', '20px', 'important');
  21755. },
  21756. onReposition: function onReposition(evt) {
  21757. $(teste).css('top', '20px', 'important');
  21758. },
  21759. onScroll: function onScroll(evt) {
  21760. $(teste).css('top', '20px', 'important');
  21761. if (!isVisible($(teste), $(teste).parent())) {
  21762. $(teste).removeClass('fixed');
  21763. }
  21764. },
  21765. onTop: function onTop(evt) {
  21766. $(teste).css('top', '20px', 'important');
  21767. }
  21768. });
  21769. }
  21770. cont++;
  21771. appender.find('.add_parameter_button').popup({
  21772. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_add_parameters"),
  21773. delay: {
  21774. show: 750,
  21775. hide: 0
  21776. }
  21777. });
  21778. return appender;
  21779. }
  21780. function isVisible(element, container) {
  21781. var elementTop = $(element).offset().top,
  21782. elementHeight = $(element).height(),
  21783. containerTop = $(container).offset().top,
  21784. containerHeight = $(container).height() - 30;
  21785. return elementTop - containerTop + elementHeight > 0 && elementTop - containerTop < containerHeight;
  21786. }
  21787. window.evento_drag;
  21788. function updateProgramObjDrag() {
  21789. var nodes = Array.prototype.slice.call($('.all_functions').children());
  21790. var function_index;
  21791. var start_index;
  21792. var function_obj;
  21793. $(evento_drag.item).parentsUntil(".all_functions").each(function (index) {
  21794. var ref = $(this);
  21795. if (ref.hasClass('function_div')) {
  21796. function_index = nodes.indexOf(this);
  21797. start_index = index;
  21798. function_obj = ref;
  21799. }
  21800. });
  21801. var path_target = [];
  21802. $(evento_drag.item).parentsUntil(".all_functions").each(function () {
  21803. if ($(this).hasClass('command_container')) {
  21804. path_target.push(this);
  21805. }
  21806. });
  21807. if (path_target.length == 0) {//console.log('soltou na raiz, na posição: ' + evento_drag.newIndex + ' mas ainda não sei de onde saiu ');
  21808. } else {//console.log('soltou dentro de algum bloco, sequência vem logo abaixo (de baixo pra cima): ');
  21809. //console.log(path_target);
  21810. }
  21811. var index_each = [];
  21812. var path_relative = [];
  21813. for (var i = path_target.length - 1; i >= 0; i--) {
  21814. if (i == path_target.length - 1) {
  21815. // está na raiz
  21816. var indice_na_raiz = function_obj.find('.command_container').index(path_target[i]);
  21817. } else {
  21818. if ($(path_target[i + 1]).hasClass('iftrue')) {
  21819. if ($(path_target[i]).parent().hasClass('commands_if')) {
  21820. path_relative.push('if');
  21821. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  21822. } else {
  21823. path_relative.push('else');
  21824. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  21825. }
  21826. } else if ($(path_target[i + 1]).hasClass('dowhiletrue')) {
  21827. path_relative.push('dowhiletrue');
  21828. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  21829. } else if ($(path_target[i + 1]).hasClass('repeatNtimes')) {
  21830. path_relative.push('repeatNtimes');
  21831. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  21832. } else if ($(path_target[i + 1]).hasClass('whiletrue')) {
  21833. path_relative.push('whiletrue');
  21834. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  21835. } else if ($(path_target[i + 1]).hasClass('switch')) {
  21836. path_relative.push('switch'); //index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  21837. }
  21838. }
  21839. } // var index_in_block = -1;
  21840. 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);
  21841. var is_in_case_switch = $(evento_drag.item).parent().hasClass('case_commands_block'); // encontrar o elemento na árvore:
  21842. var command_start_point = window.program_obj.functions[function_index].commands[indice_na_raiz];
  21843. var block_to_insert = command_start_point;
  21844. for (var i = 0; i < index_each.length; i++) {
  21845. if (path_relative[i] == "else") {
  21846. block_to_insert = block_to_insert.commands_else[index_each[i]];
  21847. } else if (path_relative[i] == "switch") {} else {
  21848. block_to_insert = block_to_insert.commands_block[index_each[i]];
  21849. }
  21850. } //console.log('command_start_point', command_start_point);
  21851. //console.log('block_to_insert', block_to_insert);
  21852. // agora tem que alocar o comando na árvore, mas considerar as quatro situações:
  21853. // (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.
  21854. if (path_target.length == 0) {
  21855. // soltou na raiz:
  21856. window.program_obj.functions[function_index].commands.splice(evento_drag.newIndex - 1, 0, command_in_drag);
  21857. } else if (is_in_else) {
  21858. if (block_to_insert.commands_else) {
  21859. block_to_insert.commands_else.splice(evento_drag.newIndex, 0, command_in_drag);
  21860. } else {
  21861. block_to_insert.commands_else = [];
  21862. block_to_insert.commands_else.push(command_in_drag);
  21863. }
  21864. } else if (is_in_case_switch) {} else {
  21865. // verificar se tem alguma coisa no bloco:
  21866. if (block_to_insert.commands_block) {
  21867. block_to_insert.commands_block.splice(evento_drag.newIndex, 0, command_in_drag);
  21868. } else {
  21869. block_to_insert.commands_block = [];
  21870. block_to_insert.commands_block.push(command_in_drag);
  21871. }
  21872. }
  21873. window.draging = false;
  21874. renderAlgorithm();
  21875. }
  21876. function prepareDragHandler(evt) {
  21877. window.draging = true;
  21878. var nodes = Array.prototype.slice.call($('.all_functions').children());
  21879. var function_index;
  21880. var function_obj;
  21881. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  21882. if ($(this).hasClass('function_div')) {
  21883. function_index = nodes.indexOf(this);
  21884. function_obj = window.program_obj.functions[function_index];
  21885. }
  21886. });
  21887. command_in_drag = $(evt.item).data("command"); //console.log('$(evt.item).parent(): ');
  21888. //console.log($(evt.item).parent());
  21889. // descobrir qual das quatro situações:
  21890. if ($(evt.item).parent().hasClass('commands_list_div')) {
  21891. // está na raiz:
  21892. if (function_obj.commands.indexOf(command_in_drag) > -1) {
  21893. function_obj.commands.splice(function_obj.commands.indexOf(command_in_drag), 1);
  21894. }
  21895. } else if ($(evt.item).parent().hasClass('commands_else')) {
  21896. // está no else:
  21897. if ($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag) > -1) {
  21898. $(evt.item).parent().data('command').commands_else.splice($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag), 1);
  21899. }
  21900. } else if ($(evt.item).parent().hasClass('case_commands_block')) {// está em um switch:
  21901. } else {
  21902. // caso padrão:
  21903. if ($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag) > -1) {
  21904. $(evt.item).parent().data('command').commands_block.splice($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag), 1);
  21905. }
  21906. }
  21907. }
  21908. var command_in_drag;
  21909. function addSortableHandler(element, id_function) {
  21910. var n_group = 'commands_drag_' + id_function;
  21911. Sortable.create(element, {
  21912. handle: '.command_drag',
  21913. ghostClass: 'ghost',
  21914. animation: 300,
  21915. group: {
  21916. name: n_group
  21917. },
  21918. onEnd: function onEnd(evt) {
  21919. var nodes = Array.prototype.slice.call($('.all_functions').children());
  21920. var function_index;
  21921. var function_obj;
  21922. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  21923. if ($(this).hasClass('function_div')) {
  21924. function_index = nodes.indexOf(this);
  21925. function_obj = window.program_obj.functions[function_index];
  21926. }
  21927. });
  21928. 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);
  21929. var itemEl = evt.item; // dragged HTMLElement
  21930. evt.to; // target list
  21931. evt.from; // previous list
  21932. evt.oldIndex; // element's old index within old parent
  21933. evt.newIndex; // element's new index within new parent
  21934. //console.log('::EVT::');
  21935. //console.log(evt);
  21936. window.evento_drag = evt;
  21937. try {
  21938. updateProgramObjDrag();
  21939. } catch (e) {
  21940. console.error(e);
  21941. window.draging = false;
  21942. }
  21943. },
  21944. onStart: function onStart(evt) {
  21945. //console.log("START::EVT::");
  21946. //console.log(evt);
  21947. //console.log("\n\ncommand_in_drag");
  21948. try {
  21949. prepareDragHandler(evt);
  21950. } catch (e) {
  21951. window.draging = false;
  21952. }
  21953. }
  21954. });
  21955. element = $(element);
  21956. element.find(".iftrue").each(function (index) {
  21957. addSortableHandler($(this).find(".block_commands")[0], id_function);
  21958. addSortableHandler($(this).find(".block_commands")[1], id_function);
  21959. });
  21960. element.find(".repeatNtimes").each(function (index) {
  21961. addSortableHandler($(this).find(".block_commands")[0], id_function);
  21962. });
  21963. element.find(".dowhiletrue").each(function (index) {
  21964. addSortableHandler($(this).find(".block_commands")[0], id_function);
  21965. });
  21966. element.find(".whiletrue").each(function (index) {
  21967. addSortableHandler($(this).find(".block_commands")[0], id_function);
  21968. });
  21969. element.find(".switch").each(function (index) {
  21970. $(this).find(".case_div").each(function (index) {
  21971. addSortableHandler($(this).find(".case_commands_block")[0], id_function);
  21972. });
  21973. });
  21974. }
  21975. function initVisualUI() {
  21976. // MUST USE CONST, LET, OR VAR !!!!!!
  21977. // const mainDiv = $('#visual-main-div');
  21978. // fill mainDiv with functions and globals...
  21979. // renderAlgorithm()...
  21980. domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_8__["DOMConsole"]("ivprog-term-div");
  21981. domConsole.hide();
  21982. $(document.getElementById("ivprog-term-div")).draggable();
  21983. $('.add_function_button').on('click', function () {
  21984. addFunctionHandler();
  21985. }).popup({
  21986. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_add_function"),
  21987. delay: {
  21988. show: 750,
  21989. hide: 0
  21990. }
  21991. });
  21992. $('.add_global_button').on('click', function () {
  21993. window.insertContext = true;
  21994. _globals__WEBPACK_IMPORTED_MODULE_3__["addGlobal"](program, true);
  21995. });
  21996. $('#run_button').on('click', function () {
  21997. showStopButton();
  21998. runCode();
  21999. });
  22000. $('#download_file_button').on('click', function () {
  22001. downloadFile();
  22002. });
  22003. $('#upload_file_button').on('click', function () {
  22004. $('#ivph_file').click().off('change').change(uploadFile);
  22005. });
  22006. $('#stop_button').on('click', function () {
  22007. showRunButton();
  22008. stopExecution();
  22009. });
  22010. $('.visual_coding_button').on('click', function () {
  22011. toggleVisualCoding();
  22012. });
  22013. $('.textual_coding_button').on('click', function () {
  22014. toggleTextualCoding();
  22015. });
  22016. $('.assessment').on('click', function () {
  22017. is_iassign = true;
  22018. runCodeAssessment();
  22019. });
  22020. $('.div_toggle_console').on('click', function () {
  22021. toggleConsole();
  22022. });
  22023. $('.expand_button').on('click', function () {
  22024. full_screen();
  22025. });
  22026. $('.help_button').on('click', function () {
  22027. window.open('https://www.usp.br/line/ivprog/', '_blank');
  22028. });
  22029. $('.main_title h2').prop('title', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_ivprog_description'));
  22030. var time_show = 750;
  22031. $('.visual_coding_button').popup({
  22032. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_visual"),
  22033. delay: {
  22034. show: time_show,
  22035. hide: 0
  22036. }
  22037. });
  22038. $('.textual_coding_button').popup({
  22039. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_textual"),
  22040. delay: {
  22041. show: time_show,
  22042. hide: 0
  22043. }
  22044. });
  22045. $('.upload_file_button').popup({
  22046. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_upload"),
  22047. delay: {
  22048. show: time_show,
  22049. hide: 0
  22050. }
  22051. });
  22052. $('.download_file_button').popup({
  22053. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_download"),
  22054. delay: {
  22055. show: time_show,
  22056. hide: 0
  22057. }
  22058. });
  22059. $('.undo_button').popup({
  22060. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_undo"),
  22061. delay: {
  22062. show: time_show,
  22063. hide: 0
  22064. }
  22065. });
  22066. $('.redo_button').popup({
  22067. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_redo"),
  22068. delay: {
  22069. show: time_show,
  22070. hide: 0
  22071. }
  22072. });
  22073. $('.run_button').popup({
  22074. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_run"),
  22075. delay: {
  22076. show: time_show,
  22077. hide: 0
  22078. }
  22079. });
  22080. $('.assessment_button').popup({
  22081. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_evaluate"),
  22082. delay: {
  22083. show: time_show,
  22084. hide: 0
  22085. }
  22086. });
  22087. $('.help_button').popup({
  22088. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_help") + ' - ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_ivprog_version") + ' ' + ivprog_version,
  22089. delay: {
  22090. show: time_show,
  22091. hide: 0
  22092. }
  22093. });
  22094. $('.add_global_button').popup({
  22095. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_add_global"),
  22096. delay: {
  22097. show: time_show,
  22098. hide: 0
  22099. }
  22100. });
  22101. $('.div_toggle_console').popup({
  22102. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_console"),
  22103. delay: {
  22104. show: time_show,
  22105. hide: 0
  22106. }
  22107. });
  22108. Sortable.create(listWithHandle, {
  22109. handle: '.glyphicon-move',
  22110. animation: 100,
  22111. ghostClass: 'ghost',
  22112. group: 'functions_divs_drag',
  22113. onEnd: function onEnd(evt) {
  22114. updateSequenceFunction(evt.oldIndex, evt.newIndex);
  22115. }
  22116. });
  22117. var listGlobalsHandle = document.getElementById("listGlobalsHandle");
  22118. Sortable.create(listGlobalsHandle, {
  22119. handle: '.ellipsis',
  22120. animation: 100,
  22121. ghostClass: 'ghost',
  22122. group: 'globals_divs_drag',
  22123. onEnd: function onEnd(evt) {
  22124. updateSequenceGlobals(evt.oldIndex, evt.newIndex);
  22125. }
  22126. });
  22127. }
  22128. function setTestCases(testCases) {
  22129. _testCases = testCases;
  22130. }
  22131. function getTestCases() {
  22132. // Deep clone of test cases to avoid unauthorized modification
  22133. // TODO: It may be not possible to use this once custom test are fully implemented
  22134. return JSON.parse(JSON.stringify(_testCases));
  22135. }
  22136. var is_iassign = false;
  22137. function updateSequenceParameters(oldIndex, newIndex, function_obj) {
  22138. function_obj.parameters_list.splice(newIndex, 0, function_obj.parameters_list.splice(oldIndex, 1)[0]);
  22139. }
  22140. function updateSequenceLocals(oldIndex, newIndex, function_obj) {
  22141. function_obj.variables_list.splice(newIndex, 0, function_obj.variables_list.splice(oldIndex, 1)[0]);
  22142. }
  22143. function updateSequenceGlobals(oldIndex, newIndex) {
  22144. program_obj.globals.splice(newIndex, 0, program_obj.globals.splice(oldIndex, 1)[0]);
  22145. }
  22146. function updateSequenceFunction(oldIndex, newIndex) {
  22147. program_obj.functions.splice(newIndex, 0, program_obj.functions.splice(oldIndex, 1)[0]);
  22148. }
  22149. function runCodeAssessment() {
  22150. if (isRunning) {
  22151. // cannot run assessment or it's already running
  22152. return -1;
  22153. }
  22154. var strCode = null;
  22155. is_iassign = false;
  22156. window.studentGrade = null;
  22157. if (settingsProgrammingTypes == "textual") {
  22158. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  22159. } else {
  22160. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  22161. }
  22162. if (strCode == null) {
  22163. // No code, so no assessment
  22164. return -1;
  22165. }
  22166. toggleConsole(true);
  22167. try {
  22168. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  22169. isRunning = true;
  22170. var runner = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__["IVProgAssessment"](data, _testCases, domConsole);
  22171. runner.runTest().then(function (grade) {
  22172. if (!is_iassign) {
  22173. parent.getEvaluationCallback(grade);
  22174. } else {
  22175. is_iassign = false;
  22176. }
  22177. isRunning = false;
  22178. })["catch"](function (err) {
  22179. console.log(err);
  22180. isRunning = false;
  22181. });
  22182. } catch (error) {
  22183. isRunning = false;
  22184. domConsole.err(error.message);
  22185. console.log(error);
  22186. if (!is_iassign) {
  22187. parent.getEvaluationCallback(0);
  22188. } else {
  22189. is_iassign = false;
  22190. }
  22191. }
  22192. return 0;
  22193. }
  22194. function runCode() {
  22195. if (isRunning) {
  22196. return;
  22197. }
  22198. var strCode = null;
  22199. if (settingsProgrammingTypes == "textual") {
  22200. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  22201. } else {
  22202. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  22203. }
  22204. if (strCode == null) {
  22205. return;
  22206. }
  22207. toggleConsole(true); // if(domConsole == null)
  22208. // domConsole = new DOMConsole("#ivprog-term");
  22209. //$("#ivprog-term").slideDown(500);
  22210. try {
  22211. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  22212. proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__["IVProgProcessor"](data);
  22213. proc.registerInput(domConsole);
  22214. proc.registerOutput(domConsole);
  22215. $("#ivprog-term").addClass('ivprog-term-active');
  22216. isRunning = true;
  22217. proc.interpretAST().then(function (_) {
  22218. scheduleCall(function () {
  22219. if (domConsole.pending_writes.length == 0) {
  22220. if (proc.mode === _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT) {
  22221. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("aborted_execution"));
  22222. } else {
  22223. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("success_execution"));
  22224. }
  22225. $("#ivprog-term").removeClass('ivprog-term-active');
  22226. isRunning = false;
  22227. proc = null;
  22228. showRunButton();
  22229. return true;
  22230. }
  22231. return false;
  22232. }, 100);
  22233. })["catch"](function (err) {
  22234. scheduleCall(function () {
  22235. if (domConsole.pending_writes.length == 0) {
  22236. if (err instanceof Error) {
  22237. domConsole.err(err.message);
  22238. } else {
  22239. domConsole.err(err);
  22240. }
  22241. $("#ivprog-term").removeClass('ivprog-term-active');
  22242. isRunning = false;
  22243. proc = null;
  22244. showRunButton();
  22245. return true;
  22246. }
  22247. return false;
  22248. }, 100);
  22249. });
  22250. } catch (error) {
  22251. scheduleCall(function () {
  22252. if (domConsole.pending_writes.length == 0) {
  22253. isRunning = false;
  22254. proc = null;
  22255. showRunButton();
  22256. domConsole.err(error.message);
  22257. console.log(error);
  22258. return true;
  22259. }
  22260. return false;
  22261. }, 100);
  22262. }
  22263. }
  22264. function toggleConsole(is_running) {
  22265. if (is_running) {
  22266. $('.ivprog-term-div').css('display', 'block');
  22267. $('#ivprog-term').css('min-height', '160px');
  22268. if (domConsole != null) domConsole.focus(); //$('#ivprog-term').css('margin-top', '-170px');
  22269. return;
  22270. } else {
  22271. domConsole.hide();
  22272. return;
  22273. }
  22274. if ($('#ivprog-term').css('min-height') == '160px') {
  22275. // esconder
  22276. $('.ivprog-term-div').css('display', 'none');
  22277. $('#ivprog-term').css('min-height', '0'); //$('#ivprog-term').css('margin-top', '-30px');
  22278. //$('#ivprog-term').css('padding', '5px');
  22279. } else {
  22280. // mostrar
  22281. $('.ivprog-term-div').css('display', 'block');
  22282. $('#ivprog-term').css('min-height', '160px'); //$('#ivprog-term').css('margin-top', '-170px');
  22283. }
  22284. } // function waitToCloseConsole () {
  22285. // domConsole.info("Aperte qualquer tecla para fechar...");
  22286. // const p = new Promise((resolve, _) => {
  22287. // domConsole.requestInput(resolve, true);
  22288. // });
  22289. // p.then( _ => {
  22290. // domConsole.dispose();
  22291. // domConsole = null;
  22292. // $("#ivprog-term").hide();
  22293. // })
  22294. // }
  22295. function toggleTextualCoding() {
  22296. var code = null;
  22297. if (settingsProgrammingTypes != "textual") {
  22298. code = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  22299. if (code == null) {
  22300. return;
  22301. }
  22302. }
  22303. $('.ivprog_visual_panel').css('display', 'none');
  22304. $('.ivprog_textual_panel').css('display', 'block');
  22305. $('.ivprog_textual_panel').removeClass('loading');
  22306. _text_editor__WEBPACK_IMPORTED_MODULE_17__["updateEditor"]();
  22307. if (code != null) _text_editor__WEBPACK_IMPORTED_MODULE_17__["setCode"](code); //$('.ivprog_textual_code').text(code);
  22308. $('.visual_coding_button').removeClass('active');
  22309. $('.textual_coding_button').addClass('active');
  22310. }
  22311. function toggleVisualCoding() {
  22312. $('.ivprog_textual_panel').addClass('loading');
  22313. $('.ivprog_textual_panel').css('display', 'none');
  22314. $('.ivprog_visual_panel').css('display', 'block');
  22315. $('.textual_coding_button').removeClass('active');
  22316. $('.visual_coding_button').addClass('active');
  22317. }
  22318. function removeParameter(function_obj, parameter_obj, parameter_container) {
  22319. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(parameter_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION_PARAM, function_obj.name);
  22320. var index = function_obj.parameters_list.indexOf(parameter_obj);
  22321. if (index > -1) {
  22322. window.insertContext = true;
  22323. function_obj.parameters_list.splice(index, 1);
  22324. }
  22325. $(parameter_container).fadeOut();
  22326. }
  22327. function updateParameterType(parameter_obj, new_type, function_name) {
  22328. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  22329. 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);
  22330. parameter_obj.type = new_type;
  22331. parameter_obj.dimensions = new_dimensions;
  22332. if (new_dimensions > 0) {
  22333. parameter_obj.rows = new_dimensions;
  22334. parameter_obj.columns = 2;
  22335. }
  22336. }
  22337. function renderParameter(function_obj, parameter_obj, function_container) {
  22338. var ret = "";
  22339. ret += '<div class="ui label function_name_parameter pink"><i class="ui icon ellipsis vertical inverted"></i>';
  22340. if (parameter_obj.reference) ret += '<input type="checkbox" checked class="by_reference">';else ret += '<input type="checkbox" class="by_copy">';
  22341. ret += '<div class="ui dropdown parameter_type">';
  22342. if (parameter_obj.dimensions > 0) {
  22343. 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()));
  22344. if (parameter_obj.dimensions == 1) {
  22345. ret += ' [ ] ';
  22346. } else {
  22347. ret += ' [ ] [ ] ';
  22348. }
  22349. ret += '</div>';
  22350. } else {
  22351. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(parameter_obj.type.toLowerCase())) + '</div>';
  22352. }
  22353. ret += '<div class="menu">';
  22354. for (var _tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22355. if (_tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22356. continue;
  22357. }
  22358. 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>';
  22359. }
  22360. 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">';
  22361. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22362. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22363. continue;
  22364. }
  22365. 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>';
  22366. }
  22367. ret += '</div></div>';
  22368. 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">';
  22369. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22370. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22371. continue;
  22372. }
  22373. 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>';
  22374. }
  22375. ret += '</div></div>';
  22376. ret += '</div></div>';
  22377. ret += '<div class="parameter_div_edit"><span class="span_name_parameter label_enable_name_parameter">' + parameter_obj.name + '</span></div> ';
  22378. ret += ' <i class="yellow inverted icon times remove_parameter"></i></div>';
  22379. ret = $(ret);
  22380. function_container.find('.container_parameters_list').append(ret);
  22381. ret.find('.remove_parameter').on('click', function (e) {
  22382. removeParameter(function_obj, parameter_obj, ret);
  22383. });
  22384. ret.find('.ui.dropdown.parameter_type').dropdown({
  22385. onChange: function onChange(_, __, $selectedItem) {
  22386. if ($selectedItem.data('dimensions')) {
  22387. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  22388. } else {
  22389. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  22390. }
  22391. },
  22392. selectOnKeydown: false
  22393. });
  22394. ret.find('.parameter_div_edit').on('click', function (e) {
  22395. 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);
  22396. enableNameParameterUpdate(parameter_obj, ret, function_obj);
  22397. });
  22398. ret.find('input:checkbox').change(function () {
  22399. parameter_obj.reference = this.checked;
  22400. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  22401. });
  22402. ret.find('.by_reference').popup({
  22403. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_parameter_reference"),
  22404. delay: {
  22405. show: 750,
  22406. hide: 0
  22407. }
  22408. });
  22409. ret.find('.by_copy').popup({
  22410. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_parameter_copy"),
  22411. delay: {
  22412. show: 750,
  22413. hide: 0
  22414. }
  22415. });
  22416. return ret;
  22417. }
  22418. function updateParameterName(parameter_var, new_name, parameter_obj_dom, function_obj) {
  22419. if (parameter_var.name == new_name) {
  22420. return;
  22421. }
  22422. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  22423. if (variableNameAlreadyExists(new_name, function_obj)) {
  22424. _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]));
  22425. } else {
  22426. 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);
  22427. parameter_var.name = new_name;
  22428. }
  22429. } else {
  22430. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](parameter_obj_dom.find('.parameter_div_edit'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  22431. }
  22432. }
  22433. function variableNameAlreadyExists(name_var, function_obj) {
  22434. if (function_obj.parameters_list) {
  22435. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  22436. if (function_obj.parameters_list[i].name == name_var) {
  22437. return true;
  22438. }
  22439. }
  22440. }
  22441. if (function_obj.variables_list) {
  22442. for (var i = 0; i < function_obj.variables_list.length; i++) {
  22443. if (function_obj.variables_list[i].name == name_var) {
  22444. return true;
  22445. }
  22446. }
  22447. }
  22448. return false;
  22449. }
  22450. function updateFunctionName(function_var, new_name, function_obj_dom) {
  22451. if (function_var.name == new_name) {
  22452. return;
  22453. }
  22454. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  22455. if (functionNameAlreadyExists(new_name)) {
  22456. _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]));
  22457. } else {
  22458. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].RENAME_FUNCTION, new_name);
  22459. function_var.name = new_name;
  22460. }
  22461. } else {
  22462. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](function_obj_dom.find('.function_name_div'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  22463. }
  22464. }
  22465. function functionNameAlreadyExists(function_name) {
  22466. for (var i = 0; i < window.program_obj.functions.length; i++) {
  22467. if (window.program_obj.functions[i].name == function_name) {
  22468. return true;
  22469. }
  22470. }
  22471. return false;
  22472. }
  22473. var opened_name_parameter = false;
  22474. var opened_input_parameter = null;
  22475. function enableNameParameterUpdate(parameter_obj, parent_node, function_obj) {
  22476. if (opened_name_parameter) {
  22477. opened_input_parameter.focus();
  22478. return;
  22479. }
  22480. opened_name_parameter = true;
  22481. parent_node = $(parent_node);
  22482. var input_field;
  22483. parent_node.find('.span_name_parameter').text('');
  22484. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + parameter_obj.name + "' />");
  22485. input_field.insertBefore(parent_node.find('.span_name_parameter'));
  22486. input_field.on('input', function () {
  22487. var inputWidth = input_field.textWidth() + 10;
  22488. opened_input_parameter = input_field;
  22489. input_field.focus();
  22490. var tmpStr = input_field.val();
  22491. input_field.val('');
  22492. input_field.val(tmpStr);
  22493. input_field.css({
  22494. width: inputWidth
  22495. });
  22496. }).trigger('input');
  22497. input_field.focusout(function () {
  22498. /// update array:
  22499. if (input_field.val().trim()) {
  22500. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  22501. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  22502. }
  22503. input_field.off();
  22504. input_field.remove(); /// update elements:
  22505. opened_name_parameter = false;
  22506. opened_input_parameter = false;
  22507. });
  22508. input_field.on('keydown', function (e) {
  22509. var code = e.keyCode || e.which;
  22510. if (code == 13) {
  22511. if (input_field.val().trim()) {
  22512. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  22513. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  22514. }
  22515. input_field.off();
  22516. input_field.remove(); /// update elements:
  22517. opened_name_parameter = false;
  22518. opened_input_parameter = false;
  22519. }
  22520. if (code == 27) {
  22521. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  22522. input_field.off();
  22523. input_field.remove(); /// update elements:
  22524. opened_name_parameter = false;
  22525. opened_input_parameter = false;
  22526. }
  22527. });
  22528. input_field.select();
  22529. }
  22530. var opened_name_function = false;
  22531. var opened_input = null;
  22532. var previousPadding = null;
  22533. function enableNameFunctionUpdate(function_obj, parent_node) {
  22534. if (opened_name_function) {
  22535. opened_input.focus();
  22536. return;
  22537. }
  22538. parent_node = $(parent_node);
  22539. parent_node.find('.span_name_function').text('');
  22540. var input_field;
  22541. if (!previousPadding) {
  22542. previousPadding = parent_node.find('.span_name_function').css('padding-left');
  22543. }
  22544. parent_node.find('.span_name_function').css('padding-left', '0');
  22545. parent_node.find('.span_name_function').css('padding-right', '0');
  22546. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + function_obj.name + "' />");
  22547. input_field.insertBefore(parent_node.find('.span_name_function'));
  22548. input_field.on('input', function () {
  22549. var inputWidth = input_field.textWidth() + 10;
  22550. opened_input = input_field;
  22551. input_field.focus();
  22552. var tmpStr = input_field.val();
  22553. input_field.val('');
  22554. input_field.val(tmpStr);
  22555. input_field.css({
  22556. width: inputWidth
  22557. });
  22558. }).trigger('input');
  22559. input_field.focusout(function () {
  22560. /// update array:
  22561. if (input_field.val().trim()) {
  22562. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  22563. }
  22564. input_field.off();
  22565. input_field.remove();
  22566. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  22567. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  22568. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  22569. opened_name_function = false;
  22570. opened_input = false;
  22571. });
  22572. input_field.on('keydown', function (e) {
  22573. var code = e.keyCode || e.which;
  22574. if (code == 13) {
  22575. if (input_field.val().trim()) {
  22576. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  22577. }
  22578. input_field.off();
  22579. input_field.remove();
  22580. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  22581. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  22582. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  22583. opened_name_function = false;
  22584. opened_input = false;
  22585. }
  22586. if (code == 27) {
  22587. input_field.off();
  22588. input_field.remove();
  22589. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  22590. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  22591. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  22592. opened_name_function = false;
  22593. opened_input = false;
  22594. }
  22595. });
  22596. input_field.select();
  22597. }
  22598. function addFunctionChangeListener(callback) {
  22599. functionsChangeListeners.push(callback);
  22600. return functionsChangeListeners.length - 1;
  22601. }
  22602. function addGlobalChangeListener(callback) {
  22603. globalChangeListeners.push(callback);
  22604. return globalChangeListeners.length - 1;
  22605. }
  22606. function removeGlobalListener(index) {
  22607. globalChangeListeners.splice(index, 1);
  22608. }
  22609. function removeFunctionListener(index) {
  22610. functionsChangeListeners.splice(index);
  22611. }
  22612. function scheduleCall(callback, time) {
  22613. var scheduled_call = function scheduled_call() {
  22614. var id = setInterval(function () {
  22615. if (callback()) {
  22616. clearInterval(id);
  22617. }
  22618. }, time);
  22619. };
  22620. scheduled_call();
  22621. }
  22622. function showRunButton() {
  22623. document.getElementById('run_button').style.display = 'inline';
  22624. document.getElementById('stop_button').style.display = 'none';
  22625. }
  22626. function showStopButton() {
  22627. document.getElementById('run_button').style.display = 'none';
  22628. document.getElementById('stop_button').style.display = 'inline';
  22629. }
  22630. function stopExecution() {
  22631. domConsole.clearPendingWrites();
  22632. domConsole.cancelPendingInputRequests();
  22633. if (!isRunning) {
  22634. return;
  22635. }
  22636. proc.mode = _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT;
  22637. }
  22638. function downloadFile() {
  22639. var contentToSend = '{}\n::algorithm::';
  22640. if (settingsProgrammingTypes == "textual") {
  22641. contentToSend += ivprogCore.CodeEditor.getCode();
  22642. } else {
  22643. contentToSend += JSON.stringify(window.program_obj, function (key, value) {
  22644. if (key == 'dom_object') {
  22645. return;
  22646. }
  22647. return value;
  22648. });
  22649. }
  22650. var date = new Date();
  22651. var temp = date.toISOString().split('T')[0] + "_" + date.toTimeString().split(' ')[0].replaceAll(':', '-');
  22652. var blob = new Blob([contentToSend], {
  22653. type: "text/plain;charset=utf-8"
  22654. });
  22655. saveAs(blob, "ivprog-exported_" + temp + ".ivph");
  22656. }
  22657. function uploadFile(evt) {
  22658. var oFReader = new FileReader();
  22659. oFReader.readAsText(document.getElementById("ivph_file").files[0]);
  22660. oFReader.onload = function (oFREvent) {
  22661. var txt = oFREvent.target.result;
  22662. try {
  22663. previousContent = txt;
  22664. prepareActivityToStudent(txt);
  22665. window.renderAlgorithm();
  22666. $('.assessment_button').addClass('disabled');
  22667. } catch (e) {
  22668. showInvalidFile();
  22669. }
  22670. };
  22671. }
  22672. /***/ }),
  22673. /***/ "./js/visualUI/globals.js":
  22674. /*!********************************!*\
  22675. !*** ./js/visualUI/globals.js ***!
  22676. \********************************/
  22677. /*! exports provided: addGlobal, renderGlobal */
  22678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22679. "use strict";
  22680. __webpack_require__.r(__webpack_exports__);
  22681. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobal", function() { return addGlobal; });
  22682. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderGlobal", function() { return renderGlobal; });
  22683. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  22684. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  22685. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  22686. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  22687. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  22688. var counter_new_globals = 0;
  22689. function addGlobal(program) {
  22690. var is_from_click = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22691. 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);
  22692. counter_new_globals++;
  22693. program.addGlobal(new_global);
  22694. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(new_global.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].INSERT_GLOBAL_VAR);
  22695. var newe = renderGlobal(new_global);
  22696. if (is_from_click) {
  22697. newe.css('display', 'none');
  22698. newe.fadeIn();
  22699. }
  22700. }
  22701. function toggleConstant(global_var) {
  22702. global_var.is_constant = !global_var.is_constant;
  22703. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].SET_GLOBAL_CONST);
  22704. }
  22705. function updateName(global_var, new_name, global_obj_dom) {
  22706. if (global_var.name == new_name) {
  22707. return;
  22708. }
  22709. if (isValidIdentifier(new_name)) {
  22710. if (globalNameAlreadyExists(new_name)) {
  22711. _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'));
  22712. } else {
  22713. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].RENAME_GLOBAL_VAR, new_name);
  22714. global_var.name = new_name;
  22715. }
  22716. } else {
  22717. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_name'));
  22718. }
  22719. }
  22720. function globalNameAlreadyExists(global_name) {
  22721. for (var i = 0; i < window.program_obj.globals.length; i++) {
  22722. if (window.program_obj.globals[i].name == global_name) {
  22723. return true;
  22724. }
  22725. }
  22726. return false;
  22727. }
  22728. function isValidIdentifier(identifier_str) {
  22729. return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  22730. }
  22731. function updateType(global_var, new_type) {
  22732. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  22733. global_var.type = new_type;
  22734. global_var.dimensions = new_dimensions;
  22735. if (new_dimensions > 0) {
  22736. global_var.rows = new_dimensions;
  22737. global_var.columns = 2;
  22738. }
  22739. 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);
  22740. updateInitialValues(global_var);
  22741. }
  22742. function removeGlobal(global_var, global_container) {
  22743. var index = window.program_obj.globals.indexOf(global_var);
  22744. if (index > -1) {
  22745. window.insertContext = true;
  22746. window.program_obj.globals.splice(index, 1);
  22747. }
  22748. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_GLOBAL_VAR);
  22749. global_container.children().off();
  22750. global_container.off();
  22751. global_container.fadeOut();
  22752. }
  22753. function updateInitialValues(global_var) {
  22754. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22755. if (global_var.dimensions == 0) {
  22756. global_var.value = 0;
  22757. }
  22758. if (global_var.dimensions == 1) {
  22759. global_var.value = [0, 0];
  22760. }
  22761. if (global_var.dimensions == 2) {
  22762. global_var.value = [[0, 0], [0, 0]];
  22763. }
  22764. }
  22765. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22766. if (global_var.dimensions == 0) {
  22767. global_var.value = 0.0;
  22768. }
  22769. if (global_var.dimensions == 1) {
  22770. global_var.value = [0.0, 0.0];
  22771. }
  22772. if (global_var.dimensions == 2) {
  22773. global_var.value = [[0.0, 0.0], [0.0, 0.0]];
  22774. }
  22775. }
  22776. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22777. if (global_var.dimensions == 0) {
  22778. global_var.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  22779. }
  22780. if (global_var.dimensions == 1) {
  22781. 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')];
  22782. }
  22783. if (global_var.dimensions == 2) {
  22784. 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')]];
  22785. }
  22786. }
  22787. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22788. if (global_var.dimensions == 0) {
  22789. global_var.value = true;
  22790. }
  22791. if (global_var.dimensions == 1) {
  22792. global_var.value = [true, true];
  22793. }
  22794. if (global_var.dimensions == 2) {
  22795. global_var.value = [[true, true], [true, true]];
  22796. }
  22797. }
  22798. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22799. if (global_var.dimensions == 0) {
  22800. global_var.value = 'A';
  22801. }
  22802. if (global_var.dimensions == 1) {
  22803. global_var.value = ['A', 'A'];
  22804. }
  22805. if (global_var.dimensions == 2) {
  22806. global_var.value = [['A', 'A'], ['A', 'A']];
  22807. }
  22808. }
  22809. 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);
  22810. }
  22811. function alternateBooleanGlobalValue(global_var, value_container) {
  22812. global_var.value = !global_var.value;
  22813. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value)));
  22814. }
  22815. function alternateBooleanGlobalVectorValue(global_var, index, value_container) {
  22816. global_var.value[index] = !global_var.value[index];
  22817. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[index])));
  22818. }
  22819. function removeGlobalColumnVector(global_var) {
  22820. if (global_var.columns == 0) {
  22821. return;
  22822. }
  22823. global_var.columns--;
  22824. global_var.value.splice(global_var.value.length - 1, 1);
  22825. }
  22826. function addGlobalColumnVector(global_var) {
  22827. global_var.columns++;
  22828. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22829. global_var.value.push(0);
  22830. }
  22831. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22832. global_var.value.push(0.0);
  22833. }
  22834. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22835. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22836. }
  22837. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22838. global_var.value.push(true);
  22839. }
  22840. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22841. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22842. }
  22843. }
  22844. function removeColumnGlobalMatrix(global_var) {
  22845. if (global_var.columns == 0) {
  22846. return;
  22847. }
  22848. global_var.columns--;
  22849. for (var i = 0; i < global_var.rows; i++) {
  22850. global_var.value[i].splice(global_var.value[i].length - 1, 1);
  22851. }
  22852. }
  22853. function addColumnGlobalMatrix(global_var) {
  22854. global_var.columns++;
  22855. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22856. for (var i = 0; i < global_var.rows; i++) {
  22857. global_var.value[i].push(0);
  22858. }
  22859. }
  22860. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22861. for (var i = 0; i < global_var.rows; i++) {
  22862. global_var.value[i].push(0.0);
  22863. }
  22864. }
  22865. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22866. for (var i = 0; i < global_var.rows; i++) {
  22867. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22868. }
  22869. }
  22870. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22871. for (var i = 0; i < global_var.rows; i++) {
  22872. global_var.value[i].push(true);
  22873. }
  22874. }
  22875. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22876. for (var i = 0; i < global_var.rows; i++) {
  22877. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22878. }
  22879. }
  22880. }
  22881. function removeLineGlobalMatrix(global_var) {
  22882. if (global_var.rows == 0) {
  22883. return;
  22884. }
  22885. global_var.rows--;
  22886. global_var.value.splice(global_var.value.length - 1, 1);
  22887. }
  22888. function addLineGlobalMatrix(global_var) {
  22889. global_var.rows++;
  22890. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22891. var n_l = [];
  22892. for (var i = 0; i < global_var.columns; i++) {
  22893. n_l.push(0);
  22894. }
  22895. global_var.value.push(n_l);
  22896. }
  22897. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22898. var n_l = [];
  22899. for (i = 0; i < global_var.columns; i++) {
  22900. n_l.push(0.0);
  22901. }
  22902. global_var.value.push(n_l);
  22903. }
  22904. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22905. var n_l = [];
  22906. for (i = 0; i < global_var.columns; i++) {
  22907. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22908. }
  22909. global_var.value.push(n_l);
  22910. }
  22911. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22912. var n_l = [];
  22913. for (i = 0; i < global_var.columns; i++) {
  22914. n_l.push(true);
  22915. }
  22916. global_var.value.push(n_l);
  22917. }
  22918. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22919. var n_l = [];
  22920. for (i = 0; i < global_var.columns; i++) {
  22921. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22922. }
  22923. global_var.value.push(n_l);
  22924. }
  22925. }
  22926. function alternateBooleanGlobalMatrixValue(global_var, row, index, value_container) {
  22927. global_var.value[row][index] = !global_var.value[row][index];
  22928. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[row][index])));
  22929. }
  22930. function renderValues(global_var, global_container) {
  22931. var ret = "";
  22932. var j = 0;
  22933. if (global_var.dimensions == 0) {
  22934. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22935. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value.toFixed(1) + '</span> </div> ';
  22936. } else {
  22937. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22938. 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> ';
  22939. } else {
  22940. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value + '</span> </div> ';
  22941. }
  22942. }
  22943. } else {
  22944. ret += '<table class="tabela_var">';
  22945. if (global_var.dimensions == 1) {
  22946. ret += '<tr>';
  22947. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22948. for (var k = 0; k < global_var.columns; k++) {
  22949. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k].toFixed(1) + '</span></td>';
  22950. }
  22951. } else {
  22952. for (var k = 0; k < global_var.columns; k++) {
  22953. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22954. 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>';
  22955. } else {
  22956. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k] + '</span>' + '</td>';
  22957. }
  22958. }
  22959. }
  22960. ret += '</tr>';
  22961. ret += '</table>';
  22962. 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>';
  22963. }
  22964. if (global_var.dimensions == 2) {
  22965. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22966. for (var l = 0; l < global_var.rows; l++) {
  22967. ret += '<tr>';
  22968. for (var k = 0; k < global_var.columns; k++) {
  22969. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  22970. }
  22971. ret += '</tr>';
  22972. }
  22973. } else {
  22974. for (var l = 0; l < global_var.rows; l++) {
  22975. ret += '<tr>';
  22976. for (var k = 0; k < global_var.columns; k++) {
  22977. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22978. 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>';
  22979. } else {
  22980. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k] + '</span></td>';
  22981. }
  22982. }
  22983. ret += '</tr>';
  22984. }
  22985. }
  22986. if (global_var.rows == 0) {
  22987. ret += '<tr><td></td></tr>';
  22988. }
  22989. 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>';
  22990. ret += '</table>';
  22991. 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>';
  22992. }
  22993. }
  22994. global_container.find(".div_valor_var").html('');
  22995. ret = $(ret);
  22996. ret.find('.span_value_variable').data('associatedOject', global_var);
  22997. ret.find(".boolean_simple_type").on('click', function (e) {
  22998. alternateBooleanGlobalValue(global_var, this.parentNode);
  22999. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23000. });
  23001. ret.find(".simple_var").on('click', function (e) {
  23002. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  23003. enableGlobalValueUpdate(global_var, this.parentNode);
  23004. });
  23005. ret.find(".boolean_vector_var").on('click', function (e) {
  23006. alternateBooleanGlobalVectorValue(global_var, $(this).data('index'), this.parentNode);
  23007. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23008. });
  23009. ret.find(".vector_var").on('click', function (e) {
  23010. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  23011. enableGlobalVectorValueUpdate(global_var, $(this).data('index'), this.parentNode);
  23012. });
  23013. ret.find(".remove_global_vector_column").on('click', function (e) {
  23014. removeGlobalColumnVector(global_var);
  23015. global_container.find(".div_valor_var").html('');
  23016. 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);
  23017. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23018. renderValues(global_var, global_container);
  23019. });
  23020. ret.find(".add_global_vector_column").on('click', function (e) {
  23021. addGlobalColumnVector(global_var);
  23022. 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);
  23023. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23024. global_container.find(".div_valor_var").html('');
  23025. renderValues(global_var, global_container);
  23026. });
  23027. ret.find(".remove_global_matrix_column").on('click', function (e) {
  23028. removeColumnGlobalMatrix(global_var);
  23029. 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);
  23030. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23031. global_container.find(".div_valor_var").html('');
  23032. renderValues(global_var, global_container);
  23033. });
  23034. ret.find(".add_global_matrix_column").on('click', function (e) {
  23035. addColumnGlobalMatrix(global_var);
  23036. 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);
  23037. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23038. global_container.find(".div_valor_var").html('');
  23039. renderValues(global_var, global_container);
  23040. });
  23041. ret.find(".remove_global_matrix_line").on('click', function (e) {
  23042. removeLineGlobalMatrix(global_var);
  23043. 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);
  23044. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23045. global_container.find(".div_valor_var").html('');
  23046. renderValues(global_var, global_container);
  23047. });
  23048. ret.find(".add_global_matrix_line").on('click', function (e) {
  23049. addLineGlobalMatrix(global_var);
  23050. 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);
  23051. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23052. global_container.find(".div_valor_var").html('');
  23053. renderValues(global_var, global_container);
  23054. });
  23055. ret.find(".boolean_matrix_var").on('click', function (e) {
  23056. alternateBooleanGlobalMatrixValue(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  23057. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23058. });
  23059. ret.find(".matrix_var").on('click', function (e) {
  23060. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  23061. enableGlobalMatrixValueUpdate(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  23062. });
  23063. global_container.find(".div_valor_var").append(ret);
  23064. updateColumnsAndRowsText(global_container, global_var);
  23065. }
  23066. function addHandlers(global_container) {
  23067. var global_var = global_container.data('associatedOject'); // Manage constant option:
  23068. global_container.find(".alternate_constant").on('click', function (e) {
  23069. toggleConstant(global_var);
  23070. $(this).removeClass("on off");
  23071. if (global_var.is_constant) {
  23072. $(this).addClass("on");
  23073. } else {
  23074. $(this).addClass("off");
  23075. }
  23076. }); // Manage global name:
  23077. global_container.find(".editing_name_var").on('click', function (e) {
  23078. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_NAME);
  23079. enableNameUpdate(global_container);
  23080. }); // Menu to change type:
  23081. global_container.find('.ui.dropdown.global_type').dropdown({
  23082. onChange: function onChange(_, __, $selectedItem) {
  23083. if ($selectedItem.data('dimensions')) {
  23084. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  23085. } else {
  23086. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  23087. }
  23088. renderValues(global_var, global_container);
  23089. },
  23090. selectOnKeydown: false
  23091. }); // Remove global:
  23092. global_container.find(".remove_global").on('click', function (e) {
  23093. removeGlobal(global_var, global_container);
  23094. });
  23095. global_container.find(".ellipsis").popup({
  23096. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_move_var"),
  23097. delay: {
  23098. show: 750,
  23099. hide: 0
  23100. }
  23101. });
  23102. global_container.find(".remove_global").popup({
  23103. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_remove_var"),
  23104. delay: {
  23105. show: 750,
  23106. hide: 0
  23107. }
  23108. });
  23109. }
  23110. function updateColumnsAndRowsText(global_container, global_var) {
  23111. var prev = global_container.find('.text').text().split('[');
  23112. if (prev.length == 2) {
  23113. var ff = prev[0] + '[ ' + global_var.columns + ' ] ';
  23114. global_container.find('.text').empty();
  23115. global_container.find('.text').text(ff);
  23116. }
  23117. if (prev.length == 3) {
  23118. var ff = prev[0] + '[ ' + global_var.columns + ' ] [ ' + global_var.rows + ' ] ';
  23119. global_container.find('.text').empty();
  23120. global_container.find('.text').text(ff);
  23121. }
  23122. }
  23123. function renderGlobal(global_var) {
  23124. var element = '<div class="ui label global_container pink"><i class="ui icon ellipsis vertical inverted"></i><div class="global_const">const: ';
  23125. element += '<i class="ui icon toggle ' + (global_var.is_constant ? "on" : "off") + ' alternate_constant"></i></div>';
  23126. element += '<div class="ui dropdown global_type">';
  23127. if (global_var.dimensions == 1) {
  23128. 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));
  23129. element += ' [ <span class="dimensions_0"></span> ] ';
  23130. element += '</div>';
  23131. } else if (global_var.dimensions == 2) {
  23132. 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));
  23133. element += ' [ <span class="dimensions_0"></span> ] [ <span class="dimensions_1"></span> ] ';
  23134. element += '</div>';
  23135. } else {
  23136. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type.toLowerCase())) + '</div>';
  23137. }
  23138. element += '<div class="menu">';
  23139. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  23140. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  23141. continue;
  23142. }
  23143. 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>';
  23144. }
  23145. 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">';
  23146. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  23147. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  23148. continue;
  23149. }
  23150. 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>';
  23151. }
  23152. element += '</div></div>';
  23153. 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">';
  23154. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  23155. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  23156. continue;
  23157. }
  23158. 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>';
  23159. }
  23160. element += '</div></div>';
  23161. 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> ';
  23162. element += '<div class="ui div_valor_var">' + global_var.value + '</div>';
  23163. element += ' <i class="yellow inverted icon times remove_global"></i></div>';
  23164. var complete_element = $(element);
  23165. complete_element.data('associatedOject', global_var);
  23166. $('.list_globals').append(complete_element);
  23167. addHandlers(complete_element);
  23168. renderValues(global_var, complete_element);
  23169. if (global_var.dimensions == 1) {
  23170. complete_element.find('.dimensions_0').text(global_var.columns);
  23171. }
  23172. if (global_var.dimensions == 2) {
  23173. complete_element.find('.dimensions_0').text(global_var.columns);
  23174. complete_element.find('.dimensions_1').text(global_var.rows);
  23175. }
  23176. return complete_element;
  23177. }
  23178. var opened_name_value_matrix_global_v = false;
  23179. var opened_input_value_matrix_global_v = null;
  23180. function enableGlobalMatrixValueUpdate(global_var, row, index, parent_node) {
  23181. if (opened_name_value_matrix_global_v) {
  23182. opened_input_value_matrix_global_v.focus();
  23183. return;
  23184. }
  23185. parent_node = $(parent_node);
  23186. opened_name_value_matrix_global_v = true;
  23187. parent_node.find('.span_value_variable').text('');
  23188. var input_field;
  23189. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23190. 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) + "' />");
  23191. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23192. } else {
  23193. 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] + "' />");
  23194. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23195. }
  23196. input_field.on('input', function () {
  23197. var inputWidth = input_field.textWidth() + 10;
  23198. opened_input_value_matrix_global_v = input_field;
  23199. input_field.focus();
  23200. var tmpStr = input_field.val();
  23201. input_field.val('');
  23202. input_field.val(tmpStr);
  23203. input_field.css({
  23204. width: inputWidth
  23205. });
  23206. }).trigger('input');
  23207. input_field.focusout(function () {
  23208. /// update array:
  23209. if (input_field.val().trim()) {
  23210. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23211. global_var.value[row][index] = parseFloat(input_field.val().trim());
  23212. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  23213. } else {
  23214. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23215. global_var.value[row][index] = parseInt(input_field.val().trim());
  23216. } else {
  23217. global_var.value[row][index] = input_field.val().trim();
  23218. }
  23219. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23220. }
  23221. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23222. } else {
  23223. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23224. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  23225. } else {
  23226. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23227. }
  23228. }
  23229. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23230. global_var.value[row][index] = input_field.val();
  23231. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23232. }
  23233. input_field.off();
  23234. input_field.remove(); /// update elements:
  23235. opened_name_value_matrix_global_v = false;
  23236. opened_input_value_matrix_global_v = false;
  23237. });
  23238. input_field.on('keydown', function (e) {
  23239. var code = e.keyCode || e.which;
  23240. if (code == 13) {
  23241. if (input_field.val().trim()) {
  23242. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23243. global_var.value[row][index] = parseFloat(input_field.val().trim());
  23244. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  23245. } else {
  23246. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23247. global_var.value[row][index] = parseInt(input_field.val().trim());
  23248. } else {
  23249. global_var.value[row][index] = input_field.val().trim();
  23250. }
  23251. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23252. }
  23253. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23254. } else {
  23255. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23256. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  23257. } else {
  23258. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23259. }
  23260. }
  23261. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23262. global_var.value[row][index] = input_field.val();
  23263. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23264. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23265. }
  23266. input_field.off();
  23267. input_field.remove(); /// update elements:
  23268. opened_name_value_matrix_global_v = false;
  23269. opened_input_value_matrix_global_v = false;
  23270. }
  23271. if (code == 27) {
  23272. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23273. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  23274. } else {
  23275. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23276. }
  23277. input_field.off();
  23278. input_field.remove(); /// update elements:
  23279. opened_name_value_matrix_global_v = false;
  23280. opened_input_value_matrix_global_v = false;
  23281. }
  23282. });
  23283. input_field.select();
  23284. }
  23285. var opened_name_value_global_var = false;
  23286. var opened_input_value_global_ar = null;
  23287. function enableGlobalValueUpdate(global_var, parent_node) {
  23288. if (opened_name_value_global_var) {
  23289. opened_input_value_global_ar.focus();
  23290. return;
  23291. }
  23292. parent_node = $(parent_node);
  23293. opened_name_value_global_var = true;
  23294. parent_node.find('.span_value_variable').text('');
  23295. var input_field;
  23296. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23297. 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) + "' />");
  23298. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23299. } else {
  23300. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value + "' />");
  23301. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23302. }
  23303. input_field.on('input', function () {
  23304. var inputWidth = input_field.textWidth() + 10;
  23305. opened_input_value_global_ar = input_field;
  23306. input_field.focus();
  23307. var tmpStr = input_field.val();
  23308. input_field.val('');
  23309. input_field.val(tmpStr);
  23310. input_field.css({
  23311. width: inputWidth
  23312. });
  23313. }).trigger('input');
  23314. input_field.focusout(function () {
  23315. var changed = false; /// update array:
  23316. if (input_field.val().trim()) {
  23317. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23318. global_var.value = parseFloat(input_field.val().trim());
  23319. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23320. } else {
  23321. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23322. global_var.value = parseInt(input_field.val().trim());
  23323. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23324. global_var.value = input_field.val().charAt(0);
  23325. } else {
  23326. global_var.value = input_field.val().trim();
  23327. }
  23328. parent_node.find('.span_value_variable').text(global_var.value);
  23329. }
  23330. changed = true;
  23331. } else {
  23332. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23333. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23334. } else {
  23335. parent_node.find('.span_value_variable').text(global_var.value);
  23336. }
  23337. }
  23338. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23339. global_var.value = input_field.val();
  23340. changed = true;
  23341. parent_node.find('.span_value_variable').text(global_var.value);
  23342. }
  23343. if (changed) {
  23344. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23345. }
  23346. input_field.off();
  23347. input_field.remove(); /// update elements:
  23348. opened_name_value_global_var = false;
  23349. opened_input_value_global_ar = false;
  23350. });
  23351. input_field.on('keydown', function (e) {
  23352. var code = e.keyCode || e.which;
  23353. var changed = true;
  23354. if (code == 13) {
  23355. if (input_field.val().trim()) {
  23356. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23357. global_var.value = parseFloat(input_field.val().trim());
  23358. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23359. } else {
  23360. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23361. global_var.value = parseInt(input_field.val().trim());
  23362. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23363. global_var.value = input_field.val().charAt(0);
  23364. } else {
  23365. global_var.value = input_field.val().trim();
  23366. }
  23367. parent_node.find('.span_value_variable').text(global_var.value);
  23368. }
  23369. changed = true;
  23370. } else {
  23371. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23372. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23373. } else {
  23374. parent_node.find('.span_value_variable').text(global_var.value);
  23375. }
  23376. }
  23377. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23378. global_var.value = input_field.val();
  23379. changed = true;
  23380. parent_node.find('.span_value_variable').text(global_var.value);
  23381. }
  23382. if (changed) {
  23383. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23384. }
  23385. input_field.off();
  23386. input_field.remove(); /// update elements:
  23387. opened_name_value_global_var = false;
  23388. opened_input_value_global_ar = false;
  23389. }
  23390. if (code == 27) {
  23391. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23392. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23393. } else {
  23394. parent_node.find('.span_value_variable').text(global_var.value);
  23395. }
  23396. input_field.off();
  23397. input_field.remove(); /// update elements:
  23398. opened_name_value_global_var = false;
  23399. opened_input_value_global_ar = false;
  23400. }
  23401. });
  23402. input_field.select();
  23403. }
  23404. var opened_name_global = false;
  23405. var opened_input_global = null;
  23406. function enableNameUpdate(global_container) {
  23407. var global_var = global_container.data('associatedOject');
  23408. if (opened_name_global) {
  23409. opened_input_global.focus();
  23410. return;
  23411. }
  23412. opened_name_global = true;
  23413. global_container.find('.span_name_variable').text('');
  23414. var input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.name + "' />");
  23415. input_name.insertBefore(global_container.find('.span_name_variable'));
  23416. input_name.on('input', function () {
  23417. var inputWidth = input_name.textWidth() + 10;
  23418. opened_input_global = input_name;
  23419. opened_input_global.focus();
  23420. opened_input_global.css({
  23421. width: inputWidth
  23422. });
  23423. }).trigger('input');
  23424. input_name.focusout(function () {
  23425. /// update array:
  23426. if (input_name.val().trim().length > 0) {
  23427. updateName(global_var, input_name.val().trim(), global_container);
  23428. global_container.find('.span_name_variable').text(global_var.name);
  23429. } else {
  23430. global_container.find('.span_name_variable').text(global_var.name);
  23431. }
  23432. input_name.off();
  23433. input_name.remove(); /// update elements:
  23434. opened_name_global = false;
  23435. opened_input_global = false;
  23436. });
  23437. input_name.on('keydown', function (e) {
  23438. var code = e.keyCode || e.which;
  23439. if (code == 13) {
  23440. if (input_name.val().trim()) {
  23441. updateName(global_var, input_name.val().trim(), global_container);
  23442. global_container.find('.span_name_variable').text(global_var.name);
  23443. } else {
  23444. global_container.find('.span_name_variable').text(global_var.name);
  23445. }
  23446. input_name.off();
  23447. input_name.remove(); /// update elements:
  23448. opened_name_global = false;
  23449. opened_input_global = false;
  23450. }
  23451. if (code == 27) {
  23452. global_container.find('.span_name_variable').text(global_var.name);
  23453. input_name.off();
  23454. input_name.remove(); /// update elements:
  23455. opened_name_global = false;
  23456. opened_input_global = false;
  23457. }
  23458. });
  23459. input_name.select();
  23460. }
  23461. var opened_name_value_vector_global_ = false;
  23462. var opened_input_value_vector_global_ = null;
  23463. function enableGlobalVectorValueUpdate(global_var, index, parent_node) {
  23464. if (opened_name_value_vector_global_) {
  23465. opened_input_value_vector_global_.focus();
  23466. return;
  23467. }
  23468. parent_node = $(parent_node);
  23469. opened_name_value_vector_global_ = true;
  23470. parent_node.find('.span_value_variable').text('');
  23471. var input_field;
  23472. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23473. 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) + "' />");
  23474. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23475. } else {
  23476. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[index] + "' />");
  23477. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23478. }
  23479. input_field.on('input', function () {
  23480. var inputWidth = input_field.textWidth() + 10;
  23481. opened_input_value_vector_global_ = input_field;
  23482. input_field.focus();
  23483. var tmpStr = input_field.val();
  23484. input_field.val('');
  23485. input_field.val(tmpStr);
  23486. input_field.css({
  23487. width: inputWidth
  23488. });
  23489. }).trigger('input');
  23490. input_field.focusout(function () {
  23491. var changed = false; /// update array:
  23492. if (input_field.val().trim()) {
  23493. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23494. global_var.value[index] = parseFloat(input_field.val().trim());
  23495. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23496. } else {
  23497. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23498. global_var.value[index] = parseInt(input_field.val().trim());
  23499. } else {
  23500. global_var.value[index] = input_field.val().trim();
  23501. }
  23502. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23503. }
  23504. changed = true;
  23505. } else {
  23506. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23507. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23508. } else {
  23509. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23510. }
  23511. }
  23512. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23513. global_var.value[index] = input_field.val();
  23514. changed = true;
  23515. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23516. }
  23517. if (changed) {
  23518. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23519. }
  23520. input_field.off();
  23521. input_field.remove(); /// update elements:
  23522. opened_name_value_vector_global_ = false;
  23523. opened_input_value_vector_global_ = false;
  23524. });
  23525. input_field.on('keydown', function (e) {
  23526. var code = e.keyCode || e.which;
  23527. var changed = false;
  23528. if (code == 13) {
  23529. if (input_field.val().trim()) {
  23530. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23531. global_var.value[index] = parseFloat(input_field.val().trim());
  23532. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23533. } else {
  23534. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23535. global_var.value[index] = parseInt(input_field.val().trim());
  23536. } else {
  23537. global_var.value[index] = input_field.val().trim();
  23538. }
  23539. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23540. }
  23541. changed = true;
  23542. } else {
  23543. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23544. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23545. } else {
  23546. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23547. }
  23548. }
  23549. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23550. global_var.value[index] = input_field.val();
  23551. changed = true;
  23552. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23553. }
  23554. if (changed) {
  23555. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23556. }
  23557. input_field.off();
  23558. input_field.remove(); /// update elements:
  23559. opened_name_value_vector_global_ = false;
  23560. opened_input_value_vector_global_ = false;
  23561. }
  23562. if (code == 27) {
  23563. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23564. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23565. } else {
  23566. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23567. }
  23568. input_field.off();
  23569. input_field.remove(); /// update elements:
  23570. opened_name_value_vector_global_ = false;
  23571. opened_input_value_vector_global_ = false;
  23572. }
  23573. });
  23574. input_field.select();
  23575. }
  23576. $.fn.textWidth = function (text, font) {
  23577. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  23578. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  23579. return $.fn.textWidth.fakeEl.width();
  23580. };
  23581. /***/ }),
  23582. /***/ "./js/visualUI/ivprog_elements.js":
  23583. /*!****************************************!*\
  23584. !*** ./js/visualUI/ivprog_elements.js ***!
  23585. \****************************************/
  23586. /*! 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 */
  23587. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23588. "use strict";
  23589. __webpack_require__.r(__webpack_exports__);
  23590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_TYPES", function() { return COMMAND_TYPES; });
  23591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_TYPES", function() { return ARITHMETIC_TYPES; });
  23592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_ELEMENTS", function() { return EXPRESSION_ELEMENTS; });
  23593. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_TYPES", function() { return EXPRESSION_TYPES; });
  23594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_COMPARISON", function() { return ARITHMETIC_COMPARISON; });
  23595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOGIC_COMPARISON", function() { return LOGIC_COMPARISON; });
  23596. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYSTEM_FUNCTIONS_CATEGORIES", function() { return SYSTEM_FUNCTIONS_CATEGORIES; });
  23597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; });
  23598. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  23599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemFunction", function() { return SystemFunction; });
  23600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });
  23601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  23602. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reader", function() { return Reader; });
  23603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Writer", function() { return Writer; });
  23604. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribution", function() { return Attribution; });
  23605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionOperator", function() { return ExpressionOperator; });
  23606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionElement", function() { return ExpressionElement; });
  23607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionalExpression", function() { return ConditionalExpression; });
  23608. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicExpression", function() { return LogicExpression; });
  23609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArithmeticExpression", function() { return ArithmeticExpression; });
  23610. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfTrue", function() { return IfTrue; });
  23611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatNTimes", function() { return RepeatNTimes; });
  23612. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WhileTrue", function() { return WhileTrue; });
  23613. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DoWhileTrue", function() { return DoWhileTrue; });
  23614. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  23615. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  23616. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwitchCase", function() { return SwitchCase; });
  23617. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  23618. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableValueMenu", function() { return VariableValueMenu; });
  23619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCallMenu", function() { return FunctionCallMenu; });
  23620. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Program", function() { return Program; });
  23621. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  23622. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__);
  23623. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  23624. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  23625. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  23626. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  23627. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__);
  23628. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  23629. var COMMAND_TYPES = Object.freeze({
  23630. "function": "function",
  23631. comment: "comment",
  23632. reader: "reader",
  23633. writer: "writer",
  23634. attribution: "attribution",
  23635. iftrue: "iftrue",
  23636. repeatNtimes: "repeatNtimes",
  23637. whiletrue: "whiletrue",
  23638. dowhiletrue: "dowhiletrue",
  23639. "switch": "switch",
  23640. switchcase: "switchcase",
  23641. functioncall: "functioncall",
  23642. "break": "break",
  23643. "return": "return"
  23644. });
  23645. var ARITHMETIC_TYPES = Object.freeze({
  23646. plus: "plus",
  23647. minus: "minus",
  23648. multiplication: "multiplication",
  23649. division: "division",
  23650. module: "module",
  23651. none: "none"
  23652. });
  23653. var EXPRESSION_ELEMENTS = Object.freeze({
  23654. exp_op_exp: "exp_op_exp",
  23655. op_exp: "op_exp",
  23656. par_exp_par: "par_exp_par",
  23657. start_point: "start_point"
  23658. });
  23659. var EXPRESSION_TYPES = Object.freeze({
  23660. exp_conditional: "exp_conditional",
  23661. exp_logic: "exp_logic",
  23662. exp_arithmetic: "exp_arithmetic",
  23663. write_sep: "write_separator"
  23664. });
  23665. var ARITHMETIC_COMPARISON = Object.freeze({
  23666. greater_than: "greater_than",
  23667. less_than: "less_than",
  23668. equals_to: "equals_to",
  23669. not_equals_to: "not_equals_to",
  23670. greater_than_or_equals_to: "greater_than_or_equals_to",
  23671. less_than_or_equals_to: "less_than_or_equals_to"
  23672. });
  23673. var LOGIC_COMPARISON = Object.freeze({
  23674. equals_to: "equals_to",
  23675. not_equals_to: "not_equals_to",
  23676. and: "and",
  23677. or: "or",
  23678. not: "not"
  23679. });
  23680. var SYSTEM_FUNCTIONS_CATEGORIES = Object.freeze({
  23681. math: "$mathLib",
  23682. text: "$strLib",
  23683. arrangement: "$arrayLib",
  23684. conversion: "$langLib"
  23685. });
  23686. var Variable = function Variable(type, name, value) {
  23687. var dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  23688. var is_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  23689. var rows = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  23690. var columns = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
  23691. var reference = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
  23692. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Variable);
  23693. this.type = type;
  23694. this.name = name;
  23695. this.value = value;
  23696. this.dimensions = dimensions;
  23697. this.is_constant = is_constant;
  23698. this.rows = rows;
  23699. this.columns = columns;
  23700. this.reference = reference;
  23701. };
  23702. var Function = function Function(name) {
  23703. var return_type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID;
  23704. var return_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  23705. var parameters_list = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  23706. var is_main = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  23707. var is_hidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
  23708. var variables_list = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
  23709. var function_comment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
  23710. var commands = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];
  23711. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Function);
  23712. this.type = COMMAND_TYPES["function"];
  23713. this.name = name;
  23714. this.return_type = return_type;
  23715. this.return_dimensions = return_dimensions;
  23716. this.parameters_list = parameters_list;
  23717. this.is_main = is_main;
  23718. this.is_hidden = is_hidden;
  23719. this.variables_list = variables_list;
  23720. this.function_comment = function_comment;
  23721. this.commands = commands;
  23722. };
  23723. var SystemFunction = function SystemFunction(identifier, return_type, return_dimensions, parameters_list) {
  23724. var function_comment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  23725. var category = arguments.length > 5 ? arguments[5] : undefined;
  23726. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SystemFunction);
  23727. this.type = COMMAND_TYPES["function"];
  23728. this.identifier = identifier;
  23729. this.return_type = return_type;
  23730. this.return_dimensions = return_dimensions;
  23731. this.parameters_list = parameters_list;
  23732. this.function_comment = function_comment;
  23733. this.category = category;
  23734. };
  23735. var Comment = function Comment(comment_text) {
  23736. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Comment);
  23737. this.type = COMMAND_TYPES.comment;
  23738. this.comment_text = comment_text;
  23739. };
  23740. var Break = function Break() {
  23741. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Break);
  23742. this.type = COMMAND_TYPES["break"];
  23743. };
  23744. var Reader = function Reader() {
  23745. var variable_value_menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new VariableValueMenu();
  23746. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Reader);
  23747. this.type = COMMAND_TYPES.reader;
  23748. this.variable_value_menu = variable_value_menu;
  23749. };
  23750. var Writer = function Writer(content) {
  23751. var newline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  23752. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Writer);
  23753. this.type = COMMAND_TYPES.writer;
  23754. this.content = content;
  23755. this.newline = newline;
  23756. };
  23757. var Attribution = function Attribution(variable) {
  23758. var expression = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23759. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Attribution);
  23760. this.type = COMMAND_TYPES.attribution;
  23761. this.variable = variable;
  23762. this.expression = expression;
  23763. };
  23764. var ExpressionOperator = function ExpressionOperator(type_op, item) {
  23765. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionOperator);
  23766. this.type_op = type_op; // Logic, Arithmetic OR Relational
  23767. this.item = item;
  23768. };
  23769. var ExpressionElement = function ExpressionElement(type_exp) {
  23770. var itens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23771. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionElement);
  23772. this.type_exp = type_exp;
  23773. this.itens = itens;
  23774. };
  23775. var ConditionalExpression = function ConditionalExpression(expression) {
  23776. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ConditionalExpression);
  23777. this.type = EXPRESSION_TYPES.exp_conditional;
  23778. this.expression = expression;
  23779. };
  23780. var LogicExpression = function LogicExpression(has_neg, first_operand, second_operand, operator) {
  23781. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, LogicExpression);
  23782. this.type = EXPRESSION_TYPES.exp_logic;
  23783. this.has_neg = has_neg;
  23784. this.first_operand = first_operand;
  23785. this.second_operand = second_operand;
  23786. this.operator = operator;
  23787. };
  23788. var ArithmeticExpression = function ArithmeticExpression(first_operand, second_operand, operator) {
  23789. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ArithmeticExpression);
  23790. this.type = EXPRESSION_TYPES.exp_arithmetic;
  23791. this.first_operand = first_operand;
  23792. this.second_operand = second_operand;
  23793. this.operator = operator;
  23794. };
  23795. var IfTrue = function IfTrue(expression, commands_block, commands_else) {
  23796. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, IfTrue);
  23797. this.type = COMMAND_TYPES.iftrue;
  23798. this.expression = expression;
  23799. this.commands_block = commands_block;
  23800. this.commands_else = commands_else;
  23801. };
  23802. var RepeatNTimes = function RepeatNTimes(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block) {
  23803. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, RepeatNTimes);
  23804. this.type = COMMAND_TYPES.repeatNtimes;
  23805. this.var_attribution = var_attribution;
  23806. this.var_incrementation = var_incrementation;
  23807. this.expression1 = expression1;
  23808. this.expression2 = expression2;
  23809. this.expression3 = expression3;
  23810. this.commands_block = commands_block;
  23811. };
  23812. var WhileTrue = function WhileTrue(expression, commands_block) {
  23813. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, WhileTrue);
  23814. this.type = COMMAND_TYPES.whiletrue;
  23815. this.expression = expression;
  23816. this.commands_block = commands_block;
  23817. };
  23818. var DoWhileTrue = function DoWhileTrue(expression, commands_block) {
  23819. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, DoWhileTrue);
  23820. this.type = COMMAND_TYPES.dowhiletrue;
  23821. this.expression = expression;
  23822. this.commands_block = commands_block;
  23823. };
  23824. var Switch = function Switch(variable) {
  23825. var cases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23826. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Switch);
  23827. this.type = COMMAND_TYPES["switch"];
  23828. this.variable = variable;
  23829. this.cases = cases;
  23830. };
  23831. var Return = function Return(variable_value_menu) {
  23832. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Return);
  23833. this.type = COMMAND_TYPES["return"];
  23834. this.variable_value_menu = variable_value_menu;
  23835. };
  23836. var SwitchCase = function SwitchCase(variable_value_menu) {
  23837. var commands_block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23838. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SwitchCase);
  23839. this.type = COMMAND_TYPES.switchcase;
  23840. this.variable_value_menu = variable_value_menu;
  23841. this.commands_block = commands_block;
  23842. };
  23843. var FunctionCall = function FunctionCall(function_called, parameters_list) {
  23844. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCall);
  23845. this.type = COMMAND_TYPES.functioncall;
  23846. this.function_called = function_called;
  23847. this.parameters_list = parameters_list;
  23848. };
  23849. var VariableValueMenu = function VariableValueMenu() {
  23850. var variable_and_value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
  23851. var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  23852. var row = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  23853. var column = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  23854. var include_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  23855. var dimensions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  23856. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, VariableValueMenu);
  23857. this.type = "var_value";
  23858. this.variable_and_value = variable_and_value;
  23859. this.content = content;
  23860. this.row = row;
  23861. this.column = column;
  23862. this.include_constant = include_constant;
  23863. this.dimensions = dimensions;
  23864. };
  23865. var FunctionCallMenu = function FunctionCallMenu() {
  23866. var function_called = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  23867. var parameters_list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23868. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCallMenu);
  23869. this.type = "function_call";
  23870. this.function_called = function_called;
  23871. this.parameters_list = parameters_list;
  23872. };
  23873. var Program = /*#__PURE__*/function () {
  23874. function Program() {
  23875. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Program);
  23876. this.functions = [];
  23877. this.globals = [];
  23878. }
  23879. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default()(Program, [{
  23880. key: "addFunction",
  23881. value: function addFunction(function_to_add) {
  23882. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.parameters_list, function () {
  23883. if (window.insertContext) {
  23884. setTimeout(function () {
  23885. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  23886. }, 300);
  23887. window.insertContext = false;
  23888. } else {
  23889. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  23890. }
  23891. }, 1);
  23892. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.variables_list, function () {
  23893. if (window.insertContext) {
  23894. setTimeout(function () {
  23895. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  23896. }, 300);
  23897. window.insertContext = false;
  23898. } else {
  23899. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  23900. }
  23901. }, 1);
  23902. this.functions.push(function_to_add);
  23903. }
  23904. }, {
  23905. key: "addVariable",
  23906. value: function addVariable(function_to_receive, variable) {
  23907. if (this.functions[function_to_receive].variable === null) {
  23908. this.functions[function_to_receive].variables_list = [];
  23909. }
  23910. this.functions[function_to_receive].variables_list.push(variable);
  23911. }
  23912. }, {
  23913. key: "addGlobal",
  23914. value: function addGlobal(variable) {
  23915. this.globals.push(variable);
  23916. }
  23917. }]);
  23918. return Program;
  23919. }();
  23920. /***/ }),
  23921. /***/ "./js/visualUI/text_editor.js":
  23922. /*!************************************!*\
  23923. !*** ./js/visualUI/text_editor.js ***!
  23924. \************************************/
  23925. /*! exports provided: initTextEditor, disable, updateEditor, setCode, getCode */
  23926. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23927. "use strict";
  23928. __webpack_require__.r(__webpack_exports__);
  23929. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initTextEditor", function() { return initTextEditor; });
  23930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disable", function() { return disable; });
  23931. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateEditor", function() { return updateEditor; });
  23932. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCode", function() { return setCode; });
  23933. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  23934. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! codemirror */ "./node_modules/codemirror/lib/codemirror.js");
  23935. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  23936. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! codemirror/addon/edit/closebrackets */ "./node_modules/codemirror/addon/edit/closebrackets.js");
  23937. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__);
  23938. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! codemirror/addon/edit/matchbrackets */ "./node_modules/codemirror/addon/edit/matchbrackets.js");
  23939. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__);
  23940. /* 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");
  23941. /* 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__);
  23942. /* harmony import */ var _util_editorMode2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../util/editorMode2 */ "./js/util/editorMode2.js");
  23943. // import "codemirror/addon/hint/show-hint";
  23944. // import "codemirror/addon/hint/anyword-hint";
  23945. Object(_util_editorMode2__WEBPACK_IMPORTED_MODULE_4__["CodeEditorMode"])(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  23946. var codeEditor = null;
  23947. function initTextEditor(element) {
  23948. var id = element;
  23949. if (element[0] == '#') {
  23950. id = element.substring(1);
  23951. }
  23952. codeEditor = codemirror__WEBPACK_IMPORTED_MODULE_0__["fromTextArea"](document.getElementById(id), {
  23953. theme: "ttcn",
  23954. value: "",
  23955. mode: "text/x-ivprog",
  23956. indentUnit: 4,
  23957. lineNumbers: true,
  23958. matchBrackets: true,
  23959. autoCloseBrackets: true,
  23960. fixedGutter: true,
  23961. styleActiveLine: true,
  23962. readOnly: true
  23963. });
  23964. }
  23965. function disable(flag) {
  23966. codeEditor.setOption("readOnly", flag);
  23967. updateEditor();
  23968. }
  23969. function updateEditor() {
  23970. codeEditor.refresh();
  23971. }
  23972. function setCode(code) {
  23973. codeEditor.setValue(code);
  23974. }
  23975. function getCode() {
  23976. return codeEditor.getValue();
  23977. }
  23978. /***/ }),
  23979. /***/ "./js/visualUI/types.js":
  23980. /*!******************************!*\
  23981. !*** ./js/visualUI/types.js ***!
  23982. \******************************/
  23983. /*! exports provided: Types */
  23984. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23985. "use strict";
  23986. __webpack_require__.r(__webpack_exports__);
  23987. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Types", function() { return Types; });
  23988. var Types = Object.freeze({
  23989. INTEGER: "integer",
  23990. REAL: "real",
  23991. TEXT: "text",
  23992. CHAR: 'char',
  23993. BOOLEAN: "boolean",
  23994. VOID: "void"
  23995. });
  23996. /***/ }),
  23997. /***/ "./js/visualUI/utils.js":
  23998. /*!******************************!*\
  23999. !*** ./js/visualUI/utils.js ***!
  24000. \******************************/
  24001. /*! exports provided: renderErrorMessage */
  24002. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24003. "use strict";
  24004. __webpack_require__.r(__webpack_exports__);
  24005. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderErrorMessage", function() { return renderErrorMessage; });
  24006. function renderErrorMessage(dom_obj_target, message_text) {
  24007. dom_obj_target.popup({
  24008. html: '<i class="ui icon inverted exclamation triangle yellow"></i>' + message_text,
  24009. transition: "fade up",
  24010. on: 'click',
  24011. closable: true,
  24012. movePopup: true,
  24013. boundary: window,
  24014. preserve: false,
  24015. target: false,
  24016. className: {
  24017. popup: 'ui popup invalid-identifier'
  24018. },
  24019. onHidden: function onHidden($module) {
  24020. dom_obj_target.popup('destroy');
  24021. }
  24022. }).popup('toggle');
  24023. }
  24024. /***/ }),
  24025. /***/ "./js/visualUI/variables.js":
  24026. /*!**********************************!*\
  24027. !*** ./js/visualUI/variables.js ***!
  24028. \**********************************/
  24029. /*! exports provided: addVariable, renderVariable */
  24030. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24031. "use strict";
  24032. __webpack_require__.r(__webpack_exports__);
  24033. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVariable", function() { return addVariable; });
  24034. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderVariable", function() { return renderVariable; });
  24035. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  24036. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  24037. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  24038. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  24039. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  24040. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  24041. var counter_new_variables = 0;
  24042. function addVariable(function_obj, function_container) {
  24043. var is_in_click = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  24044. 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);
  24045. if (function_obj.variables_list == null) {
  24046. function_obj.variables_list = [];
  24047. }
  24048. function_obj.variables_list.push(new_var);
  24049. counter_new_variables++;
  24050. 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);
  24051. var newe = renderVariable(function_container, new_var, function_obj);
  24052. if (is_in_click) {
  24053. newe.css('display', 'none');
  24054. newe.fadeIn();
  24055. }
  24056. }
  24057. function updateName(variable_obj, new_name, variable_obj_dom, function_obj) {
  24058. if (variable_obj.name == new_name) {
  24059. return;
  24060. }
  24061. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_5__["isValidIdentifier"])(new_name)) {
  24062. if (variableNameAlreadyExists(new_name, function_obj)) {
  24063. _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]));
  24064. } else {
  24065. 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);
  24066. variable_obj.name = new_name;
  24067. }
  24068. } else {
  24069. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  24070. }
  24071. }
  24072. function variableNameAlreadyExists(name_var, function_obj) {
  24073. if (function_obj.parameters_list) {
  24074. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  24075. if (function_obj.parameters_list[i].name == name_var) {
  24076. return true;
  24077. }
  24078. }
  24079. }
  24080. if (function_obj.variables_list) {
  24081. for (var i = 0; i < function_obj.variables_list.length; i++) {
  24082. if (function_obj.variables_list[i].name == name_var) {
  24083. return true;
  24084. }
  24085. }
  24086. }
  24087. return false;
  24088. }
  24089. function removeVariable(variable_obj, variable_container, function_name) {
  24090. var function_associated = variable_container.data('associatedFunction');
  24091. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_FUNCTION_VAR, variable_obj.name);
  24092. var index = function_associated.variables_list.indexOf(variable_obj);
  24093. if (index > -1) {
  24094. window.insertContext = true;
  24095. delete function_associated.variables_list[index];
  24096. function_associated.variables_list.splice(index, 1);
  24097. }
  24098. variable_container.children().off();
  24099. variable_container.off();
  24100. variable_container.fadeOut();
  24101. }
  24102. function updateType(variable_obj, new_type, function_name) {
  24103. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  24104. variable_obj.type = new_type;
  24105. variable_obj.dimensions = new_dimensions;
  24106. if (new_dimensions > 0) {
  24107. variable_obj.rows = new_dimensions;
  24108. variable_obj.columns = 2;
  24109. }
  24110. 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);
  24111. updateInitialValues(variable_obj, function_name);
  24112. }
  24113. function addHandlers(variable_obj, variable_container, function_obj) {
  24114. // Manage variable name:
  24115. variable_container.find(".editing_name_var").on('click', function (e) {
  24116. 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);
  24117. enableNameUpdate(variable_obj, variable_container, function_obj);
  24118. }); // Menu to change type:
  24119. variable_container.find('.ui.dropdown.variable_type').dropdown({
  24120. onChange: function onChange(_, __, $selectedItem) {
  24121. if ($selectedItem.data('dimensions')) {
  24122. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  24123. } else {
  24124. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  24125. }
  24126. renderValues(variable_obj, variable_container, function_obj.name);
  24127. },
  24128. selectOnKeydown: false
  24129. }); // Remove variable:
  24130. variable_container.find(".remove_variable").on('click', function (e) {
  24131. removeVariable(variable_obj, variable_container, function_obj.name);
  24132. });
  24133. variable_container.find(".ellipsis").popup({
  24134. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_move_var"),
  24135. delay: {
  24136. show: 750,
  24137. hide: 0
  24138. }
  24139. });
  24140. variable_container.find(".remove_variable").popup({
  24141. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_remove_var"),
  24142. delay: {
  24143. show: 750,
  24144. hide: 0
  24145. }
  24146. });
  24147. }
  24148. function renderVariable(function_container, new_var, function_obj) {
  24149. var element = '<div class="ui label variable_container pink"><i class="ui icon ellipsis vertical inverted"></i>';
  24150. element += '<div class="ui dropdown variable_type">';
  24151. if (new_var.dimensions == 1) {
  24152. 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()));
  24153. element += ' [ ] </div>';
  24154. } else if (new_var.dimensions == 2) {
  24155. 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()));
  24156. element += ' [ ] [ ] </div>';
  24157. } else {
  24158. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase())) + '</div>';
  24159. }
  24160. element += '<div class="menu">';
  24161. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  24162. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  24163. continue;
  24164. }
  24165. 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>';
  24166. }
  24167. 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">';
  24168. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  24169. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  24170. continue;
  24171. }
  24172. 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>';
  24173. }
  24174. element += '</div></div>';
  24175. 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">';
  24176. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  24177. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  24178. continue;
  24179. }
  24180. 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>';
  24181. }
  24182. element += '</div></div>';
  24183. element += '</div></div> ';
  24184. element += '<div class="editing_name_var"><span class="span_name_variable enable_edit_name_variable">' + new_var.name + '</span> </div>';
  24185. element += ' <span class="character_equals"> <&#8212; </span> <div class="ui div_valor_var">' + new_var.value + '</div>';
  24186. element += ' <i class="yellow inverted icon times remove_variable"></i></div>';
  24187. element = $(element);
  24188. element.data('associatedFunction', function_obj);
  24189. function_container.find('.variables_list_div').append(element);
  24190. addHandlers(new_var, element, function_obj);
  24191. renderValues(new_var, element, function_obj.name);
  24192. return element;
  24193. }
  24194. function updateColumnsAndRowsText(variable_container, variable_var) {
  24195. var prev = variable_container.find('.text').text().split('[');
  24196. if (prev.length == 2) {
  24197. var ff = prev[0] + '[ ' + variable_var.columns + ' ] ';
  24198. variable_container.find('.text').empty();
  24199. variable_container.find('.text').text(ff);
  24200. }
  24201. if (prev.length == 3) {
  24202. var ff = prev[0] + '[ ' + variable_var.columns + ' ] [ ' + variable_var.rows + ' ] ';
  24203. variable_container.find('.text').empty();
  24204. variable_container.find('.text').text(ff);
  24205. }
  24206. }
  24207. function renderValues(new_var, variable_container, function_name) {
  24208. var ret = "";
  24209. var j = 0;
  24210. if (new_var.dimensions == 0) {
  24211. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24212. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value.toFixed(1) + '</span> </div> ';
  24213. } else {
  24214. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24215. 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> ';
  24216. } else {
  24217. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value + '</span> </div> ';
  24218. }
  24219. }
  24220. } else {
  24221. ret += '<table class="tabela_var">';
  24222. if (new_var.dimensions == 1) {
  24223. ret += '<tr>';
  24224. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24225. for (var k = 0; k < new_var.columns; k++) {
  24226. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k].toFixed(1) + '</span></td>';
  24227. }
  24228. } else {
  24229. for (var k = 0; k < new_var.columns; k++) {
  24230. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24231. 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>';
  24232. } else {
  24233. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k] + '</span>' + '</td>';
  24234. }
  24235. }
  24236. }
  24237. ret += '</tr>';
  24238. ret += '</table>';
  24239. 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>';
  24240. }
  24241. if (new_var.dimensions == 2) {
  24242. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24243. for (var l = 0; l < new_var.rows; l++) {
  24244. ret += '<tr>';
  24245. for (var k = 0; k < new_var.columns; k++) {
  24246. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  24247. }
  24248. ret += '</tr>';
  24249. }
  24250. } else {
  24251. for (var l = 0; l < new_var.rows; l++) {
  24252. ret += '<tr>';
  24253. for (var k = 0; k < new_var.columns; k++) {
  24254. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24255. 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>';
  24256. } else {
  24257. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k] + '</span></td>';
  24258. }
  24259. }
  24260. ret += '</tr>';
  24261. }
  24262. }
  24263. if (new_var.rows == 0) {
  24264. ret += '<tr><td></td></tr>';
  24265. }
  24266. 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>';
  24267. ret += '</table>';
  24268. 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>';
  24269. }
  24270. }
  24271. $(variable_container).find(".div_valor_var").html('');
  24272. ret = $(ret);
  24273. $(ret).find('.span_value_variable').data('associatedOject', new_var);
  24274. $(ret).find(".boolean_simple_type").on('click', function (e) {
  24275. 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);
  24276. alternateBooleanValue(new_var, this.parentNode);
  24277. });
  24278. $(ret).find(".simple_var").on('click', function (e) {
  24279. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  24280. enableValueUpdate(new_var, this.parentNode, function_name);
  24281. });
  24282. $(ret).find(".boolean_vector_var").on('click', function (e) {
  24283. alternateBooleanVectorValue(new_var, $(this).data('index'), this.parentNode);
  24284. 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);
  24285. });
  24286. $(ret).find(".vector_var").on('click', function (e) {
  24287. enableVectorValueUpdate(new_var, $(this).data('index'), this.parentNode, function_name);
  24288. });
  24289. $(ret).find(".remove_global_vector_column").on('click', function (e) {
  24290. removeColumnVector(new_var);
  24291. 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);
  24292. 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);
  24293. $(variable_container).find(".div_valor_var").html('');
  24294. renderValues(new_var, variable_container, function_name);
  24295. });
  24296. $(ret).find(".add_global_vector_column").on('click', function (e) {
  24297. addColumnVector(new_var);
  24298. 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);
  24299. 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);
  24300. $(variable_container).find(".div_valor_var").html('');
  24301. renderValues(new_var, variable_container, function_name);
  24302. });
  24303. $(ret).find(".remove_global_matrix_column").on('click', function (e) {
  24304. removeColumnMatrix(new_var);
  24305. 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);
  24306. 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);
  24307. $(variable_container).find(".div_valor_var").html('');
  24308. renderValues(new_var, variable_container, function_name);
  24309. });
  24310. $(ret).find(".add_global_matrix_column").on('click', function (e) {
  24311. addColumnMatrix(new_var);
  24312. 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);
  24313. 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);
  24314. $(variable_container).find(".div_valor_var").html('');
  24315. renderValues(new_var, variable_container, function_name);
  24316. });
  24317. $(ret).find(".remove_global_matrix_line").on('click', function (e) {
  24318. removeLineMatrix(new_var);
  24319. 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);
  24320. 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);
  24321. $(variable_container).find(".div_valor_var").html('');
  24322. renderValues(new_var, variable_container, function_name);
  24323. });
  24324. $(ret).find(".add_global_matrix_line").on('click', function (e) {
  24325. addLineMatrix(new_var);
  24326. 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);
  24327. 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);
  24328. $(variable_container).find(".div_valor_var").html('');
  24329. renderValues(new_var, variable_container, function_name);
  24330. });
  24331. $(ret).find(".boolean_matrix_var").on('click', function (e) {
  24332. alternateBooleanMatrixValue(new_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  24333. 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);
  24334. });
  24335. $(ret).find(".matrix_var").on('click', function (e) {
  24336. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  24337. enableMatrixValueUpdate(new_var, $(this).data('row'), $(this).data('index'), this.parentNode, function_name);
  24338. });
  24339. $(variable_container).find(".div_valor_var").append(ret);
  24340. updateColumnsAndRowsText(variable_container, new_var);
  24341. }
  24342. function alternateBooleanMatrixValue(var_obj, row, index, value_container) {
  24343. var_obj.value[row][index] = !var_obj.value[row][index];
  24344. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[row][index])));
  24345. }
  24346. function addLineMatrix(var_obj) {
  24347. var_obj.rows++;
  24348. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24349. var n_l = [];
  24350. for (var i = 0; i < var_obj.columns; i++) {
  24351. n_l.push(0);
  24352. }
  24353. var_obj.value.push(n_l);
  24354. }
  24355. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24356. var n_l = [];
  24357. for (i = 0; i < var_obj.columns; i++) {
  24358. n_l.push(0.0);
  24359. }
  24360. var_obj.value.push(n_l);
  24361. }
  24362. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24363. var n_l = [];
  24364. for (i = 0; i < var_obj.columns; i++) {
  24365. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  24366. }
  24367. var_obj.value.push(n_l);
  24368. }
  24369. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24370. var n_l = [];
  24371. for (i = 0; i < var_obj.columns; i++) {
  24372. n_l.push(true);
  24373. }
  24374. var_obj.value.push(n_l);
  24375. }
  24376. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24377. var n_l = [];
  24378. for (i = 0; i < var_obj.columns; i++) {
  24379. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  24380. }
  24381. var_obj.value.push(n_l);
  24382. }
  24383. }
  24384. function removeLineMatrix(var_obj) {
  24385. if (var_obj.rows == 0) {
  24386. return;
  24387. }
  24388. var_obj.rows--;
  24389. var_obj.value.splice(var_obj.value.length - 1, 1);
  24390. }
  24391. function addColumnMatrix(var_obj) {
  24392. var_obj.columns++;
  24393. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24394. for (var i = 0; i < var_obj.rows; i++) {
  24395. var_obj.value[i].push(0);
  24396. }
  24397. }
  24398. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24399. for (var i = 0; i < var_obj.rows; i++) {
  24400. var_obj.value[i].push(0.0);
  24401. }
  24402. }
  24403. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24404. for (var i = 0; i < var_obj.rows; i++) {
  24405. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  24406. }
  24407. }
  24408. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24409. for (var i = 0; i < var_obj.rows; i++) {
  24410. var_obj.value[i].push(true);
  24411. }
  24412. }
  24413. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24414. for (var i = 0; i < var_obj.rows; i++) {
  24415. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  24416. }
  24417. }
  24418. }
  24419. function removeColumnMatrix(var_obj) {
  24420. if (var_obj.columns == 0) {
  24421. return;
  24422. }
  24423. var_obj.columns--;
  24424. for (var i = 0; i < var_obj.rows; i++) {
  24425. var_obj.value[i].splice(var_obj.value[i].length - 1, 1);
  24426. }
  24427. }
  24428. function addColumnVector(var_obj) {
  24429. var_obj.columns++;
  24430. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24431. var_obj.value.push(0);
  24432. }
  24433. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24434. var_obj.value.push(0.0);
  24435. }
  24436. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24437. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  24438. }
  24439. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24440. var_obj.value.push(true);
  24441. }
  24442. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24443. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  24444. }
  24445. }
  24446. function removeColumnVector(var_obj) {
  24447. if (var_obj.columns == 0) {
  24448. return;
  24449. }
  24450. var_obj.columns--;
  24451. var_obj.value.splice(var_obj.value.length - 1, 1);
  24452. }
  24453. function alternateBooleanValue(var_obj, value_container) {
  24454. var_obj.value = !var_obj.value;
  24455. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value)));
  24456. }
  24457. function alternateBooleanVectorValue(var_obj, index, value_container) {
  24458. var_obj.value[index] = !var_obj.value[index];
  24459. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[index])));
  24460. }
  24461. function updateInitialValues(variable_obj, function_name) {
  24462. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24463. if (variable_obj.dimensions == 0) {
  24464. variable_obj.value = 0;
  24465. }
  24466. if (variable_obj.dimensions == 1) {
  24467. variable_obj.value = [0, 0];
  24468. }
  24469. if (variable_obj.dimensions == 2) {
  24470. variable_obj.value = [[0, 0], [0, 0]];
  24471. }
  24472. }
  24473. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24474. if (variable_obj.dimensions == 0) {
  24475. variable_obj.value = 0.0;
  24476. }
  24477. if (variable_obj.dimensions == 1) {
  24478. variable_obj.value = [0.0, 0.0];
  24479. }
  24480. if (variable_obj.dimensions == 2) {
  24481. variable_obj.value = [[0.0, 0.0], [0.0, 0.0]];
  24482. }
  24483. }
  24484. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24485. if (variable_obj.dimensions == 0) {
  24486. variable_obj.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  24487. }
  24488. if (variable_obj.dimensions == 1) {
  24489. 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')];
  24490. }
  24491. if (variable_obj.dimensions == 2) {
  24492. 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')]];
  24493. }
  24494. }
  24495. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24496. if (variable_obj.dimensions == 0) {
  24497. variable_obj.value = true;
  24498. }
  24499. if (variable_obj.dimensions == 1) {
  24500. variable_obj.value = [true, true];
  24501. }
  24502. if (variable_obj.dimensions == 2) {
  24503. variable_obj.value = [[true, true], [true, true]];
  24504. }
  24505. }
  24506. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24507. if (variable_obj.dimensions == 0) {
  24508. variable_obj.value = 'A';
  24509. }
  24510. if (variable_obj.dimensions == 1) {
  24511. variable_obj.value = ['A', 'A'];
  24512. }
  24513. if (variable_obj.dimensions == 2) {
  24514. variable_obj.value = [['A', 'A'], ['A', 'A']];
  24515. }
  24516. }
  24517. 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);
  24518. }
  24519. var opened_name_value_vector_global_ = false;
  24520. var opened_input_value_vector_global_ = null;
  24521. function enableVectorValueUpdate(var_obj, index, parent_node, function_name) {
  24522. if (opened_name_value_vector_global_) {
  24523. opened_input_value_vector_global_.focus();
  24524. return;
  24525. }
  24526. parent_node = $(parent_node);
  24527. opened_name_value_vector_global_ = true;
  24528. parent_node.find('.span_value_variable').text('');
  24529. var input_field;
  24530. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24531. 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) + "' />");
  24532. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24533. } else {
  24534. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[index] + "' />");
  24535. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24536. }
  24537. input_field.on('input', function () {
  24538. var inputWidth = input_field.textWidth() + 10;
  24539. opened_input_value_vector_global_ = input_field;
  24540. input_field.focus();
  24541. var tmpStr = input_field.val();
  24542. input_field.val('');
  24543. input_field.val(tmpStr);
  24544. input_field.css({
  24545. width: inputWidth
  24546. });
  24547. }).trigger('input');
  24548. input_field.focusout(function () {
  24549. var changed = false; /// update array:
  24550. if (input_field.val().trim()) {
  24551. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24552. var_obj.value[index] = parseFloat(input_field.val().trim());
  24553. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24554. } else {
  24555. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24556. var_obj.value[index] = parseInt(input_field.val().trim());
  24557. } else {
  24558. var_obj.value[index] = input_field.val().trim();
  24559. }
  24560. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24561. }
  24562. changed = true;
  24563. } else {
  24564. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24565. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24566. } else {
  24567. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24568. }
  24569. }
  24570. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24571. var_obj.value[index] = input_field.val();
  24572. changed = true;
  24573. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24574. }
  24575. if (changed) {
  24576. 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);
  24577. }
  24578. input_field.off();
  24579. input_field.remove(); /// update elements:
  24580. opened_name_value_vector_global_ = false;
  24581. opened_input_value_vector_global_ = false;
  24582. });
  24583. input_field.on('keydown', function (e) {
  24584. var code = e.keyCode || e.which;
  24585. var changed = false;
  24586. if (code == 13) {
  24587. if (input_field.val().trim()) {
  24588. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24589. var_obj.value[index] = parseFloat(input_field.val().trim());
  24590. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24591. } else {
  24592. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24593. var_obj.value[index] = parseInt(input_field.val().trim());
  24594. } else {
  24595. var_obj.value[index] = input_field.val().trim();
  24596. }
  24597. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24598. }
  24599. changed = true;
  24600. } else {
  24601. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24602. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24603. } else {
  24604. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24605. }
  24606. }
  24607. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24608. var_obj.value[index] = input_field.val();
  24609. changed = true;
  24610. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24611. }
  24612. if (changed) {
  24613. 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);
  24614. }
  24615. input_field.off();
  24616. input_field.remove(); /// update elements:
  24617. opened_name_value_vector_global_ = false;
  24618. opened_input_value_vector_global_ = false;
  24619. }
  24620. if (code == 27) {
  24621. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24622. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24623. } else {
  24624. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24625. }
  24626. input_field.off();
  24627. input_field.remove(); /// update elements:
  24628. opened_name_value_vector_global_ = false;
  24629. opened_input_value_vector_global_ = false;
  24630. }
  24631. });
  24632. input_field.select();
  24633. }
  24634. var opened_name_value_global_var = false;
  24635. var opened_input_value_global_ar = null;
  24636. function enableValueUpdate(var_obj, parent_node, function_name) {
  24637. if (opened_name_value_global_var) {
  24638. opened_input_value_global_ar.focus();
  24639. return;
  24640. }
  24641. parent_node = $(parent_node);
  24642. opened_name_value_global_var = true;
  24643. var input_field;
  24644. parent_node.find('.span_value_variable').text('');
  24645. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24646. 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) + "' />");
  24647. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24648. } else {
  24649. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value + "' />");
  24650. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24651. }
  24652. input_field.on('input', function () {
  24653. var inputWidth = input_field.textWidth() + 10;
  24654. opened_input_value_global_ar = input_field;
  24655. input_field.focus();
  24656. var tmpStr = input_field.val();
  24657. input_field.val('');
  24658. input_field.val(tmpStr);
  24659. input_field.css({
  24660. width: inputWidth
  24661. });
  24662. }).trigger('input');
  24663. input_field.focusout(function () {
  24664. /// update array:
  24665. var changed = false;
  24666. if (input_field.val().trim()) {
  24667. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24668. var_obj.value = parseFloat(input_field.val().trim());
  24669. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24670. } else {
  24671. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24672. var_obj.value = parseInt(input_field.val().trim());
  24673. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24674. var_obj.value = input_field.val().charAt(0);
  24675. } else {
  24676. var_obj.value = input_field.val().trim();
  24677. }
  24678. parent_node.find('.span_value_variable').text(var_obj.value);
  24679. }
  24680. changed = true;
  24681. } else {
  24682. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24683. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24684. } else {
  24685. parent_node.find('.span_value_variable').text(var_obj.value);
  24686. }
  24687. }
  24688. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24689. var_obj.value = input_field.val();
  24690. changed = true;
  24691. parent_node.find('.span_value_variable').text(var_obj.value);
  24692. }
  24693. if (changed) {
  24694. 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);
  24695. }
  24696. input_field.off();
  24697. input_field.remove(); /// update elements:
  24698. opened_name_value_global_var = false;
  24699. opened_input_value_global_ar = false;
  24700. });
  24701. input_field.on('keydown', function (e) {
  24702. var code = e.keyCode || e.which;
  24703. var changed = false;
  24704. if (code == 13) {
  24705. if (input_field.val().trim()) {
  24706. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24707. var_obj.value = parseFloat(input_field.val().trim());
  24708. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24709. } else {
  24710. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24711. var_obj.value = parseInt(input_field.val().trim());
  24712. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24713. var_obj.value = input_field.val().charAt(0);
  24714. } else {
  24715. var_obj.value = input_field.val().trim();
  24716. }
  24717. parent_node.find('.span_value_variable').text(var_obj.value);
  24718. }
  24719. changed = true;
  24720. } else {
  24721. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24722. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24723. } else {
  24724. parent_node.find('.span_value_variable').text(var_obj.value);
  24725. }
  24726. }
  24727. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24728. var_obj.value = input_field.val();
  24729. changed = true;
  24730. parent_node.find('.span_value_variable').text(var_obj.value);
  24731. }
  24732. if (changed) {
  24733. 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);
  24734. }
  24735. input_field.off();
  24736. input_field.remove(); /// update elements:
  24737. opened_name_value_global_var = false;
  24738. opened_input_value_global_ar = false;
  24739. }
  24740. if (code == 27) {
  24741. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24742. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24743. } else {
  24744. parent_node.find('.span_value_variable').text(var_obj.value);
  24745. }
  24746. input_field.off();
  24747. input_field.remove(); /// update elements:
  24748. opened_name_value_global_var = false;
  24749. opened_input_value_global_ar = false;
  24750. }
  24751. });
  24752. input_field.select();
  24753. }
  24754. var opened_name_global = false;
  24755. var opened_input_global = null;
  24756. function enableNameUpdate(variable_obj, variable_container, function_obj) {
  24757. if (opened_name_global) {
  24758. opened_input_global.focus();
  24759. return;
  24760. }
  24761. opened_name_global = true;
  24762. variable_container.find('.span_name_variable').text('');
  24763. var input_name;
  24764. input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + variable_obj.name + "' />");
  24765. input_name.insertBefore(variable_container.find('.span_name_variable'));
  24766. input_name.on('input', function () {
  24767. var inputWidth = input_name.textWidth() + 10;
  24768. opened_input_global = input_name;
  24769. input_name.focus();
  24770. var tmpStr = input_name.val();
  24771. input_name.val('');
  24772. input_name.val(tmpStr);
  24773. input_name.css({
  24774. width: inputWidth
  24775. });
  24776. }).trigger('input');
  24777. input_name.focusout(function () {
  24778. /// update array:
  24779. if (input_name.val().trim().length > 0) {
  24780. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  24781. variable_container.find('.span_name_variable').text(variable_obj.name);
  24782. } else {
  24783. variable_container.find('.span_name_variable').text(variable_obj.name);
  24784. }
  24785. input_name.off();
  24786. input_name.remove(); /// update elements:
  24787. opened_name_global = false;
  24788. opened_input_global = false;
  24789. });
  24790. input_name.on('keydown', function (e) {
  24791. var code = e.keyCode || e.which;
  24792. if (code == 13) {
  24793. if (input_name.val().trim().length > 0) {
  24794. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  24795. variable_container.find('.span_name_variable').text(variable_obj.name);
  24796. } else {
  24797. variable_container.find('.span_name_variable').text(variable_obj.name);
  24798. }
  24799. input_name.off();
  24800. input_name.remove(); /// update elements:
  24801. opened_name_global = false;
  24802. opened_input_global = false;
  24803. }
  24804. if (code == 27) {
  24805. variable_container.find('.span_name_variable').text(variable_obj.name);
  24806. input_name.off();
  24807. input_name.remove(); /// update elements:
  24808. opened_name_global = false;
  24809. opened_input_global = false;
  24810. }
  24811. });
  24812. input_name.select();
  24813. }
  24814. var opened_name_value_matrix_global_v = false;
  24815. var opened_input_value_matrix_global_v = null;
  24816. function enableMatrixValueUpdate(var_obj, row, index, parent_node, function_name) {
  24817. if (opened_name_value_matrix_global_v) {
  24818. opened_input_value_matrix_global_v.focus();
  24819. return;
  24820. }
  24821. parent_node = $(parent_node);
  24822. opened_name_value_matrix_global_v = true;
  24823. parent_node.find('.span_value_variable').text('');
  24824. var input_field;
  24825. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24826. 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) + "' />");
  24827. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24828. } else {
  24829. 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] + "' />");
  24830. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24831. }
  24832. input_field.on('input', function () {
  24833. var inputWidth = input_field.textWidth() + 10;
  24834. opened_input_value_matrix_global_v = input_field;
  24835. input_field.focus();
  24836. var tmpStr = input_field.val();
  24837. input_field.val('');
  24838. input_field.val(tmpStr);
  24839. input_field.css({
  24840. width: inputWidth
  24841. });
  24842. }).trigger('input');
  24843. input_field.focusout(function () {
  24844. var changed = false; /// update array:
  24845. if (input_field.val().trim()) {
  24846. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24847. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  24848. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24849. } else {
  24850. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24851. var_obj.value[row][index] = parseInt(input_field.val().trim());
  24852. } else {
  24853. var_obj.value[row][index] = input_field.val().trim();
  24854. }
  24855. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24856. }
  24857. changed = true;
  24858. } else {
  24859. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24860. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24861. } else {
  24862. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24863. }
  24864. }
  24865. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24866. var_obj.value[row][index] = input_field.val();
  24867. changed = true;
  24868. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24869. }
  24870. if (changed) {
  24871. 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);
  24872. }
  24873. input_field.off();
  24874. input_field.remove(); /// update elements:
  24875. opened_name_value_matrix_global_v = false;
  24876. opened_input_value_matrix_global_v = false;
  24877. });
  24878. input_field.on('keydown', function (e) {
  24879. var code = e.keyCode || e.which;
  24880. var changed = false;
  24881. if (code == 13) {
  24882. if (input_field.val().trim()) {
  24883. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24884. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  24885. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24886. } else {
  24887. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24888. var_obj.value[row][index] = parseInt(input_field.val().trim());
  24889. } else {
  24890. var_obj.value[row][index] = input_field.val().trim();
  24891. }
  24892. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24893. }
  24894. changed = true;
  24895. } else {
  24896. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24897. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24898. } else {
  24899. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24900. }
  24901. }
  24902. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24903. var_obj.value[row][index] = input_field.val();
  24904. changed = true;
  24905. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24906. }
  24907. if (changed) {
  24908. 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);
  24909. }
  24910. input_field.off();
  24911. input_field.remove(); /// update elements:
  24912. opened_name_value_matrix_global_v = false;
  24913. opened_input_value_matrix_global_v = false;
  24914. }
  24915. if (code == 27) {
  24916. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24917. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24918. } else {
  24919. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24920. }
  24921. input_field.off();
  24922. input_field.remove(); /// update elements:
  24923. opened_name_value_matrix_global_v = false;
  24924. opened_input_value_matrix_global_v = false;
  24925. }
  24926. });
  24927. input_field.select();
  24928. }
  24929. /***/ })
  24930. /******/ });
  24931. });
  24932. //# sourceMappingURL=main.057ebe8ca55b355184cd.js.map