main.7121176c0750a24caa1f.js 1.4 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324
  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_02_10 16_25\"}");
  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-48289T1aitCa3P7nn/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-48289mryj67g3StD5/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","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_comment_start":"Comentário inicial da função...","text_comment_main":"Esta é a função principal...","text_read_var":"Entrada/Leitura de dados","text_write_var":"Saída/Escrita de dados","text_command_read":"leia","text_command_write":"escreva","text_return":"devolva","text_btn_return":"Devolver","text_comment":"Comentário","string_join_or":"ou","matrix_info_string":"matriz de $0","vector_info_string":"vetor de $0","text_attribution":"Atribuição","text_if":"se","text_break":"pare","text_else":"senao","text_for":"repita_para","text_code_while":"repita_enquanto","text_code_do":"repita","text_code_do_until":"ate_que","text_command_do":"repita","text_command_while":"repita enquanto","text_command_do_until":"até que","text_code_switch":"escolha","text_code_case":"caso","text_config_programming":"Programação","text_config_programming_both":"Visual e textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Lógicos","text_arithmetic_expression":"Aritméticos","text_iftrue":"Se verdadeiro então","text_message_error_activity_file":"Aconteceu um erro ao processar a atividade. <br> Recarregue a página para tentar novamente.","text_message_error_activity_reload":"Recarregar","text_repeatNtimes":"Repita N vezes","text_receives":"recebe","text_whiletrue":"Enquanto verdadeiro","text_dowhiletrue":"Repita até que verdadeiro","text_switch":"Escolha","text_functioncall":"Chamada de função","text_value":"Valor","text_operator":"Operador","text_parentheses":"Parênteses","text_change":"Alterar","text_teacher_algorithm":"Algoritmo","text_teacher_algorithm_include":"Incluir o algoritmo abaixo no exercício","text_teacher_test_case":"Casos de teste","text_teacher_config":"Configurações","text_teacher_data_types":"Tipos de dados","text_teacher_commands":"Comandos","text_teacher_functions":"Funções","text_teacher_create_functions":"Criar novas funções","text_teacher_create_movement_functions":"Movimentar funções","text_teacher_test_case_input":"Entrada","text_teacher_test_case_output":"Saída","text_teacher_test_case_actions":"Ações","text_teacher_test_case_add":"Adicionar caso de teste","text_header_ivprog_functions":"Funções do iVProg","text_menu_functions_math":"Matemática","text_menu_functions_text":"Texto","text_menu_functions_array":"Arranjo","text_menu_functions_conversion":"Conversão","text_no_variable":"Nenhuma variável declarada","text_no_variable_instruction":"Antes de utilizar uma variável, é necessário criá-la","text_ivprog_description":"Programação Visual interativa na Internet","tooltip_visual":"Programação visual","tooltip_textual":"Programação textual","tooltip_upload":"Upload de código fonte","tooltip_download":"Download do código fonte","tooltip_undo":"Desfazer","tooltip_redo":"Refazer","tooltip_run":"Executar o programa","tooltip_evaluate":"Avaliar o programa","tooltip_help":"Ajuda","tooltip_add_global":"Adicionar variável global","tooltip_hide_function":"Ocultar os elementos da função","var_menu_select_var":"Selecione uma variável","var_menu_select_all":"Selecione","var_menu_select_function":"Selecione uma função","expression_menu_select":"Construir uma expressão lógica","inform_valid_content":"Informe o conteúdo!","inform_valid_expression":"Construa uma expressão lógica!","tooltip_terminal_clear":"Limpa o terminal removendo todos os textos já escritos e os pendentes.","tooltip_terminal_show":"Exibe o terminal caso esteja escondido","tooltip_terminal_hide":"Esconde o terminal caso não esteja escondido","text_ivprog_version":"Versão","text_teacher_filter":"Filtro","text_teacher_filter_active":"Ativado","text_teacher_filter_help":"Ao ativar o filtro, as modificações do iVProg estarão bloqueadas.","text_join_assessment_outputs":" ; ","assessment-detail-time-label":"Duração","assessment-detail-grade-label":"Nota","assessment-detail-input-label":"Entradas","assessment-detail-output-label":"Saídas","assessment-detail-expected-label":"Esperava","assessment-detail-generated-label":"Gerou","assessment-detail-result-label":"Resultado","assessment-detail-title":"Caso de Teste $0","text_teacher_generate_outputs":"Gerar saídas","text_teacher_generate_outputs_algorithm":"Antes de gerar as saídas, elabore um algoritmo!","text_code_for_from":"de","text_code_for_to":"ate","text_code_for_pass":"passo","text_for_from":"de","text_for_to":"até","text_for_pass":"passo","text_relational_expression":"Relacionais","write_command_newline_on":"Quebra de linha ativada","write_command_newline_off":" Quebra de linha desativada","write_seprator_menu_text":"Espaço","initial_program_code":"programa {\\n\\n\\t\\tfuncao vazio inicio () {\\n\\t\\t\\t// Inicie seu codigo aqui!\\n\\t\\t}\\n}","type_char":"caractere","charvar_default_value":"A","write_seprator_menu_tooltip":"Separador para imprimir mais valores/variáveis"},"en":{"function":"function","btn_clear":"Clean","btn_function":"Function","btn_arithmetic_plus":"Addition","btn_arithmetic_minus":"Subtraction","btn_arithmetic_multiplication":"Multiplication","btn_arithmetic_division":"Division","btn_arithmetic_module":"Remainder","btn_break":"break","btn_case":"Case","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_comment_start":"Function initial comment","text_comment_main":"This is the main funcion","text_read_var":"Input/Read data","text_write_var":"Output/Write data","text_command_read":"read","text_command_write":"write","text_return":"return","text_btn_return":"Return","text_comment":"Comment","string_join_or":"or","matrix_info_string":"matrix of $0","vector_info_string":"vector of $0","text_attribution":"Assignment","text_if":"if","text_break":"break","text_else":"else","text_for":"repeat_for","text_code_while":"repeat_while","text_code_do":"repeat","text_code_do_until":"until","text_command_do":"repeat","text_command_while":"repeat while","text_command_do_until":"until","text_code_switch":"switch","text_code_case":"case","text_config_programming":"Programming","text_config_programming_both":"Visual & Textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Logic","text_arithmetic_expression":"Arithmetics","text_iftrue":"If true then","text_message_error_activity_file":"There was an error processing the activity.<br> Reload the page to try again.","text_message_error_activity_reload":"Reload","text_repeatNtimes":"Repeat N times","text_receives":"receives","text_whiletrue":"While true","text_dowhiletrue":"Repeat until true","text_switch":"Switch","text_functioncall":"Function call","text_value":"Value","text_operator":"Operator","text_parentheses":"Parentheses","text_change":"Modify","text_teacher_algorithm":"Algorithm","text_teacher_algorithm_include":"Include the algorithm below in the activity","text_teacher_test_case":"Test cases","text_teacher_config":"Configurations","text_teacher_data_types":"Data types","text_teacher_commands":"Commands","text_teacher_functions":"Functions","text_teacher_create_functions":"Create new functions","text_teacher_create_movement_functions":"Move functions","text_teacher_test_case_input":"Input","text_teacher_test_case_output":"Output","text_teacher_test_case_actions":"Actions","text_teacher_test_case_add":"Add test case","text_header_ivprog_functions":"iVProg Functions","text_menu_functions_math":"Math","text_menu_functions_text":"Text","text_menu_functions_array":"Array","text_menu_functions_conversion":"Conversion","text_no_variable":"No variable declared","text_no_variable_instruction":"Before using a variable, you need to create it","text_ivprog_description":"Interactive and Visual Programming on the Internet","tooltip_visual":"Visual programming","tooltip_textual":"Textual programming","tooltip_upload":"Upload source code","tooltip_download":"Download source code","tooltip_undo":"Undo","tooltip_redo":"Redo","tooltip_run":"Run the program","tooltip_evaluate":"Evaluate the program","tooltip_help":"Help","tooltip_add_global":"Add a global variable","tooltip_hide_function":"Hide function elements","var_menu_select_var":"Select a variable","var_menu_select_all":"Select","var_menu_select_function":"Select a function","expression_menu_select":"Construct a logic expression","inform_valid_content":"Provide some data","inform_valid_expression":"Construct a logic expression","tooltip_terminal_clear":"Clears the terminal by removing all wrriten and pending text.","tooltip_terminal_show":"Shows the terminal if it is hidden","tooltip_terminal_hide":"Hides the terminal if it is not on display","text_ivprog_version":"Version","text_teacher_filter":"Filter","text_teacher_filter_active":"Activated","text_teacher_filter_help":"By activating the filter modifications in iVProg will be blocked","text_join_assessment_outputs":" ; ","assessment-detail-time-label":"Duration","assessment-detail-grade-label":"Grade","assessment-detail-input-label":"Inputs","assessment-detail-output-label":"Outputs","assessment-detail-expected-label":"Expected","assessment-detail-generated-label":"Generated","assessment-detail-result-label":"Result","assessment-detail-title":"Test Case $0","text_teacher_generate_outputs":"Generate outputs","text_teacher_generate_outputs_algorithm":"Before generating the outputs you need to create an algorithm","text_code_for_from":"from","text_code_for_to":"to","text_code_for_pass":"pass","text_for_from":"from","text_for_to":"to","text_for_pass":"pass","text_relational_expression":"Relational","write_command_newline_on":" Line break is on","write_command_newline_off":" Line break is off","write_seprator_menu_text":"Spacer","initial_program_code":"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}","type_char":"char","charvar_default_value":"A","write_seprator_menu_tooltip":"Separator used to print more values/variables"},"es":{"function":"function","btn_clear":"Limpiar","btn_function":"Funcíon","btn_arithmetic_plus":"Adición","btn_arithmetic_minus":"Sustracción","btn_arithmetic_multiplication":"Multiplicación","btn_arithmetic_division":"División","btn_arithmetic_module":"Resto","btn_break":"break","btn_case":"Caso","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_comment_start":"Comentario inicial de la función","text_comment_main":"Esta es la función principal","text_read_var":"Entrada/Lectura de dados","text_write_var":"Salida/Escribir datos","text_command_read":"read","text_command_write":"write","text_return":"return","text_btn_return":"Devolución","text_comment":"Comentario","string_join_or":"or","matrix_info_string":"matriz de $0","vector_info_string":"vector de $0","text_attribution":"Asignación","text_if":"if","text_break":"break","text_else":"else","text_for":"repeat_for","text_code_while":"repeat_while","text_code_do":"repeat","text_code_do_until":"until","text_command_do":"repeat","text_command_while":"repeat while","text_command_do_until":"until","text_code_switch":"switch","text_code_case":"case","text_config_programming":"Programación","text_config_programming_both":"Visual & Textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Lógicos","text_arithmetic_expression":"Aritmética","text_iftrue":"Si verdad entonces","text_message_error_activity_file":"Se produjo un error al procesar la actividad.<br> Recargar la página para volver a intentarlo.","text_message_error_activity_reload":"Recargar","text_repeatNtimes":"Repetir N veces","text_receives":"receives","text_whiletrue":"Mientras verdad","text_dowhiletrue":"Repita hasta verdad","text_switch":"Switch","text_functioncall":"Llamada de función","text_value":"Valor","text_operator":"Operador","text_parentheses":"Paréntesis","text_change":"Modify","text_teacher_algorithm":"Algorithm","text_teacher_algorithm_include":"Incluir el algoritmo en la actividad.","text_teacher_test_case":"Test cases","text_teacher_config":"Configuraciones","text_teacher_data_types":"Data types","text_teacher_commands":"Commands","text_teacher_functions":"Funciones","text_teacher_create_functions":"Create new functions","text_teacher_create_movement_functions":"Move functions","text_teacher_test_case_input":"Input","text_teacher_test_case_output":"Output","text_teacher_test_case_actions":"Actions","text_teacher_test_case_add":"Add test case","text_header_ivprog_functions":"iVProg Functions","text_menu_functions_math":"Math","text_menu_functions_text":"Text","text_menu_functions_array":"Array","text_menu_functions_conversion":"Conversion","text_no_variable":"No variable declared","text_no_variable_instruction":"Antes de usar una variable, debe crearla","text_ivprog_description":"Interactive and Visual Programming on the Internet","tooltip_visual":"Visual programming","tooltip_textual":"Textual programming","tooltip_upload":"Upload source code","tooltip_download":"Download source code","tooltip_undo":"Undo","tooltip_redo":"Redo","tooltip_run":"Run the program","tooltip_evaluate":"Evaluate the program","tooltip_help":"Help","tooltip_add_global":"Add a global variable","tooltip_hide_function":"Hide function elements","var_menu_select_var":"Select a variable","var_menu_select_all":"Select","var_menu_select_function":"Select a function","expression_menu_select":"Construct a logic expression","inform_valid_content":"Proporcionar algunos datos","inform_valid_expression":"Construct a logic expression","tooltip_terminal_clear":"Borra el terminal eliminando todo el texto escrito y pendiente.","tooltip_terminal_show":"Muestra el terminal si está oculto.","tooltip_terminal_hide":"Oculta el terminal si no está en exhibición","text_ivprog_version":"Version","text_teacher_filter":"Filter","text_teacher_filter_active":"Activated","text_teacher_filter_help":"Al activar el filtro, las modificaciones en iVProg serán bloqueadas","text_join_assessment_outputs":" ;","assessment-detail-time-label":"Duration","assessment-detail-grade-label":"Grade","assessment-detail-input-label":"Inputs","assessment-detail-output-label":"Outputs","assessment-detail-expected-label":"Expected","assessment-detail-generated-label":"Generated","assessment-detail-result-label":"Result","assessment-detail-title":"Test Case $0","text_teacher_generate_outputs":"Generate outputs","text_teacher_generate_outputs_algorithm":"Antes de generar las salidas necesita crear un algoritmo","text_code_for_from":"from","text_code_for_to":"to","text_code_for_pass":"pass","text_for_from":"from","text_for_to":"to","text_for_pass":"pass","text_relational_expression":"Relational","write_command_newline_on":"El salto de línea está activado","write_command_newline_off":"El salto de línea está desactivado","write_seprator_menu_text":"Spacer","initial_program_code":"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}","type_char":"char","charvar_default_value":"A","write_seprator_menu_tooltip":"Separator used to print more values/variables"}}
  1466. /***/ }),
  1467. /***/ "./js/assessment/ivprogAssessment.js":
  1468. /*!*******************************************!*\
  1469. !*** ./js/assessment/ivprogAssessment.js ***!
  1470. \*******************************************/
  1471. /*! exports provided: IVProgAssessment */
  1472. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1473. "use strict";
  1474. __webpack_require__.r(__webpack_exports__);
  1475. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgAssessment", function() { return IVProgAssessment; });
  1476. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  1477. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  1478. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  1479. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  1480. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  1481. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  1482. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  1483. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  1484. /* harmony import */ var _output_matching_output_matching__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./output_matching/output_matching */ "./js/assessment/output_matching/output_matching.js");
  1485. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  1486. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  1487. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_5__["getInstance"]();
  1488. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_2__["default"].StringTypes;
  1489. var AssessmentConfig = {
  1490. max_instruction_count: 350250,
  1491. suspend_threshold: 200
  1492. };
  1493. var IVProgAssessment = /*#__PURE__*/function () {
  1494. function IVProgAssessment(ast_code, testCases, domConsole) {
  1495. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgAssessment);
  1496. this.ast_code = ast_code;
  1497. this.testCases = testCases;
  1498. this.domConsole = domConsole;
  1499. this.old_config = JSON.parse(JSON.stringify(_util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]));
  1500. _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].setConfig(AssessmentConfig);
  1501. }
  1502. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgAssessment, [{
  1503. key: "runTest",
  1504. value: function runTest() {
  1505. var _this = this;
  1506. try {
  1507. // loop test cases and show messages through domconsole
  1508. var partialTests = this.testCases.map(function (t, name) {
  1509. return new _output_matching_output_matching__WEBPACK_IMPORTED_MODULE_6__["OutputMatching"](new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_3__["IVProgProcessor"](_this.ast_code), t.input, t.output, name);
  1510. });
  1511. var testResult = partialTests.map(function (om) {
  1512. return om.eval();
  1513. });
  1514. return Promise.all(testResult).then(function (results) {
  1515. var grade = 0;
  1516. for (var i = 0; i < results.length; i += 1) {
  1517. var result = results[i];
  1518. grade += result.grade;
  1519. if (result.grade == 1) {
  1520. _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].INFO, StringTypes.MESSAGE, 'test_case_success', result.name + 1, result.generateOutput());
  1521. } else if (result.status == 1) {
  1522. _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.ERROR, 'test_case_failed_exception', result.name + 1, result.error_msg, result.generateOutput());
  1523. } else {
  1524. _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.ERROR, 'test_case_failed', result.name + 1, result.generateOutput());
  1525. }
  1526. }
  1527. grade /= results.length;
  1528. var channel = grade == 1 ? _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].INFO : _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR;
  1529. _this.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", (grade * 100).toFixed(2));
  1530. return grade;
  1531. }); // return testResult.then(function (total) {
  1532. // const grade = total / this.testCases.length;
  1533. // const channel = grade == 1 ? DOMConsole.INFO : DOMConsole.ERR;
  1534. // this.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", (grade * 100).toFixed(2));
  1535. // return Promise.resolve(grade)
  1536. // }).catch(err => {
  1537. // this.domConsole.err("Erro inesperado durante o cálculo da nota.");// try and show error messages through domconsole
  1538. // this.domConsole.err(err.message);
  1539. // return Promise.resolve(0);
  1540. // });
  1541. } catch (error) {
  1542. this.showErrorMessage(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.MESSAGE, "unexpected_execution_error");
  1543. this.domConsole.err(error.message);
  1544. return Promise.resolve(0);
  1545. } finally {
  1546. _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].setConfig(this.old_config);
  1547. }
  1548. }
  1549. }, {
  1550. key: "showErrorMessage",
  1551. value: function showErrorMessage(errorID) {
  1552. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1553. args[_key - 1] = arguments[_key];
  1554. }
  1555. this.domConsole.err(LocalizedStrings.getError(errorID, args));
  1556. }
  1557. }, {
  1558. key: "showInfoMessage",
  1559. value: function showInfoMessage(msgID) {
  1560. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1561. args[_key2 - 1] = arguments[_key2];
  1562. }
  1563. this.domConsole.info(LocalizedStrings.getMessage(msgID, args));
  1564. }
  1565. }, {
  1566. key: "writeToConsole",
  1567. value: function writeToConsole(channel, msgType, msgID) {
  1568. var msg = LocalizedStrings.getString(msgID, msgType);
  1569. for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
  1570. args[_key3 - 3] = arguments[_key3];
  1571. }
  1572. msg = LocalizedStrings.processString(msg, args);
  1573. this.domConsole.writeRawHTML(msg, channel);
  1574. }
  1575. }]);
  1576. return IVProgAssessment;
  1577. }();
  1578. /***/ }),
  1579. /***/ "./js/assessment/output_matching/assessment_result.js":
  1580. /*!************************************************************!*\
  1581. !*** ./js/assessment/output_matching/assessment_result.js ***!
  1582. \************************************************************/
  1583. /*! exports provided: OutputAssessmentResult */
  1584. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1585. "use strict";
  1586. __webpack_require__.r(__webpack_exports__);
  1587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputAssessmentResult", function() { return OutputAssessmentResult; });
  1588. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  1589. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  1590. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  1591. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  1592. /* harmony import */ var _util_string_diff__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../util/string_diff */ "./js/util/string_diff.js");
  1593. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  1594. var OutputAssessmentResult = /*#__PURE__*/function () {
  1595. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputAssessmentResult, null, [{
  1596. key: "PAGE_TEMPLATE",
  1597. get: function get() {
  1598. return "<!DOCTYPE html>\n <html>\n <head>\n <meta http-equiv='content-type' content='text/html; charset=UTF-8'>\n <link rel='stylesheet' href='css/ivprog-assessment.css' type='text/css'/>\n </head>\n <body>\n :assessment-result:\n </body>\n </html>";
  1599. }
  1600. }, {
  1601. key: "DETAIL_TEMPLATE",
  1602. get: function get() {
  1603. return "<div class='details-body'>\n <div class='details-header'>\n <h2>:test-name:</h2>\n <p>:time-label:: <span>:time:ms</span></p>\n <p>:grade-label:: <span>:grade:%</span></p>\n </div>\n <div>\n <h3>:input-label:</h3>\n <ul>\n <li>:input-list:</li>\n </ul>\n </div>\n <div>\n <h3>:output-label:</h3>\n :output-result:\n </div>\n </div>";
  1604. }
  1605. }, {
  1606. key: "OUPUT_TABLE_TEMPLATE",
  1607. get: function get() {
  1608. return "<div class='detaisl-div-table'>\n <table class='assessment-output-table'>\n <tr>\n <th>:expected-label:</th>\n <th>:generated-label:</th>\n <th>:result-label:</th>\n </tr>\n :results:\n </table>\n </div>";
  1609. }
  1610. }, {
  1611. key: "OUTPUT_TEMPLATE",
  1612. get: function get() {
  1613. return "<tr><td class=':class-expected:'>$0</td>\n <td class=':class-generated:'>$1</td>\n <td class=':class-result:'>$2</td></tr>";
  1614. }
  1615. }, {
  1616. key: "EMPTY_OUTPUT_TEMPLATE",
  1617. get: function get() {
  1618. return "<div class='assessment-popup'><img class='assessment-empty-output' src='img/empty.svg'>\n <span class='assessment-popuptext'>$0</span></div>";
  1619. }
  1620. }, {
  1621. key: "FAILED_TEMPLATE",
  1622. get: function get() {
  1623. return "<p class='assessment-failed-execution'><span class='assessment-failed-case'>\u2717</span>$0</p>";
  1624. }
  1625. }, {
  1626. key: "INPUT_INFO_TEMPLATE",
  1627. get: function get() {
  1628. return "<span class='$0'>$1</span>";
  1629. } // Status code - it is not grade related!
  1630. // 0 - Succesful execution
  1631. // 1 - failed execution
  1632. }]);
  1633. function OutputAssessmentResult(name, status, inputs, result, store, time) {
  1634. var error_msg = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
  1635. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputAssessmentResult);
  1636. this.name = name;
  1637. this.status = status;
  1638. this.inputs = inputs;
  1639. this.results = result;
  1640. this.store = store;
  1641. this.time = time;
  1642. this.error_msg = error_msg;
  1643. }
  1644. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputAssessmentResult, [{
  1645. key: "prepareResults",
  1646. value: function prepareResults() {
  1647. var _this = this;
  1648. var template = OutputAssessmentResult.DETAIL_TEMPLATE;
  1649. var grade = (this.grade * 100).toFixed(2);
  1650. var time = this.time || "-";
  1651. template = template.replace(':test-name:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-title', [this.name + 1]));
  1652. template = template.replace(':time-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-time-label'));
  1653. template = template.replace(':time:', time);
  1654. template = template.replace(':grade-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-grade-label'));
  1655. template = template.replace(':grade:', grade);
  1656. var input_spans = this.prepareInputList(this.inputs);
  1657. template = template.replace(':input-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-input-label'));
  1658. template = template.replace(':input-list:', input_spans);
  1659. template = template.replace(':output-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-output-label'));
  1660. if (this.status == 0) {
  1661. var output_rows = this.results.map(function (result) {
  1662. if (result.type == "string") {
  1663. return _this.formatString(result);
  1664. } else if (result.type == "number") {
  1665. return _this.formatNumber(result);
  1666. } else {
  1667. return _this.formatBool(result);
  1668. }
  1669. }, this);
  1670. template = template.replace(':output-result:', this.prepareOutputTable(output_rows));
  1671. } else {
  1672. var failed_text = OutputAssessmentResult.FAILED_TEMPLATE;
  1673. failed_text = failed_text.replace("$0", this.error_msg);
  1674. template = template.replace(":output-result:", failed_text);
  1675. }
  1676. return template;
  1677. }
  1678. }, {
  1679. key: "prepareInputList",
  1680. value: function prepareInputList(input_list) {
  1681. var list = input_list.map(function (input) {
  1682. var template = OutputAssessmentResult.INPUT_INFO_TEMPLATE;
  1683. template = template.replace("$1", input.value);
  1684. if (input.read) {
  1685. template = template.replace("$0", "assessment-input-read");
  1686. } else {
  1687. template = template.replace("$0", "assessment-input-unread");
  1688. }
  1689. return template;
  1690. }, this);
  1691. return list.join(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('text_join_assessment_outputs'));
  1692. }
  1693. }, {
  1694. key: "prepareOutputTable",
  1695. value: function prepareOutputTable(output_rows) {
  1696. var template = OutputAssessmentResult.OUPUT_TABLE_TEMPLATE;
  1697. template = template.replace(':expected-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-expected-label'));
  1698. template = template.replace(':generated-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-generated-label'));
  1699. template = template.replace(':result-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-result-label'));
  1700. template = template.replace(':results:', output_rows.join(''));
  1701. return template;
  1702. }
  1703. }, {
  1704. key: "generateOutput",
  1705. value: function generateOutput() {
  1706. var assessment_result = this.prepareResults();
  1707. var page = OutputAssessmentResult.PAGE_TEMPLATE;
  1708. page = page.replace(':assessment-result:', assessment_result);
  1709. page = page.replace(/(\r|\n|\t)/gm, '').replace(/> *</g, '><');
  1710. return page;
  1711. }
  1712. }, {
  1713. key: "formatNumber",
  1714. value: function formatNumber(result) {
  1715. var result_class = result.grade == 1 ? 'assessment-number-result' : 'assessment-number-result-failed';
  1716. var template = this.formatOutput('assessment-number-expected', 'assessment-number-generated', result_class, result);
  1717. return template;
  1718. }
  1719. }, {
  1720. key: "formatBool",
  1721. value: function formatBool(result) {
  1722. var result_class = result.grade == 1 ? 'assessment-bool-result' : 'assessment-bool-result-failed';
  1723. var template = this.formatOutput('assessment-bool-expected', 'assessment-bool-generated', result_class, result);
  1724. return template;
  1725. }
  1726. }, {
  1727. key: "formatOutput",
  1728. value: function formatOutput(expected_class, generated_class, result_class, result) {
  1729. var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
  1730. template = template.replace(":class-expected:", expected_class);
  1731. template = template.replace(":class-generated:", generated_class);
  1732. template = template.replace(":class-result:", result_class);
  1733. var expected_tmpl = result.expected;
  1734. var generated_tmpl = result.generated;
  1735. if (expected_tmpl == null) {
  1736. expected_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-expected-tooltip'));
  1737. } else if (generated_tmpl == null) {
  1738. generated_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-generated-tooltip'));
  1739. }
  1740. template = template.replace("$0", expected_tmpl);
  1741. template = template.replace("$1", generated_tmpl);
  1742. var final_result = result.grade == 1 ? "✓" : "✗";
  1743. template = template.replace("$2", final_result);
  1744. return template;
  1745. }
  1746. }, {
  1747. key: "formatString",
  1748. value: function formatString(result) {
  1749. var _this2 = this;
  1750. var expected_class = 'assessment-string-expected';
  1751. var generated_class = 'assessment-string-generated'; //const result_class = 'assessment-string-result';
  1752. var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
  1753. template = template.replace(":class-expected:", expected_class);
  1754. template = template.replace(":class-generated:", generated_class); //template = template.replace(":class-result:", result_class);
  1755. var g_string = result.generated || "";
  1756. var e_string = result.expected || ""; // console.log("generated: ", g_string,"expected: ", e_string);
  1757. var g_string_tmpl = g_string;
  1758. var e_string_tmpl = e_string;
  1759. if (result.generated == null) {
  1760. g_string_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-generated-tooltip'));
  1761. } else if (result.expected == null) {
  1762. e_string_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-expected-tooltip'));
  1763. }
  1764. template = template.replace("$0", e_string_tmpl);
  1765. template = template.replace("$1", g_string_tmpl);
  1766. if (result.grade == 1) {
  1767. template = template.replace("$2", "✓");
  1768. template = template.replace(":class-result:", 'assessment-string-result');
  1769. } else {
  1770. var diff = Object(_util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"])(g_string, e_string); // console.log(diff);
  1771. var diff_vec = diff.map(function (part) {
  1772. return _this2.getDiffStringStyle(part[1], part[0]);
  1773. }, this);
  1774. var diff_string = diff_vec.reduce(function (prev, actual) {
  1775. return prev + actual;
  1776. }, "");
  1777. template = template.replace("$2", "<span class='assessment-failed-case'>✗</span>" + diff_string);
  1778. template = template.replace(":class-result:", "assessment-string-diff");
  1779. }
  1780. return template;
  1781. }
  1782. }, {
  1783. key: "getDiffStringStyle",
  1784. value: function getDiffStringStyle(text, action) {
  1785. var template = "<span class='$0'>$1</span>"; // Fix missing whitespace when its a single element
  1786. text = text.replace(/\s/g, "&#160;");
  1787. switch (action) {
  1788. case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].INSERT:
  1789. return template.replace("$0", "stringdiff-insert").replace("$1", text);
  1790. case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].DELETE:
  1791. return template.replace("$0", "stringdiff-delete").replace("$1", text);
  1792. case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].EQUAL:
  1793. return template.replace("$0", "stringdiff-equal").replace("$1", text);
  1794. }
  1795. }
  1796. }, {
  1797. key: "grade",
  1798. get: function get() {
  1799. if (this.results == null) {
  1800. return 0;
  1801. }
  1802. return this.results.reduce(function (prev, val) {
  1803. return prev + val.grade;
  1804. }, 0) / this.results.length;
  1805. }
  1806. }]);
  1807. return OutputAssessmentResult;
  1808. }();
  1809. /***/ }),
  1810. /***/ "./js/assessment/output_matching/output_matching.js":
  1811. /*!**********************************************************!*\
  1812. !*** ./js/assessment/output_matching/output_matching.js ***!
  1813. \**********************************************************/
  1814. /*! exports provided: OutputMatching */
  1815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1816. "use strict";
  1817. __webpack_require__.r(__webpack_exports__);
  1818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatching", function() { return OutputMatching; });
  1819. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  1820. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  1821. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  1822. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  1823. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  1824. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
  1825. /* harmony import */ var _util_input_assessment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/input_assessment */ "./js/util/input_assessment.js");
  1826. /* harmony import */ var _util_outputTest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/outputTest */ "./js/util/outputTest.js");
  1827. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
  1828. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_5__);
  1829. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/utils */ "./js/util/utils.js");
  1830. /* harmony import */ var _assessment_result__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./assessment_result */ "./js/assessment/output_matching/assessment_result.js");
  1831. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  1832. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  1833. /* harmony import */ var _output_result__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./output_result */ "./js/assessment/output_matching/output_result.js");
  1834. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_9__["getInstance"]();
  1835. var OutputMatching = /*#__PURE__*/function () {
  1836. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputMatching, null, [{
  1837. key: "NUM_REGEX",
  1838. get: function get() {
  1839. return /^[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)$/;
  1840. }
  1841. }, {
  1842. key: "NUM_IN_STRING_REGEX",
  1843. get: function get() {
  1844. return /[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)/g;
  1845. }
  1846. }, {
  1847. key: "BOOLEAN_REGEX",
  1848. get: function get() {
  1849. var str = "^(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")$");
  1850. return new RegExp(str);
  1851. }
  1852. }, {
  1853. key: "BOOLEAN_IN_STRING_REGEX",
  1854. get: function get() {
  1855. var str = "(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")");
  1856. return new RegExp(str, 'g');
  1857. }
  1858. }]);
  1859. function OutputMatching(program, input_list, expected_output, test_name) {
  1860. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputMatching);
  1861. this.program = program;
  1862. this.name = test_name;
  1863. this.input_list = input_list;
  1864. this.expected_output = expected_output;
  1865. }
  1866. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputMatching, [{
  1867. key: "eval",
  1868. value: function _eval() {
  1869. var _this = this;
  1870. var refThis = this;
  1871. var input = new _util_input_assessment__WEBPACK_IMPORTED_MODULE_3__["InputAssessment"](this.input_list);
  1872. var gen_output = new _util_outputTest__WEBPACK_IMPORTED_MODULE_4__["OutputTest"]();
  1873. this.program.registerInput(input);
  1874. this.program.registerOutput(gen_output);
  1875. var start_time = Date.now();
  1876. return this.program.interpretAST().then(function (sto) {
  1877. var final_time = Date.now() - start_time;
  1878. if (input.isInputAvailable()) {
  1879. return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 1, input.input_list, null, sto, final_time, refThis.getErrorMessage('test_case_few_reads', _this.name + 1));
  1880. }
  1881. var result = gen_output.list.map(function (g_out, i) {
  1882. if (i >= _this.expected_output.length) {
  1883. return new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"](null, g_out, 0, _this.getPotentialOutputType(g_out));
  1884. }
  1885. return _this.outputMatch(g_out, _this.expected_output[i]);
  1886. }, _this);
  1887. if (_this.expected_output.length > gen_output.list.length) {
  1888. console.log("Saída insuficientes!", _this.expected_output.length, gen_output.list.length);
  1889. for (var i = gen_output.list.length; i < _this.expected_output.length; ++i) {
  1890. var e_out = _this.expected_output[i];
  1891. result.push(new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"](e_out, null, 0, _this.getPotentialOutputType(e_out)));
  1892. }
  1893. } else if (_this.expected_output.length == 0 && _this.expected_output.length == gen_output.list.length) {
  1894. // no output expected....
  1895. result.push(new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"]("", "", 1, "string"));
  1896. }
  1897. return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 0, input.input_list, result, sto, final_time);
  1898. })["catch"](function (error) {
  1899. return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 1, input.input_list, null, null, null, refThis.getErrorMessage('test_case_exception', _this.name + 1, error.message));
  1900. });
  1901. }
  1902. }, {
  1903. key: "getPotentialOutputType",
  1904. value: function getPotentialOutputType(output) {
  1905. if (OutputMatching.NUM_REGEX.test(output)) {
  1906. return "number";
  1907. } else if (OutputMatching.BOOLEAN_REGEX.test(output)) {
  1908. return "bool";
  1909. } else {
  1910. return "string";
  1911. }
  1912. }
  1913. }, {
  1914. key: "outputMatch",
  1915. value: function outputMatch(g_output, e_output) {
  1916. if (OutputMatching.NUM_REGEX.test(e_output)) {
  1917. if (!OutputMatching.NUM_REGEX.test(g_output)) {
  1918. return this.checkStrings(g_output, e_output);
  1919. }
  1920. var g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](g_output);
  1921. var e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](e_output);
  1922. return this.checkNumbers(g_num, e_num);
  1923. } else if (OutputMatching.BOOLEAN_REGEX.test(e_output)) {
  1924. if (!OutputMatching.BOOLEAN_REGEX.test(g_output)) {
  1925. return this.checkStrings(g_output, e_output);
  1926. }
  1927. var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](g_output);
  1928. var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](e_output);
  1929. return this.checkBoolean(g_bool, e_bool);
  1930. } else {
  1931. return this.checkStrings(g_output, e_output);
  1932. }
  1933. }
  1934. }, {
  1935. key: "checkNumbers",
  1936. value: function checkNumbers(g_num, e_num) {
  1937. var decimalPlaces = Math.min(e_num.dp(), _util_config__WEBPACK_IMPORTED_MODULE_5__["Config"].decimalPlaces);
  1938. g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](g_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"].ROUND_FLOOR));
  1939. e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](e_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"].ROUND_FLOOR));
  1940. var result = g_num.eq(e_num);
  1941. var grade = result ? 1 : 0;
  1942. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](e_num.toNumber(), g_num.toNumber(), grade);
  1943. }
  1944. }, {
  1945. key: "checkBoolean",
  1946. value: function checkBoolean(g_bool, e_bool) {
  1947. var grade = g_bool == e_bool ? 1 : 0;
  1948. var g_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["convertBoolToString"](g_bool);
  1949. var e_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["convertBoolToString"](e_bool);
  1950. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](e_bool_text, g_bool_text, grade);
  1951. }
  1952. }, {
  1953. key: "checkStrings",
  1954. value: function checkStrings(g_output, e_ouput) {
  1955. var _this2 = this;
  1956. var assessmentList = [];
  1957. var e_output_clean = e_ouput.trim();
  1958. var g_output_clean = g_output.trim();
  1959. if (OutputMatching.NUM_IN_STRING_REGEX.test(e_ouput)) {
  1960. var expected_numbers = e_ouput.match(OutputMatching.NUM_IN_STRING_REGEX);
  1961. var generated_numbers = g_output.match(OutputMatching.NUM_IN_STRING_REGEX) || [];
  1962. var result = generated_numbers.map(function (val, i) {
  1963. if (i >= expected_numbers.length) {
  1964. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](null, val, 0);
  1965. }
  1966. var g_val = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](val);
  1967. var e_val = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](expected_numbers[i]);
  1968. return _this2.checkNumbers(g_val, e_val);
  1969. }, this);
  1970. if (expected_numbers.length > generated_numbers.length) {
  1971. for (var i = generated_numbers.length; i < expected_numbers.length; ++i) {
  1972. result.push(_output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](expected_numbers[i], null, 0));
  1973. }
  1974. }
  1975. e_output_clean = e_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '');
  1976. g_output_clean = g_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '');
  1977. var numberGrade = result.reduce(function (prev, r) {
  1978. return prev + r.grade;
  1979. }, 0) / result.length;
  1980. assessmentList.push(numberGrade);
  1981. }
  1982. if (OutputMatching.BOOLEAN_IN_STRING_REGEX.test(e_ouput)) {
  1983. var expected_bools = e_ouput.match(OutputMatching.BOOLEAN_IN_STRING_REGEX);
  1984. var generated_bools = g_output.match(OutputMatching.BOOLEAN_IN_STRING_REGEX) || [];
  1985. var _result = generated_bools.map(function (val, i) {
  1986. if (i >= expected_bools.length) {
  1987. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](null, val, 0);
  1988. }
  1989. var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](val);
  1990. var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](expected_bools[i]);
  1991. return _this2.checkBoolean(g_bool, e_bool);
  1992. }, this);
  1993. if (expected_bools.length > generated_bools.length) {
  1994. for (var _i = generated_bools.length; _i < expected_bools.length; ++_i) {
  1995. _result.push(_output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](expected_bools[_i], null, 0));
  1996. }
  1997. }
  1998. e_output_clean = e_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '');
  1999. g_output_clean = g_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '');
  2000. var boolGrade = _result.reduce(function (prev, r) {
  2001. return prev + r.grade;
  2002. }, 0) / _result.length;
  2003. assessmentList.push(boolGrade);
  2004. }
  2005. var dist = Object(_util_utils__WEBPACK_IMPORTED_MODULE_6__["levenshteinDistance"])(g_output_clean, e_output_clean);
  2006. var gradeDiff = Math.max(0, e_output_clean.length - dist) / e_output_clean.length;
  2007. gradeDiff = Number.isNaN(gradeDiff) ? 0 : gradeDiff;
  2008. var assessment_size = assessmentList.length + 1;
  2009. var gradeAcc = assessmentList.reduce(function (prev, val) {
  2010. return prev + val / assessment_size;
  2011. }, 0);
  2012. var finalGrade = 1 * (gradeDiff / assessment_size + gradeAcc);
  2013. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createStringResult"](e_ouput, g_output, finalGrade);
  2014. }
  2015. }, {
  2016. key: "getErrorMessage",
  2017. value: function getErrorMessage(errorID) {
  2018. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2019. args[_key - 1] = arguments[_key];
  2020. }
  2021. return LocalizedStrings.getError(errorID, args);
  2022. }
  2023. }]);
  2024. return OutputMatching;
  2025. }();
  2026. /***/ }),
  2027. /***/ "./js/assessment/output_matching/output_result.js":
  2028. /*!********************************************************!*\
  2029. !*** ./js/assessment/output_matching/output_result.js ***!
  2030. \********************************************************/
  2031. /*! exports provided: createNumberResult, createBoolResult, createStringResult, OutputMatchResult */
  2032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2033. "use strict";
  2034. __webpack_require__.r(__webpack_exports__);
  2035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumberResult", function() { return createNumberResult; });
  2036. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBoolResult", function() { return createBoolResult; });
  2037. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStringResult", function() { return createStringResult; });
  2038. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatchResult", function() { return OutputMatchResult; });
  2039. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2040. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2041. function createNumberResult(expected, generated, grade) {
  2042. return new OutputMatchResult(expected, generated, grade, "number");
  2043. }
  2044. function createBoolResult(expected, generated, grade) {
  2045. return new OutputMatchResult(expected, generated, grade, "bool");
  2046. }
  2047. function createStringResult(expected, generated, grade) {
  2048. return new OutputMatchResult(expected, generated, grade, "string");
  2049. }
  2050. var OutputMatchResult = function OutputMatchResult(expected, generated, grade, type) {
  2051. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputMatchResult);
  2052. this.expected = expected;
  2053. this.generated = generated;
  2054. this.grade = grade;
  2055. this.type = type;
  2056. };
  2057. /***/ }),
  2058. /***/ "./js/ast/ast_helpers.js":
  2059. /*!*******************************!*\
  2060. !*** ./js/ast/ast_helpers.js ***!
  2061. \*******************************/
  2062. /*! exports provided: recover */
  2063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2064. "use strict";
  2065. __webpack_require__.r(__webpack_exports__);
  2066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recover", function() { return recover; });
  2067. /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
  2068. function recover(_) {
  2069. var start = this._tokenStartCharIndex;
  2070. var stop = this._input.index;
  2071. var text = this._input.getText(start, stop);
  2072. text = this.getErrorDisplay(text);
  2073. var line = this._tokenStartLine;
  2074. var column = this._tokenStartColumn;
  2075. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__["SyntaxErrorFactory"].invalid_character(text, line, column);
  2076. }
  2077. /***/ }),
  2078. /***/ "./js/ast/commands/arrayAssign.js":
  2079. /*!****************************************!*\
  2080. !*** ./js/ast/commands/arrayAssign.js ***!
  2081. \****************************************/
  2082. /*! exports provided: ArrayIndexAssign */
  2083. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2084. "use strict";
  2085. __webpack_require__.r(__webpack_exports__);
  2086. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return ArrayIndexAssign; });
  2087. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2088. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2089. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2090. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2091. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2092. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2093. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2094. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2095. /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
  2096. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2097. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2098. var ArrayIndexAssign = /*#__PURE__*/function (_Assign) {
  2099. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(ArrayIndexAssign, _Assign);
  2100. var _super = _createSuper(ArrayIndexAssign);
  2101. function ArrayIndexAssign(id, lineExpression, columnExpression, expression) {
  2102. var _this;
  2103. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayIndexAssign);
  2104. _this = _super.call(this, id, expression);
  2105. _this.line = lineExpression;
  2106. _this.column = columnExpression;
  2107. return _this;
  2108. }
  2109. return ArrayIndexAssign;
  2110. }(_assign__WEBPACK_IMPORTED_MODULE_4__["Assign"]);
  2111. /***/ }),
  2112. /***/ "./js/ast/commands/arrayDeclaration.js":
  2113. /*!*********************************************!*\
  2114. !*** ./js/ast/commands/arrayDeclaration.js ***!
  2115. \*********************************************/
  2116. /*! exports provided: ArrayDeclaration */
  2117. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2118. "use strict";
  2119. __webpack_require__.r(__webpack_exports__);
  2120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return ArrayDeclaration; });
  2121. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2122. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2123. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2124. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2125. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2126. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2127. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2128. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2129. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2130. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2131. /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
  2132. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2133. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2134. var ArrayDeclaration = /*#__PURE__*/function (_Declaration) {
  2135. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayDeclaration, _Declaration);
  2136. var _super = _createSuper(ArrayDeclaration);
  2137. function ArrayDeclaration(id, type, lines, columns, initial, isConst) {
  2138. var _this;
  2139. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayDeclaration);
  2140. _this = _super.call(this, id, type, initial, isConst);
  2141. _this.lines = lines;
  2142. _this.columns = columns;
  2143. return _this;
  2144. }
  2145. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayDeclaration, [{
  2146. key: "isVector",
  2147. get: function get() {
  2148. return this.columns == null;
  2149. }
  2150. }]);
  2151. return ArrayDeclaration;
  2152. }(_declaration__WEBPACK_IMPORTED_MODULE_5__["Declaration"]);
  2153. /***/ }),
  2154. /***/ "./js/ast/commands/assign.js":
  2155. /*!***********************************!*\
  2156. !*** ./js/ast/commands/assign.js ***!
  2157. \***********************************/
  2158. /*! exports provided: Assign */
  2159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2160. "use strict";
  2161. __webpack_require__.r(__webpack_exports__);
  2162. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return Assign; });
  2163. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2164. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2165. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2166. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2167. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2168. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2169. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2170. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2171. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2172. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2173. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2174. var Assign = /*#__PURE__*/function (_Command) {
  2175. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Assign, _Command);
  2176. var _super = _createSuper(Assign);
  2177. function Assign(id, expression) {
  2178. var _this;
  2179. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Assign);
  2180. _this = _super.call(this);
  2181. _this.id = id;
  2182. _this.expression = expression;
  2183. return _this;
  2184. }
  2185. return Assign;
  2186. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2187. /***/ }),
  2188. /***/ "./js/ast/commands/break.js":
  2189. /*!**********************************!*\
  2190. !*** ./js/ast/commands/break.js ***!
  2191. \**********************************/
  2192. /*! exports provided: Break */
  2193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2194. "use strict";
  2195. __webpack_require__.r(__webpack_exports__);
  2196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  2197. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2198. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2199. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2200. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2201. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2202. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2203. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2204. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2205. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2206. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2207. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2208. var Break = /*#__PURE__*/function (_Command) {
  2209. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Break, _Command);
  2210. var _super = _createSuper(Break);
  2211. function Break() {
  2212. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Break);
  2213. return _super.call(this);
  2214. }
  2215. return Break;
  2216. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2217. /***/ }),
  2218. /***/ "./js/ast/commands/case.js":
  2219. /*!*********************************!*\
  2220. !*** ./js/ast/commands/case.js ***!
  2221. \*********************************/
  2222. /*! exports provided: Case */
  2223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2224. "use strict";
  2225. __webpack_require__.r(__webpack_exports__);
  2226. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return Case; });
  2227. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2228. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2229. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2230. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2231. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2232. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2233. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2234. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2235. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2236. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2237. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2238. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2239. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2240. var Case = /*#__PURE__*/function (_Command) {
  2241. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(Case, _Command);
  2242. var _super = _createSuper(Case);
  2243. function Case(expression) {
  2244. var _this;
  2245. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Case);
  2246. _this = _super.call(this);
  2247. _this.expression = expression;
  2248. /**
  2249. * @type {Command[]}
  2250. */
  2251. _this.commands = [];
  2252. return _this;
  2253. }
  2254. /**
  2255. *
  2256. * @param {Command[]} commands
  2257. */
  2258. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Case, [{
  2259. key: "setCommands",
  2260. value: function setCommands(commands) {
  2261. this.commands = commands;
  2262. }
  2263. }, {
  2264. key: "isDefault",
  2265. get: function get() {
  2266. return this.expression === null;
  2267. }
  2268. }]);
  2269. return Case;
  2270. }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
  2271. /***/ }),
  2272. /***/ "./js/ast/commands/command.js":
  2273. /*!************************************!*\
  2274. !*** ./js/ast/commands/command.js ***!
  2275. \************************************/
  2276. /*! exports provided: Command */
  2277. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2278. "use strict";
  2279. __webpack_require__.r(__webpack_exports__);
  2280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
  2281. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2282. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2283. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2284. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2285. var Command = /*#__PURE__*/function () {
  2286. function Command() {
  2287. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Command);
  2288. this._sourceInfo = null;
  2289. }
  2290. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Command, [{
  2291. key: "sourceInfo",
  2292. set: function set(sourceInfo) {
  2293. this._sourceInfo = sourceInfo;
  2294. },
  2295. get: function get() {
  2296. return this._sourceInfo;
  2297. }
  2298. }]);
  2299. return Command;
  2300. }();
  2301. /***/ }),
  2302. /***/ "./js/ast/commands/commandBlock.js":
  2303. /*!*****************************************!*\
  2304. !*** ./js/ast/commands/commandBlock.js ***!
  2305. \*****************************************/
  2306. /*! exports provided: CommandBlock */
  2307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2308. "use strict";
  2309. __webpack_require__.r(__webpack_exports__);
  2310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return CommandBlock; });
  2311. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2312. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2313. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2314. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2315. var CommandBlock = /*#__PURE__*/function () {
  2316. function CommandBlock(variables, commands) {
  2317. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CommandBlock);
  2318. this.variables = variables;
  2319. this.commands = commands;
  2320. this._sourceInfo = null;
  2321. }
  2322. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(CommandBlock, [{
  2323. key: "sourceInfo",
  2324. set: function set(sourceInfo) {
  2325. this._sourceInfo = sourceInfo;
  2326. },
  2327. get: function get() {
  2328. return this._sourceInfo;
  2329. }
  2330. }]);
  2331. return CommandBlock;
  2332. }();
  2333. /***/ }),
  2334. /***/ "./js/ast/commands/declaration.js":
  2335. /*!****************************************!*\
  2336. !*** ./js/ast/commands/declaration.js ***!
  2337. \****************************************/
  2338. /*! exports provided: Declaration */
  2339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2340. "use strict";
  2341. __webpack_require__.r(__webpack_exports__);
  2342. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return Declaration; });
  2343. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2344. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2345. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2346. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2347. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2348. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2349. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2350. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2351. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2352. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2353. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2354. var Declaration = /*#__PURE__*/function (_Command) {
  2355. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Declaration, _Command);
  2356. var _super = _createSuper(Declaration);
  2357. function Declaration(id, type, initial, isConst) {
  2358. var _this;
  2359. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Declaration);
  2360. _this = _super.call(this);
  2361. _this.id = id;
  2362. _this.type = type;
  2363. _this.initial = initial;
  2364. _this.isConst = isConst;
  2365. return _this;
  2366. }
  2367. return Declaration;
  2368. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2369. /***/ }),
  2370. /***/ "./js/ast/commands/for.js":
  2371. /*!********************************!*\
  2372. !*** ./js/ast/commands/for.js ***!
  2373. \********************************/
  2374. /*! exports provided: For */
  2375. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2376. "use strict";
  2377. __webpack_require__.r(__webpack_exports__);
  2378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "For", function() { return For; });
  2379. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2380. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2381. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2382. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2383. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2384. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2385. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2386. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2387. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2388. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2389. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2390. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2391. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2392. var For = /*#__PURE__*/function (_Command) {
  2393. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(For, _Command);
  2394. var _super = _createSuper(For);
  2395. function For(for_id, for_from, for_to, for_pass, commandBlock) {
  2396. var _this;
  2397. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, For);
  2398. _this = _super.call(this);
  2399. _this.for_id = for_id;
  2400. _this.for_from = for_from;
  2401. _this.for_to = for_to;
  2402. _this.for_pass = for_pass;
  2403. _this.commandBlock = commandBlock;
  2404. return _this;
  2405. }
  2406. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(For, [{
  2407. key: "commands",
  2408. get: function get() {
  2409. return this.commandBlock.commands;
  2410. }
  2411. }]);
  2412. return For;
  2413. }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
  2414. /***/ }),
  2415. /***/ "./js/ast/commands/formalParameter.js":
  2416. /*!********************************************!*\
  2417. !*** ./js/ast/commands/formalParameter.js ***!
  2418. \********************************************/
  2419. /*! exports provided: FormalParameter */
  2420. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2421. "use strict";
  2422. __webpack_require__.r(__webpack_exports__);
  2423. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return FormalParameter; });
  2424. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2425. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2426. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2427. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2428. var FormalParameter = /*#__PURE__*/function () {
  2429. function FormalParameter(type, id) {
  2430. var byRef = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  2431. var variadic = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2432. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FormalParameter);
  2433. this.type = type;
  2434. this.id = id;
  2435. this.byRef = byRef;
  2436. this.variadic = variadic;
  2437. this._sourceInfo = null;
  2438. }
  2439. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(FormalParameter, [{
  2440. key: "sourceInfo",
  2441. set: function set(sourceInfo) {
  2442. this._sourceInfo = sourceInfo;
  2443. },
  2444. get: function get() {
  2445. return this._sourceInfo;
  2446. }
  2447. }]);
  2448. return FormalParameter;
  2449. }();
  2450. /***/ }),
  2451. /***/ "./js/ast/commands/function.js":
  2452. /*!*************************************!*\
  2453. !*** ./js/ast/commands/function.js ***!
  2454. \*************************************/
  2455. /*! exports provided: Function */
  2456. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2457. "use strict";
  2458. __webpack_require__.r(__webpack_exports__);
  2459. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  2460. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2461. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2462. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2463. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2464. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  2465. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_2__);
  2466. var Function = /*#__PURE__*/function () {
  2467. /**
  2468. *
  2469. * @param {string} name
  2470. * @param {import('./../../typeSystem/itype').IType} returnType
  2471. * @param {import('./formalParameter').FormalParameter[]} formalParameters
  2472. * @param {import('./commandBlock').CommandBlock} commandBlock
  2473. */
  2474. function Function(name, returnType, formalParameters, commandBlock) {
  2475. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Function);
  2476. this.name = name;
  2477. this.returnType = returnType;
  2478. this.formalParameters = formalParameters;
  2479. this.commandBlock = commandBlock;
  2480. this._sourceInfo = null;
  2481. }
  2482. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Function, [{
  2483. key: "hasVariadic",
  2484. value: function hasVariadic() {
  2485. return this.formalParameters.some(function (p) {
  2486. return p.variadic;
  2487. });
  2488. }
  2489. }, {
  2490. key: "isMain",
  2491. get: function get() {
  2492. return this.name === null && this.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID);
  2493. }
  2494. }, {
  2495. key: "commands",
  2496. get: function get() {
  2497. return this.commandBlock.commands;
  2498. }
  2499. }, {
  2500. key: "variablesDeclarations",
  2501. get: function get() {
  2502. return this.commandBlock.variables;
  2503. }
  2504. }, {
  2505. key: "sourceInfo",
  2506. set: function set(sourceInfo) {
  2507. this._sourceInfo = sourceInfo;
  2508. },
  2509. get: function get() {
  2510. return this._sourceInfo;
  2511. }
  2512. }]);
  2513. return Function;
  2514. }();
  2515. /***/ }),
  2516. /***/ "./js/ast/commands/ifThenElse.js":
  2517. /*!***************************************!*\
  2518. !*** ./js/ast/commands/ifThenElse.js ***!
  2519. \***************************************/
  2520. /*! exports provided: IfThenElse */
  2521. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2522. "use strict";
  2523. __webpack_require__.r(__webpack_exports__);
  2524. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return IfThenElse; });
  2525. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2526. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2527. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2528. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2529. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2530. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2531. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2532. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2533. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2534. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2535. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2536. var IfThenElse = /*#__PURE__*/function (_Command) {
  2537. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(IfThenElse, _Command);
  2538. var _super = _createSuper(IfThenElse);
  2539. function IfThenElse(condition, ifTrue, ifFalse) {
  2540. var _this;
  2541. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IfThenElse);
  2542. _this = _super.call(this);
  2543. _this.condition = condition;
  2544. _this.ifTrue = ifTrue;
  2545. _this.ifFalse = ifFalse;
  2546. return _this;
  2547. }
  2548. return IfThenElse;
  2549. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2550. /***/ }),
  2551. /***/ "./js/ast/commands/index.js":
  2552. /*!**********************************!*\
  2553. !*** ./js/ast/commands/index.js ***!
  2554. \**********************************/
  2555. /*! exports provided: Break, Return, Assign, ArrayIndexAssign, Declaration, ArrayDeclaration, While, For, Function, IfThenElse, CommandBlock, RepeatUntil, Switch, Case, SysCall, FormalParameter, FunctionCall */
  2556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2557. "use strict";
  2558. __webpack_require__.r(__webpack_exports__);
  2559. /* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./break */ "./js/ast/commands/break.js");
  2560. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return _break__WEBPACK_IMPORTED_MODULE_0__["Break"]; });
  2561. /* harmony import */ var _return__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./return */ "./js/ast/commands/return.js");
  2562. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return _return__WEBPACK_IMPORTED_MODULE_1__["Return"]; });
  2563. /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
  2564. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return _assign__WEBPACK_IMPORTED_MODULE_2__["Assign"]; });
  2565. /* harmony import */ var _arrayAssign__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./arrayAssign */ "./js/ast/commands/arrayAssign.js");
  2566. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return _arrayAssign__WEBPACK_IMPORTED_MODULE_3__["ArrayIndexAssign"]; });
  2567. /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
  2568. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return _declaration__WEBPACK_IMPORTED_MODULE_4__["Declaration"]; });
  2569. /* harmony import */ var _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./arrayDeclaration */ "./js/ast/commands/arrayDeclaration.js");
  2570. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]; });
  2571. /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
  2572. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "While", function() { return _while__WEBPACK_IMPORTED_MODULE_6__["While"]; });
  2573. /* harmony import */ var _for__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./for */ "./js/ast/commands/for.js");
  2574. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "For", function() { return _for__WEBPACK_IMPORTED_MODULE_7__["For"]; });
  2575. /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./function */ "./js/ast/commands/function.js");
  2576. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return _function__WEBPACK_IMPORTED_MODULE_8__["Function"]; });
  2577. /* harmony import */ var _ifThenElse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ifThenElse */ "./js/ast/commands/ifThenElse.js");
  2578. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return _ifThenElse__WEBPACK_IMPORTED_MODULE_9__["IfThenElse"]; });
  2579. /* harmony import */ var _commandBlock__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commandBlock */ "./js/ast/commands/commandBlock.js");
  2580. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return _commandBlock__WEBPACK_IMPORTED_MODULE_10__["CommandBlock"]; });
  2581. /* harmony import */ var _repeatUntil__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./repeatUntil */ "./js/ast/commands/repeatUntil.js");
  2582. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return _repeatUntil__WEBPACK_IMPORTED_MODULE_11__["RepeatUntil"]; });
  2583. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./switch */ "./js/ast/commands/switch.js");
  2584. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return _switch__WEBPACK_IMPORTED_MODULE_12__["Switch"]; });
  2585. /* harmony import */ var _case__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./case */ "./js/ast/commands/case.js");
  2586. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return _case__WEBPACK_IMPORTED_MODULE_13__["Case"]; });
  2587. /* harmony import */ var _sysCall__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sysCall */ "./js/ast/commands/sysCall.js");
  2588. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return _sysCall__WEBPACK_IMPORTED_MODULE_14__["SysCall"]; });
  2589. /* harmony import */ var _formalParameter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./formalParameter */ "./js/ast/commands/formalParameter.js");
  2590. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return _formalParameter__WEBPACK_IMPORTED_MODULE_15__["FormalParameter"]; });
  2591. /* harmony import */ var _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../expressions/functionCall */ "./js/ast/expressions/functionCall.js");
  2592. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__["FunctionCall"]; });
  2593. //Proxy to expression since they do exatcly the same thing
  2594. /***/ }),
  2595. /***/ "./js/ast/commands/repeatUntil.js":
  2596. /*!****************************************!*\
  2597. !*** ./js/ast/commands/repeatUntil.js ***!
  2598. \****************************************/
  2599. /*! exports provided: RepeatUntil */
  2600. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2601. "use strict";
  2602. __webpack_require__.r(__webpack_exports__);
  2603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return RepeatUntil; });
  2604. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2605. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2606. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2607. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2608. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2609. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2610. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2611. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2612. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2613. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2614. /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
  2615. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2616. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2617. var RepeatUntil = /*#__PURE__*/function (_While) {
  2618. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RepeatUntil, _While);
  2619. var _super = _createSuper(RepeatUntil);
  2620. function RepeatUntil(condition, commandBlock) {
  2621. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RepeatUntil);
  2622. return _super.call(this, condition, commandBlock);
  2623. }
  2624. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RepeatUntil, [{
  2625. key: "testFirst",
  2626. get: function get() {
  2627. return false;
  2628. }
  2629. }]);
  2630. return RepeatUntil;
  2631. }(_while__WEBPACK_IMPORTED_MODULE_5__["While"]);
  2632. /***/ }),
  2633. /***/ "./js/ast/commands/return.js":
  2634. /*!***********************************!*\
  2635. !*** ./js/ast/commands/return.js ***!
  2636. \***********************************/
  2637. /*! exports provided: Return */
  2638. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2639. "use strict";
  2640. __webpack_require__.r(__webpack_exports__);
  2641. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  2642. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2643. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2644. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2645. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2646. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2647. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2648. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2649. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2650. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2651. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2652. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2653. var Return = /*#__PURE__*/function (_Command) {
  2654. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Return, _Command);
  2655. var _super = _createSuper(Return);
  2656. function Return(expression) {
  2657. var _this;
  2658. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Return);
  2659. _this = _super.call(this);
  2660. _this.expression = expression;
  2661. return _this;
  2662. }
  2663. return Return;
  2664. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2665. /***/ }),
  2666. /***/ "./js/ast/commands/switch.js":
  2667. /*!***********************************!*\
  2668. !*** ./js/ast/commands/switch.js ***!
  2669. \***********************************/
  2670. /*! exports provided: Switch */
  2671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2672. "use strict";
  2673. __webpack_require__.r(__webpack_exports__);
  2674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  2675. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2676. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2677. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2678. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2679. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2680. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2681. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2682. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2683. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2684. /* harmony import */ var _expressions_expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../expressions/expression */ "./js/ast/expressions/expression.js");
  2685. /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! . */ "./js/ast/commands/index.js");
  2686. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
  2687. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2688. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  2689. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  2690. var Switch = /*#__PURE__*/function (_Command) {
  2691. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Switch, _Command);
  2692. var _super = _createSuper(Switch);
  2693. /**
  2694. *
  2695. * @param {Expression} expression
  2696. * @param {Case[]} cases
  2697. */
  2698. function Switch(expression, cases) {
  2699. var _this;
  2700. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Switch);
  2701. _this = _super.call(this);
  2702. _this.expression = expression;
  2703. _this.cases = cases;
  2704. return _this;
  2705. }
  2706. return Switch;
  2707. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2708. /***/ }),
  2709. /***/ "./js/ast/commands/sysCall.js":
  2710. /*!************************************!*\
  2711. !*** ./js/ast/commands/sysCall.js ***!
  2712. \************************************/
  2713. /*! exports provided: SysCall */
  2714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2715. "use strict";
  2716. __webpack_require__.r(__webpack_exports__);
  2717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return SysCall; });
  2718. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2719. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2720. /**
  2721. * This class represents all the language defined functions.
  2722. * The language processor uses the id provided here to properly execute the desired function.
  2723. * The function is actually implemented inside the language processor.
  2724. * All the functions can be found at: js/processor/definedFunctions.js
  2725. */
  2726. var SysCall = function SysCall(langFunc) {
  2727. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SysCall);
  2728. this.langFunc = langFunc;
  2729. };
  2730. /***/ }),
  2731. /***/ "./js/ast/commands/while.js":
  2732. /*!**********************************!*\
  2733. !*** ./js/ast/commands/while.js ***!
  2734. \**********************************/
  2735. /*! exports provided: While */
  2736. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2737. "use strict";
  2738. __webpack_require__.r(__webpack_exports__);
  2739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "While", function() { return While; });
  2740. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2741. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2742. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2743. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2744. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2745. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2746. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2747. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2748. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2749. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2750. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2751. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
  2752. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  2753. var While = /*#__PURE__*/function (_Command) {
  2754. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(While, _Command);
  2755. var _super = _createSuper(While);
  2756. function While(expression, commandBlock) {
  2757. var _this;
  2758. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, While);
  2759. _this = _super.call(this);
  2760. _this.expression = expression;
  2761. _this.commandBlock = commandBlock;
  2762. return _this;
  2763. }
  2764. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(While, [{
  2765. key: "commands",
  2766. get: function get() {
  2767. return this.commandBlock.commands;
  2768. }
  2769. }, {
  2770. key: "testFirst",
  2771. get: function get() {
  2772. return true;
  2773. }
  2774. }]);
  2775. return While;
  2776. }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
  2777. /***/ }),
  2778. /***/ "./js/ast/error/syntaxError.js":
  2779. /*!*************************************!*\
  2780. !*** ./js/ast/error/syntaxError.js ***!
  2781. \*************************************/
  2782. /*! exports provided: SyntaxError */
  2783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2784. "use strict";
  2785. __webpack_require__.r(__webpack_exports__);
  2786. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxError", function() { return SyntaxError; });
  2787. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  2788. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  2789. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2790. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  2791. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2792. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
  2793. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  2794. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);
  2795. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2796. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
  2797. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2798. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);
  2799. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2800. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
  2801. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  2802. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7__);
  2803. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result); }; }
  2804. 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; } }
  2805. var SyntaxError = /*#__PURE__*/function (_Error) {
  2806. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(SyntaxError, _Error);
  2807. var _super = _createSuper(SyntaxError);
  2808. function SyntaxError(msg, id) {
  2809. var _this;
  2810. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SyntaxError);
  2811. _this = _super.call.apply(_super, [this].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(msg)));
  2812. _this.id = id;
  2813. _this._context = {};
  2814. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this), SyntaxError);
  2815. return _this;
  2816. }
  2817. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(SyntaxError, [{
  2818. key: "context",
  2819. get: function get() {
  2820. return this._context;
  2821. },
  2822. set: function set(contextObj) {
  2823. this._context = contextObj;
  2824. }
  2825. }]);
  2826. return SyntaxError;
  2827. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7___default()(Error));
  2828. /***/ }),
  2829. /***/ "./js/ast/error/syntaxErrorFactory.js":
  2830. /*!********************************************!*\
  2831. !*** ./js/ast/error/syntaxErrorFactory.js ***!
  2832. \********************************************/
  2833. /*! exports provided: SyntaxErrorFactory */
  2834. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2835. "use strict";
  2836. __webpack_require__.r(__webpack_exports__);
  2837. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxErrorFactory", function() { return SyntaxErrorFactory; });
  2838. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  2839. /* harmony import */ var _syntaxError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./syntaxError */ "./js/ast/error/syntaxError.js");
  2840. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["getInstance"]();
  2841. function createError(message_id) {
  2842. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2843. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError(message_id, context), message_id);
  2844. }
  2845. var SyntaxErrorFactory = Object.freeze({
  2846. extra_lines: function extra_lines() {
  2847. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError("extra_lines"));
  2848. },
  2849. token_missing_one: function token_missing_one(expected, token) {
  2850. var context = [expected, token.text, token.line, token.column];
  2851. var error = createError("token_missing_one", context);
  2852. error.context = {
  2853. line: token.line,
  2854. column: token.column
  2855. };
  2856. return error;
  2857. },
  2858. token_missing_list: function token_missing_list(expectedList, token) {
  2859. var line = expectedList.join(LocalizedStrings.getOR());
  2860. var error = SyntaxErrorFactory.token_missing_one(line, token);
  2861. error.context = {
  2862. line: token.line,
  2863. column: token.column
  2864. };
  2865. return error;
  2866. },
  2867. id_missing: function id_missing(token) {
  2868. var context = [token.text, token.line, token.column];
  2869. var error = createError("id_missing", context);
  2870. error.context = {
  2871. line: token.line,
  2872. column: token.column
  2873. };
  2874. return error;
  2875. },
  2876. eos_missing: function eos_missing(token) {
  2877. var context = [token.line, token.column];
  2878. var error = createError("eos_missing", context);
  2879. error.context = {
  2880. line: token.line,
  2881. column: token.column
  2882. };
  2883. return error;
  2884. },
  2885. invalid_array_dimension: function invalid_array_dimension(typeName, token) {
  2886. var context = [token.line, token.column, typeName];
  2887. var error = createError("invalid_array_dimension", context);
  2888. error.context = {
  2889. line: token.line,
  2890. column: token.column
  2891. };
  2892. return error;
  2893. },
  2894. invalid_array_size: function invalid_array_size(token) {
  2895. var context = [token.line];
  2896. var error = createError("invalid_array_size", context);
  2897. error.context = {
  2898. line: token.line,
  2899. column: token.column
  2900. };
  2901. return error;
  2902. },
  2903. invalid_main_return: function invalid_main_return(name, typeName, token) {
  2904. var context = [name, typeName, token.line];
  2905. var error = createError("invalid_main_return", context);
  2906. error.context = {
  2907. line: token.line,
  2908. column: token.column
  2909. };
  2910. return error;
  2911. },
  2912. invalid_var_declaration: function invalid_var_declaration(token) {
  2913. var context = [token.line];
  2914. var error = createError("invalid_var_declaration", context);
  2915. error.context = {
  2916. line: token.line,
  2917. column: token.column
  2918. };
  2919. return error;
  2920. },
  2921. invalid_break_command: function invalid_break_command(cmdName, token) {
  2922. var context = [token.line, cmdName];
  2923. var error = createError("invalid_break_command", context);
  2924. error.context = {
  2925. line: token.line,
  2926. column: token.column
  2927. };
  2928. return error;
  2929. },
  2930. invalid_terminal: function invalid_terminal(token) {
  2931. var context = [token.text, token.line, token.column];
  2932. var error = createError("invalid_terminal", context);
  2933. error.context = {
  2934. line: token.line,
  2935. column: token.column
  2936. };
  2937. return error;
  2938. },
  2939. invalid_type: function invalid_type(list, token) {
  2940. var line = list.join(LocalizedStrings.getOR());
  2941. var context = [token.text, token.line, token.column, line];
  2942. var error = createError("invalid_type", context);
  2943. error.context = {
  2944. line: token.line,
  2945. column: token.column
  2946. };
  2947. return error;
  2948. },
  2949. const_not_init: function const_not_init(token) {
  2950. var context = [token.line, token.column];
  2951. var error = createError("const_not_init", context);
  2952. error.context = {
  2953. line: token.line,
  2954. column: token.column
  2955. };
  2956. return error;
  2957. },
  2958. invalid_id_format: function invalid_id_format(token) {
  2959. var context = [token.text, token.line, token.column];
  2960. var error = createError("invalid_id_format", context);
  2961. error.context = {
  2962. line: token.line,
  2963. column: token.column
  2964. };
  2965. return error;
  2966. },
  2967. duplicate_function: function duplicate_function(token) {
  2968. var context = [token.text, token.line, token.column];
  2969. var error = createError("duplicate_function", context);
  2970. error.context = {
  2971. line: token.line,
  2972. column: token.column
  2973. };
  2974. return error;
  2975. },
  2976. main_parameters: function main_parameters() {
  2977. return createError("main_parameters");
  2978. },
  2979. duplicate_variable: function duplicate_variable(token) {
  2980. var context = [token.text, token.line, token.column];
  2981. var error = createError("duplicate_variable", context);
  2982. error.context = {
  2983. line: token.line,
  2984. column: token.column
  2985. };
  2986. return error;
  2987. },
  2988. invalid_character: function invalid_character(text, line, column) {
  2989. var context = [text, line];
  2990. var error = createError("invalid_character", context);
  2991. error.context = {
  2992. line: line,
  2993. column: column
  2994. };
  2995. return error;
  2996. },
  2997. annonymous_array_literal: function annonymous_array_literal(token) {
  2998. var context = [token.line];
  2999. var error = createError("annonymous_array_literal", context);
  3000. error.context = {
  3001. line: token.line,
  3002. column: token.column
  3003. };
  3004. return error;
  3005. },
  3006. invalid_matrix_literal_line: function invalid_matrix_literal_line(exp, sourceInfo) {
  3007. var context = [exp, sourceInfo.line];
  3008. var error = createError("invalid_matrix_literal_line", context);
  3009. error.context = {
  3010. line: sourceInfo.line,
  3011. column: sourceInfo.column
  3012. };
  3013. return error;
  3014. },
  3015. cannot_infer_matrix_line: function cannot_infer_matrix_line(name, sourceInfo) {
  3016. var context = [name, sourceInfo.line];
  3017. var error = createError("cannot_infer_matrix_line", context);
  3018. error.context = {
  3019. line: sourceInfo.line,
  3020. column: sourceInfo.column
  3021. };
  3022. return error;
  3023. },
  3024. cannot_infer_matrix_column: function cannot_infer_matrix_column(name, sourceInfo) {
  3025. var context = [name, sourceInfo.line];
  3026. var error = createError("cannot_infer_matrix_column", context);
  3027. error.context = {
  3028. line: sourceInfo.line,
  3029. column: sourceInfo.column
  3030. };
  3031. return error;
  3032. },
  3033. cannot_infer_vector_size: function cannot_infer_vector_size(name, sourceInfo) {
  3034. var context = [name, sourceInfo.line];
  3035. var error = createError("cannot_infer_vector_size", context);
  3036. error.context = {
  3037. line: sourceInfo.line,
  3038. column: sourceInfo.column
  3039. };
  3040. return error;
  3041. },
  3042. matrix_to_vector_literal_attr: function matrix_to_vector_literal_attr(name, exp, sourceInfo) {
  3043. var context = [sourceInfo.line, exp, name];
  3044. var error = createError("matrix_to_vector_literal_attr", context);
  3045. error.context = {
  3046. line: sourceInfo.line,
  3047. column: sourceInfo.column
  3048. };
  3049. return error;
  3050. },
  3051. vector_to_matrix_literal_attr: function vector_to_matrix_literal_attr(name, exp, sourceInfo) {
  3052. var context = [sourceInfo.line, exp, name];
  3053. var error = createError("vector_to_matrix_literal_attr", context);
  3054. error.context = {
  3055. line: sourceInfo.line,
  3056. column: sourceInfo.column
  3057. };
  3058. return error;
  3059. },
  3060. array_init_not_literal: function array_init_not_literal(sourceInfo) {
  3061. var context = [sourceInfo.line];
  3062. var error = createError("array_init_not_literal", context);
  3063. error.context = {
  3064. line: sourceInfo.line,
  3065. column: sourceInfo.column
  3066. };
  3067. return error;
  3068. },
  3069. array_exceeds_2d: function array_exceeds_2d(sourceInfo) {
  3070. var context = [sourceInfo.line];
  3071. var error = createError("array_exceeds_2d", context);
  3072. error.context = {
  3073. line: sourceInfo.line,
  3074. column: sourceInfo.column
  3075. };
  3076. return error;
  3077. },
  3078. invalid_matrix_id_dimension: function invalid_matrix_id_dimension(sourceInfo) {
  3079. var context = [sourceInfo.line];
  3080. var error = createError("invalid_matrix_id_dimension", context);
  3081. error.context = {
  3082. line: sourceInfo.line,
  3083. column: sourceInfo.column
  3084. };
  3085. return error;
  3086. },
  3087. invalid_vector_init: function invalid_vector_init(sourceInfo) {
  3088. var context = [sourceInfo.line];
  3089. var error = createError("invalid_vector_init", context);
  3090. error.context = {
  3091. line: sourceInfo.line,
  3092. column: sourceInfo.column
  3093. };
  3094. return error;
  3095. },
  3096. invalid_matrix_init: function invalid_matrix_init(sourceInfo) {
  3097. var context = [sourceInfo.line];
  3098. var error = createError("invalid_matrix_init", context);
  3099. error.context = {
  3100. line: sourceInfo.line,
  3101. column: sourceInfo.column
  3102. };
  3103. return error;
  3104. }
  3105. });
  3106. /***/ }),
  3107. /***/ "./js/ast/expressions/arrayAccess.js":
  3108. /*!*******************************************!*\
  3109. !*** ./js/ast/expressions/arrayAccess.js ***!
  3110. \*******************************************/
  3111. /*! exports provided: ArrayAccess */
  3112. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3113. "use strict";
  3114. __webpack_require__.r(__webpack_exports__);
  3115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return ArrayAccess; });
  3116. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3117. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3118. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3119. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3120. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3121. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3122. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3123. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3124. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3125. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3126. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3127. 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); }; }
  3128. 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; } }
  3129. var ArrayAccess = /*#__PURE__*/function (_Expression) {
  3130. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayAccess, _Expression);
  3131. var _super = _createSuper(ArrayAccess);
  3132. function ArrayAccess(id, line, column) {
  3133. var _this;
  3134. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayAccess);
  3135. _this = _super.call(this);
  3136. _this.id = id;
  3137. _this.line = line;
  3138. _this.column = column;
  3139. return _this;
  3140. }
  3141. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayAccess, [{
  3142. key: "toString",
  3143. value: function toString() {
  3144. var strLine = this.line.toString();
  3145. var strColumn = null;
  3146. if (this.column) {
  3147. strColumn = this.column.toString();
  3148. }
  3149. var text = null;
  3150. if (strColumn) {
  3151. text = "".concat(this.id, "[").concat(strLine, "][").concat(strColumn, "]");
  3152. } else {
  3153. text = "".concat(this.id, "[").concat(strLine, "]");
  3154. }
  3155. if (this.parenthesis) {
  3156. return "(".concat(text, ")");
  3157. } else {
  3158. return text;
  3159. }
  3160. }
  3161. }]);
  3162. return ArrayAccess;
  3163. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3164. /***/ }),
  3165. /***/ "./js/ast/expressions/arrayLiteral.js":
  3166. /*!********************************************!*\
  3167. !*** ./js/ast/expressions/arrayLiteral.js ***!
  3168. \********************************************/
  3169. /*! exports provided: ArrayLiteral */
  3170. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3171. "use strict";
  3172. __webpack_require__.r(__webpack_exports__);
  3173. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return ArrayLiteral; });
  3174. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3175. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3176. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3177. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3178. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3179. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3180. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3181. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3182. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3183. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3184. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3185. 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); }; }
  3186. 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; } }
  3187. var ArrayLiteral = /*#__PURE__*/function (_Literal) {
  3188. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayLiteral, _Literal);
  3189. var _super = _createSuper(ArrayLiteral);
  3190. /**
  3191. *
  3192. * @param {import('../../typeSystem/itype').IType} type
  3193. * @param {import('./expression').Expression[]} value
  3194. */
  3195. function ArrayLiteral(type, value) {
  3196. var _this;
  3197. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayLiteral);
  3198. _this = _super.call(this, type);
  3199. _this.value = value;
  3200. return _this;
  3201. }
  3202. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayLiteral, [{
  3203. key: "validateType",
  3204. value: function validateType() {
  3205. var valid = true; // const subtype = this.subtype;
  3206. // if(this.columns !== null) {
  3207. // const len = this.lines;
  3208. // const len2 = this.columns;
  3209. // for (let i = len - 1; i >= 0 && valid; --i) {
  3210. // for (let j = len2 - 1; j >= 0 && valid; --j) {
  3211. // if(!this.value[i].value[j].type.isCompatilbe(subtype)) {
  3212. // valid = false;
  3213. // break;
  3214. // }
  3215. // }
  3216. // }
  3217. // } else {
  3218. // const len = this.lines;
  3219. // for (var i = len - 1; i >= 0 && valid; i--) {
  3220. // if(!this.value[i].type.isCompatilbe(subtype)) {
  3221. // valid = false;
  3222. // break;
  3223. // }
  3224. // }
  3225. // }
  3226. // Cannot validate type since no information on variables literals are available
  3227. return valid;
  3228. }
  3229. }, {
  3230. key: "validateSize",
  3231. value: function validateSize() {
  3232. var valid = true; // if(this.columns !== null) {
  3233. // const equalityTest = this.value.map(v => v.value.length)
  3234. // .reduce((old, next) => {
  3235. // console.log(next);
  3236. // if (old == null) {
  3237. // return next;
  3238. // } else if (old === next) {
  3239. // return old
  3240. // } else {
  3241. // return -1;
  3242. // }
  3243. // }, null);
  3244. // valid = equalityTest !== -1;
  3245. // }
  3246. // check is now made inside IVProgParser.parseVectorList(...)
  3247. return valid;
  3248. }
  3249. }, {
  3250. key: "toString",
  3251. value: function toString() {
  3252. var strList = this.value.map(function (arrayLiteral) {
  3253. return arrayLiteral.toString();
  3254. });
  3255. var text = "{" + strList.join(',') + "}";
  3256. if (this.parenthesis) {
  3257. return "(".concat(text, ")");
  3258. } else {
  3259. return text;
  3260. }
  3261. }
  3262. }, {
  3263. key: "subtype",
  3264. get: function get() {
  3265. var element = this.value[0];
  3266. if (element instanceof ArrayLiteral) {
  3267. return element.value[0].type;
  3268. } else {
  3269. return element.type;
  3270. }
  3271. }
  3272. }, {
  3273. key: "lines",
  3274. get: function get() {
  3275. return this.value.length;
  3276. }
  3277. }, {
  3278. key: "columns",
  3279. get: function get() {
  3280. var element = this.value[0];
  3281. if (!(element instanceof ArrayLiteral)) {
  3282. return null;
  3283. } else {
  3284. return element.value.length;
  3285. }
  3286. }
  3287. }, {
  3288. key: "isVector",
  3289. get: function get() {
  3290. return this.columns === null;
  3291. }
  3292. }, {
  3293. key: "isValid",
  3294. get: function get() {
  3295. return this.validateSize() && this.validateType();
  3296. }
  3297. }]);
  3298. return ArrayLiteral;
  3299. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3300. /***/ }),
  3301. /***/ "./js/ast/expressions/boolLiteral.js":
  3302. /*!*******************************************!*\
  3303. !*** ./js/ast/expressions/boolLiteral.js ***!
  3304. \*******************************************/
  3305. /*! exports provided: BoolLiteral */
  3306. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3307. "use strict";
  3308. __webpack_require__.r(__webpack_exports__);
  3309. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return BoolLiteral; });
  3310. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3311. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3312. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3313. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3314. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3315. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3316. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3317. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3318. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3319. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3320. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3321. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3322. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3323. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3324. 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); }; }
  3325. 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; } }
  3326. var BoolLiteral = /*#__PURE__*/function (_Literal) {
  3327. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(BoolLiteral, _Literal);
  3328. var _super = _createSuper(BoolLiteral);
  3329. function BoolLiteral(value) {
  3330. var _this;
  3331. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, BoolLiteral);
  3332. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].BOOLEAN);
  3333. _this.value = value;
  3334. return _this;
  3335. }
  3336. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(BoolLiteral, [{
  3337. key: "toString",
  3338. value: function toString() {
  3339. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertBoolToString"])(this.value);
  3340. if (this.parenthesis) {
  3341. return "(".concat(text, ")");
  3342. } else {
  3343. return text;
  3344. }
  3345. }
  3346. }]);
  3347. return BoolLiteral;
  3348. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3349. /***/ }),
  3350. /***/ "./js/ast/expressions/charLiteral.js":
  3351. /*!*******************************************!*\
  3352. !*** ./js/ast/expressions/charLiteral.js ***!
  3353. \*******************************************/
  3354. /*! exports provided: CharLiteral */
  3355. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3356. "use strict";
  3357. __webpack_require__.r(__webpack_exports__);
  3358. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return CharLiteral; });
  3359. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3360. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3361. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3362. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3363. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3364. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3365. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3366. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3367. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3368. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3369. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3370. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3371. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3372. 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); }; }
  3373. 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; } }
  3374. var CharLiteral = /*#__PURE__*/function (_Literal) {
  3375. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(CharLiteral, _Literal);
  3376. var _super = _createSuper(CharLiteral);
  3377. function CharLiteral(value) {
  3378. var _this;
  3379. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CharLiteral);
  3380. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].CHAR);
  3381. _this.value = value;
  3382. return _this;
  3383. }
  3384. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(CharLiteral, [{
  3385. key: "toString",
  3386. value: function toString() {
  3387. var text = "'".concat(this.value, "'");
  3388. if (this.parenthesis) {
  3389. return "(".concat(text, ")");
  3390. } else {
  3391. return text;
  3392. }
  3393. }
  3394. }]);
  3395. return CharLiteral;
  3396. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3397. /***/ }),
  3398. /***/ "./js/ast/expressions/expression.js":
  3399. /*!******************************************!*\
  3400. !*** ./js/ast/expressions/expression.js ***!
  3401. \******************************************/
  3402. /*! exports provided: Expression */
  3403. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3404. "use strict";
  3405. __webpack_require__.r(__webpack_exports__);
  3406. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Expression", function() { return Expression; });
  3407. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3408. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3409. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3410. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3411. var Expression = /*#__PURE__*/function () {
  3412. function Expression() {
  3413. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Expression);
  3414. this._sourceInfo = null;
  3415. this._parenthesis = false;
  3416. }
  3417. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Expression, [{
  3418. key: "sourceInfo",
  3419. set: function set(sourceInfo) {
  3420. this._sourceInfo = sourceInfo;
  3421. },
  3422. get: function get() {
  3423. return this._sourceInfo;
  3424. }
  3425. }, {
  3426. key: "parenthesis",
  3427. set: function set(flag) {
  3428. this._parenthesis = flag;
  3429. },
  3430. get: function get() {
  3431. return this._parenthesis;
  3432. }
  3433. }]);
  3434. return Expression;
  3435. }();
  3436. /***/ }),
  3437. /***/ "./js/ast/expressions/functionCall.js":
  3438. /*!********************************************!*\
  3439. !*** ./js/ast/expressions/functionCall.js ***!
  3440. \********************************************/
  3441. /*! exports provided: FunctionCall */
  3442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3443. "use strict";
  3444. __webpack_require__.r(__webpack_exports__);
  3445. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  3446. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3447. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3448. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3449. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3450. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3451. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3452. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3453. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3454. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3455. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3456. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3457. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  3458. 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); }; }
  3459. 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; } }
  3460. var FunctionCall = /*#__PURE__*/function (_Expression) {
  3461. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(FunctionCall, _Expression);
  3462. var _super = _createSuper(FunctionCall);
  3463. /**
  3464. *
  3465. * @param {string} id
  3466. * @param {Expression[]} actualParameters
  3467. */
  3468. function FunctionCall(id, actualParameters) {
  3469. var _this;
  3470. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FunctionCall);
  3471. _this = _super.call(this);
  3472. _this.id = id;
  3473. _this.actualParameters = actualParameters;
  3474. return _this;
  3475. }
  3476. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(FunctionCall, [{
  3477. key: "toString",
  3478. value: function toString() {
  3479. var name = null;
  3480. if (this.isMainCall) {
  3481. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getMainFunctionName();
  3482. } else {
  3483. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getLocalName(this.id);
  3484. }
  3485. var params = null;
  3486. if (this.actualParameters.length == 0) {
  3487. params = "()";
  3488. } else {
  3489. var strParams = this.actualParameters.map(function (v) {
  3490. return v.toString();
  3491. });
  3492. params = "(" + strParams.join(",") + ")";
  3493. }
  3494. if (this.parenthesis) {
  3495. return "(".concat(name + params, ")");
  3496. } else {
  3497. return name + params;
  3498. }
  3499. }
  3500. }, {
  3501. key: "isMainCall",
  3502. get: function get() {
  3503. return this.id === null;
  3504. }
  3505. }, {
  3506. key: "parametersSize",
  3507. get: function get() {
  3508. return this.actualParameters.length;
  3509. }
  3510. }]);
  3511. return FunctionCall;
  3512. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3513. /***/ }),
  3514. /***/ "./js/ast/expressions/index.js":
  3515. /*!*************************************!*\
  3516. !*** ./js/ast/expressions/index.js ***!
  3517. \*************************************/
  3518. /*! exports provided: ArrayAccess, FunctionCall, IntLiteral, RealLiteral, BoolLiteral, CharLiteral, StringLiteral, ArrayLiteral, VariableLiteral, InfixApp, UnaryApp */
  3519. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3520. "use strict";
  3521. __webpack_require__.r(__webpack_exports__);
  3522. /* harmony import */ var _arrayAccess__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayAccess */ "./js/ast/expressions/arrayAccess.js");
  3523. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return _arrayAccess__WEBPACK_IMPORTED_MODULE_0__["ArrayAccess"]; });
  3524. /* harmony import */ var _functionCall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functionCall */ "./js/ast/expressions/functionCall.js");
  3525. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _functionCall__WEBPACK_IMPORTED_MODULE_1__["FunctionCall"]; });
  3526. /* harmony import */ var _intLiteral__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intLiteral */ "./js/ast/expressions/intLiteral.js");
  3527. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return _intLiteral__WEBPACK_IMPORTED_MODULE_2__["IntLiteral"]; });
  3528. /* harmony import */ var _realLiteral__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./realLiteral */ "./js/ast/expressions/realLiteral.js");
  3529. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return _realLiteral__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"]; });
  3530. /* harmony import */ var _boolLiteral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./boolLiteral */ "./js/ast/expressions/boolLiteral.js");
  3531. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return _boolLiteral__WEBPACK_IMPORTED_MODULE_4__["BoolLiteral"]; });
  3532. /* harmony import */ var _charLiteral__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./charLiteral */ "./js/ast/expressions/charLiteral.js");
  3533. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return _charLiteral__WEBPACK_IMPORTED_MODULE_5__["CharLiteral"]; });
  3534. /* harmony import */ var _stringLiteral__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stringLiteral */ "./js/ast/expressions/stringLiteral.js");
  3535. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return _stringLiteral__WEBPACK_IMPORTED_MODULE_6__["StringLiteral"]; });
  3536. /* harmony import */ var _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./arrayLiteral */ "./js/ast/expressions/arrayLiteral.js");
  3537. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__["ArrayLiteral"]; });
  3538. /* harmony import */ var _variableLiteral__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./variableLiteral */ "./js/ast/expressions/variableLiteral.js");
  3539. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return _variableLiteral__WEBPACK_IMPORTED_MODULE_8__["VariableLiteral"]; });
  3540. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  3541. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return _infixApp__WEBPACK_IMPORTED_MODULE_9__["InfixApp"]; });
  3542. /* harmony import */ var _unaryApp__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./unaryApp */ "./js/ast/expressions/unaryApp.js");
  3543. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return _unaryApp__WEBPACK_IMPORTED_MODULE_10__["UnaryApp"]; });
  3544. /***/ }),
  3545. /***/ "./js/ast/expressions/infixApp.js":
  3546. /*!****************************************!*\
  3547. !*** ./js/ast/expressions/infixApp.js ***!
  3548. \****************************************/
  3549. /*! exports provided: InfixApp */
  3550. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3551. "use strict";
  3552. __webpack_require__.r(__webpack_exports__);
  3553. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return InfixApp; });
  3554. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3555. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3556. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3557. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3558. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3559. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3560. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3561. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3562. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3563. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3564. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3565. 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); }; }
  3566. 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; } }
  3567. var InfixApp = /*#__PURE__*/function (_Expression) {
  3568. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InfixApp, _Expression);
  3569. var _super = _createSuper(InfixApp);
  3570. function InfixApp(op, left, right) {
  3571. var _this;
  3572. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InfixApp);
  3573. _this = _super.call(this);
  3574. _this.op = op;
  3575. _this.left = left;
  3576. _this.right = right;
  3577. return _this;
  3578. }
  3579. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InfixApp, [{
  3580. key: "toString",
  3581. value: function toString() {
  3582. var l = this.left.toString();
  3583. var op = this.op.value;
  3584. var r = this.right.toString();
  3585. if (this.parenthesis) {
  3586. return "(".concat(l + op + r, ")");
  3587. } else {
  3588. return l + op + r;
  3589. }
  3590. }
  3591. }]);
  3592. return InfixApp;
  3593. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3594. /***/ }),
  3595. /***/ "./js/ast/expressions/intLiteral.js":
  3596. /*!******************************************!*\
  3597. !*** ./js/ast/expressions/intLiteral.js ***!
  3598. \******************************************/
  3599. /*! exports provided: IntLiteral */
  3600. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3601. "use strict";
  3602. __webpack_require__.r(__webpack_exports__);
  3603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return IntLiteral; });
  3604. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3605. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3606. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3607. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3608. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3609. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3610. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3611. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3612. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3613. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3614. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3615. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3616. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3617. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3618. 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); }; }
  3619. 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; } }
  3620. var IntLiteral = /*#__PURE__*/function (_Literal) {
  3621. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IntLiteral, _Literal);
  3622. var _super = _createSuper(IntLiteral);
  3623. function IntLiteral(value) {
  3624. var _this;
  3625. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IntLiteral);
  3626. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].INTEGER);
  3627. _this.value = value;
  3628. return _this;
  3629. }
  3630. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IntLiteral, [{
  3631. key: "toString",
  3632. value: function toString() {
  3633. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
  3634. if (this.parenthesis) {
  3635. return "(".concat(text, ")");
  3636. } else {
  3637. return text;
  3638. }
  3639. }
  3640. }]);
  3641. return IntLiteral;
  3642. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3643. /***/ }),
  3644. /***/ "./js/ast/expressions/literal.js":
  3645. /*!***************************************!*\
  3646. !*** ./js/ast/expressions/literal.js ***!
  3647. \***************************************/
  3648. /*! exports provided: Literal */
  3649. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3650. "use strict";
  3651. __webpack_require__.r(__webpack_exports__);
  3652. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Literal", function() { return Literal; });
  3653. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3654. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3655. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3656. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  3657. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3658. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  3659. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3660. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  3661. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3662. 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); }; }
  3663. 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; } }
  3664. var Literal = /*#__PURE__*/function (_Expression) {
  3665. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Literal, _Expression);
  3666. var _super = _createSuper(Literal);
  3667. function Literal(type) {
  3668. var _this;
  3669. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Literal);
  3670. _this = _super.call(this);
  3671. _this.type = type;
  3672. return _this;
  3673. }
  3674. return Literal;
  3675. }(_expression__WEBPACK_IMPORTED_MODULE_4__["Expression"]);
  3676. /***/ }),
  3677. /***/ "./js/ast/expressions/realLiteral.js":
  3678. /*!*******************************************!*\
  3679. !*** ./js/ast/expressions/realLiteral.js ***!
  3680. \*******************************************/
  3681. /*! exports provided: RealLiteral */
  3682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3683. "use strict";
  3684. __webpack_require__.r(__webpack_exports__);
  3685. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return RealLiteral; });
  3686. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3687. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3688. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3689. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3690. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3691. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3692. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3693. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3694. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3695. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3696. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3697. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3698. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3699. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3700. 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); }; }
  3701. 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; } }
  3702. var RealLiteral = /*#__PURE__*/function (_Literal) {
  3703. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RealLiteral, _Literal);
  3704. var _super = _createSuper(RealLiteral);
  3705. function RealLiteral(value) {
  3706. var _this;
  3707. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RealLiteral);
  3708. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].REAL);
  3709. _this.value = value;
  3710. return _this;
  3711. }
  3712. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RealLiteral, [{
  3713. key: "toString",
  3714. value: function toString() {
  3715. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
  3716. if (this.parenthesis) {
  3717. return "(".concat(text, ")");
  3718. } else {
  3719. return text;
  3720. }
  3721. }
  3722. }]);
  3723. return RealLiteral;
  3724. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3725. /***/ }),
  3726. /***/ "./js/ast/expressions/stringLiteral.js":
  3727. /*!*********************************************!*\
  3728. !*** ./js/ast/expressions/stringLiteral.js ***!
  3729. \*********************************************/
  3730. /*! exports provided: StringLiteral */
  3731. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3732. "use strict";
  3733. __webpack_require__.r(__webpack_exports__);
  3734. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return StringLiteral; });
  3735. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3736. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3737. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3738. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3739. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3740. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3741. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3742. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3743. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3744. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3745. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3746. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3747. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3748. 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); }; }
  3749. 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; } }
  3750. var StringLiteral = /*#__PURE__*/function (_Literal) {
  3751. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(StringLiteral, _Literal);
  3752. var _super = _createSuper(StringLiteral);
  3753. function StringLiteral(value) {
  3754. var _this;
  3755. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, StringLiteral);
  3756. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].STRING);
  3757. _this.value = value;
  3758. return _this;
  3759. }
  3760. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(StringLiteral, [{
  3761. key: "toString",
  3762. value: function toString() {
  3763. var text = '"' + this.value + '"';
  3764. if (this.parenthesis) {
  3765. return "(".concat(text, ")");
  3766. } else {
  3767. return text;
  3768. }
  3769. }
  3770. }]);
  3771. return StringLiteral;
  3772. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3773. /***/ }),
  3774. /***/ "./js/ast/expressions/unaryApp.js":
  3775. /*!****************************************!*\
  3776. !*** ./js/ast/expressions/unaryApp.js ***!
  3777. \****************************************/
  3778. /*! exports provided: UnaryApp */
  3779. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3780. "use strict";
  3781. __webpack_require__.r(__webpack_exports__);
  3782. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return UnaryApp; });
  3783. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3784. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3785. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3786. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3787. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3788. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3789. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3790. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3791. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3792. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3793. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  3794. 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); }; }
  3795. 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; } }
  3796. var UnaryApp = /*#__PURE__*/function (_InfixApp) {
  3797. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(UnaryApp, _InfixApp);
  3798. var _super = _createSuper(UnaryApp);
  3799. function UnaryApp(op, left) {
  3800. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, UnaryApp);
  3801. return _super.call(this, op, left, null);
  3802. }
  3803. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(UnaryApp, [{
  3804. key: "toString",
  3805. value: function toString() {
  3806. var l = this.left.toString();
  3807. var op = this.op.value;
  3808. if (this.parenthesis) {
  3809. return "(".concat(op + l, ")");
  3810. } else {
  3811. return op + l;
  3812. }
  3813. }
  3814. }]);
  3815. return UnaryApp;
  3816. }(_infixApp__WEBPACK_IMPORTED_MODULE_5__["InfixApp"]);
  3817. /***/ }),
  3818. /***/ "./js/ast/expressions/variableLiteral.js":
  3819. /*!***********************************************!*\
  3820. !*** ./js/ast/expressions/variableLiteral.js ***!
  3821. \***********************************************/
  3822. /*! exports provided: VariableLiteral */
  3823. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3824. "use strict";
  3825. __webpack_require__.r(__webpack_exports__);
  3826. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return VariableLiteral; });
  3827. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3828. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3829. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3830. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3831. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3832. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3833. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3834. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3835. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3836. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3837. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3838. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3839. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3840. 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); }; }
  3841. 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; } }
  3842. var VariableLiteral = /*#__PURE__*/function (_Literal) {
  3843. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(VariableLiteral, _Literal);
  3844. var _super = _createSuper(VariableLiteral);
  3845. function VariableLiteral(id) {
  3846. var _this;
  3847. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, VariableLiteral);
  3848. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].UNDEFINED);
  3849. _this.id = id;
  3850. return _this;
  3851. }
  3852. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(VariableLiteral, [{
  3853. key: "toString",
  3854. value: function toString() {
  3855. if (this.parenthesis) {
  3856. return "(".concat(this.id, ")");
  3857. } else {
  3858. return this.id;
  3859. }
  3860. }
  3861. }]);
  3862. return VariableLiteral;
  3863. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3864. /***/ }),
  3865. /***/ "./js/ast/ivprogParser.js":
  3866. /*!********************************!*\
  3867. !*** ./js/ast/ivprogParser.js ***!
  3868. \********************************/
  3869. /*! exports provided: IVProgParser */
  3870. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3871. "use strict";
  3872. __webpack_require__.r(__webpack_exports__);
  3873. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgParser", function() { return IVProgParser; });
  3874. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3875. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3876. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3877. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3878. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
  3879. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antlr4_index__WEBPACK_IMPORTED_MODULE_2__);
  3880. /* harmony import */ var _expressions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./expressions */ "./js/ast/expressions/index.js");
  3881. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands */ "./js/ast/commands/index.js");
  3882. /* harmony import */ var _ast_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ast_helpers */ "./js/ast/ast_helpers.js");
  3883. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3884. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  3885. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__);
  3886. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  3887. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  3888. /* harmony import */ var _sourceInfo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sourceInfo */ "./js/ast/sourceInfo.js");
  3889. /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./operators */ "./js/ast/operators.ts");
  3890. /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_operators__WEBPACK_IMPORTED_MODULE_10__);
  3891. /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
  3892. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  3893. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  3894. var IVProgParser = /*#__PURE__*/function () {
  3895. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, null, [{
  3896. key: "createParser",
  3897. value: function createParser(input) {
  3898. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLexer();
  3899. return new IVProgParser(input, lexerClass);
  3900. } // <BEGIN scope consts>
  3901. }, {
  3902. key: "BASE",
  3903. get: function get() {
  3904. return 0;
  3905. }
  3906. }, {
  3907. key: "FUNCTION",
  3908. get: function get() {
  3909. return 1;
  3910. }
  3911. }, {
  3912. key: "COMMAND",
  3913. get: function get() {
  3914. return 2;
  3915. }
  3916. }, {
  3917. key: "BREAKABLE",
  3918. get: function get() {
  3919. return 4;
  3920. } // </ END scope consts>
  3921. }]);
  3922. function IVProgParser(input, lexerClass) {
  3923. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgParser);
  3924. this.lexerClass = lexerClass;
  3925. this.inputStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["InputStream"](input);
  3926. this.lexer = new lexerClass(this.inputStream);
  3927. this.lexer.recover = _ast_helpers__WEBPACK_IMPORTED_MODULE_5__["recover"].bind(this.lexer);
  3928. this.tokenStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["CommonTokenStream"](this.lexer);
  3929. this.tokenStream.fill();
  3930. this.pos = 1;
  3931. this.variableTypes = [this.lexerClass.RK_INTEGER, this.lexerClass.RK_REAL, this.lexerClass.RK_BOOLEAN, this.lexerClass.RK_STRING, this.lexerClass.RK_CHARACTER];
  3932. this.functionTypes = this.variableTypes.concat(this.lexerClass.RK_VOID);
  3933. this.parsingArrayDimension = 0;
  3934. this.scope = [];
  3935. this.langFuncs = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLangFuncs();
  3936. this.definedFuncsNameList = [];
  3937. this.definedVariablesStack = [];
  3938. }
  3939. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, [{
  3940. key: "parseTree",
  3941. value: function parseTree() {
  3942. return this.parseProgram();
  3943. }
  3944. }, {
  3945. key: "getToken",
  3946. value: function getToken() {
  3947. var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pos;
  3948. // if(index === null)
  3949. // index = this.pos;
  3950. return this.tokenStream.LT(index);
  3951. }
  3952. }, {
  3953. key: "insideScope",
  3954. value: function insideScope(scope) {
  3955. if (this.scope.length <= 0) {
  3956. return IVProgParser.BASE === scope;
  3957. } else {
  3958. return this.scope[this.scope.length - 1] === scope;
  3959. }
  3960. }
  3961. }, {
  3962. key: "pushScope",
  3963. value: function pushScope(scope) {
  3964. this.scope.push(scope);
  3965. }
  3966. }, {
  3967. key: "pushVariableStack",
  3968. value: function pushVariableStack() {
  3969. this.definedVariablesStack.push([]);
  3970. }
  3971. }, {
  3972. key: "popScope",
  3973. value: function popScope() {
  3974. return this.scope.pop();
  3975. }
  3976. }, {
  3977. key: "popVariableStack",
  3978. value: function popVariableStack() {
  3979. return this.definedVariablesStack.pop();
  3980. }
  3981. }, {
  3982. key: "getCurrentVariableStack",
  3983. value: function getCurrentVariableStack() {
  3984. return this.definedVariablesStack[this.definedVariablesStack.length - 1];
  3985. }
  3986. }, {
  3987. key: "isEOF",
  3988. value: function isEOF() {
  3989. this.getToken(this.pos);
  3990. return this.tokenStream.fetchedEOF;
  3991. }
  3992. }, {
  3993. key: "parseProgram",
  3994. value: function parseProgram() {
  3995. this.consumeNewLines();
  3996. var token = this.getToken();
  3997. var globalVars = [];
  3998. var functions = [];
  3999. if (this.lexerClass.RK_PROGRAM === token.type) {
  4000. this.pos++;
  4001. this.consumeNewLines();
  4002. this.checkOpenCurly();
  4003. this.pos++;
  4004. this.pushVariableStack();
  4005. for (;;) {
  4006. this.consumeNewLines();
  4007. var _token = this.getToken();
  4008. if (_token.type === this.lexerClass.RK_CONST || this.isVariableType(_token)) {
  4009. globalVars = globalVars.concat(this.parseGlobalVariables());
  4010. } else if (_token.type === this.lexerClass.RK_FUNCTION) {
  4011. this.pushVariableStack();
  4012. functions = functions.concat(this.parseFunction());
  4013. this.popVariableStack();
  4014. } else {
  4015. break;
  4016. }
  4017. }
  4018. this.consumeNewLines();
  4019. this.checkCloseCurly();
  4020. this.pos++;
  4021. this.consumeNewLines();
  4022. if (!this.isEOF()) {
  4023. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].extra_lines();
  4024. }
  4025. this.popVariableStack();
  4026. return {
  4027. global: globalVars,
  4028. functions: functions
  4029. };
  4030. } else {
  4031. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_PROGRAM], token);
  4032. }
  4033. }
  4034. }, {
  4035. key: "checkOpenCurly",
  4036. value: function checkOpenCurly() {
  4037. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4038. var token = this.getToken();
  4039. if (this.lexerClass.OPEN_CURLY !== token.type) {
  4040. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("{", token);else return false;
  4041. }
  4042. return true;
  4043. }
  4044. }, {
  4045. key: "checkCloseCurly",
  4046. value: function checkCloseCurly() {
  4047. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4048. var token = this.getToken();
  4049. if (this.lexerClass.CLOSE_CURLY !== token.type) {
  4050. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("}", token);else return false;
  4051. }
  4052. return true;
  4053. }
  4054. /* It checks if the current token at position pos is a ']'.
  4055. * As a check function it doesn't increment pos.
  4056. *
  4057. * @params bool:attempt, indicates that the token is optional. Defaults: false
  4058. *
  4059. * @returns true if the attempt is true and current token is '[',
  4060. * false is attempt is true and current token is not '['
  4061. **/
  4062. }, {
  4063. key: "checkOpenBrace",
  4064. value: function checkOpenBrace() {
  4065. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4066. var token = this.getToken();
  4067. if (this.lexerClass.OPEN_BRACE !== token.type) {
  4068. if (!attempt) {
  4069. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("[", token);
  4070. } else {
  4071. return false;
  4072. }
  4073. }
  4074. return true;
  4075. }
  4076. }, {
  4077. key: "checkCloseBrace",
  4078. value: function checkCloseBrace() {
  4079. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4080. var token = this.getToken();
  4081. if (this.lexerClass.CLOSE_BRACE !== token.type) {
  4082. if (!attempt) {
  4083. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("]", token);
  4084. } else {
  4085. return false;
  4086. }
  4087. }
  4088. return true;
  4089. }
  4090. }, {
  4091. key: "checkOpenParenthesis",
  4092. value: function checkOpenParenthesis() {
  4093. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4094. var token = this.getToken();
  4095. if (this.lexerClass.OPEN_PARENTHESIS !== token.type) {
  4096. if (!attempt) {
  4097. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("(", token);
  4098. } else {
  4099. return false;
  4100. }
  4101. }
  4102. return true;
  4103. }
  4104. }, {
  4105. key: "checkCloseParenthesis",
  4106. value: function checkCloseParenthesis() {
  4107. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4108. var token = this.getToken();
  4109. if (this.lexerClass.CLOSE_PARENTHESIS !== token.type) {
  4110. if (!attempt) {
  4111. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(")", token);
  4112. } else {
  4113. return false;
  4114. }
  4115. }
  4116. return true;
  4117. }
  4118. }, {
  4119. key: "checkEOS",
  4120. value: function checkEOS() {
  4121. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4122. var eosToken = this.getToken();
  4123. if (eosToken.type !== this.lexerClass.EOS) {
  4124. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].eos_missing(eosToken);else return false;
  4125. }
  4126. return true;
  4127. }
  4128. }, {
  4129. key: "checkFunctionDuplicate",
  4130. value: function checkFunctionDuplicate(functionID, funcIDToken) {
  4131. var id = functionID === null ? "$main" : functionID;
  4132. var index = this.definedFuncsNameList.indexOf(id);
  4133. if (index !== -1) {
  4134. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_function(funcIDToken);
  4135. }
  4136. this.definedFuncsNameList.push(id);
  4137. }
  4138. }, {
  4139. key: "checkVariableDuplicate",
  4140. value: function checkVariableDuplicate(variableID, sourceInfo) {
  4141. var index = this.getCurrentVariableStack().indexOf(variableID);
  4142. if (index !== -1) {
  4143. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_variable(sourceInfo);
  4144. }
  4145. this.getCurrentVariableStack().push(variableID);
  4146. }
  4147. }, {
  4148. key: "consumeForSemiColon",
  4149. value: function consumeForSemiColon() {
  4150. var eosToken = this.getToken();
  4151. if (eosToken.type === this.lexerClass.EOS && eosToken.text.match(";")) {
  4152. this.pos++;
  4153. return;
  4154. }
  4155. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(";", eosToken);
  4156. }
  4157. }, {
  4158. key: "parseGlobalVariables",
  4159. value: function parseGlobalVariables() {
  4160. var decl = this.parseMaybeConst();
  4161. this.checkEOS();
  4162. this.pos++;
  4163. return decl;
  4164. }
  4165. /*
  4166. * Checks if the next token is PR_CONST. It's only available
  4167. * at global variables declaration level
  4168. * @returns Declararion(const, type, id, initVal?)
  4169. **/
  4170. }, {
  4171. key: "parseMaybeConst",
  4172. value: function parseMaybeConst() {
  4173. var constToken = this.getToken();
  4174. if (constToken.type === this.lexerClass.RK_CONST) {
  4175. this.pos++;
  4176. var typeString = this.parseType();
  4177. return this.parseDeclaration(typeString, true);
  4178. } else if (this.isVariableType(constToken)) {
  4179. var _typeString = this.parseType();
  4180. return this.parseDeclaration(_typeString);
  4181. } else {
  4182. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_CONST]].concat(this.getTypeArray()), constToken);
  4183. }
  4184. }
  4185. /*
  4186. * Parses a declarion of the form: type --- id --- (= --- EAnd)?
  4187. * @returns a list of Declararion(const, type, id, initVal?)
  4188. **/
  4189. }, {
  4190. key: "parseDeclaration",
  4191. value: function parseDeclaration(typeString) {
  4192. var isConst = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  4193. var initial = null;
  4194. var dim1 = null;
  4195. var dim2 = null;
  4196. var dimensions = 0;
  4197. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(this.getToken());
  4198. var idString = this.parseID();
  4199. this.checkVariableDuplicate(idString, sourceInfo); // Check for array or vector
  4200. // ID[int/IDi?][int/IDj?]
  4201. if (this.checkOpenBrace(true)) {
  4202. this.pos += 1;
  4203. this.consumeNewLines();
  4204. dim1 = this.parseArrayDimension();
  4205. this.consumeNewLines();
  4206. this.checkCloseBrace();
  4207. this.pos += 1;
  4208. dimensions += 1;
  4209. if (this.checkOpenBrace(true)) {
  4210. this.pos += 1;
  4211. this.consumeNewLines();
  4212. dim2 = this.parseArrayDimension();
  4213. this.consumeNewLines();
  4214. this.checkCloseBrace();
  4215. this.pos += 1;
  4216. dimensions += 1;
  4217. }
  4218. return this.parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2);
  4219. } else {
  4220. var equalsToken = this.getToken();
  4221. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4222. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4223. }
  4224. if (equalsToken.type === this.lexerClass.EQUAL) {
  4225. this.pos++;
  4226. initial = this.parseExpressionOR();
  4227. }
  4228. var declaration = new _commands__WEBPACK_IMPORTED_MODULE_4__["Declaration"](idString, typeString, initial, isConst);
  4229. declaration.sourceInfo = sourceInfo;
  4230. var commaToken = this.getToken();
  4231. if (commaToken.type === this.lexerClass.COMMA) {
  4232. this.pos++;
  4233. this.consumeNewLines();
  4234. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4235. } else {
  4236. return [declaration];
  4237. }
  4238. }
  4239. }
  4240. }, {
  4241. key: "parseArrayDeclaration",
  4242. value: function parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2) {
  4243. var equalsToken = this.getToken();
  4244. var n_lines = dim1;
  4245. var n_columns = dim2;
  4246. var initial = null;
  4247. var dim_is_id = false;
  4248. if (dim1 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"] || dim2 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"]) {
  4249. dim_is_id = true;
  4250. if (dimensions > 1 && (dim1 == null || dim2 == null)) {
  4251. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_id_dimension(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4252. }
  4253. }
  4254. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4255. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4256. }
  4257. if (equalsToken.type === this.lexerClass.EQUAL) {
  4258. if (dim_is_id) {
  4259. if (dimensions == 1) {
  4260. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_vector_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4261. } else {
  4262. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4263. }
  4264. }
  4265. this.pos += 1;
  4266. initial = this.parseArrayLiteral(typeString);
  4267. }
  4268. if (initial == null && dim1 == null) {
  4269. if (dimensions > 1) {
  4270. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_line(idString, sourceInfo);
  4271. }
  4272. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_vector_size(idString, sourceInfo);
  4273. }
  4274. if (dimensions > 1) {
  4275. if (initial == null && dim2 == null) {
  4276. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_column(idString, sourceInfo);
  4277. }
  4278. }
  4279. if (dimensions === 1 && initial != null && !initial.isVector) {
  4280. var expString = initial.toString();
  4281. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].matrix_to_vector_literal_attr(idString, expString, initial.sourceInfo);
  4282. } else if (dimensions > 1 && initial != null && initial.isVector) {
  4283. var _expString = initial.toString();
  4284. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].vector_to_matrix_literal_attr(idString, _expString, initial.sourceInfo);
  4285. }
  4286. if (dim1 == null) {
  4287. n_lines = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.lines));
  4288. n_lines.sourceInfo = sourceInfo;
  4289. }
  4290. if (dimensions > 1) {
  4291. if (dim2 == null) {
  4292. n_columns = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.columns));
  4293. n_columns.sourceInfo = sourceInfo;
  4294. }
  4295. }
  4296. 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);
  4297. declaration.sourceInfo = sourceInfo;
  4298. var commaToken = this.getToken();
  4299. if (commaToken.type === this.lexerClass.COMMA) {
  4300. this.pos++;
  4301. this.consumeNewLines();
  4302. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4303. } else {
  4304. return [declaration];
  4305. }
  4306. }
  4307. }, {
  4308. key: "consumeNewLines",
  4309. value: function consumeNewLines() {
  4310. var token = this.getToken();
  4311. while (token.type === this.lexerClass.EOS && token.text.match("[\r\n]+")) {
  4312. this.pos++;
  4313. token = this.getToken();
  4314. }
  4315. }
  4316. }, {
  4317. key: "isVariableType",
  4318. value: function isVariableType(token) {
  4319. return this.variableTypes.find(function (v) {
  4320. return v === token.type;
  4321. });
  4322. }
  4323. /*
  4324. * Reads the next token of the stream to check if it is a Integer or an ID.
  4325. * @returns Integer | ID
  4326. **/
  4327. }, {
  4328. key: "parseArrayDimension",
  4329. value: function parseArrayDimension() {
  4330. var dimToken = this.getToken();
  4331. if (dimToken.type === this.lexerClass.INTEGER) {
  4332. //parse as int literal
  4333. this.pos++;
  4334. return this.getIntLiteral(dimToken);
  4335. } else if (dimToken.type === this.lexerClass.ID) {
  4336. //parse as variable
  4337. this.pos++;
  4338. return this.parseVariable(dimToken);
  4339. } else if (dimToken.type === this.lexerClass.CLOSE_BRACE) {
  4340. return null;
  4341. } else {
  4342. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_array_dimension(this.lexer.literalNames[this.lexerClass.RK_INTEGER], dimToken);
  4343. }
  4344. }
  4345. /*
  4346. * Returns an object {type: 'int', value: value}.
  4347. * It checks for binary and hexadecimal integers.
  4348. * @returns object with fields type and value
  4349. **/
  4350. }, {
  4351. key: "getIntLiteral",
  4352. value: function getIntLiteral(token) {
  4353. var text = token.text;
  4354. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4355. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](text));
  4356. exp.sourceInfo = sourceInfo;
  4357. return exp;
  4358. }
  4359. }, {
  4360. key: "getRealLiteral",
  4361. value: function getRealLiteral(token) {
  4362. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4363. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toReal"](token.text));
  4364. exp.sourceInfo = sourceInfo;
  4365. return exp;
  4366. }
  4367. }, {
  4368. key: "getStringLiteral",
  4369. value: function getStringLiteral(token) {
  4370. var text = token.text;
  4371. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4372. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["StringLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toString"](text));
  4373. exp.sourceInfo = sourceInfo;
  4374. return exp;
  4375. }
  4376. }, {
  4377. key: "getCharLiteral",
  4378. value: function getCharLiteral(token) {
  4379. var text = token.text;
  4380. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["CharLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toChar"](text));
  4381. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4382. return exp;
  4383. }
  4384. }, {
  4385. key: "getBoolLiteral",
  4386. value: function getBoolLiteral(token) {
  4387. var val = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toBool"](token.text);
  4388. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["BoolLiteral"](val);
  4389. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4390. return exp;
  4391. }
  4392. }, {
  4393. key: "parseArrayLiteral",
  4394. value: function parseArrayLiteral(typeString) {
  4395. var openCurly = this.checkOpenCurly(true);
  4396. if (!openCurly) {
  4397. var invalid_token = this.getToken();
  4398. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_init_not_literal(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(invalid_token));
  4399. }
  4400. var beginArray = this.getToken();
  4401. if (this.parsingArrayDimension >= 2) {
  4402. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
  4403. }
  4404. this.pos += 1;
  4405. this.parsingArrayDimension += 1;
  4406. this.consumeNewLines();
  4407. var data = null;
  4408. var maybeCurlyOpen = this.checkOpenCurly(true);
  4409. if (maybeCurlyOpen) {
  4410. // This is potentially a list of vectors
  4411. data = this.parseVectorList(typeString);
  4412. } else {
  4413. data = this.parseExpressionList();
  4414. }
  4415. this.consumeNewLines();
  4416. this.checkCloseCurly();
  4417. var endArray = this.getToken();
  4418. this.pos += 1;
  4419. this.parsingArrayDimension -= 1;
  4420. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4421. var dataDim = 1;
  4422. if (data[0] instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"]) {
  4423. dataDim += 1;
  4424. } else if (data.length == 1) {
  4425. console.log("Talvez uma variável seja uma melhor opção");
  4426. }
  4427. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dataDim);
  4428. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
  4429. exp.sourceInfo = sourceInfo;
  4430. return exp;
  4431. }
  4432. /**
  4433. * Returns a list of ArrayLiterals. Helper function for parsing matrices
  4434. */
  4435. }, {
  4436. key: "parseVectorList",
  4437. value: function parseVectorList(typeString) {
  4438. var list = [];
  4439. var lastSize = null;
  4440. for (;;) {
  4441. this.checkOpenCurly();
  4442. var beginArray = this.getToken();
  4443. if (this.parsingArrayDimension >= 2) {
  4444. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
  4445. }
  4446. this.pos += 1;
  4447. this.parsingArrayDimension += 1;
  4448. this.consumeNewLines();
  4449. var data = this.parseExpressionList();
  4450. this.consumeNewLines();
  4451. this.checkCloseCurly();
  4452. var endArray = this.getToken();
  4453. this.pos += 1;
  4454. this.parsingArrayDimension -= 1;
  4455. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4456. if (lastSize == null) {
  4457. lastSize = data.length;
  4458. } else if (lastSize !== data.length) {
  4459. var expString = this.inputStream.getText(beginArray.start, endArray.stop);
  4460. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_literal_line(expString, sourceInfo);
  4461. }
  4462. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, 1);
  4463. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
  4464. exp.sourceInfo = sourceInfo;
  4465. list.push(exp);
  4466. var commaToken = this.getToken();
  4467. if (commaToken.type !== this.lexerClass.COMMA) {
  4468. break;
  4469. }
  4470. this.pos += 1;
  4471. this.consumeNewLines();
  4472. }
  4473. if (list.length == 1) {
  4474. console.log("Talvez um vetor seja uma melhor opção");
  4475. }
  4476. return list;
  4477. }
  4478. /*
  4479. * Returns an object {type: 'variable', value: value}.
  4480. * @returns object with fields type and value
  4481. **/
  4482. }, {
  4483. key: "parseVariable",
  4484. value: function parseVariable(token) {
  4485. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4486. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](token.text);
  4487. exp.sourceInfo = sourceInfo;
  4488. return exp;
  4489. }
  4490. /*
  4491. * Returns an object representing a function. It has
  4492. * four attributes: returnType, id, formalParams and block.
  4493. * The block object has two attributes: declarations and commands
  4494. **/
  4495. }, {
  4496. key: "parseFunction",
  4497. value: function parseFunction() {
  4498. this.pushScope(IVProgParser.FUNCTION);
  4499. var formalParams = [];
  4500. var token = this.getToken();
  4501. if (token.type !== this.lexerClass.RK_FUNCTION) {
  4502. //throw SyntaxError.createError(this.lexer.literalNames[this.lexerClass.PR_FUNCAO], token);
  4503. return null;
  4504. }
  4505. this.pos++;
  4506. var funType = this.parseType();
  4507. var dimensions = 0;
  4508. if (this.checkOpenBrace(true)) {
  4509. this.pos++;
  4510. this.checkCloseBrace();
  4511. this.pos++;
  4512. dimensions++;
  4513. if (this.checkOpenBrace(true)) {
  4514. this.pos++;
  4515. this.checkCloseBrace();
  4516. this.pos++;
  4517. dimensions++;
  4518. }
  4519. }
  4520. var funcIDToken = this.getToken();
  4521. var functionID = this.parseID();
  4522. this.checkFunctionDuplicate(functionID, funcIDToken);
  4523. this.checkOpenParenthesis();
  4524. this.pos++;
  4525. this.consumeNewLines();
  4526. if (!this.checkCloseParenthesis(true)) {
  4527. formalParams = this.parseFormalParameters(); // formal parameters
  4528. this.consumeNewLines();
  4529. this.checkCloseParenthesis();
  4530. this.pos++;
  4531. } else {
  4532. this.pos++;
  4533. }
  4534. this.consumeNewLines();
  4535. var commandsBlock = this.parseCommandBlock();
  4536. var returnType = funType;
  4537. if (dimensions > 0) {
  4538. returnType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](funType, dimensions);
  4539. }
  4540. var func = new _commands__WEBPACK_IMPORTED_MODULE_4__["Function"](functionID, returnType, formalParams, commandsBlock);
  4541. if (functionID === null && !func.isMain) {
  4542. 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);
  4543. } else if (func.isMain && formalParams.length !== 0) {
  4544. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].main_parameters();
  4545. }
  4546. this.popScope();
  4547. return func;
  4548. }
  4549. /*
  4550. * Parse the formal parameters of a function.
  4551. * @returns a list of objects with the following attributes: type, id and dimensions.
  4552. **/
  4553. }, {
  4554. key: "parseFormalParameters",
  4555. value: function parseFormalParameters() {
  4556. var list = [];
  4557. for (;;) {
  4558. var dimensions = 0;
  4559. var reference = false;
  4560. var typeString = this.parseType();
  4561. var maybeIDToken = this.getToken();
  4562. if (maybeIDToken.type === this.lexerClass.RK_REFERENCE) {
  4563. reference = true;
  4564. this.pos += 1;
  4565. maybeIDToken = this.getToken();
  4566. }
  4567. var idString = this.parseID();
  4568. this.checkVariableDuplicate(idString, maybeIDToken);
  4569. if (this.checkOpenBrace(true)) {
  4570. this.pos += 1;
  4571. dimensions += 1;
  4572. this.checkCloseBrace();
  4573. this.pos += 1;
  4574. if (this.checkOpenBrace(true)) {
  4575. this.pos += 1;
  4576. dimensions += 1;
  4577. this.checkCloseBrace();
  4578. this.pos += 1;
  4579. }
  4580. }
  4581. var type = null;
  4582. if (dimensions > 0) {
  4583. type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dimensions);
  4584. } else {
  4585. type = typeString;
  4586. }
  4587. var parameter = new _commands__WEBPACK_IMPORTED_MODULE_4__["FormalParameter"](type, idString, reference);
  4588. parameter.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(maybeIDToken);
  4589. list.push(parameter);
  4590. var commaToken = this.getToken();
  4591. if (commaToken.type !== this.lexerClass.COMMA) break;
  4592. this.pos++;
  4593. this.consumeNewLines();
  4594. }
  4595. return list;
  4596. }
  4597. }, {
  4598. key: "parseID",
  4599. value: function parseID() {
  4600. var token = this.getToken();
  4601. if (token.type !== this.lexerClass.ID) {
  4602. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
  4603. }
  4604. this.pos++;
  4605. if (this.insideScope(IVProgParser.FUNCTION)) {
  4606. if (token.text === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
  4607. return null;
  4608. }
  4609. }
  4610. return token.text;
  4611. }
  4612. }, {
  4613. key: "parseMaybeLibID",
  4614. value: function parseMaybeLibID() {
  4615. var token = this.getToken();
  4616. if (token.type !== this.lexerClass.ID && token.type !== this.lexerClass.LIB_ID) {
  4617. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
  4618. }
  4619. this.pos++;
  4620. return token.text;
  4621. }
  4622. }, {
  4623. key: "parseType",
  4624. value: function parseType() {
  4625. var token = this.getToken();
  4626. if (token.type === this.lexerClass.ID && this.insideScope(IVProgParser.FUNCTION)) {
  4627. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
  4628. } else if (token.type === this.lexerClass.RK_VOID && this.insideScope(IVProgParser.FUNCTION)) {
  4629. this.pos++;
  4630. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
  4631. } else if (this.isVariableType(token)) {
  4632. this.pos++;
  4633. switch (token.type) {
  4634. case this.lexerClass.RK_INTEGER:
  4635. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER;
  4636. case this.lexerClass.RK_BOOLEAN:
  4637. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].BOOLEAN;
  4638. case this.lexerClass.RK_REAL:
  4639. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].REAL;
  4640. case this.lexerClass.RK_STRING:
  4641. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].STRING;
  4642. case this.lexerClass.RK_CHARACTER:
  4643. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].CHAR;
  4644. default:
  4645. break;
  4646. }
  4647. }
  4648. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_type(this.getTypeArray(), token);
  4649. }
  4650. }, {
  4651. key: "parseCommandBlock",
  4652. value: function parseCommandBlock() {
  4653. var optionalCurly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4654. var variablesDecl = [];
  4655. var commands = [];
  4656. var hasOpen = false;
  4657. if (this.checkOpenCurly(optionalCurly)) {
  4658. this.pos++;
  4659. hasOpen = true;
  4660. }
  4661. this.consumeNewLines();
  4662. var parsedCommand = false;
  4663. for (;;) {
  4664. var cmd = this.parseCommand();
  4665. if (cmd === null) break;
  4666. if (cmd !== -1) {
  4667. if (cmd instanceof Array) {
  4668. if (parsedCommand) {
  4669. var lastToken = this.getToken(this.pos - 1);
  4670. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(lastToken);
  4671. }
  4672. variablesDecl = variablesDecl.concat(cmd);
  4673. } else {
  4674. parsedCommand = true;
  4675. commands.push(cmd);
  4676. }
  4677. }
  4678. }
  4679. this.consumeNewLines();
  4680. if (hasOpen) {
  4681. this.checkCloseCurly();
  4682. this.pos++;
  4683. this.consumeNewLines();
  4684. }
  4685. return new _commands__WEBPACK_IMPORTED_MODULE_4__["CommandBlock"](variablesDecl, commands);
  4686. }
  4687. }, {
  4688. key: "parseCommand",
  4689. value: function parseCommand() {
  4690. var token = this.getToken();
  4691. if (this.isVariableType(token)) {
  4692. if (!this.insideScope(IVProgParser.FUNCTION)) {
  4693. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(token);
  4694. }
  4695. this.pushScope(IVProgParser.BASE);
  4696. var varType = this.parseType();
  4697. this.popScope();
  4698. var cmd = this.parseDeclaration(varType);
  4699. this.checkEOS();
  4700. this.pos++;
  4701. return cmd;
  4702. } else if (token.type === this.lexerClass.ID) {
  4703. return this.parseIDCommand();
  4704. } else if (token.type === this.lexerClass.LIB_ID) {
  4705. return this.parseIDCommand();
  4706. } else if (token.type === this.lexerClass.RK_RETURN) {
  4707. return this.parseReturn();
  4708. } else if (token.type === this.lexerClass.RK_WHILE || token.type === this.lexerClass.RK_WHILE_ALT) {
  4709. return this.parseWhile();
  4710. } else if (token.type === this.lexerClass.RK_FOR || token.type === this.lexerClass.RK_FOR_ALT) {
  4711. return this.parseFor();
  4712. } else if (token.type === this.lexerClass.RK_BREAK) {
  4713. if (!this.insideScope(IVProgParser.BREAKABLE)) {
  4714. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_break_command(this.lexer.literalNames[this.lexerClass.RK_BREAK], token);
  4715. }
  4716. return this.parseBreak();
  4717. } else if (token.type === this.lexerClass.RK_SWITCH) {
  4718. return this.parseSwitchCase();
  4719. } else if (token.type === this.lexerClass.RK_DO) {
  4720. return this.parseRepeatUntil();
  4721. } else if (token.type === this.lexerClass.RK_IF) {
  4722. return this.parseIfThenElse();
  4723. } else if (this.checkEOS(true)) {
  4724. this.pos++;
  4725. return -1;
  4726. } else {
  4727. return null;
  4728. }
  4729. }
  4730. }, {
  4731. key: "parseSwitchCase",
  4732. value: function parseSwitchCase() {
  4733. this.pushScope(IVProgParser.BREAKABLE);
  4734. this.pos++;
  4735. this.checkOpenParenthesis();
  4736. this.pos++;
  4737. this.consumeNewLines();
  4738. var exp = this.parseExpressionOR();
  4739. this.consumeNewLines();
  4740. this.checkCloseParenthesis();
  4741. this.pos++;
  4742. this.consumeNewLines();
  4743. this.checkOpenCurly();
  4744. this.pos++;
  4745. this.consumeNewLines();
  4746. var casesList = this.parseCases();
  4747. this.consumeNewLines();
  4748. this.checkCloseCurly();
  4749. this.pos++;
  4750. this.consumeNewLines();
  4751. this.popScope();
  4752. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Switch"](exp, casesList);
  4753. }
  4754. }, {
  4755. key: "parseRepeatUntil",
  4756. value: function parseRepeatUntil() {
  4757. this.pos++;
  4758. this.consumeNewLines();
  4759. this.pushScope(IVProgParser.BREAKABLE);
  4760. var commandsBlock = this.parseCommandBlock();
  4761. this.consumeNewLines(); //Maybe not...
  4762. var whileToken = this.getToken();
  4763. if (whileToken.type !== this.lexerClass.RK_DO_UNTIL) {
  4764. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_DO_UNTIL], whileToken);
  4765. }
  4766. this.pos++;
  4767. this.checkOpenParenthesis();
  4768. this.pos++;
  4769. this.consumeNewLines();
  4770. var condition = this.parseExpressionOR();
  4771. this.consumeNewLines();
  4772. this.checkCloseParenthesis();
  4773. this.pos++;
  4774. this.checkEOS();
  4775. this.popScope();
  4776. return new _commands__WEBPACK_IMPORTED_MODULE_4__["RepeatUntil"](condition, commandsBlock);
  4777. }
  4778. }, {
  4779. key: "parseIfThenElse",
  4780. value: function parseIfThenElse() {
  4781. if (this.insideScope(IVProgParser.BREAKABLE)) {
  4782. this.pushScope(IVProgParser.BREAKABLE);
  4783. } else {
  4784. this.pushScope(IVProgParser.COMMAND);
  4785. }
  4786. var token = this.getToken();
  4787. this.pos++;
  4788. this.checkOpenParenthesis();
  4789. this.pos++;
  4790. this.consumeNewLines();
  4791. var logicalExpression = this.parseExpressionOR();
  4792. this.consumeNewLines();
  4793. this.checkCloseParenthesis();
  4794. this.pos++;
  4795. this.consumeNewLines();
  4796. var cmdBlocks = this.parseCommandBlock();
  4797. var maybeElse = this.getToken();
  4798. if (maybeElse.type === this.lexerClass.RK_ELSE) {
  4799. this.pos++;
  4800. this.consumeNewLines();
  4801. var maybeIf = this.getToken();
  4802. var elseBlock = null;
  4803. if (this.checkOpenCurly(true)) {
  4804. elseBlock = this.parseCommandBlock();
  4805. } else if (maybeIf.type === this.lexerClass.RK_IF) {
  4806. elseBlock = this.parseIfThenElse();
  4807. } else {
  4808. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_IF], "{"], maybeIf);
  4809. }
  4810. this.popScope();
  4811. var _cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, elseBlock);
  4812. _cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4813. return _cmd;
  4814. }
  4815. this.popScope();
  4816. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, null);
  4817. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4818. return cmd;
  4819. }
  4820. }, {
  4821. key: "parseFor",
  4822. value: function parseFor() {
  4823. this.pushScope(IVProgParser.BREAKABLE);
  4824. var for_token = this.getToken();
  4825. this.pos += 1; // parse ID
  4826. var id_token = this.getToken();
  4827. var id = this.parseID();
  4828. var for_id = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
  4829. for_id.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(id_token); // END parse ID
  4830. var for_from = this.parseForParameters(this.lexerClass.RK_FOR_FROM);
  4831. var for_to = this.parseForParameters(this.lexerClass.RK_FOR_TO);
  4832. var maybePass = this.parseForParameters(this.lexerClass.RK_FOR_PASS);
  4833. this.consumeNewLines();
  4834. var commandsBlock = this.parseCommandBlock();
  4835. this.popScope();
  4836. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["For"](for_id, for_from, for_to, maybePass, commandsBlock);
  4837. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(for_token);
  4838. return cmd;
  4839. }
  4840. }, {
  4841. key: "parseWhile",
  4842. value: function parseWhile() {
  4843. this.pushScope(IVProgParser.BREAKABLE);
  4844. var token = this.getToken();
  4845. this.pos++;
  4846. this.checkOpenParenthesis();
  4847. this.pos++;
  4848. this.consumeNewLines();
  4849. var logicalExpression = this.parseExpressionOR();
  4850. this.consumeNewLines();
  4851. this.checkCloseParenthesis();
  4852. this.pos++;
  4853. this.consumeNewLines();
  4854. var cmdBlocks = this.parseCommandBlock();
  4855. this.popScope();
  4856. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["While"](logicalExpression, cmdBlocks);
  4857. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4858. return cmd;
  4859. }
  4860. }, {
  4861. key: "parseBreak",
  4862. value: function parseBreak() {
  4863. var token = this.getToken();
  4864. this.pos++;
  4865. this.checkEOS();
  4866. this.pos++;
  4867. var command = new _commands__WEBPACK_IMPORTED_MODULE_4__["Break"]();
  4868. command.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4869. return command;
  4870. }
  4871. }, {
  4872. key: "parseReturn",
  4873. value: function parseReturn() {
  4874. this.pos++;
  4875. var exp = null;
  4876. if (!this.checkEOS(true)) {
  4877. exp = this.parseExpressionOR();
  4878. this.checkEOS();
  4879. }
  4880. this.pos++;
  4881. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Return"](exp);
  4882. }
  4883. }, {
  4884. key: "parseIDCommand",
  4885. value: function parseIDCommand() {
  4886. var refToken = this.getToken();
  4887. var isID = refToken.type === this.lexerClass.ID;
  4888. var id = this.parseMaybeLibID();
  4889. if (this.checkOpenBrace(true)) {
  4890. this.pos++;
  4891. var lineExpression = null;
  4892. var columnExpression = null;
  4893. this.consumeNewLines();
  4894. lineExpression = this.parseExpression();
  4895. this.consumeNewLines();
  4896. this.checkCloseBrace();
  4897. this.pos++;
  4898. if (this.checkOpenBrace(true)) {
  4899. this.pos++;
  4900. this.consumeNewLines();
  4901. columnExpression = this.parseExpression();
  4902. this.consumeNewLines();
  4903. this.checkCloseBrace();
  4904. this.pos++;
  4905. }
  4906. var equalToken = this.getToken();
  4907. if (equalToken.type !== this.lexerClass.EQUAL) {
  4908. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one("=", equalToken);
  4909. }
  4910. this.pos++;
  4911. var exp = this.parseExpressionOR();
  4912. this.checkEOS();
  4913. this.pos++;
  4914. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["ArrayIndexAssign"](id, lineExpression, columnExpression, exp);
  4915. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalToken);
  4916. return cmd;
  4917. }
  4918. var equalOrParenthesis = this.getToken();
  4919. if (isID && equalOrParenthesis.type === this.lexerClass.EQUAL) {
  4920. this.pos++;
  4921. var _exp = this.parseExpressionOR();
  4922. this.checkEOS();
  4923. this.pos++;
  4924. var _cmd2 = new _commands__WEBPACK_IMPORTED_MODULE_4__["Assign"](id, _exp);
  4925. _cmd2.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalOrParenthesis);
  4926. return _cmd2;
  4927. } else if (equalOrParenthesis.type === this.lexerClass.OPEN_PARENTHESIS) {
  4928. var funcCall = this.parseFunctionCallCommand(id);
  4929. this.checkEOS();
  4930. this.pos++;
  4931. return funcCall;
  4932. } else if (isID) {
  4933. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list(["=", "("], equalOrParenthesis);
  4934. } else {
  4935. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(refToken);
  4936. }
  4937. }
  4938. }, {
  4939. key: "parseForParameters",
  4940. value: function parseForParameters(keyword_code) {
  4941. if (keyword_code === this.lexerClass.RK_FOR_PASS) {
  4942. if (this.checkOpenCurly(true)) {
  4943. return null;
  4944. }
  4945. }
  4946. var from_token = this.getToken();
  4947. if (from_token.type !== keyword_code) {
  4948. // TODO better error message
  4949. var keyword = this.lexer.literalNames[keyword_code];
  4950. throw new Error("Error de sintaxe no comando repita_para: esperava-se " + keyword + " mas encontrou " + from_token.text);
  4951. }
  4952. this.pos += 1;
  4953. var int_or_id = this.getToken();
  4954. var is_unary_op = false;
  4955. var op = null;
  4956. if (int_or_id.type === this.lexerClass.SUM_OP) {
  4957. is_unary_op = true;
  4958. op = int_or_id.text;
  4959. this.pos += 1;
  4960. int_or_id = this.getToken();
  4961. }
  4962. var for_from = null;
  4963. if (int_or_id.type === this.lexerClass.ID) {
  4964. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](this.parseID());
  4965. for_from.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(int_or_id);
  4966. } else if (int_or_id.type === this.lexerClass.INTEGER) {
  4967. this.pos += 1;
  4968. for_from = this.getIntLiteral(int_or_id);
  4969. }
  4970. if (for_from == null) {
  4971. // TODO better error message
  4972. var _keyword = this.lexer.literalNames[keyword_code];
  4973. 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.");
  4974. }
  4975. if (is_unary_op) {
  4976. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(op), for_from);
  4977. }
  4978. return for_from;
  4979. }
  4980. }, {
  4981. key: "parseCases",
  4982. value: function parseCases() {
  4983. var token = this.getToken();
  4984. if (token.type !== this.lexerClass.RK_CASE) {
  4985. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_CASE], token);
  4986. }
  4987. this.pos++;
  4988. var nextToken = this.getToken();
  4989. if (nextToken.type === this.lexerClass.RK_DEFAULT) {
  4990. this.pos++;
  4991. var colonToken = this.getToken();
  4992. if (colonToken.type !== this.lexerClass.COLON) {
  4993. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(":", colonToken);
  4994. }
  4995. this.pos++;
  4996. this.consumeNewLines();
  4997. var block = this.parseCommandBlock(true);
  4998. var defaultCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](null);
  4999. defaultCase.setCommands(block.commands);
  5000. return [defaultCase];
  5001. } else {
  5002. var exp = this.parseExpressionOR();
  5003. var _colonToken = this.getToken();
  5004. if (_colonToken.type !== this.lexerClass.COLON) {
  5005. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(":", _colonToken);
  5006. }
  5007. this.pos++;
  5008. this.consumeNewLines();
  5009. var _block = this.parseCommandBlock(true);
  5010. var aCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](exp);
  5011. aCase.setCommands(_block.commands);
  5012. var caseToken = this.getToken();
  5013. if (caseToken.type === this.lexerClass.RK_CASE) {
  5014. return [aCase].concat(this.parseCases());
  5015. } else {
  5016. return [aCase];
  5017. }
  5018. }
  5019. }
  5020. /*
  5021. * Parses an Expression following the structure:
  5022. *
  5023. * EOR => EAnd ( 'or' EOR)? #expression and
  5024. *
  5025. * EOR => ENot ('and' EOR)? #expression or
  5026. *
  5027. * ENot => 'not'? ER #expression not
  5028. *
  5029. * ER => E ((>=, <=, ==, >, <) E)? #expression relational
  5030. *
  5031. * E => factor ((+, -) E)? #expression
  5032. *
  5033. * factor=> term ((*, /, %) factor)?
  5034. *
  5035. * term => literal || arrayAccess || FuncCall || ID || '('EAnd')'
  5036. **/
  5037. }, {
  5038. key: "parseExpressionOR",
  5039. value: function parseExpressionOR() {
  5040. var exp1 = this.parseExpressionAND();
  5041. while (this.getToken().type === this.lexerClass.OR_OPERATOR) {
  5042. var opToken = this.getToken();
  5043. this.pos++;
  5044. var or = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])("or");
  5045. this.consumeNewLines();
  5046. var exp2 = this.parseExpressionAND();
  5047. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](or, exp1, exp2);
  5048. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  5049. exp1 = finalExp;
  5050. }
  5051. return exp1;
  5052. }
  5053. }, {
  5054. key: "parseExpressionAND",
  5055. value: function parseExpressionAND() {
  5056. var exp1 = this.parseExpressionNot();
  5057. while (this.getToken().type === this.lexerClass.AND_OPERATOR) {
  5058. var opToken = this.getToken();
  5059. this.pos++;
  5060. var and = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])("and");
  5061. this.consumeNewLines();
  5062. var exp2 = this.parseExpressionNot();
  5063. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](and, exp1, exp2);
  5064. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  5065. exp1 = finalExp;
  5066. }
  5067. return exp1;
  5068. }
  5069. }, {
  5070. key: "parseExpressionNot",
  5071. value: function parseExpressionNot() {
  5072. var maybeNotToken = this.getToken();
  5073. if (maybeNotToken.type === this.lexerClass.NOT_OPERATOR) {
  5074. var opToken = this.getToken();
  5075. this.pos++;
  5076. var not = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])("not");
  5077. var exp1 = this.parseExpressionRel();
  5078. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](not, exp1);
  5079. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  5080. return finalExp;
  5081. } else {
  5082. return this.parseExpressionRel();
  5083. }
  5084. }
  5085. }, {
  5086. key: "parseExpressionRel",
  5087. value: function parseExpressionRel() {
  5088. var exp1 = this.parseExpression();
  5089. while (this.getToken().type === this.lexerClass.RELATIONAL_OPERATOR) {
  5090. var relToken = this.getToken();
  5091. this.pos++;
  5092. var rel = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(relToken.text);
  5093. var exp2 = this.parseExpression();
  5094. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](rel, exp1, exp2);
  5095. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(relToken);
  5096. exp1 = finalExp;
  5097. }
  5098. return exp1;
  5099. }
  5100. }, {
  5101. key: "parseExpression",
  5102. value: function parseExpression() {
  5103. var factor = this.parseFactor();
  5104. while (this.getToken().type === this.lexerClass.SUM_OP) {
  5105. var sumOpToken = this.getToken();
  5106. this.pos++;
  5107. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(sumOpToken.text);
  5108. var factor2 = this.parseFactor();
  5109. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, factor, factor2);
  5110. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(sumOpToken);
  5111. factor = finalExp;
  5112. }
  5113. return factor;
  5114. }
  5115. }, {
  5116. key: "parseFactor",
  5117. value: function parseFactor() {
  5118. var term = this.parseTerm();
  5119. while (this.getToken().type === this.lexerClass.MULTI_OP) {
  5120. var multOpToken = this.getToken();
  5121. this.pos++;
  5122. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(multOpToken.text);
  5123. var term2 = this.parseTerm();
  5124. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, term, term2);
  5125. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(multOpToken);
  5126. term = finalExp;
  5127. }
  5128. return term;
  5129. }
  5130. }, {
  5131. key: "parseTerm",
  5132. value: function parseTerm() {
  5133. var token = this.getToken();
  5134. var sourceInfo = null;
  5135. var exp = null;
  5136. switch (token.type) {
  5137. case this.lexerClass.SUM_OP:
  5138. this.pos++;
  5139. sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  5140. exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(token.text), this.parseTerm());
  5141. exp.sourceInfo = sourceInfo;
  5142. return exp;
  5143. case this.lexerClass.INTEGER:
  5144. this.pos++;
  5145. return this.getIntLiteral(token);
  5146. case this.lexerClass.REAL:
  5147. this.pos++;
  5148. return this.getRealLiteral(token);
  5149. case this.lexerClass.STRING:
  5150. this.pos++;
  5151. return this.getStringLiteral(token);
  5152. case this.lexerClass.CHARACTER:
  5153. this.pos++;
  5154. return this.getCharLiteral(token);
  5155. case this.lexerClass.RK_TRUE:
  5156. case this.lexerClass.RK_FALSE:
  5157. this.pos++;
  5158. return this.getBoolLiteral(token);
  5159. case this.lexerClass.OPEN_CURLY:
  5160. // No more annonymous array
  5161. // return this.parseArrayLiteral();
  5162. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].annonymous_array_literal(token);
  5163. case this.lexerClass.ID:
  5164. case this.lexerClass.LIB_ID:
  5165. return this.parseIDTerm();
  5166. case this.lexerClass.OPEN_PARENTHESIS:
  5167. return this.parseParenthesisExp();
  5168. default:
  5169. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_terminal(token);
  5170. }
  5171. }
  5172. }, {
  5173. key: "parseIDTerm",
  5174. value: function parseIDTerm() {
  5175. var tokenA = this.getToken();
  5176. var id = this.parseMaybeLibID();
  5177. var isID = tokenA.type === this.lexerClass.ID;
  5178. if (isID && this.checkOpenBrace(true)) {
  5179. var tokenB = null;
  5180. this.pos++;
  5181. var firstIndex = this.parseExpression();
  5182. var secondIndex = null;
  5183. this.consumeNewLines();
  5184. this.checkCloseBrace();
  5185. tokenB = this.getToken();
  5186. this.pos++;
  5187. if (this.checkOpenBrace(true)) {
  5188. this.pos++;
  5189. secondIndex = this.parseExpression();
  5190. this.consumeNewLines();
  5191. this.checkCloseBrace();
  5192. tokenB = this.getToken();
  5193. this.pos++;
  5194. }
  5195. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5196. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayAccess"](id, firstIndex, secondIndex);
  5197. exp.sourceInfo = sourceInfo;
  5198. return exp;
  5199. } else if (this.checkOpenParenthesis(true)) {
  5200. return this.parseFunctionCallExpression(id);
  5201. } else if (isID) {
  5202. var _sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(tokenA);
  5203. var _exp2 = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
  5204. _exp2.sourceInfo = _sourceInfo;
  5205. return _exp2;
  5206. } else {
  5207. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(tokenA);
  5208. }
  5209. }
  5210. }, {
  5211. key: "getFunctionName",
  5212. value: function getFunctionName(id) {
  5213. var name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getInternalName(id);
  5214. if (name === null) {
  5215. if (id === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
  5216. return null;
  5217. }
  5218. return id;
  5219. } else {
  5220. return name;
  5221. }
  5222. }
  5223. }, {
  5224. key: "parseFunctionCallExpression",
  5225. value: function parseFunctionCallExpression(id) {
  5226. var tokenA = this.getToken(this.pos - 1);
  5227. var actualParameters = this.parseActualParameters();
  5228. var tokenB = this.getToken(this.pos - 1);
  5229. var funcName = this.getFunctionName(id);
  5230. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5231. var cmd = new _expressions__WEBPACK_IMPORTED_MODULE_3__["FunctionCall"](funcName, actualParameters);
  5232. cmd.sourceInfo = sourceInfo;
  5233. return cmd;
  5234. }
  5235. }, {
  5236. key: "parseFunctionCallCommand",
  5237. value: function parseFunctionCallCommand(id) {
  5238. return this.parseFunctionCallExpression(id);
  5239. }
  5240. }, {
  5241. key: "parseParenthesisExp",
  5242. value: function parseParenthesisExp() {
  5243. this.checkOpenParenthesis();
  5244. var tokenA = this.getToken();
  5245. this.pos += 1;
  5246. this.consumeNewLines();
  5247. var exp = this.parseExpressionOR();
  5248. this.consumeNewLines();
  5249. this.checkCloseParenthesis();
  5250. var tokenB = this.getToken();
  5251. this.pos += 1;
  5252. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5253. exp.parenthesis = true;
  5254. return exp;
  5255. }
  5256. }, {
  5257. key: "parseActualParameters",
  5258. value: function parseActualParameters() {
  5259. this.checkOpenParenthesis();
  5260. this.pos++;
  5261. if (this.checkCloseParenthesis(true)) {
  5262. this.pos++;
  5263. return [];
  5264. }
  5265. this.consumeNewLines();
  5266. var list = this.parseExpressionList();
  5267. this.consumeNewLines();
  5268. this.checkCloseParenthesis();
  5269. this.pos++;
  5270. return list;
  5271. }
  5272. }, {
  5273. key: "parseExpressionList",
  5274. value: function parseExpressionList() {
  5275. var list = [];
  5276. for (;;) {
  5277. var exp = this.parseExpressionOR();
  5278. list.push(exp);
  5279. var maybeToken = this.getToken();
  5280. if (maybeToken.type !== this.lexerClass.COMMA) {
  5281. break;
  5282. } else {
  5283. this.pos++;
  5284. this.consumeNewLines();
  5285. }
  5286. }
  5287. return list;
  5288. }
  5289. }, {
  5290. key: "getTypeArray",
  5291. value: function getTypeArray() {
  5292. var _this = this;
  5293. var types = this.insideScope(IVProgParser.FUNCTION) ? this.functionTypes : this.variableTypes;
  5294. return types.map(function (x) {
  5295. return _this.lexer.literalNames[x];
  5296. });
  5297. }
  5298. }]);
  5299. return IVProgParser;
  5300. }();
  5301. /***/ }),
  5302. /***/ "./js/ast/operators.ts":
  5303. /*!*****************************!*\
  5304. !*** ./js/ast/operators.ts ***!
  5305. \*****************************/
  5306. /*! no static exports found */
  5307. /***/ (function(module, exports, __webpack_require__) {
  5308. "use strict";
  5309. Object.defineProperty(exports, "__esModule", { value: true });
  5310. exports.convertFromString = exports.Operators = void 0;
  5311. exports.Operators = Object.freeze({
  5312. ADD: { ord: 0, value: "+" },
  5313. SUB: { ord: 1, value: "-" },
  5314. MULT: { ord: 2, value: '*' },
  5315. DIV: { ord: 3, value: '/' },
  5316. MOD: { ord: 4, value: '%' },
  5317. GT: { ord: 5, value: '>' },
  5318. GE: { ord: 6, value: '>=' },
  5319. LT: { ord: 7, value: '<' },
  5320. LE: { ord: 8, value: '<=' },
  5321. EQ: { ord: 9, value: '==' },
  5322. NEQ: { ord: 10, value: '!=' },
  5323. AND: { ord: 11, value: 'and' },
  5324. OR: { ord: 12, value: 'or' },
  5325. NOT: { ord: 13, value: 'not' }
  5326. });
  5327. function convertFromString(op) {
  5328. switch (op) {
  5329. case '+': return exports.Operators.ADD;
  5330. case '-': return exports.Operators.SUB;
  5331. case '*': return exports.Operators.MULT;
  5332. case '/': return exports.Operators.DIV;
  5333. case '%': return exports.Operators.MOD;
  5334. case '>': return exports.Operators.GT;
  5335. case '>=': return exports.Operators.GE;
  5336. case '<': return exports.Operators.LT;
  5337. case '<=': return exports.Operators.LE;
  5338. case '==': return exports.Operators.EQ;
  5339. case '!=': return exports.Operators.NEQ;
  5340. case 'and': return exports.Operators.AND;
  5341. case 'or': return exports.Operators.OR;
  5342. case 'not': return exports.Operators.NOT;
  5343. }
  5344. return null;
  5345. }
  5346. exports.convertFromString = convertFromString;
  5347. /***/ }),
  5348. /***/ "./js/ast/sourceInfo.js":
  5349. /*!******************************!*\
  5350. !*** ./js/ast/sourceInfo.js ***!
  5351. \******************************/
  5352. /*! exports provided: SourceInfo */
  5353. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5354. "use strict";
  5355. __webpack_require__.r(__webpack_exports__);
  5356. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SourceInfo", function() { return SourceInfo; });
  5357. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5358. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5359. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5360. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5361. var SourceInfo = /*#__PURE__*/function () {
  5362. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SourceInfo, null, [{
  5363. key: "createSourceInfo",
  5364. value: function createSourceInfo(token) {
  5365. return new SourceInfo(token.line, token.column, token.text, token.text.length);
  5366. }
  5367. }, {
  5368. key: "createSourceInfoFromList",
  5369. value: function createSourceInfoFromList(tokenA, tokenB) {
  5370. var line = tokenA.line;
  5371. 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
  5372. // No idea why...
  5373. var size = tokenB.tokenIndex + 1 - tokenA.tokenIndex;
  5374. return new SourceInfo(line, column, "", size);
  5375. }
  5376. }]);
  5377. function SourceInfo(line, column, text, size) {
  5378. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SourceInfo);
  5379. this.line = line;
  5380. this.column = column;
  5381. this.text = text;
  5382. this.size = size;
  5383. }
  5384. return SourceInfo;
  5385. }();
  5386. /***/ }),
  5387. /***/ "./js/io/domConsole.js":
  5388. /*!*****************************!*\
  5389. !*** ./js/io/domConsole.js ***!
  5390. \*****************************/
  5391. /*! exports provided: DOMConsole */
  5392. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5393. "use strict";
  5394. __webpack_require__.r(__webpack_exports__);
  5395. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMConsole", function() { return DOMConsole; });
  5396. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  5397. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  5398. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  5399. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  5400. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5401. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
  5402. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5403. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
  5404. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  5405. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  5406. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  5407. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_6__);
  5408. var DOMConsole = /*#__PURE__*/function () {
  5409. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, null, [{
  5410. key: "BASH_TEMPLATE",
  5411. get: function get() {
  5412. 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>";
  5413. }
  5414. }, {
  5415. key: "INPUT_CARET_TEMPLATE",
  5416. get: function get() {
  5417. return "\n <div id=\"cmd\">\n <span></span>\n <div id=\"cursor\"></div>\n </div>";
  5418. }
  5419. }, {
  5420. key: "USER",
  5421. get: function get() {
  5422. return 0;
  5423. }
  5424. }, {
  5425. key: "INFO",
  5426. get: function get() {
  5427. return 1;
  5428. }
  5429. }, {
  5430. key: "ERR",
  5431. get: function get() {
  5432. return 2;
  5433. }
  5434. }, {
  5435. key: "INPUT",
  5436. get: function get() {
  5437. return 3;
  5438. }
  5439. }]);
  5440. function DOMConsole(elementID) {
  5441. var disableMarginTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5442. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, DOMConsole);
  5443. this.disableMarginTop = disableMarginTop;
  5444. this.input = null;
  5445. this.cursorInterval = null;
  5446. this.idleInterval = null;
  5447. this.inputDiv = null;
  5448. this.inputCMD = null;
  5449. this.inputSpan = null;
  5450. this.cursorRef = null;
  5451. this.needInput = false;
  5452. this.clearBtn = null;
  5453. this.hideBtn = null;
  5454. this.showBtn = null;
  5455. this.termDiv = null;
  5456. this.anyKey = false;
  5457. var actualID = elementID;
  5458. if (elementID[0] === "#") {
  5459. actualID = elementID.substring(1);
  5460. }
  5461. this.parent = document.getElementById(actualID);
  5462. this.setup();
  5463. this.inputListeners = [];
  5464. this.hideInput();
  5465. this.pending_writes = [];
  5466. this.last_clear = -1;
  5467. }
  5468. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, [{
  5469. key: "setup",
  5470. value: function setup() {
  5471. this._setupDom();
  5472. this._setupEvents();
  5473. }
  5474. }, {
  5475. key: "_setupEvents",
  5476. value: function _setupEvents() {
  5477. this.input.addEventListener("keydown", this.registerInput.bind(this));
  5478. this.clearBtn.addEventListener("click", this.clearBtnClick.bind(this));
  5479. this.hideBtn.addEventListener("click", this.hideBtnClick.bind(this));
  5480. this.showBtn.addEventListener("click", this.showBtnClick.bind(this));
  5481. }
  5482. }, {
  5483. key: "registerInput",
  5484. value: function registerInput(event) {
  5485. if (!this.needInput) {
  5486. return;
  5487. }
  5488. var keyCode = event.which;
  5489. if (keyCode === 13 || this.anyKey) {
  5490. if (this.idleInterval != null) {
  5491. clearInterval(this.idleInterval);
  5492. this.idleInterval = null;
  5493. }
  5494. var text = this.input.value;
  5495. text = text.replace("[\n\r]+", "");
  5496. this.notifyListeners(text);
  5497. this._appendUserInput(text);
  5498. this.input.value = "";
  5499. this.inputSpan.innerHTML = "";
  5500. this.currentLine = null;
  5501. }
  5502. }
  5503. }, {
  5504. key: "_setupDom",
  5505. value: function _setupDom() {
  5506. var bashNode = document.createElement("div");
  5507. bashNode.classList.add("bash");
  5508. bashNode.innerHTML = DOMConsole.BASH_TEMPLATE;
  5509. this.termDiv = bashNode.querySelector("#ivprog-term");
  5510. this.termDiv.classList.add("ivprog-term-div");
  5511. this.inputDiv = document.createElement("div");
  5512. this.inputDiv.id = "ivprog-terminal-inputdiv";
  5513. this.inputDiv.innerHTML = DOMConsole.INPUT_CARET_TEMPLATE;
  5514. this.input = document.createElement("input");
  5515. this.input.setAttribute("name", "command");
  5516. this.input.setAttribute("value", "");
  5517. this.input.setAttribute("type", "text");
  5518. this.input.setAttribute("autocomplete", "off");
  5519. this.inputDiv.append(this.input);
  5520. this.termDiv.append(this.inputDiv);
  5521. bashNode.append(this.termDiv);
  5522. this.parent.append(bashNode);
  5523. this.inputCMD = this.inputDiv.querySelector("#cmd");
  5524. this.cursorRef = this.inputCMD.querySelector("#cursor");
  5525. this.inputSpan = this.inputCMD.querySelector("span");
  5526. this.clearBtn = bashNode.querySelector("#ivprog-console-clearbtn");
  5527. this.hideBtn = bashNode.querySelector("#ivprog-console-hidebtn");
  5528. this.showBtn = bashNode.querySelector("#ivprog-console-showbtn");
  5529. this._setupCursor(); //Jquery tooltips....
  5530. window.$(this.clearBtn).popup({
  5531. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_clear")
  5532. });
  5533. window.$(this.showBtn).popup({
  5534. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_show")
  5535. });
  5536. window.$(this.hideBtn).popup({
  5537. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_hide")
  5538. });
  5539. }
  5540. }, {
  5541. key: "_setupCursor",
  5542. value: function _setupCursor() {
  5543. this.inputCMD.addEventListener("click", this.blinkCaretAndFocus.bind(this)); //this.inputCMD.click();
  5544. this.input.addEventListener("keyup", this.updateSpanText.bind(this));
  5545. this.input.addEventListener("blur", this.stopBlinkCaret.bind(this));
  5546. }
  5547. }, {
  5548. key: "blinkCaretAndFocus",
  5549. value: function blinkCaretAndFocus() {
  5550. var _this = this;
  5551. if (this.cursorInterval != null) {
  5552. return;
  5553. }
  5554. this.input.focus();
  5555. this.cursorInterval = window.setInterval(function () {
  5556. if (_this.cursorRef.style.visibility === "visible") {
  5557. _this.cursorRef.style.visibility = "hidden";
  5558. } else {
  5559. _this.cursorRef.style.visibility = "visible";
  5560. }
  5561. }, 500);
  5562. }
  5563. }, {
  5564. key: "updateSpanText",
  5565. value: function updateSpanText() {
  5566. this.inputSpan.innerHTML = this.input.value;
  5567. if (this.idleInterval != null) window.clearInterval(this.idleInterval);
  5568. this.scheduleNotify();
  5569. }
  5570. }, {
  5571. key: "stopBlinkCaret",
  5572. value: function stopBlinkCaret() {
  5573. clearInterval(this.cursorInterval);
  5574. this.cursorInterval = null;
  5575. this.cursorRef.style.visibility = "visible";
  5576. }
  5577. }, {
  5578. key: "notifyListeners",
  5579. value: function notifyListeners(text) {
  5580. this.inputListeners.forEach(function (resolve) {
  5581. return resolve(text);
  5582. });
  5583. this.inputListeners.splice(0, this.inputListeners.length);
  5584. this.hideInput();
  5585. this.anyKey = false;
  5586. }
  5587. }, {
  5588. key: "writeRawHTML",
  5589. value: function writeRawHTML(text, channel) {
  5590. this._appendTextLn(text, channel, false);
  5591. }
  5592. }, {
  5593. key: "write",
  5594. value: function write(text) {
  5595. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5596. this._appendText(text, DOMConsole.USER, newLine);
  5597. }
  5598. }, {
  5599. key: "info",
  5600. value: function info(text) {
  5601. this._appendTextLn(text, DOMConsole.INFO);
  5602. }
  5603. }, {
  5604. key: "err",
  5605. value: function err(text) {
  5606. this._appendTextLn(text, DOMConsole.ERR);
  5607. }
  5608. }, {
  5609. key: "_appendText",
  5610. value: function () {
  5611. 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) {
  5612. var newLine,
  5613. write_time,
  5614. divClass,
  5615. textDiv,
  5616. _args = arguments;
  5617. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  5618. while (1) {
  5619. switch (_context.prev = _context.next) {
  5620. case 0:
  5621. newLine = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
  5622. // console.debug("Caling appendText");
  5623. write_time = Date.now();
  5624. this.pending_writes.push(0);
  5625. _context.next = 5;
  5626. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  5627. case 5:
  5628. this.pending_writes.pop();
  5629. if (!(this.last_clear >= write_time)) {
  5630. _context.next = 8;
  5631. break;
  5632. }
  5633. return _context.abrupt("return");
  5634. case 8:
  5635. if (this.currentLine == null) {
  5636. divClass = this.getClassForType(type);
  5637. textDiv = document.createElement("div");
  5638. textDiv.classList.add(divClass);
  5639. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5640. this.currentLine = textDiv;
  5641. }
  5642. this.currentLine.innerHTML += this.getOutputText(text);
  5643. if (newLine) {
  5644. // console.debug("append newline");
  5645. this.currentLine = null;
  5646. }
  5647. this.scrollTerm();
  5648. case 12:
  5649. case "end":
  5650. return _context.stop();
  5651. }
  5652. }
  5653. }, _callee, this);
  5654. }));
  5655. function _appendText(_x, _x2) {
  5656. return _appendText2.apply(this, arguments);
  5657. }
  5658. return _appendText;
  5659. }()
  5660. }, {
  5661. key: "_appendTextLn",
  5662. value: function () {
  5663. 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) {
  5664. var filter,
  5665. write_time,
  5666. divClass,
  5667. textDiv,
  5668. _args2 = arguments;
  5669. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  5670. while (1) {
  5671. switch (_context2.prev = _context2.next) {
  5672. case 0:
  5673. filter = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : true;
  5674. write_time = Date.now();
  5675. this.pending_writes.push(0);
  5676. _context2.next = 5;
  5677. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  5678. case 5:
  5679. this.pending_writes.pop();
  5680. if (!(this.last_clear >= write_time)) {
  5681. _context2.next = 8;
  5682. break;
  5683. }
  5684. return _context2.abrupt("return");
  5685. case 8:
  5686. divClass = this.getClassForType(type);
  5687. textDiv = document.createElement("div");
  5688. textDiv.classList.add(divClass);
  5689. if (filter) textDiv.innerHTML = this.getOutputText(text);else textDiv.innerHTML = "<span>".concat(text, "</span>");
  5690. if (this.currentLine != null && this.currentLine.innerHTML.length === 0) {
  5691. this.termDiv.removeChild(this.currentLine);
  5692. }
  5693. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5694. this.currentLine = null;
  5695. this.scrollTerm();
  5696. case 16:
  5697. case "end":
  5698. return _context2.stop();
  5699. }
  5700. }
  5701. }, _callee2, this);
  5702. }));
  5703. function _appendTextLn(_x3, _x4) {
  5704. return _appendTextLn2.apply(this, arguments);
  5705. }
  5706. return _appendTextLn;
  5707. }()
  5708. }, {
  5709. key: "_appendUserInput",
  5710. value: function () {
  5711. 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) {
  5712. var write_time, divClass, textDiv;
  5713. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  5714. while (1) {
  5715. switch (_context3.prev = _context3.next) {
  5716. case 0:
  5717. write_time = Date.now();
  5718. this.pending_writes.push(0);
  5719. _context3.next = 4;
  5720. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  5721. case 4:
  5722. this.pending_writes.pop();
  5723. if (!(this.last_clear >= write_time)) {
  5724. _context3.next = 7;
  5725. break;
  5726. }
  5727. return _context3.abrupt("return");
  5728. case 7:
  5729. divClass = this.getClassForType(DOMConsole.INPUT);
  5730. textDiv = document.createElement("div");
  5731. textDiv.innerHTML = this.getUserInputText(text);
  5732. textDiv.classList.add(divClass);
  5733. this.termDiv.insertBefore(textDiv, this.inputDiv);
  5734. this.currentLine = null;
  5735. this.scrollTerm();
  5736. case 14:
  5737. case "end":
  5738. return _context3.stop();
  5739. }
  5740. }
  5741. }, _callee3, this);
  5742. }));
  5743. function _appendUserInput(_x5) {
  5744. return _appendUserInput2.apply(this, arguments);
  5745. }
  5746. return _appendUserInput;
  5747. }()
  5748. }, {
  5749. key: "getOutputText",
  5750. value: function getOutputText(text) {
  5751. text = text.replace(/\s/g, "&#160;");
  5752. return "<span>".concat(text, "</span>");
  5753. }
  5754. }, {
  5755. key: "getUserInputText",
  5756. value: function getUserInputText(text) {
  5757. if (text.trim().length == 0) {
  5758. text = "&nbsp;";
  5759. }
  5760. return "<i class=\"icon keyboard outline\" style=\"float:left\"></i><span>".concat(text, "</span>");
  5761. }
  5762. }, {
  5763. key: "scrollTerm",
  5764. value: function scrollTerm() {
  5765. //scrollIt(this.inputDiv.previousSibling,200);
  5766. this.termDiv.scrollTop = this.termDiv.scrollHeight;
  5767. }
  5768. }, {
  5769. key: "focus",
  5770. value: function focus() {
  5771. this.termDiv.style.display = "block"; // Is in draggable mode?
  5772. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  5773. this.parent.style.marginTop = "-160px";
  5774. }
  5775. if (this.needInput) {
  5776. this.showInput();
  5777. this.scheduleNotify();
  5778. }
  5779. if (!_util_utils__WEBPACK_IMPORTED_MODULE_5__["isElementInViewport"](this.termDiv)) this.termDiv.scrollIntoView(false);
  5780. this.scrollTerm();
  5781. }
  5782. }, {
  5783. key: "hide",
  5784. value: function hide() {
  5785. if (this.needInput) {
  5786. clearInterval(this.idleInterval);
  5787. this.hideInput();
  5788. this.needInput = true;
  5789. } // Is in draggable mode?
  5790. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  5791. this.parent.style.marginTop = "0";
  5792. }
  5793. this.termDiv.style.display = "none";
  5794. }
  5795. }, {
  5796. key: "getClassForType",
  5797. value: function getClassForType(type) {
  5798. switch (type) {
  5799. case DOMConsole.INPUT:
  5800. return "ivprog-term-userInput";
  5801. case DOMConsole.USER:
  5802. return "ivprog-term-userText";
  5803. case DOMConsole.INFO:
  5804. return "ivprog-term-info";
  5805. case DOMConsole.ERR:
  5806. return "ivprog-term-error";
  5807. }
  5808. }
  5809. }, {
  5810. key: "dispose",
  5811. value: function dispose() {
  5812. this.input.removeEventListener("keyup", this.updateSpanText.bind(this));
  5813. this.input.removeEventListener("blur", this.stopBlinkCaret.bind(this));
  5814. this.input.removeEventListener("keydown", this.registerInput.bind(this));
  5815. this.inputCMD.removeEventListener("click", this.blinkCaretAndFocus.bind(this));
  5816. this.clearBtn.removeEventListener("click", this.clearBtnClick.bind(this));
  5817. this.hideBtn.removeEventListener("click", this.hideBtnClick.bind(this));
  5818. this.showBtn.removeEventListener("click", this.showBtnClick.bind(this));
  5819. this.input = null;
  5820. this.inputCMD = null;
  5821. this.inputDiv = null;
  5822. this.termDiv = null;
  5823. this.inputSpan = null;
  5824. this.cursorRef = null;
  5825. this.clearBtn = null;
  5826. this.hideBtn = null;
  5827. this.showBtn = null;
  5828. this.currentLine = null;
  5829. var cNode = this.parent.cloneNode(false);
  5830. this.parent.parentNode.replaceChild(cNode, this.parent);
  5831. if (this.cursorInterval != null) {
  5832. clearInterval(this.cursorInterval);
  5833. }
  5834. if (this.idleInterval != null) {
  5835. clearInterval(this.idleInterval);
  5836. }
  5837. }
  5838. }, {
  5839. key: "showInput",
  5840. value: function showInput() {
  5841. this.needInput = true;
  5842. this.inputDiv.style.display = "block";
  5843. this.inputCMD.click(); //this.inputCMD.scrollIntoView();
  5844. this.scrollTerm();
  5845. }
  5846. }, {
  5847. key: "hideInput",
  5848. value: function hideInput() {
  5849. this.needInput = false;
  5850. this.inputDiv.style.display = " none";
  5851. clearInterval(this.cursorInterval);
  5852. this.cursorInterval = null;
  5853. }
  5854. }, {
  5855. key: "requestInput",
  5856. value: function requestInput() {
  5857. var _this2 = this;
  5858. var anyKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  5859. var promise = new Promise(function (resolve, _) {
  5860. _this2.inputListeners.push(resolve);
  5861. _this2.anyKey = anyKey;
  5862. if (_this2.idleInterval == null) _this2.scheduleNotify();
  5863. _this2.showInput();
  5864. });
  5865. return promise;
  5866. }
  5867. }, {
  5868. key: "sendOutput",
  5869. value: function sendOutput(text) {
  5870. //console.debug(text);
  5871. var output = "" + text;
  5872. if (output.indexOf("\n") !== -1) {
  5873. //console.debug("newline");
  5874. var outputList = output.split("\n");
  5875. var i = 0;
  5876. for (; i < outputList.length - 1; i += 1) {
  5877. //console.debug("newline write");
  5878. var _t = outputList[i];
  5879. _t = _t.replace(/\t/g, "&#x0020;&#x0020;");
  5880. _t = _t.replace(/\s/g, "&#x0020;");
  5881. if (_t.length !== 0) {
  5882. this.write(_t);
  5883. }
  5884. this.write("", true);
  5885. }
  5886. var t = outputList[i];
  5887. t = t.replace(/\t/g, "&#x0020;&#x0020;");
  5888. t = t.replace(/\s/g, "&#x0020;");
  5889. if (t.length != 0) this.write(t);
  5890. } else {
  5891. // console.debug("no newline");
  5892. output = output.replace(/\t/g, "&#x0020;&#x0020;");
  5893. output = output.replace(/\s/g, "&#x0020;");
  5894. if (output.length != 0) this.write(output);
  5895. }
  5896. }
  5897. }, {
  5898. key: "clearPendingWrites",
  5899. value: function clearPendingWrites() {
  5900. this.last_clear = Date.now();
  5901. }
  5902. }, {
  5903. key: "clear",
  5904. value: function clear() {
  5905. this.clearPendingWrites();
  5906. while (this.inputDiv.parentElement.childNodes.length > 1) {
  5907. this.inputDiv.parentElement.removeChild(this.inputDiv.parentElement.firstChild);
  5908. }
  5909. this.input.value = "";
  5910. this.inputSpan.innerHTML = "";
  5911. this.currentLine = null;
  5912. }
  5913. }, {
  5914. key: "clearBtnClick",
  5915. value: function clearBtnClick() {
  5916. this.clear();
  5917. }
  5918. }, {
  5919. key: "showBtnClick",
  5920. value: function showBtnClick() {
  5921. this.focus();
  5922. }
  5923. }, {
  5924. key: "hideBtnClick",
  5925. value: function hideBtnClick() {
  5926. this.hide();
  5927. }
  5928. }, {
  5929. key: "notifyIdle",
  5930. value: function notifyIdle() {
  5931. this.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("awaiting_input_message"));
  5932. this.inputCMD.click();
  5933. }
  5934. }, {
  5935. key: "scheduleNotify",
  5936. value: function scheduleNotify() {
  5937. this.idleInterval = window.setInterval(this.notifyIdle.bind(this), _util_config__WEBPACK_IMPORTED_MODULE_6__["Config"].idle_input_interval);
  5938. }
  5939. }, {
  5940. key: "cancelPendingInputRequests",
  5941. value: function cancelPendingInputRequests() {
  5942. this.inputListeners.forEach(function (resolve) {
  5943. return resolve("");
  5944. });
  5945. this.inputListeners.splice(0, this.inputListeners.length);
  5946. if (this.idleInterval != null) {
  5947. clearInterval(this.idleInterval);
  5948. this.idleInterval = null;
  5949. }
  5950. this.input.value = "";
  5951. this.inputSpan.innerHTML = "";
  5952. this.currentLine = null;
  5953. this.hideInput();
  5954. this.anyKey = false;
  5955. }
  5956. }]);
  5957. return DOMConsole;
  5958. }();
  5959. /***/ }),
  5960. /***/ "./js/io/input.js":
  5961. /*!************************!*\
  5962. !*** ./js/io/input.js ***!
  5963. \************************/
  5964. /*! exports provided: Input */
  5965. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5966. "use strict";
  5967. __webpack_require__.r(__webpack_exports__);
  5968. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
  5969. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5970. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5971. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5972. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5973. var Input = /*#__PURE__*/function () {
  5974. function Input() {
  5975. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Input);
  5976. }
  5977. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Input, [{
  5978. key: "requestInput",
  5979. value: function requestInput() {
  5980. throw new Error("Must be implemented");
  5981. }
  5982. }, {
  5983. key: "cancelPendingInputRequests",
  5984. value: function cancelPendingInputRequests() {
  5985. throw new Error("Must be implemented");
  5986. }
  5987. }]);
  5988. return Input;
  5989. }();
  5990. /***/ }),
  5991. /***/ "./js/io/output.js":
  5992. /*!*************************!*\
  5993. !*** ./js/io/output.js ***!
  5994. \*************************/
  5995. /*! exports provided: Output */
  5996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5997. "use strict";
  5998. __webpack_require__.r(__webpack_exports__);
  5999. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; });
  6000. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  6001. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  6002. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  6003. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  6004. var Output = /*#__PURE__*/function () {
  6005. function Output() {
  6006. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Output);
  6007. }
  6008. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Output, [{
  6009. key: "sendOutput",
  6010. value: function sendOutput(text) {
  6011. throw new Error("Must be implemented");
  6012. }
  6013. }]);
  6014. return Output;
  6015. }();
  6016. /***/ }),
  6017. /***/ "./js/main.js":
  6018. /*!********************!*\
  6019. !*** ./js/main.js ***!
  6020. \********************/
  6021. /*! exports provided: runner, initVisualUI, addFunctionChangeListener, addGlobalChangeListener, removeFunctionListener, removeGlobalListener, getTestCases, autoEval, prepareActivityToStudentHelper, LocalizedStrings, i18n, getLogs, getLogsAsString, registerClick, registerUserEvent, parseLogs, ActionTypes, CodeEditor, openAssessmentDetail, autoGenerateTestCaseOutput, Config, parseExpression */
  6022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6023. "use strict";
  6024. __webpack_require__.r(__webpack_exports__);
  6025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  6026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18n", function() { return i18n; });
  6027. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditor", function() { return CodeEditor; });
  6028. /* harmony import */ var _runner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runner */ "./js/runner.js");
  6029. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return _runner__WEBPACK_IMPORTED_MODULE_0__["runner"]; });
  6030. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualUI/functions */ "./js/visualUI/functions.js");
  6031. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["initVisualUI"]; });
  6032. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addFunctionChangeListener"]; });
  6033. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addGlobalChangeListener"]; });
  6034. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeFunctionListener"]; });
  6035. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeGlobalListener"]; });
  6036. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["getTestCases"]; });
  6037. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6038. /* harmony import */ var _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/i18nHelper */ "./js/services/i18nHelper.js");
  6039. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/userLog */ "./js/services/userLog.js");
  6040. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogs"]; });
  6041. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogsAsString"]; });
  6042. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerClick"]; });
  6043. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"]; });
  6044. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"]; });
  6045. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"]; });
  6046. /* harmony import */ var _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/iassignHelpers */ "./js/util/iassignHelpers.js");
  6047. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["autoEval"]; });
  6048. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["prepareActivityToStudentHelper"]; });
  6049. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/utils */ "./js/util/utils.js");
  6050. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return _util_utils__WEBPACK_IMPORTED_MODULE_6__["openAssessmentDetail"]; });
  6051. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/config */ "./js/util/config.ts");
  6052. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  6053. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Config", function() { return _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]; });
  6054. /* harmony import */ var _util_parseFromVisual__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util/parseFromVisual */ "./js/util/parseFromVisual.js");
  6055. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseExpression", function() { return _util_parseFromVisual__WEBPACK_IMPORTED_MODULE_8__["parseExpression"]; });
  6056. /* harmony import */ var _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./visualUI/text_editor */ "./js/visualUI/text_editor.js");
  6057. /* harmony import */ var _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util/auto_gen_output */ "./js/util/auto_gen_output.js");
  6058. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_10__["autoGenerateTestCaseOutput"]; });
  6059. var CodeEditor = {
  6060. initTextEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["initTextEditor"],
  6061. setCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["setCode"],
  6062. getCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["getCode"],
  6063. updateEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["updateEditor"],
  6064. disable: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_9__["disable"]
  6065. };
  6066. var i18n = _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__["i18nHelper"].i18n;
  6067. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6068. /***/ }),
  6069. /***/ "./js/memory/address.ts":
  6070. /*!******************************!*\
  6071. !*** ./js/memory/address.ts ***!
  6072. \******************************/
  6073. /*! no static exports found */
  6074. /***/ (function(module, exports, __webpack_require__) {
  6075. "use strict";
  6076. Object.defineProperty(exports, "__esModule", { value: true });
  6077. exports.Address = void 0;
  6078. class Address {
  6079. /**
  6080. *
  6081. * @param {Number} id the address id
  6082. * @param {never} value the value stored at this address
  6083. */
  6084. constructor(id, value) {
  6085. this.id = id;
  6086. this.value = value;
  6087. }
  6088. }
  6089. exports.Address = Address;
  6090. /***/ }),
  6091. /***/ "./js/memory/location.ts":
  6092. /*!*******************************!*\
  6093. !*** ./js/memory/location.ts ***!
  6094. \*******************************/
  6095. /*! no static exports found */
  6096. /***/ (function(module, exports, __webpack_require__) {
  6097. "use strict";
  6098. Object.defineProperty(exports, "__esModule", { value: true });
  6099. exports.Location = void 0;
  6100. const address_1 = __webpack_require__(/*! ./address */ "./js/memory/address.ts");
  6101. class LocationHolder {
  6102. constructor() {
  6103. this.data = [];
  6104. this.address_id = 0;
  6105. }
  6106. /**
  6107. *
  6108. * @param {never} value the value to be allocated
  6109. * @returns {number} - the address id
  6110. */
  6111. allocate(value) {
  6112. const id = this.address_id;
  6113. // console.log("Allocation address "+ id);
  6114. const address = new address_1.Address(id, value);
  6115. this.data.push(address);
  6116. this.address_id += 1;
  6117. return id;
  6118. }
  6119. /**
  6120. *
  6121. * @param {number} id
  6122. */
  6123. deallocate(id) {
  6124. const index = this.findIndex(id);
  6125. // console.log("Deallocation address "+ id);
  6126. if (index !== -1) {
  6127. this.data.splice(index, 1);
  6128. return true;
  6129. }
  6130. return false;
  6131. }
  6132. /**
  6133. *
  6134. * @param {number} id
  6135. * @returns {Address} the address identified by id
  6136. */
  6137. find(id) {
  6138. let beg = 0;
  6139. let end = this.data.length;
  6140. // console.log("Finding address "+id);
  6141. while (beg < end) {
  6142. const med = Math.floor((beg + end) / 2);
  6143. const address = this.getAddressAt(med);
  6144. if (address.id === id) {
  6145. return address;
  6146. }
  6147. else if (id > address.id) {
  6148. beg = med;
  6149. }
  6150. else {
  6151. end = med;
  6152. }
  6153. }
  6154. return undefined;
  6155. }
  6156. getAddressAt(pos) {
  6157. return this.data[pos];
  6158. }
  6159. /**
  6160. *
  6161. * @param {number} id address id
  6162. * @returns {number} the index of the address identified by id
  6163. */
  6164. findIndex(id) {
  6165. let beg = 0;
  6166. let end = this.data.length;
  6167. while (beg < end) {
  6168. const med = Math.floor((beg + end) / 2);
  6169. const address = this.getAddressAt(med);
  6170. if (address.id === id) {
  6171. return med;
  6172. }
  6173. else if (id > address.id) {
  6174. beg = med;
  6175. }
  6176. else {
  6177. end = med;
  6178. }
  6179. }
  6180. return -1;
  6181. }
  6182. updateAddress(id, value) {
  6183. const index = this.findIndex(id);
  6184. if (index === -1) {
  6185. throw new Error("Invalid address..." + id);
  6186. }
  6187. this.data[index].value = value;
  6188. }
  6189. clear() {
  6190. for (let i = 0; i < this.data.length; i += 1) {
  6191. delete this.data[i];
  6192. }
  6193. this.data = [];
  6194. this.address_id = 0;
  6195. }
  6196. }
  6197. const inner_ref = new LocationHolder();
  6198. exports.Location = Object.freeze({
  6199. allocate: inner_ref.allocate.bind(inner_ref),
  6200. deallocate: inner_ref.deallocate.bind(inner_ref),
  6201. find: inner_ref.find.bind(inner_ref),
  6202. updateAddress: inner_ref.updateAddress.bind(inner_ref),
  6203. clear: inner_ref.clear.bind(inner_ref),
  6204. size: () => inner_ref.data.length
  6205. });
  6206. /***/ }),
  6207. /***/ "./js/processor/compatibilityTable.ts":
  6208. /*!********************************************!*\
  6209. !*** ./js/processor/compatibilityTable.ts ***!
  6210. \********************************************/
  6211. /*! no static exports found */
  6212. /***/ (function(module, exports, __webpack_require__) {
  6213. "use strict";
  6214. Object.defineProperty(exports, "__esModule", { value: true });
  6215. exports.resultTypeAfterUnaryOp = exports.resultTypeAfterInfixOp = void 0;
  6216. const types_1 = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  6217. const operators_1 = __webpack_require__(/*! ../ast/operators */ "./js/ast/operators.ts");
  6218. const multiType_1 = __webpack_require__(/*! ../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  6219. const config_1 = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  6220. function buildInfixAddTable() {
  6221. const table = [[], [], [], [], []];
  6222. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6223. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6224. table[types_1.Types.INTEGER.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6225. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6226. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6227. table[types_1.Types.REAL.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6228. table[types_1.Types.STRING.ord][types_1.Types.INTEGER.ord] = types_1.Types.STRING;
  6229. table[types_1.Types.STRING.ord][types_1.Types.REAL.ord] = types_1.Types.STRING;
  6230. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6231. table[types_1.Types.STRING.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.STRING;
  6232. table[types_1.Types.STRING.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6233. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6234. table[types_1.Types.CHAR.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6235. return table;
  6236. }
  6237. function buildInfixMultiDivSubTable() {
  6238. const table = [[], []];
  6239. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6240. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6241. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6242. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6243. return table;
  6244. }
  6245. function buildInfixEqualityInequalityTable() {
  6246. const table = [[], [], [], [], []];
  6247. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6248. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6249. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6250. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6251. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6252. return table;
  6253. }
  6254. function buildInfixRelationalTable() {
  6255. const table = [[], [], [], [], []];
  6256. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6257. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6258. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6259. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6260. return table;
  6261. }
  6262. function buildInfixAndOrTable() {
  6263. const table = [[], [], [], []];
  6264. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6265. return table;
  6266. }
  6267. function buildInfixModTable() {
  6268. const table = [[]];
  6269. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6270. return table;
  6271. }
  6272. function buildUnarySumSubList() {
  6273. const list = [];
  6274. list[types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6275. list[types_1.Types.REAL.ord] = types_1.Types.REAL;
  6276. return list;
  6277. }
  6278. function buildUnaryNegList() {
  6279. const list = [];
  6280. list[types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6281. return list;
  6282. }
  6283. function buildInfixCompatibilityTable() {
  6284. const compatibilityMap = new WeakMap();
  6285. compatibilityMap.set(operators_1.Operators.ADD, buildInfixAddTable());
  6286. compatibilityMap.set(operators_1.Operators.SUB, buildInfixMultiDivSubTable());
  6287. compatibilityMap.set(operators_1.Operators.MULT, buildInfixMultiDivSubTable());
  6288. compatibilityMap.set(operators_1.Operators.DIV, buildInfixMultiDivSubTable());
  6289. compatibilityMap.set(operators_1.Operators.EQ, buildInfixEqualityInequalityTable());
  6290. compatibilityMap.set(operators_1.Operators.NEQ, buildInfixEqualityInequalityTable());
  6291. compatibilityMap.set(operators_1.Operators.GE, buildInfixRelationalTable());
  6292. compatibilityMap.set(operators_1.Operators.GT, buildInfixRelationalTable());
  6293. compatibilityMap.set(operators_1.Operators.LE, buildInfixRelationalTable());
  6294. compatibilityMap.set(operators_1.Operators.LT, buildInfixRelationalTable());
  6295. compatibilityMap.set(operators_1.Operators.OR, buildInfixAndOrTable());
  6296. compatibilityMap.set(operators_1.Operators.AND, buildInfixAndOrTable());
  6297. compatibilityMap.set(operators_1.Operators.MOD, buildInfixModTable());
  6298. return compatibilityMap;
  6299. }
  6300. function buildUnaryCompatibilityTable() {
  6301. const compatibilityMap = new WeakMap();
  6302. compatibilityMap.set(operators_1.Operators.ADD, buildUnarySumSubList());
  6303. compatibilityMap.set(operators_1.Operators.SUB, buildUnarySumSubList());
  6304. compatibilityMap.set(operators_1.Operators.NOT, buildUnaryNegList());
  6305. return compatibilityMap;
  6306. }
  6307. const infixMap = buildInfixCompatibilityTable();
  6308. const unaryMap = buildUnaryCompatibilityTable();
  6309. function resultTypeAfterInfixOp(operator, leftExpressionType, rightExpressionType) {
  6310. try {
  6311. if (leftExpressionType instanceof multiType_1.MultiType && rightExpressionType instanceof multiType_1.MultiType) {
  6312. let newMulti = [];
  6313. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6314. const typeA = leftExpressionType.types[i];
  6315. for (let j = 0; j < rightExpressionType.types.length; ++i) {
  6316. const typeB = rightExpressionType.types[j];
  6317. newMulti.push(resultTypeAfterInfixOp(operator, typeA, typeB));
  6318. }
  6319. }
  6320. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6321. if (newMulti.length <= 0) {
  6322. if (config_1.Config.enable_type_casting) {
  6323. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6324. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6325. return new multiType_1.MultiType([types_1.Types.INTEGER, types_1.Types.REAL]);
  6326. }
  6327. }
  6328. }
  6329. return types_1.Types.UNDEFINED;
  6330. }
  6331. else {
  6332. return new multiType_1.MultiType(newMulti);
  6333. }
  6334. }
  6335. else if (leftExpressionType instanceof multiType_1.MultiType) {
  6336. if (leftExpressionType.isCompatible(rightExpressionType)) {
  6337. return resultTypeAfterInfixOp(operator, rightExpressionType, rightExpressionType);
  6338. }
  6339. else {
  6340. if (config_1.Config.enable_type_casting) {
  6341. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6342. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6343. return rightExpressionType;
  6344. }
  6345. }
  6346. }
  6347. return types_1.Types.UNDEFINED;
  6348. }
  6349. }
  6350. else if (rightExpressionType instanceof multiType_1.MultiType) {
  6351. if (rightExpressionType.isCompatible(leftExpressionType)) {
  6352. return resultTypeAfterInfixOp(operator, leftExpressionType, leftExpressionType);
  6353. }
  6354. else {
  6355. if (config_1.Config.enable_type_casting) {
  6356. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6357. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6358. return leftExpressionType;
  6359. }
  6360. }
  6361. }
  6362. return types_1.Types.UNDEFINED;
  6363. }
  6364. }
  6365. const resultTable = infixMap.get(operator) || [];
  6366. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6367. const resultType = resultTable[leftExpressionType.ord][rightExpressionType.ord];
  6368. if (resultType === null || resultType === undefined) {
  6369. if (config_1.Config.enable_type_casting) {
  6370. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6371. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6372. if (operator === operators_1.Operators.MOD) {
  6373. return types_1.Types.INTEGER;
  6374. }
  6375. else if (operator.ord >= 5 && operator.ord <= 10) {
  6376. return types_1.Types.BOOLEAN;
  6377. }
  6378. }
  6379. }
  6380. }
  6381. return types_1.Types.UNDEFINED;
  6382. }
  6383. return resultType;
  6384. }
  6385. catch (e) {
  6386. if (e instanceof TypeError) {
  6387. return types_1.Types.UNDEFINED;
  6388. }
  6389. else {
  6390. throw e;
  6391. }
  6392. }
  6393. }
  6394. exports.resultTypeAfterInfixOp = resultTypeAfterInfixOp;
  6395. function resultTypeAfterUnaryOp(operator, leftExpressionType) {
  6396. try {
  6397. if (leftExpressionType instanceof multiType_1.MultiType) {
  6398. let newMulti = [];
  6399. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6400. const type = leftExpressionType.types[i];
  6401. newMulti.push(resultTypeAfterUnaryOp(operator, type));
  6402. }
  6403. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6404. if (newMulti.length <= 0) {
  6405. return types_1.Types.UNDEFINED;
  6406. }
  6407. return new multiType_1.MultiType(newMulti);
  6408. }
  6409. const resultTable = unaryMap.get(operator) || [];
  6410. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6411. const resultType = resultTable[leftExpressionType.ord];
  6412. if (resultType == null) {
  6413. return types_1.Types.UNDEFINED;
  6414. }
  6415. return resultType;
  6416. }
  6417. catch (e) {
  6418. if (e instanceof TypeError) {
  6419. return types_1.Types.UNDEFINED;
  6420. }
  6421. else {
  6422. throw e;
  6423. }
  6424. }
  6425. }
  6426. exports.resultTypeAfterUnaryOp = resultTypeAfterUnaryOp;
  6427. /***/ }),
  6428. /***/ "./js/processor/context.ts":
  6429. /*!*********************************!*\
  6430. !*** ./js/processor/context.ts ***!
  6431. \*********************************/
  6432. /*! no static exports found */
  6433. /***/ (function(module, exports, __webpack_require__) {
  6434. "use strict";
  6435. Object.defineProperty(exports, "__esModule", { value: true });
  6436. exports.Context = void 0;
  6437. exports.Context = Object.freeze({
  6438. BASE: Symbol('context:base'),
  6439. BREAKABLE: Symbol('context:breakable'),
  6440. FUNCTION: Symbol('context:function')
  6441. });
  6442. /***/ }),
  6443. /***/ "./js/processor/definedFunctions.js":
  6444. /*!******************************************!*\
  6445. !*** ./js/processor/definedFunctions.js ***!
  6446. \******************************************/
  6447. /*! exports provided: LanguageDefinedFunction */
  6448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6449. "use strict";
  6450. __webpack_require__.r(__webpack_exports__);
  6451. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageDefinedFunction", function() { return LanguageDefinedFunction; });
  6452. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  6453. /* harmony import */ var _lib_io__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/io */ "./js/processor/lib/io.js");
  6454. /* harmony import */ var _lib_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/strings */ "./js/processor/lib/strings.js");
  6455. /* harmony import */ var _lib_arrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/arrays */ "./js/processor/lib/arrays.js");
  6456. /* harmony import */ var _lib_lang__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/lang */ "./js/processor/lib/lang.js");
  6457. /* harmony import */ var _lib_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/math */ "./js/processor/lib/math.js");
  6458. function valueToKey(value, object) {
  6459. for (var key in object) {
  6460. if (Object.prototype.hasOwnProperty.call(object, key)) {
  6461. if (object[key] === value) {
  6462. return key;
  6463. }
  6464. }
  6465. }
  6466. return null;
  6467. }
  6468. function concatObjects() {
  6469. var result = {};
  6470. for (var i = 0; i < arguments.length; i++) {
  6471. var obj = i < 0 || arguments.length <= i ? undefined : arguments[i];
  6472. for (var key in obj) {
  6473. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  6474. result[key] = obj[key];
  6475. }
  6476. }
  6477. }
  6478. return result;
  6479. }
  6480. var libsObject = {
  6481. $mathLib: {
  6482. $sin: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSinFun"])(),
  6483. $cos: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createCosFun"])(),
  6484. $tan: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createTanFun"])(),
  6485. $sqrt: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSqrtFun"])(),
  6486. $pow: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createPowFun"])(),
  6487. $log: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createLogFun"])(),
  6488. $abs: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createAbsFun"])(),
  6489. $negate: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createNegateFun"])(),
  6490. $invert: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createInvertFun"])(),
  6491. $max: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMaxFun"])(),
  6492. $min: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMinFun"])(),
  6493. $rand: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createRandFun"])()
  6494. },
  6495. $ioLib: {
  6496. $read: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createInputFun"])(),
  6497. $write: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createOutputFun"])()
  6498. },
  6499. $strLib: {
  6500. $substring: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createSubstringFun"])(),
  6501. $length: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLengthFun"])(),
  6502. $uppercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createUppercaseFun"])(),
  6503. $lowercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLowercaseFun"])(),
  6504. $charAt: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createrCharAtFun"])()
  6505. },
  6506. $arrayLib: {
  6507. $numElements: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createNumElementsFun"])(),
  6508. $matrixLines: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixLinesFun"])(),
  6509. $matrixColumns: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixColumnsFun"])()
  6510. },
  6511. $langLib: {
  6512. $isReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsRealFun"])(),
  6513. $isInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsIntFun"])(),
  6514. $isBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsBoolFun"])(),
  6515. $castReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastRealFun"])(),
  6516. $castInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastIntFun"])(),
  6517. $castBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastBoolFun"])(),
  6518. $castString: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastStringFun"])(),
  6519. $castChar: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastCharFun"])()
  6520. }
  6521. };
  6522. var funcsObject = concatObjects(libsObject.$ioLib, libsObject.$langLib, libsObject.$strLib, libsObject.$arrayLib);
  6523. var LanguageDefinedFunction = Object.freeze({
  6524. getMainFunctionName: function getMainFunctionName() {
  6525. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs().main_function;
  6526. },
  6527. getInternalName: function getInternalName(localName) {
  6528. if (localName.indexOf(".") !== -1) {
  6529. var names = localName.split(".");
  6530. var lib = valueToKey(names[0], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs());
  6531. var internalName = valueToKey(names[1], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6532. if (lib === null || internalName === null) {
  6533. return null;
  6534. }
  6535. return lib + "." + internalName;
  6536. }
  6537. var funcName = valueToKey(localName, _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6538. if (funcName !== null) {
  6539. if (funcsObject[funcName]) {
  6540. return funcName;
  6541. }
  6542. }
  6543. return null;
  6544. },
  6545. getFunction: function getFunction(internalName) {
  6546. if (internalName.indexOf(".") !== -1) {
  6547. var names = internalName.split(".");
  6548. var libName = names[0];
  6549. var funName = names[1];
  6550. return libsObject[libName][funName];
  6551. }
  6552. return funcsObject[internalName];
  6553. },
  6554. getLocalName: function getLocalName(internalName) {
  6555. if (internalName.indexOf(".") !== -1) {
  6556. var names = internalName.split(".");
  6557. var libName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs()[names[0]];
  6558. var funName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[names[1]];
  6559. return "".concat(libName, ".").concat(funName);
  6560. } else if (_services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName]) {
  6561. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName];
  6562. } else {
  6563. return internalName;
  6564. }
  6565. }
  6566. });
  6567. /***/ }),
  6568. /***/ "./js/processor/error/processorErrorFactory.js":
  6569. /*!*****************************************************!*\
  6570. !*** ./js/processor/error/processorErrorFactory.js ***!
  6571. \*****************************************************/
  6572. /*! exports provided: ProcessorErrorFactory */
  6573. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6574. "use strict";
  6575. __webpack_require__.r(__webpack_exports__);
  6576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProcessorErrorFactory", function() { return ProcessorErrorFactory; });
  6577. /* harmony import */ var _runtimeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runtimeError */ "./js/processor/error/runtimeError.js");
  6578. /* harmony import */ var _semanticError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./semanticError */ "./js/processor/error/semanticError.js");
  6579. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6580. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../definedFunctions */ "./js/processor/definedFunctions.js");
  6581. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6582. function createRuntimeError(i18n_id) {
  6583. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6584. return new _runtimeError__WEBPACK_IMPORTED_MODULE_0__["RuntimeError"](LocalizedStrings.getError(i18n_id, context), i18n_id);
  6585. }
  6586. function createSemanticError(i18n_id) {
  6587. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6588. return new _semanticError__WEBPACK_IMPORTED_MODULE_1__["SemanticError"](LocalizedStrings.getError(i18n_id, context), i18n_id);
  6589. }
  6590. var ProcessorErrorFactory = Object.freeze({
  6591. symbol_not_found_full: function symbol_not_found_full(id, sourceInfo) {
  6592. if (sourceInfo) {
  6593. var context = [id, sourceInfo.line, sourceInfo.column];
  6594. var error = createSemanticError("symbol_not_found_full", context);
  6595. error.context = {
  6596. line: sourceInfo.line,
  6597. column: sourceInfo.column
  6598. };
  6599. return error;
  6600. } else {
  6601. return ProcessorErrorFactory.symbol_not_found(id);
  6602. }
  6603. },
  6604. symbol_not_found: function symbol_not_found(id) {
  6605. var context = [id];
  6606. return createSemanticError("symbol_not_found", context);
  6607. },
  6608. function_missing_full: function function_missing_full(id, sourceInfo) {
  6609. if (sourceInfo) {
  6610. var context = [id, sourceInfo.line, sourceInfo.column];
  6611. var error = createSemanticError("function_missing_full", context);
  6612. error.context = {
  6613. line: sourceInfo.line,
  6614. column: sourceInfo.column
  6615. };
  6616. return error;
  6617. } else {
  6618. return ProcessorErrorFactory.function_missing(id);
  6619. }
  6620. },
  6621. function_missing: function function_missing(id) {
  6622. var context = [id];
  6623. return createSemanticError("function_missing", context);
  6624. },
  6625. main_missing: function main_missing() {
  6626. return createSemanticError("main_missing");
  6627. },
  6628. array_dimension_not_int_full: function array_dimension_not_int_full(sourceInfo) {
  6629. if (sourceInfo) {
  6630. var context = [sourceInfo.line];
  6631. var error = createSemanticError("array_dimension_not_int_full", context);
  6632. error.context = {
  6633. line: sourceInfo.line,
  6634. column: sourceInfo.column
  6635. };
  6636. return error;
  6637. } else {
  6638. return ProcessorErrorFactory.array_dimension_not_int();
  6639. }
  6640. },
  6641. array_dimension_not_int: function array_dimension_not_int() {
  6642. return createSemanticError("array_dimension_not_int");
  6643. },
  6644. unknown_command_full: function unknown_command_full(sourceInfo) {
  6645. if (sourceInfo) {
  6646. var context = [sourceInfo.line];
  6647. var error = createRuntimeError("unknown_command_full", context);
  6648. error.context = {
  6649. line: sourceInfo.line,
  6650. column: sourceInfo.column
  6651. };
  6652. return error;
  6653. } else {
  6654. return ProcessorErrorFactory.unknown_command();
  6655. }
  6656. },
  6657. unknown_command: function unknown_command() {
  6658. return createRuntimeError("unknown_command");
  6659. },
  6660. incompatible_types_full: function incompatible_types_full(left_type, left_dim, right_type, right_dim, exp, source_info) {
  6661. if (source_info) {
  6662. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, source_info.line, LocalizedStrings.translateType(right_type, right_dim)];
  6663. var error = createSemanticError("incompatible_types_full", context);
  6664. error.context = {
  6665. line: source_info.line,
  6666. column: source_info.column
  6667. };
  6668. return error;
  6669. } else {
  6670. return ProcessorErrorFactory.incompatible_types(left_type, left_dim, right_type, right_dim, exp);
  6671. }
  6672. },
  6673. incompatible_types: function incompatible_types(left_type, left_dim, right_type, right_dim, exp) {
  6674. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, LocalizedStrings.translateType(right_type, right_dim)];
  6675. return createSemanticError("incompatible_types", context);
  6676. },
  6677. incompatible_types_array_full: function incompatible_types_array_full(exp, type, dim, sourceInfo) {
  6678. if (sourceInfo) {
  6679. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6680. var error = createSemanticError("incompatible_types_array_full", context);
  6681. error.context = {
  6682. line: sourceInfo.line,
  6683. column: sourceInfo.column
  6684. };
  6685. return error;
  6686. } else {
  6687. return ProcessorErrorFactory.incompatible_types_array(exp, type, dim);
  6688. }
  6689. },
  6690. incompatible_types_array: function incompatible_types_array(exp, type, dim) {
  6691. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6692. return createSemanticError("incompatible_types_array", context);
  6693. },
  6694. loop_condition_type_full: function loop_condition_type_full(exp, sourceInfo) {
  6695. if (sourceInfo) {
  6696. var context = [sourceInfo.line, sourceInfo.column, exp];
  6697. var error = createSemanticError("loop_condition_type_full", context);
  6698. error.context = {
  6699. line: sourceInfo.line,
  6700. column: sourceInfo.column
  6701. };
  6702. return error;
  6703. } else {
  6704. return ProcessorErrorFactory.loop_condition_type(exp);
  6705. }
  6706. },
  6707. loop_condition_type: function loop_condition_type(exp) {
  6708. var context = [exp];
  6709. return createSemanticError("loop_condition_type", context);
  6710. },
  6711. /**
  6712. * @deprecated 01/10/2019
  6713. */
  6714. endless_loop_full: function endless_loop_full(sourceInfo) {
  6715. if (sourceInfo) {
  6716. var context = [sourceInfo.line];
  6717. var error = createSemanticError("endless_loop_full", context);
  6718. error.context = {
  6719. line: sourceInfo.line,
  6720. column: sourceInfo.column
  6721. };
  6722. return error;
  6723. } else {
  6724. return ProcessorErrorFactory.endless_loop();
  6725. }
  6726. },
  6727. endless_loop: function endless_loop() {
  6728. return createSemanticError("endless_loop");
  6729. },
  6730. if_condition_type_full: function if_condition_type_full(exp, sourceInfo) {
  6731. if (sourceInfo) {
  6732. var context = [sourceInfo.line, sourceInfo.column, exp];
  6733. var error = createSemanticError("if_condition_type_full", context);
  6734. error.context = {
  6735. line: sourceInfo.line,
  6736. column: sourceInfo.column
  6737. };
  6738. return error;
  6739. } else {
  6740. return ProcessorErrorFactory.if_condition_type(exp);
  6741. }
  6742. },
  6743. if_condition_type: function if_condition_type(exp) {
  6744. var context = [exp];
  6745. return createSemanticError("if_condition_type", context);
  6746. },
  6747. invalid_global_var: function invalid_global_var() {
  6748. return createRuntimeError("invalid_global_var");
  6749. },
  6750. not_implemented: function not_implemented(id) {
  6751. var context = [id];
  6752. return createRuntimeError("not_implemented", context);
  6753. },
  6754. invalid_case_type_full: function invalid_case_type_full(exp, type, dim, sourceInfo) {
  6755. if (sourceInfo) {
  6756. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6757. var error = createSemanticError("invalid_case_type_full", context);
  6758. error.context = {
  6759. line: sourceInfo.line,
  6760. column: sourceInfo.column
  6761. };
  6762. return error;
  6763. } else {
  6764. return ProcessorErrorFactory.invalid_case_type(exp, type, dim);
  6765. }
  6766. },
  6767. invalid_case_type: function invalid_case_type(exp, type, dim) {
  6768. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6769. return createSemanticError("invalid_case_type", context);
  6770. },
  6771. void_in_expression_full: function void_in_expression_full(id, sourceInfo) {
  6772. if (sourceInfo) {
  6773. var context = [sourceInfo.line, sourceInfo.column, id];
  6774. var error = createSemanticError("void_in_expression_full", context);
  6775. error.context = {
  6776. line: sourceInfo.line,
  6777. column: sourceInfo.column
  6778. };
  6779. return error;
  6780. } else {
  6781. return ProcessorErrorFactory.void_in_expression(id);
  6782. }
  6783. },
  6784. void_in_expression: function void_in_expression(id) {
  6785. var context = [id];
  6786. return createSemanticError("void_in_expression", context);
  6787. },
  6788. invalid_array_access_full: function invalid_array_access_full(id, sourceInfo) {
  6789. if (sourceInfo) {
  6790. var context = [id, sourceInfo.line, sourceInfo.column];
  6791. var error = createSemanticError("invalid_array_access_full", context);
  6792. error.context = {
  6793. line: sourceInfo.line,
  6794. column: sourceInfo.column
  6795. };
  6796. return error;
  6797. } else {
  6798. return ProcessorErrorFactory.invalid_array_access(id);
  6799. }
  6800. },
  6801. invalid_array_access: function invalid_array_access(id) {
  6802. var context = [id];
  6803. return createSemanticError("invalid_array_access", context);
  6804. },
  6805. invalid_matrix_access_full: function invalid_matrix_access_full(id, sourceInfo) {
  6806. if (sourceInfo) {
  6807. var context = [id, sourceInfo.line, sourceInfo.column];
  6808. var error = createSemanticError("invalid_matrix_access_full", context);
  6809. error.context = {
  6810. line: sourceInfo.line,
  6811. column: sourceInfo.column
  6812. };
  6813. return error;
  6814. } else {
  6815. return ProcessorErrorFactory.invalid_matrix_access(id);
  6816. }
  6817. },
  6818. invalid_matrix_access: function invalid_matrix_access(id) {
  6819. var context = [id];
  6820. return createSemanticError("invalid_matrix_access", context);
  6821. },
  6822. matrix_column_outbounds_full: function matrix_column_outbounds_full(id, value, columns, sourceInfo) {
  6823. if (sourceInfo) {
  6824. var context = [sourceInfo.line, value, id, columns];
  6825. var error = createRuntimeError("matrix_column_outbounds_full", context);
  6826. error.context = {
  6827. line: sourceInfo.line,
  6828. column: sourceInfo.column
  6829. };
  6830. return error;
  6831. } else {
  6832. return ProcessorErrorFactory.matrix_column_outbounds(id, value, columns);
  6833. }
  6834. },
  6835. matrix_column_outbounds: function matrix_column_outbounds(id, value, columns) {
  6836. var context = [value, id, columns];
  6837. return createRuntimeError("matrix_column_outbounds", context);
  6838. },
  6839. matrix_line_outbounds_full: function matrix_line_outbounds_full(id, value, lines, sourceInfo) {
  6840. if (sourceInfo) {
  6841. var context = [sourceInfo.line, value, id, lines];
  6842. var error = createRuntimeError("matrix_line_outbounds_full", context);
  6843. error.context = {
  6844. line: sourceInfo.line,
  6845. column: sourceInfo.column
  6846. };
  6847. return error;
  6848. } else {
  6849. return ProcessorErrorFactory.matrix_line_outbounds(id, value, lines);
  6850. }
  6851. },
  6852. matrix_line_outbounds: function matrix_line_outbounds(id, value, lines) {
  6853. var context = [value, id, lines];
  6854. return createRuntimeError("matrix_line_outbounds", context);
  6855. },
  6856. vector_line_outbounds_full: function vector_line_outbounds_full(id, value, lines, sourceInfo) {
  6857. if (sourceInfo) {
  6858. var context = [sourceInfo.line, value, id, lines];
  6859. var error = createRuntimeError("vector_line_outbounds_full", context);
  6860. error.context = {
  6861. line: sourceInfo.line,
  6862. column: sourceInfo.column
  6863. };
  6864. return error;
  6865. } else {
  6866. return ProcessorErrorFactory.vector_line_outbounds(id, value, lines);
  6867. }
  6868. },
  6869. vector_line_outbounds: function vector_line_outbounds(id, value, lines) {
  6870. var context = [value, id, lines];
  6871. return createRuntimeError("vector_line_outbounds", context);
  6872. },
  6873. vector_not_matrix_full: function vector_not_matrix_full(id, sourceInfo) {
  6874. if (sourceInfo) {
  6875. var context = [sourceInfo.line, id];
  6876. var error = createRuntimeError("vector_not_matrix_full", context);
  6877. error.context = {
  6878. line: sourceInfo.line,
  6879. column: sourceInfo.column
  6880. };
  6881. return error;
  6882. } else {
  6883. return ProcessorErrorFactory.vector_not_matrix(id);
  6884. }
  6885. },
  6886. vector_not_matrix: function vector_not_matrix(id) {
  6887. var context = [id];
  6888. return createRuntimeError("vector_not_matrix", context);
  6889. },
  6890. function_no_return: function function_no_return(id) {
  6891. var context = [id];
  6892. return createSemanticError("function_no_return", context);
  6893. },
  6894. invalid_void_return_full: function invalid_void_return_full(id, type, dim, sourceInfo) {
  6895. if (sourceInfo) {
  6896. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6897. var error = createSemanticError("invalid_void_return_full", context);
  6898. error.context = {
  6899. line: sourceInfo.line,
  6900. column: sourceInfo.column
  6901. };
  6902. return error;
  6903. } else {
  6904. return ProcessorErrorFactory.invalid_void_return(id, type, dim);
  6905. }
  6906. },
  6907. invalid_void_return: function invalid_void_return(id, type, dim) {
  6908. var context = [id, LocalizedStrings.translateType(type, dim)];
  6909. return createSemanticError("invalid_void_return_full", context);
  6910. },
  6911. invalid_return_type_full: function invalid_return_type_full(id, type, dim, sourceInfo) {
  6912. if (sourceInfo) {
  6913. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6914. var error = createSemanticError("invalid_return_type_full", context);
  6915. error.context = {
  6916. line: sourceInfo.line,
  6917. column: sourceInfo.column
  6918. };
  6919. return error;
  6920. } else {
  6921. return ProcessorErrorFactory.invalid_return_type(id, type, dim);
  6922. }
  6923. },
  6924. invalid_return_type: function invalid_return_type(id, type, dim) {
  6925. var context = [id, LocalizedStrings.translateType(type, dim)];
  6926. return createSemanticError("invalid_return_type", context);
  6927. },
  6928. invalid_parameters_size_full: function invalid_parameters_size_full(id, expected, actual, sourceInfo) {
  6929. if (sourceInfo) {
  6930. var context = [sourceInfo.line, id, expected, actual];
  6931. var error = createSemanticError("invalid_parameters_size_full", context);
  6932. error.context = {
  6933. line: sourceInfo.line,
  6934. column: sourceInfo.column
  6935. };
  6936. return error;
  6937. } else {
  6938. return ProcessorErrorFactory.invalid_parameters_size(id, expected, actual);
  6939. }
  6940. },
  6941. invalid_parameters_size: function invalid_parameters_size(id, expected, actual) {
  6942. var context = [id, expected, actual];
  6943. return createSemanticError("invalid_parameters_size", context);
  6944. },
  6945. invalid_parameter_type_full: function invalid_parameter_type_full(fun_name, exp, sourceInfo) {
  6946. if (sourceInfo) {
  6947. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  6948. var error = createSemanticError("invalid_parameter_type_full", context);
  6949. error.context = {
  6950. line: sourceInfo.line,
  6951. column: sourceInfo.column
  6952. };
  6953. return error;
  6954. } else {
  6955. return ProcessorErrorFactory.invalid_parameter_type(fun_name, exp);
  6956. }
  6957. },
  6958. invalid_parameter_type: function invalid_parameter_type(fun_name, exp) {
  6959. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  6960. return createSemanticError("invalid_parameter_type_full", context);
  6961. },
  6962. invalid_ref_full: function invalid_ref_full(id, exp, sourceInfo) {
  6963. if (sourceInfo) {
  6964. var context = [exp, id, sourceInfo.line];
  6965. var error = createSemanticError("invalid_ref_full", context);
  6966. error.context = {
  6967. line: sourceInfo.line,
  6968. column: sourceInfo.column
  6969. };
  6970. return error;
  6971. } else {
  6972. return ProcessorErrorFactory.invalid_ref(id, exp);
  6973. }
  6974. },
  6975. invalid_ref: function invalid_ref(id, exp) {
  6976. var context = [exp, id];
  6977. return createSemanticError("invalid_ref", context);
  6978. },
  6979. unexpected_break_command_full: function unexpected_break_command_full(sourceInfo) {
  6980. if (sourceInfo) {
  6981. var context = [sourceInfo.line];
  6982. var error = createRuntimeError("unexpected_break_command_full", context);
  6983. error.context = {
  6984. line: sourceInfo.line,
  6985. column: sourceInfo.column
  6986. };
  6987. return error;
  6988. } else {
  6989. return ProcessorErrorFactory.unexpected_break_command();
  6990. }
  6991. },
  6992. unexpected_break_command: function unexpected_break_command() {
  6993. return createRuntimeError("unexpected_break_command");
  6994. },
  6995. invalid_array_literal_type_full: function invalid_array_literal_type_full(exp, sourceInfo) {
  6996. if (sourceInfo) {
  6997. var context = [sourceInfo.line, exp];
  6998. var error = createRuntimeError("invalid_array_literal_type_full", context);
  6999. error.context = {
  7000. line: sourceInfo.line,
  7001. column: sourceInfo.column
  7002. };
  7003. return error;
  7004. } else {
  7005. return ProcessorErrorFactory.invalid_array_literal_type(exp);
  7006. }
  7007. },
  7008. invalid_array_literal_type: function invalid_array_literal_type(exp) {
  7009. var context = [exp];
  7010. return createRuntimeError("invalid_array_literal_type", context);
  7011. },
  7012. invalid_array_literal_line_full: function invalid_array_literal_line_full(expected, actual, sourceInfo) {
  7013. if (sourceInfo) {
  7014. var context = [sourceInfo.line, expected, actual];
  7015. var error = createRuntimeError("invalid_array_literal_line_full", context);
  7016. error.context = {
  7017. line: sourceInfo.line,
  7018. column: sourceInfo.column
  7019. };
  7020. return error;
  7021. } else {
  7022. return ProcessorErrorFactory.invalid_array_literal_type(expected, actual);
  7023. }
  7024. },
  7025. invalid_array_literal_line: function invalid_array_literal_line(expected, actual) {
  7026. var context = [expected, actual];
  7027. return createRuntimeError("invalid_array_literal_line", context);
  7028. },
  7029. invalid_array_literal_column_full: function invalid_array_literal_column_full(expected, actual, sourceInfo) {
  7030. if (sourceInfo) {
  7031. var context = [sourceInfo.line, expected, actual];
  7032. var error = createRuntimeError("invalid_array_literal_column_full", context);
  7033. error.context = {
  7034. line: sourceInfo.line,
  7035. column: sourceInfo.column
  7036. };
  7037. return error;
  7038. } else {
  7039. return ProcessorErrorFactory.invalid_array_literal_column(expected, actual);
  7040. }
  7041. },
  7042. invalid_array_literal_column: function invalid_array_literal_column(expected, actual) {
  7043. var context = [expected, actual];
  7044. return createRuntimeError("invalid_array_literal_column", context);
  7045. },
  7046. invalid_unary_op_full: function invalid_unary_op_full(expString, opName, type, dim, sourceInfo) {
  7047. if (sourceInfo) {
  7048. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  7049. var error = createRuntimeError("invalid_unary_op_full", context);
  7050. error.context = {
  7051. line: sourceInfo.line,
  7052. column: sourceInfo.column
  7053. };
  7054. return error;
  7055. } else {
  7056. return ProcessorErrorFactory.invalid_unary_op(opName, type, dim);
  7057. }
  7058. },
  7059. invalid_unary_op: function invalid_unary_op(expString, opName, type, dim) {
  7060. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  7061. return createRuntimeError("invalid_unary_op", context);
  7062. },
  7063. invalid_infix_op_full: function invalid_infix_op_full(expString, opName, typeLeft, dimLeft, typeRight, dimRight, sourceInfo) {
  7064. if (sourceInfo) {
  7065. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  7066. var error = createRuntimeError("invalid_infix_op_full", context);
  7067. error.context = {
  7068. line: sourceInfo.line,
  7069. column: sourceInfo.column
  7070. };
  7071. return error;
  7072. } else {
  7073. return ProcessorErrorFactory.invalid_infix_op(opName, typeLeft, dimLeft, typeRight, dimRight);
  7074. }
  7075. },
  7076. invalid_infix_op: function invalid_infix_op(expString, opName, typeLeft, dimLeft, typeRight, dimRight) {
  7077. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  7078. return createRuntimeError("invalid_infix_op", context);
  7079. },
  7080. array_dimension_not_positive_full: function array_dimension_not_positive_full(sourceInfo) {
  7081. if (sourceInfo) {
  7082. var context = [sourceInfo.line];
  7083. var error = createSemanticError("array_dimension_not_positive_full", context);
  7084. error.context = {
  7085. line: sourceInfo.line,
  7086. column: sourceInfo.column
  7087. };
  7088. return error;
  7089. } else {
  7090. return ProcessorErrorFactory.array_dimension_not_positive();
  7091. }
  7092. },
  7093. array_dimension_not_positive: function array_dimension_not_positive() {
  7094. return createSemanticError("array_dimension_not_positive");
  7095. },
  7096. invalid_type_conversion: function invalid_type_conversion(value, type, dim) {
  7097. var context = [value, LocalizedStrings.translateType(type, dim)];
  7098. return createRuntimeError("invalid_type_conversion", context);
  7099. },
  7100. invalid_read_type: function invalid_read_type(exp, type, dim, name, source_info) {
  7101. var context = [source_info.line, exp, LocalizedStrings.translateType(type, dim), name];
  7102. var error = createRuntimeError("invalid_read_type", context);
  7103. error.context = {
  7104. line: source_info.line,
  7105. column: source_info.column
  7106. };
  7107. return error;
  7108. },
  7109. invalid_read_type_array: function invalid_read_type_array(exp, typePos, dimPos, name, typeArray, dimArray, sourceInfo) {
  7110. var context = [sourceInfo.line, exp, LocalizedStrings.translateType(typePos, dimPos), name, LocalizedStrings.translateType(typeArray, dimArray)];
  7111. var error = createRuntimeError("invalid_read_type_array", context);
  7112. error.context = {
  7113. line: sourceInfo.line,
  7114. column: sourceInfo.column
  7115. };
  7116. return error;
  7117. },
  7118. invalid_const_ref_full: function invalid_const_ref_full(fun_name, exp, sourceInfo) {
  7119. if (sourceInfo) {
  7120. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  7121. var error = createSemanticError("invalid_const_ref_full", context);
  7122. error.context = {
  7123. line: sourceInfo.line,
  7124. column: sourceInfo.column
  7125. };
  7126. return error;
  7127. } else {
  7128. return ProcessorErrorFactory.invalid_const_ref(fun_name, exp);
  7129. }
  7130. },
  7131. invalid_const_ref: function invalid_const_ref(fun_name, exp) {
  7132. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  7133. var error = createSemanticError("invalid_const_ref", context);
  7134. return error;
  7135. },
  7136. invalid_const_assignment_full: function invalid_const_assignment_full(var_id, source_info) {
  7137. if (source_info) {
  7138. var context = [source_info.line, var_id];
  7139. var error = createSemanticError("invalid_const_assignment_full", context);
  7140. error.context = {
  7141. line: source_info.line,
  7142. column: source_info.column
  7143. };
  7144. return error;
  7145. } else {
  7146. return ProcessorErrorFactory.invalid_const_assignment(var_id);
  7147. }
  7148. },
  7149. invalid_const_assignment: function invalid_const_assignment(var_id) {
  7150. var context = [var_id];
  7151. return createSemanticError("invalid_const_assignment", context);
  7152. },
  7153. invalid_vector_assignment_full: function invalid_vector_assignment_full(left_id, left_size, right_id, right_size, source_info) {
  7154. if (source_info) {
  7155. var context = [source_info.line, left_id, left_size, right_id, right_size];
  7156. var error = createRuntimeError("invalid_vector_assignment_full", context);
  7157. error.context = {
  7158. line: source_info.line,
  7159. column: source_info.column
  7160. };
  7161. return error;
  7162. } else {
  7163. return ProcessorErrorFactory.invalid_vector_assignment(left_id, left_size, right_id, right_size);
  7164. }
  7165. },
  7166. invalid_vector_assignment: function invalid_vector_assignment(left_id, left_size, right_id, right_size) {
  7167. var context = [left_id, left_size, right_id, right_size];
  7168. return createRuntimeError("invalid_vector_assignment", context);
  7169. },
  7170. invalid_matrix_assignment_full: function invalid_matrix_assignment_full(left_id, left_line, left_column, right_id, right_line, right_column, source_info) {
  7171. if (source_info) {
  7172. var context = [source_info.line, left_id, left_line, left_column, right_id, right_line, right_column];
  7173. var error = createRuntimeError("invalid_matrix_assignment_full", context);
  7174. error.context = {
  7175. line: source_info.line,
  7176. column: source_info.column
  7177. };
  7178. return error;
  7179. } else {
  7180. return ProcessorErrorFactory.invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column);
  7181. }
  7182. },
  7183. invalid_matrix_assignment: function invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column) {
  7184. var context = [left_id, left_line, left_column, right_id, right_line, right_column];
  7185. return createRuntimeError("invalid_matrix_assignment", context);
  7186. },
  7187. matrix_to_vector_attr: function matrix_to_vector_attr(left_id, right_id, source_info) {
  7188. // SourceInfo have to be valid...
  7189. var context = [source_info.line, right_id, left_id];
  7190. var error = createSemanticError("matrix_to_vector_attr", context);
  7191. error.context = {
  7192. line: source_info.line,
  7193. column: source_info.column
  7194. };
  7195. return error;
  7196. },
  7197. vector_to_matrix_attr: function vector_to_matrix_attr(left_id, right_id, source_info) {
  7198. // SourceInfo have to be valid...
  7199. var context = [source_info.line, right_id, left_id];
  7200. var error = createSemanticError("vector_to_matrix_attr", context);
  7201. error.context = {
  7202. line: source_info.line,
  7203. column: source_info.column
  7204. };
  7205. return error;
  7206. },
  7207. invalid_matrix_index_assign_full: function invalid_matrix_index_assign_full(mat_id, mat_line, mat_size, exp, exp_size, source_info) {
  7208. if (source_info) {
  7209. var context = [source_info.line, mat_line, mat_id, mat_size, exp, exp_size];
  7210. var error = createRuntimeError("invalid_matrix_index_assign_full", context);
  7211. error.context = {
  7212. line: source_info.line,
  7213. column: source_info.column
  7214. };
  7215. return error;
  7216. } else {
  7217. return ProcessorErrorFactory.invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size);
  7218. }
  7219. },
  7220. invalid_matrix_index_assign: function invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size) {
  7221. var context = [mat_line, mat_id, mat_size, exp, exp_size];
  7222. return createRuntimeError("invalid_matrix_index_assign", context);
  7223. },
  7224. invalid_number_elements_vector: function invalid_number_elements_vector(expected_num, exp, actual_num, source_info) {
  7225. // SourceInfo have to be valid...
  7226. var context = [expected_num, source_info.line, exp, actual_num];
  7227. var error = createRuntimeError("invalid_number_elements_vector", context);
  7228. error.context = {
  7229. line: source_info.line,
  7230. column: source_info.column
  7231. };
  7232. return error;
  7233. },
  7234. invalid_number_lines_matrix: function invalid_number_lines_matrix(expected_num, exp, actual_num, source_info) {
  7235. // SourceInfo have to be valid...
  7236. var context = [expected_num, source_info.line, exp, actual_num];
  7237. var error = createRuntimeError("invalid_number_lines_matrix", context);
  7238. error.context = {
  7239. line: source_info.line,
  7240. column: source_info.column
  7241. };
  7242. return error;
  7243. },
  7244. divsion_by_zero_full: function divsion_by_zero_full(exp, source_info) {
  7245. if (source_info) {
  7246. var context = [source_info.line, exp];
  7247. var error = createRuntimeError("divsion_by_zero_full", context);
  7248. error.context = {
  7249. line: source_info.line,
  7250. column: source_info.column
  7251. };
  7252. return error;
  7253. } else {
  7254. return ProcessorErrorFactory.divsion_by_zero(exp);
  7255. }
  7256. },
  7257. divsion_by_zero: function divsion_by_zero(exp) {
  7258. var context = [exp];
  7259. return createRuntimeError("divsion_by_zero", context);
  7260. },
  7261. undefined_tanget_value: function undefined_tanget_value(value, source_info) {
  7262. var context = [source_info.line, value];
  7263. var error = createRuntimeError("undefined_tanget_value", context);
  7264. error.context = {
  7265. line: source_info.line,
  7266. column: source_info.column
  7267. };
  7268. return error;
  7269. },
  7270. negative_log_value: function negative_log_value(source_info) {
  7271. var error = createRuntimeError("negative_log_value", [source_info.line]);
  7272. error.context = {
  7273. line: source_info.line,
  7274. column: source_info.column
  7275. };
  7276. return error;
  7277. },
  7278. invalid_string_index: function invalid_string_index(index, str, source_info) {
  7279. var local_fun_name = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName("$charAt");
  7280. var context = [source_info.line, local_fun_name, index, str, str.length - 1];
  7281. var error = createRuntimeError("invalid_string_index", context);
  7282. error.context = {
  7283. line: source_info.line,
  7284. column: source_info.column
  7285. };
  7286. return error;
  7287. },
  7288. negative_sqrt_value: function negative_sqrt_value(source_info) {
  7289. var error = createRuntimeError("negative_sqrt_value", [source_info.line]);
  7290. error.context = {
  7291. line: source_info.line,
  7292. column: source_info.column
  7293. };
  7294. return error;
  7295. },
  7296. /**
  7297. * @deprecated 01/10/2019
  7298. */
  7299. exceeded_recursive_calls: function exceeded_recursive_calls(source_info) {
  7300. var context = [source_info.line];
  7301. var error = createRuntimeError("exceeded_recursive_calls", context);
  7302. error.context = {
  7303. line: source_info.line,
  7304. column: source_info.column
  7305. };
  7306. return error;
  7307. },
  7308. invalid_for_variable: function invalid_for_variable(id, source_info) {
  7309. var context = [source_info.line, id];
  7310. var error = createSemanticError("invalid_for_variable", context);
  7311. error.context = {
  7312. line: source_info.line,
  7313. column: source_info.column
  7314. };
  7315. return error;
  7316. },
  7317. invalid_for_from: function invalid_for_from(exp, source_info) {
  7318. var context = [source_info.line, exp];
  7319. var error = createSemanticError("invalid_for_from", context);
  7320. error.context = {
  7321. line: source_info.line,
  7322. column: source_info.column
  7323. };
  7324. return error;
  7325. },
  7326. invalid_for_to: function invalid_for_to(exp, source_info) {
  7327. var context = [source_info.line, exp];
  7328. var error = createSemanticError("invalid_for_to", context);
  7329. error.context = {
  7330. line: source_info.line,
  7331. column: source_info.column
  7332. };
  7333. return error;
  7334. },
  7335. invalid_for_pass: function invalid_for_pass(exp, source_info) {
  7336. var context = [source_info.line, exp];
  7337. var error = createSemanticError("invalid_for_pass", context);
  7338. error.context = {
  7339. line: source_info.line,
  7340. column: source_info.column
  7341. };
  7342. return error;
  7343. },
  7344. exceed_max_instructions: function exceed_max_instructions() {
  7345. return createRuntimeError("exceed_max_instructions");
  7346. }
  7347. });
  7348. /***/ }),
  7349. /***/ "./js/processor/error/runtimeError.js":
  7350. /*!********************************************!*\
  7351. !*** ./js/processor/error/runtimeError.js ***!
  7352. \********************************************/
  7353. /*! exports provided: RuntimeError */
  7354. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7355. "use strict";
  7356. __webpack_require__.r(__webpack_exports__);
  7357. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuntimeError", function() { return RuntimeError; });
  7358. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  7359. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  7360. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7361. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  7362. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  7363. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
  7364. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  7365. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);
  7366. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  7367. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
  7368. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  7369. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);
  7370. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  7371. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
  7372. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  7373. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7__);
  7374. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result); }; }
  7375. 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; } }
  7376. var RuntimeError = /*#__PURE__*/function (_Error) {
  7377. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(RuntimeError, _Error);
  7378. var _super = _createSuper(RuntimeError);
  7379. function RuntimeError(msg, id) {
  7380. var _this;
  7381. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, RuntimeError);
  7382. _this = _super.call.apply(_super, [this].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(msg)));
  7383. _this.id = id;
  7384. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this), RuntimeError);
  7385. return _this;
  7386. }
  7387. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(RuntimeError, [{
  7388. key: "context",
  7389. get: function get() {
  7390. return this._context;
  7391. },
  7392. set: function set(contextObj) {
  7393. this._context = contextObj;
  7394. }
  7395. }]);
  7396. return RuntimeError;
  7397. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7___default()(Error));
  7398. /***/ }),
  7399. /***/ "./js/processor/error/semanticError.js":
  7400. /*!*********************************************!*\
  7401. !*** ./js/processor/error/semanticError.js ***!
  7402. \*********************************************/
  7403. /*! exports provided: SemanticError */
  7404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7405. "use strict";
  7406. __webpack_require__.r(__webpack_exports__);
  7407. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticError", function() { return SemanticError; });
  7408. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  7409. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  7410. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7411. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  7412. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  7413. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
  7414. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  7415. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);
  7416. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  7417. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
  7418. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  7419. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);
  7420. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  7421. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
  7422. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  7423. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7__);
  7424. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result); }; }
  7425. 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; } }
  7426. var SemanticError = /*#__PURE__*/function (_Error) {
  7427. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(SemanticError, _Error);
  7428. var _super = _createSuper(SemanticError);
  7429. function SemanticError(msg, id) {
  7430. var _this;
  7431. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SemanticError);
  7432. _this = _super.call.apply(_super, [this].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(msg)));
  7433. _this.id = id;
  7434. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this), SemanticError);
  7435. return _this;
  7436. }
  7437. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(SemanticError, [{
  7438. key: "context",
  7439. get: function get() {
  7440. return this._context;
  7441. },
  7442. set: function set(contextObj) {
  7443. this._context = contextObj;
  7444. }
  7445. }]);
  7446. return SemanticError;
  7447. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_7___default()(Error));
  7448. /***/ }),
  7449. /***/ "./js/processor/ivprogProcessor.js":
  7450. /*!*****************************************!*\
  7451. !*** ./js/processor/ivprogProcessor.js ***!
  7452. \*****************************************/
  7453. /*! exports provided: IVProgProcessor */
  7454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7455. "use strict";
  7456. __webpack_require__.r(__webpack_exports__);
  7457. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgProcessor", function() { return IVProgProcessor; });
  7458. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
  7459. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
  7460. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  7461. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  7462. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  7463. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  7464. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7465. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);
  7466. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  7467. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);
  7468. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./store/store */ "./js/processor/store/store.ts");
  7469. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_5__);
  7470. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modes */ "./js/processor/modes.ts");
  7471. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  7472. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./context */ "./js/processor/context.ts");
  7473. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_context__WEBPACK_IMPORTED_MODULE_7__);
  7474. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../typeSystem/types */ "./js/typeSystem/types.ts");
  7475. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__);
  7476. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  7477. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  7478. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./definedFunctions */ "./js/processor/definedFunctions.js");
  7479. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./compatibilityTable */ "./js/processor/compatibilityTable.ts");
  7480. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__);
  7481. /* harmony import */ var _ast_commands___WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../ast/commands/ */ "./js/ast/commands/index.js");
  7482. /* harmony import */ var _ast_commands_command__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../ast/commands/command */ "./js/ast/commands/command.js");
  7483. /* harmony import */ var _ast_expressions___WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../ast/expressions/ */ "./js/ast/expressions/index.js");
  7484. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  7485. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  7486. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  7487. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__);
  7488. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  7489. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  7490. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_19__);
  7491. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  7492. /* harmony import */ var _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./error/runtimeError */ "./js/processor/error/runtimeError.js");
  7493. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../memory/location */ "./js/memory/location.ts");
  7494. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_22__);
  7495. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./store/value/store_value */ "./js/processor/store/value/store_value.ts");
  7496. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_23__);
  7497. /* 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");
  7498. /* 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__);
  7499. /* 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");
  7500. /* 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__);
  7501. /* 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");
  7502. /* 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__);
  7503. /* 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");
  7504. /* 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__);
  7505. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  7506. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7507. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7508. var IVProgProcessor = /*#__PURE__*/function () {
  7509. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, null, [{
  7510. key: "MAIN_INTERNAL_ID",
  7511. get: function get() {
  7512. return "$main";
  7513. }
  7514. }]);
  7515. function IVProgProcessor(ast) {
  7516. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, IVProgProcessor);
  7517. this.ast = ast;
  7518. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7519. this.stores = [this.globalStore];
  7520. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7521. this.input = null;
  7522. this.forceKill = false;
  7523. this.output = null;
  7524. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7525. /**
  7526. * Stores the sourceInfo of every function call, command or expression
  7527. */
  7528. this.function_call_stack = [];
  7529. this.instruction_count = 0;
  7530. this.function_call_count = 0;
  7531. }
  7532. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, [{
  7533. key: "registerInput",
  7534. value: function registerInput(input) {
  7535. if (this.input !== null) this.input = null;
  7536. this.input = input;
  7537. }
  7538. }, {
  7539. key: "registerOutput",
  7540. value: function registerOutput(output) {
  7541. if (this.output !== null) this.output = null;
  7542. this.output = output;
  7543. }
  7544. }, {
  7545. key: "checkContext",
  7546. value: function checkContext(context) {
  7547. return this.context[this.context.length - 1] === context;
  7548. }
  7549. }, {
  7550. key: "ignoreSwitchCases",
  7551. value: function ignoreSwitchCases(store) {
  7552. if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN) {
  7553. return true;
  7554. } else if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  7555. return true;
  7556. } else {
  7557. return false;
  7558. }
  7559. }
  7560. }, {
  7561. key: "prepareState",
  7562. value: function prepareState() {
  7563. if (this.stores !== null) {
  7564. for (var i = 0; i < this.stores.length; i++) {
  7565. delete this.stores[i];
  7566. }
  7567. this.stores = null;
  7568. }
  7569. if (this.globalStore !== null) this.globalStore = null;
  7570. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7571. this.stores = [this.globalStore];
  7572. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7573. this.instruction_count = 0;
  7574. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7575. }
  7576. }, {
  7577. key: "interpretAST",
  7578. value: function () {
  7579. var _interpretAST = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee() {
  7580. var mainFunc;
  7581. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  7582. while (1) {
  7583. switch (_context.prev = _context.next) {
  7584. case 0:
  7585. this.prepareState();
  7586. _memory_location__WEBPACK_IMPORTED_MODULE_22__["Location"].clear();
  7587. _context.next = 4;
  7588. return this.initGlobal();
  7589. case 4:
  7590. mainFunc = this.findMainFunction();
  7591. if (!(mainFunc === null)) {
  7592. _context.next = 7;
  7593. break;
  7594. }
  7595. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].main_missing();
  7596. case 7:
  7597. return _context.abrupt("return", this.runFunction(mainFunc, [], this.globalStore));
  7598. case 8:
  7599. case "end":
  7600. return _context.stop();
  7601. }
  7602. }
  7603. }, _callee, this);
  7604. }));
  7605. function interpretAST() {
  7606. return _interpretAST.apply(this, arguments);
  7607. }
  7608. return interpretAST;
  7609. }()
  7610. }, {
  7611. key: "initGlobal",
  7612. value: function () {
  7613. var _initGlobal = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2() {
  7614. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  7615. while (1) {
  7616. switch (_context2.prev = _context2.next) {
  7617. case 0:
  7618. if (this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE)) {
  7619. _context2.next = 2;
  7620. break;
  7621. }
  7622. return _context2.abrupt("return", _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_global_var());
  7623. case 2:
  7624. return _context2.abrupt("return", this.executeCommands(this.globalStore, this.ast.global));
  7625. case 3:
  7626. case "end":
  7627. return _context2.stop();
  7628. }
  7629. }
  7630. }, _callee2, this);
  7631. }));
  7632. function initGlobal() {
  7633. return _initGlobal.apply(this, arguments);
  7634. }
  7635. return initGlobal;
  7636. }()
  7637. }, {
  7638. key: "findMainFunction",
  7639. value: function findMainFunction() {
  7640. return this.ast.functions.find(function (v) {
  7641. return v.isMain;
  7642. });
  7643. }
  7644. }, {
  7645. key: "findFunction",
  7646. value: function findFunction(name) {
  7647. if (name.match(/^\$.+$/)) {
  7648. if (name === IVProgProcessor.MAIN_INTERNAL_ID) {
  7649. return this.findMainFunction();
  7650. }
  7651. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getFunction(name);
  7652. if (!fun) {
  7653. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].not_implemented(name);
  7654. }
  7655. return fun;
  7656. } else {
  7657. var val = this.ast.functions.find(function (v) {
  7658. return v.name === name;
  7659. });
  7660. if (!val) {
  7661. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_missing(name);
  7662. }
  7663. return val;
  7664. }
  7665. }
  7666. }, {
  7667. key: "runFunction",
  7668. value: function () {
  7669. 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) {
  7670. var funcName, funcStore, stoWithVars, finalSto;
  7671. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  7672. while (1) {
  7673. switch (_context3.prev = _context3.next) {
  7674. case 0:
  7675. funcName = func.isMain ? IVProgProcessor.MAIN_INTERNAL_ID : func.name;
  7676. funcStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"](funcName);
  7677. funcStore.extendStore(this.globalStore);
  7678. _context3.next = 5;
  7679. return this.associateParameters(func.formalParameters, actualParameters, store, funcStore);
  7680. case 5:
  7681. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].FUNCTION);
  7682. this.stores.push(funcStore);
  7683. _context3.next = 9;
  7684. return this.executeCommands(funcStore, func.variablesDeclarations);
  7685. case 9:
  7686. stoWithVars = _context3.sent;
  7687. _context3.next = 12;
  7688. return this.executeCommands(stoWithVars, func.commands);
  7689. case 12:
  7690. finalSto = _context3.sent;
  7691. this.stores.pop();
  7692. this.context.pop();
  7693. return _context3.abrupt("return", finalSto);
  7694. case 16:
  7695. case "end":
  7696. return _context3.stop();
  7697. }
  7698. }
  7699. }, _callee3, this);
  7700. }));
  7701. function runFunction(_x, _x2, _x3) {
  7702. return _runFunction.apply(this, arguments);
  7703. }
  7704. return runFunction;
  7705. }()
  7706. /**
  7707. *
  7708. * @param {import('./../ast/commands/formalParameter').FormalParameter[]} formal_params
  7709. * @param {Expression[]} effective_params
  7710. * @param {Store} caller_store
  7711. * @param {Store} callee_store
  7712. */
  7713. }, {
  7714. key: "associateParameters",
  7715. value: function () {
  7716. 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) {
  7717. var funcName, hasVariadic, i, j, formalParameter, _yield$this$associate, _yield$this$associate2, actualParam;
  7718. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  7719. while (1) {
  7720. switch (_context4.prev = _context4.next) {
  7721. case 0:
  7722. funcName = callee_store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : callee_store.name;
  7723. hasVariadic = formal_params.some(function (p) {
  7724. return p.variadic;
  7725. });
  7726. if (!(formal_params.length != effective_params.length && !hasVariadic || formal_params.length > effective_params.length)) {
  7727. _context4.next = 4;
  7728. break;
  7729. }
  7730. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameters_size(funcName, formal_params.length, effective_params.length);
  7731. case 4:
  7732. i = 0, j = 0;
  7733. case 5:
  7734. if (!(i < formal_params.length && j < effective_params.length)) {
  7735. _context4.next = 23;
  7736. break;
  7737. }
  7738. formalParameter = formal_params[i];
  7739. if (!formalParameter.variadic) {
  7740. _context4.next = 16;
  7741. break;
  7742. }
  7743. _context4.next = 10;
  7744. return this.associateVariadicParameter(funcName, formalParameter, j, effective_params, caller_store, callee_store);
  7745. case 10:
  7746. _yield$this$associate = _context4.sent;
  7747. _yield$this$associate2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_yield$this$associate, 2);
  7748. j = _yield$this$associate2[0];
  7749. callee_store = _yield$this$associate2[1];
  7750. _context4.next = 20;
  7751. break;
  7752. case 16:
  7753. actualParam = effective_params[i];
  7754. _context4.next = 19;
  7755. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store);
  7756. case 19:
  7757. callee_store = _context4.sent;
  7758. case 20:
  7759. i += 1, j += 1;
  7760. _context4.next = 5;
  7761. break;
  7762. case 23:
  7763. return _context4.abrupt("return", callee_store);
  7764. case 24:
  7765. case "end":
  7766. return _context4.stop();
  7767. }
  7768. }
  7769. }, _callee4, this);
  7770. }));
  7771. function associateParameters(_x4, _x5, _x6, _x7) {
  7772. return _associateParameters.apply(this, arguments);
  7773. }
  7774. return associateParameters;
  7775. }()
  7776. /**
  7777. *
  7778. * @param {string} funcName
  7779. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7780. * @param {number} index
  7781. * @param {Expression[]} effective_params
  7782. * @param {Store} caller_store
  7783. * @param {Store} callee_store
  7784. */
  7785. }, {
  7786. key: "associateVariadicParameter",
  7787. value: function () {
  7788. 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) {
  7789. var i, count, actualParam, variadicCount;
  7790. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  7791. while (1) {
  7792. switch (_context5.prev = _context5.next) {
  7793. case 0:
  7794. count = 1;
  7795. i = index;
  7796. case 2:
  7797. if (!(i < effective_params.length)) {
  7798. _context5.next = 11;
  7799. break;
  7800. }
  7801. actualParam = effective_params[i];
  7802. _context5.next = 6;
  7803. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store, count);
  7804. case 6:
  7805. callee_store = _context5.sent;
  7806. count += 1;
  7807. case 8:
  7808. i += 1;
  7809. _context5.next = 2;
  7810. break;
  7811. case 11:
  7812. variadicCount = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER, count, undefined, true);
  7813. callee_store.insertStore("".concat(formalParameter.id, ".0"), variadicCount);
  7814. return _context5.abrupt("return", [i - 1, callee_store]);
  7815. case 14:
  7816. case "end":
  7817. return _context5.stop();
  7818. }
  7819. }
  7820. }, _callee5, this);
  7821. }));
  7822. function associateVariadicParameter(_x8, _x9, _x10, _x11, _x12, _x13) {
  7823. return _associateVariadicParameter.apply(this, arguments);
  7824. }
  7825. return associateVariadicParameter;
  7826. }()
  7827. /**
  7828. *
  7829. * @param {string} funcName
  7830. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7831. * @param {Expression} actualParameter
  7832. * @param {Store} callerStore
  7833. * @param {Store} calleeStore
  7834. * @param {number} variadicCount The number of the current value being assigned to the variadic parameter, default 0
  7835. */
  7836. }, {
  7837. key: "associateParameter",
  7838. value: function () {
  7839. 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) {
  7840. var variadicCount,
  7841. actualValue,
  7842. shouldTypeCast,
  7843. realObj,
  7844. ref,
  7845. values,
  7846. array_type,
  7847. addresses,
  7848. columns,
  7849. line,
  7850. column,
  7851. varID,
  7852. realValue,
  7853. _varID,
  7854. _args6 = arguments;
  7855. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  7856. while (1) {
  7857. switch (_context6.prev = _context6.next) {
  7858. case 0:
  7859. variadicCount = _args6.length > 5 && _args6[5] !== undefined ? _args6[5] : 0;
  7860. _context6.next = 3;
  7861. return this.evaluateExpression(callerStore, actualParameter);
  7862. case 3:
  7863. actualValue = _context6.sent;
  7864. shouldTypeCast = false;
  7865. if (formalParameter.type.isCompatible(actualValue.type)) {
  7866. _context6.next = 11;
  7867. break;
  7868. }
  7869. 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))) {
  7870. _context6.next = 10;
  7871. break;
  7872. }
  7873. shouldTypeCast = true;
  7874. _context6.next = 11;
  7875. break;
  7876. case 10:
  7877. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameter_type(funcName, actualParameter.toString());
  7878. case 11:
  7879. if (!(formalParameter.byRef && !actualValue.inStore())) {
  7880. _context6.next = 13;
  7881. break;
  7882. }
  7883. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_ref(funcName, actualParameter.toString());
  7884. case 13:
  7885. if (formalParameter.byRef) {
  7886. realObj = callerStore.getStoreObject(actualValue.id);
  7887. ref = null;
  7888. if (actualValue instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"]) {
  7889. // it's a vector or matrix...
  7890. values = actualValue.get();
  7891. array_type = actualValue.type;
  7892. addresses = values.map(function (v) {
  7893. return realObj.getLocAddressOf(v.line, v.column);
  7894. });
  7895. columns = actualValue.isVector() ? 0 : actualValue.columns;
  7896. ref = new _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__["ArrayStoreValueRef"](array_type, values, addresses, actualValue.lines, columns, realObj.id);
  7897. } else {
  7898. if (actualValue instanceof _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"]) {
  7899. line = actualValue.line;
  7900. column = actualValue.column;
  7901. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.getLocAddressOf(line, column), realObj.id);
  7902. ref.setReferenceDimension(realObj.type.dimensions);
  7903. } else {
  7904. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.locAddress, realObj.id);
  7905. }
  7906. }
  7907. varID = formalParameter.id;
  7908. if (formalParameter.variadic) varID = "".concat(varID, ".").concat(variadicCount);
  7909. calleeStore.insertStore(varID, ref);
  7910. } else {
  7911. realValue = actualValue;
  7912. if (shouldTypeCast) {
  7913. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(formalParameter.type, realValue);
  7914. }
  7915. _varID = formalParameter.id;
  7916. if (formalParameter.variadic) _varID = "".concat(_varID, ".").concat(variadicCount);
  7917. calleeStore.insertStore(_varID, realValue);
  7918. }
  7919. return _context6.abrupt("return", calleeStore);
  7920. case 15:
  7921. case "end":
  7922. return _context6.stop();
  7923. }
  7924. }
  7925. }, _callee6, this);
  7926. }));
  7927. function associateParameter(_x14, _x15, _x16, _x17, _x18) {
  7928. return _associateParameter.apply(this, arguments);
  7929. }
  7930. return associateParameter;
  7931. }()
  7932. /**
  7933. *
  7934. * @param {Store} store
  7935. * @param {Command[]} cmds
  7936. *
  7937. * @returns {Promise<Store>}
  7938. */
  7939. }, {
  7940. key: "executeCommands",
  7941. value: function () {
  7942. 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) {
  7943. var sto, i;
  7944. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  7945. while (1) {
  7946. switch (_context7.prev = _context7.next) {
  7947. case 0:
  7948. // helper to partially apply a function, in this case executeCommand
  7949. sto = store;
  7950. i = 0;
  7951. case 2:
  7952. if (!(i < cmds.length)) {
  7953. _context7.next = 9;
  7954. break;
  7955. }
  7956. _context7.next = 5;
  7957. return this.executeCommand(sto, cmds[i]);
  7958. case 5:
  7959. sto = _context7.sent;
  7960. case 6:
  7961. i += 1;
  7962. _context7.next = 2;
  7963. break;
  7964. case 9:
  7965. return _context7.abrupt("return", sto);
  7966. case 10:
  7967. case "end":
  7968. return _context7.stop();
  7969. }
  7970. }
  7971. }, _callee7, this);
  7972. }));
  7973. function executeCommands(_x19, _x20) {
  7974. return _executeCommands.apply(this, arguments);
  7975. }
  7976. return executeCommands;
  7977. }()
  7978. /**
  7979. *
  7980. * @param {Store} store
  7981. * @param {Command} cmd
  7982. *
  7983. * @returns {Promise<Store>}
  7984. */
  7985. }, {
  7986. key: "executeCommand",
  7987. value: function () {
  7988. 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) {
  7989. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  7990. while (1) {
  7991. switch (_context8.prev = _context8.next) {
  7992. case 0:
  7993. this.instruction_count += 1;
  7994. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  7995. _context8.next = 4;
  7996. break;
  7997. }
  7998. _context8.next = 4;
  7999. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
  8000. case 4:
  8001. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  8002. _context8.next = 8;
  8003. break;
  8004. }
  8005. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceed_max_instructions();
  8006. case 8:
  8007. if (!this.forceKill) {
  8008. _context8.next = 12;
  8009. break;
  8010. }
  8011. throw "FORCED_KILL!";
  8012. case 12:
  8013. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].PAUSE)) {
  8014. _context8.next = 16;
  8015. break;
  8016. }
  8017. return _context8.abrupt("return", this.executeCommand(store, cmd));
  8018. case 16:
  8019. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  8020. _context8.next = 20;
  8021. break;
  8022. }
  8023. return _context8.abrupt("return", store);
  8024. case 20:
  8025. if (!(this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE) && store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8026. _context8.next = 24;
  8027. break;
  8028. }
  8029. return _context8.abrupt("return", store);
  8030. case 24:
  8031. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  8032. _context8.next = 26;
  8033. break;
  8034. }
  8035. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  8036. case 26:
  8037. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Declaration"])) {
  8038. _context8.next = 30;
  8039. break;
  8040. }
  8041. return _context8.abrupt("return", this.executeDeclaration(store, cmd));
  8042. case 30:
  8043. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayIndexAssign"])) {
  8044. _context8.next = 34;
  8045. break;
  8046. }
  8047. return _context8.abrupt("return", this.executeArrayIndexAssign(store, cmd));
  8048. case 34:
  8049. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"])) {
  8050. _context8.next = 38;
  8051. break;
  8052. }
  8053. return _context8.abrupt("return", this.executeAssign(store, cmd));
  8054. case 38:
  8055. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Break"])) {
  8056. _context8.next = 42;
  8057. break;
  8058. }
  8059. return _context8.abrupt("return", this.executeBreak(store, cmd));
  8060. case 42:
  8061. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Return"])) {
  8062. _context8.next = 46;
  8063. break;
  8064. }
  8065. return _context8.abrupt("return", this.executeReturn(store, cmd));
  8066. case 46:
  8067. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  8068. _context8.next = 50;
  8069. break;
  8070. }
  8071. return _context8.abrupt("return", this.executeIfThenElse(store, cmd));
  8072. case 50:
  8073. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["RepeatUntil"])) {
  8074. _context8.next = 54;
  8075. break;
  8076. }
  8077. return _context8.abrupt("return", this.executeRepeatUntil(store, cmd));
  8078. case 54:
  8079. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"])) {
  8080. _context8.next = 58;
  8081. break;
  8082. }
  8083. return _context8.abrupt("return", this.executeWhile(store, cmd));
  8084. case 58:
  8085. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["For"])) {
  8086. _context8.next = 62;
  8087. break;
  8088. }
  8089. return _context8.abrupt("return", this.executeFor(store, cmd));
  8090. case 62:
  8091. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Switch"])) {
  8092. _context8.next = 66;
  8093. break;
  8094. }
  8095. return _context8.abrupt("return", this.executeSwitch(store, cmd));
  8096. case 66:
  8097. if (!(cmd instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  8098. _context8.next = 70;
  8099. break;
  8100. }
  8101. return _context8.abrupt("return", this.executeFunctionCall(store, cmd));
  8102. case 70:
  8103. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["SysCall"])) {
  8104. _context8.next = 74;
  8105. break;
  8106. }
  8107. return _context8.abrupt("return", this.executeSysCall(store, cmd));
  8108. case 74:
  8109. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unknown_command(cmd.sourceInfo);
  8110. case 75:
  8111. case "end":
  8112. return _context8.stop();
  8113. }
  8114. }
  8115. }, _callee8, this);
  8116. }));
  8117. function executeCommand(_x21, _x22) {
  8118. return _executeCommand.apply(this, arguments);
  8119. }
  8120. return executeCommand;
  8121. }()
  8122. /**
  8123. *
  8124. * @param {Store} store
  8125. * @param {Commands.SysCall} cmd
  8126. *
  8127. * @returns {Promise<Store>}
  8128. */
  8129. }, {
  8130. key: "executeSysCall",
  8131. value: function () {
  8132. 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) {
  8133. var func;
  8134. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  8135. while (1) {
  8136. switch (_context9.prev = _context9.next) {
  8137. case 0:
  8138. func = cmd.langFunc.bind(this);
  8139. return _context9.abrupt("return", func(store, cmd));
  8140. case 2:
  8141. case "end":
  8142. return _context9.stop();
  8143. }
  8144. }
  8145. }, _callee9, this);
  8146. }));
  8147. function executeSysCall(_x23, _x24) {
  8148. return _executeSysCall.apply(this, arguments);
  8149. }
  8150. return executeSysCall;
  8151. }()
  8152. /**
  8153. *
  8154. * @param {Store} store
  8155. * @param {Commands.FunctionCall} cmd
  8156. *
  8157. * @returns {Promise<Store>}
  8158. */
  8159. }, {
  8160. key: "executeFunctionCall",
  8161. value: function () {
  8162. 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) {
  8163. var func, sto, funcName;
  8164. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  8165. while (1) {
  8166. switch (_context10.prev = _context10.next) {
  8167. case 0:
  8168. func = null;
  8169. if (cmd.isMainCall) {
  8170. func = this.findMainFunction();
  8171. } else {
  8172. func = this.findFunction(cmd.id);
  8173. }
  8174. this.function_call_stack.push(cmd.sourceInfo);
  8175. _context10.next = 5;
  8176. return this.runFunction(func, cmd.actualParameters, store);
  8177. case 5:
  8178. sto = _context10.sent;
  8179. sto.destroy();
  8180. if (!(!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType) && sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  8181. _context10.next = 12;
  8182. break;
  8183. }
  8184. funcName = func.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : func.name;
  8185. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_no_return(funcName);
  8186. case 12:
  8187. this.function_call_stack.pop();
  8188. return _context10.abrupt("return", store);
  8189. case 14:
  8190. case "end":
  8191. return _context10.stop();
  8192. }
  8193. }
  8194. }, _callee10, this);
  8195. }));
  8196. function executeFunctionCall(_x25, _x26) {
  8197. return _executeFunctionCall.apply(this, arguments);
  8198. }
  8199. return executeFunctionCall;
  8200. }()
  8201. /**
  8202. *
  8203. * @param {Store} store
  8204. * @param {Commands.Switch} cmd
  8205. *
  8206. * @returns {Promise<Store>}
  8207. */
  8208. }, {
  8209. key: "executeSwitch",
  8210. value: function () {
  8211. 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) {
  8212. var switchCases, lastStore, lastCaseCheckResult, i, switchCase, equalityInfixApp, result;
  8213. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  8214. while (1) {
  8215. switch (_context11.prev = _context11.next) {
  8216. case 0:
  8217. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  8218. switchCases = cmd.cases;
  8219. lastStore = store;
  8220. lastCaseCheckResult = false;
  8221. i = 0;
  8222. case 5:
  8223. if (!(i < switchCases.length && !this.ignoreSwitchCases(lastStore))) {
  8224. _context11.next = 26;
  8225. break;
  8226. }
  8227. switchCase = switchCases[i];
  8228. if (!(lastCaseCheckResult || switchCase.isDefault)) {
  8229. _context11.next = 13;
  8230. break;
  8231. }
  8232. _context11.next = 10;
  8233. return this.executeCommands(lastStore, switchCase.commands);
  8234. case 10:
  8235. lastStore = _context11.sent;
  8236. _context11.next = 23;
  8237. break;
  8238. case 13:
  8239. equalityInfixApp = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].EQ, cmd.expression, switchCase.expression);
  8240. equalityInfixApp.sourceInfo = switchCase.sourceInfo;
  8241. _context11.next = 17;
  8242. return this.evaluateExpression(lastStore, equalityInfixApp);
  8243. case 17:
  8244. result = _context11.sent;
  8245. if (!result.get()) {
  8246. _context11.next = 22;
  8247. break;
  8248. }
  8249. _context11.next = 21;
  8250. return this.executeCommands(lastStore, switchCase.commands);
  8251. case 21:
  8252. lastStore = _context11.sent;
  8253. case 22:
  8254. lastCaseCheckResult = result.get();
  8255. case 23:
  8256. i += 1;
  8257. _context11.next = 5;
  8258. break;
  8259. case 26:
  8260. this.context.pop();
  8261. if (lastStore.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  8262. lastStore.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8263. }
  8264. return _context11.abrupt("return", lastStore);
  8265. case 29:
  8266. case "end":
  8267. return _context11.stop();
  8268. }
  8269. }
  8270. }, _callee11, this);
  8271. }));
  8272. function executeSwitch(_x27, _x28) {
  8273. return _executeSwitch.apply(this, arguments);
  8274. }
  8275. return executeSwitch;
  8276. }()
  8277. /**
  8278. *
  8279. * @param {Store} store
  8280. * @param {Commands.For} cmd
  8281. *
  8282. * @returns {Promise<Store>}
  8283. */
  8284. }, {
  8285. key: "executeFor",
  8286. value: function () {
  8287. 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) {
  8288. var initCmd, passValue, condition, checkEndGTBegin, isForward, increment, whileBlock, forAsWhile, newCmdList;
  8289. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  8290. while (1) {
  8291. switch (_context12.prev = _context12.next) {
  8292. case 0:
  8293. //BEGIN for -> while rewrite
  8294. initCmd = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"](cmd.for_id.id, cmd.for_from);
  8295. initCmd.sourceInfo = cmd.sourceInfo; // Assume for is iterating forward and that pass is not missing
  8296. passValue = cmd.for_pass;
  8297. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LT, cmd.for_id, cmd.for_to);
  8298. if (!(cmd.for_pass == null)) {
  8299. _context12.next = 12;
  8300. break;
  8301. }
  8302. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(1));
  8303. _context12.next = 8;
  8304. 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));
  8305. case 8:
  8306. checkEndGTBegin = _context12.sent;
  8307. if (!checkEndGTBegin.get()) {
  8308. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(-1));
  8309. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  8310. }
  8311. _context12.next = 16;
  8312. break;
  8313. case 12:
  8314. _context12.next = 14;
  8315. 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))));
  8316. case 14:
  8317. isForward = _context12.sent;
  8318. if (!isForward.get()) {
  8319. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  8320. }
  8321. case 16:
  8322. condition.sourceInfo = cmd.sourceInfo;
  8323. 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));
  8324. increment.sourceInfo = cmd.sourceInfo;
  8325. whileBlock = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["CommandBlock"]([], cmd.commands.concat(increment));
  8326. forAsWhile = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"](condition, whileBlock);
  8327. forAsWhile.sourceInfo = cmd.sourceInfo; //END for -> while rewrite
  8328. newCmdList = [initCmd, forAsWhile];
  8329. return _context12.abrupt("return", this.executeCommands(store, newCmdList));
  8330. case 24:
  8331. case "end":
  8332. return _context12.stop();
  8333. }
  8334. }
  8335. }, _callee12, this);
  8336. }));
  8337. function executeFor(_x29, _x30) {
  8338. return _executeFor.apply(this, arguments);
  8339. }
  8340. return executeFor;
  8341. }()
  8342. /**
  8343. *
  8344. * @param {Store} store
  8345. * @param {Commands.RepeatUntil} cmd
  8346. *
  8347. * @returns {Promise<Store>}
  8348. */
  8349. }, {
  8350. key: "executeRepeatUntil",
  8351. value: function () {
  8352. 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) {
  8353. var sto, checkCondition;
  8354. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  8355. while (1) {
  8356. switch (_context13.prev = _context13.next) {
  8357. case 0:
  8358. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  8359. _context13.next = 3;
  8360. return this.executeCommands(store, cmd.commands);
  8361. case 3:
  8362. sto = _context13.sent;
  8363. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8364. _context13.next = 8;
  8365. break;
  8366. }
  8367. this.context.pop();
  8368. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8369. return _context13.abrupt("return", sto);
  8370. case 8:
  8371. _context13.next = 10;
  8372. return this.evaluateExpression(sto, cmd.expression);
  8373. case 10:
  8374. checkCondition = _context13.sent;
  8375. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8376. _context13.next = 13;
  8377. break;
  8378. }
  8379. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.sourceInfo);
  8380. case 13:
  8381. this.context.pop();
  8382. if (!checkCondition.get()) {
  8383. _context13.next = 18;
  8384. break;
  8385. }
  8386. return _context13.abrupt("return", sto);
  8387. case 18:
  8388. return _context13.abrupt("return", this.executeCommand(sto, cmd));
  8389. case 19:
  8390. case "end":
  8391. return _context13.stop();
  8392. }
  8393. }
  8394. }, _callee13, this);
  8395. }));
  8396. function executeRepeatUntil(_x31, _x32) {
  8397. return _executeRepeatUntil.apply(this, arguments);
  8398. }
  8399. return executeRepeatUntil;
  8400. }()
  8401. /**
  8402. *
  8403. * @param {Store} store
  8404. * @param {Commands.While} cmd
  8405. *
  8406. * @returns {Promise<Store>}
  8407. */
  8408. }, {
  8409. key: "executeWhile",
  8410. value: function () {
  8411. 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) {
  8412. var checkCondition, sto;
  8413. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee14$(_context14) {
  8414. while (1) {
  8415. switch (_context14.prev = _context14.next) {
  8416. case 0:
  8417. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  8418. _context14.next = 3;
  8419. return this.evaluateExpression(store, cmd.expression);
  8420. case 3:
  8421. checkCondition = _context14.sent;
  8422. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8423. _context14.next = 6;
  8424. break;
  8425. }
  8426. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  8427. case 6:
  8428. if (!checkCondition.get()) {
  8429. _context14.next = 17;
  8430. break;
  8431. }
  8432. _context14.next = 9;
  8433. return this.executeCommands(store, cmd.commands);
  8434. case 9:
  8435. sto = _context14.sent;
  8436. this.context.pop();
  8437. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8438. _context14.next = 14;
  8439. break;
  8440. }
  8441. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8442. return _context14.abrupt("return", sto);
  8443. case 14:
  8444. return _context14.abrupt("return", this.executeCommand(sto, cmd));
  8445. case 17:
  8446. this.context.pop();
  8447. return _context14.abrupt("return", store);
  8448. case 19:
  8449. case "end":
  8450. return _context14.stop();
  8451. }
  8452. }
  8453. }, _callee14, this);
  8454. }));
  8455. function executeWhile(_x33, _x34) {
  8456. return _executeWhile.apply(this, arguments);
  8457. }
  8458. return executeWhile;
  8459. }()
  8460. /**
  8461. *
  8462. * @param {Store} store
  8463. * @param {Commands.IfThenElse} cmd
  8464. *
  8465. * @returns {Promise<Store>}
  8466. */
  8467. }, {
  8468. key: "executeIfThenElse",
  8469. value: function () {
  8470. 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) {
  8471. var isTrue;
  8472. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee15$(_context15) {
  8473. while (1) {
  8474. switch (_context15.prev = _context15.next) {
  8475. case 0:
  8476. _context15.next = 2;
  8477. return this.evaluateExpression(store, cmd.condition);
  8478. case 2:
  8479. isTrue = _context15.sent;
  8480. if (isTrue.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8481. _context15.next = 5;
  8482. break;
  8483. }
  8484. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  8485. case 5:
  8486. if (!isTrue.get()) {
  8487. _context15.next = 9;
  8488. break;
  8489. }
  8490. return _context15.abrupt("return", this.executeCommands(store, cmd.ifTrue.commands));
  8491. case 9:
  8492. if (!(cmd.ifFalse !== null)) {
  8493. _context15.next = 17;
  8494. break;
  8495. }
  8496. if (!(cmd.ifFalse instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  8497. _context15.next = 14;
  8498. break;
  8499. }
  8500. return _context15.abrupt("return", this.executeCommand(store, cmd.ifFalse));
  8501. case 14:
  8502. return _context15.abrupt("return", this.executeCommands(store, cmd.ifFalse.commands));
  8503. case 15:
  8504. _context15.next = 18;
  8505. break;
  8506. case 17:
  8507. return _context15.abrupt("return", store);
  8508. case 18:
  8509. case "end":
  8510. return _context15.stop();
  8511. }
  8512. }
  8513. }, _callee15, this);
  8514. }));
  8515. function executeIfThenElse(_x35, _x36) {
  8516. return _executeIfThenElse.apply(this, arguments);
  8517. }
  8518. return executeIfThenElse;
  8519. }()
  8520. /**
  8521. *
  8522. * @param {Store} store
  8523. * @param {Commands.Return} cmd
  8524. *
  8525. * @returns {Promise<Store>}
  8526. */
  8527. }, {
  8528. key: "executeReturn",
  8529. value: function () {
  8530. 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) {
  8531. var funcName, func, funcType, value, real_value, stringInfo, info;
  8532. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee16$(_context16) {
  8533. while (1) {
  8534. switch (_context16.prev = _context16.next) {
  8535. case 0:
  8536. 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);
  8537. func = this.findFunction(store.name);
  8538. funcType = func.returnType;
  8539. _context16.next = 5;
  8540. return this.evaluateExpression(store, cmd.expression);
  8541. case 5:
  8542. value = _context16.sent;
  8543. if (!(value === null && funcType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID))) {
  8544. _context16.next = 9;
  8545. break;
  8546. }
  8547. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8548. return _context16.abrupt("return", store);
  8549. case 9:
  8550. real_value = value;
  8551. if (!(value === null || !funcType.isCompatible(value.type))) {
  8552. _context16.next = 16;
  8553. break;
  8554. }
  8555. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(funcType, value.type))) {
  8556. _context16.next = 15;
  8557. break;
  8558. }
  8559. stringInfo = funcType.stringInfo();
  8560. info = stringInfo[0];
  8561. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_return_type_full(funcName, info.type, info.dim, cmd.sourceInfo);
  8562. case 15:
  8563. real_value = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(funcType, value);
  8564. case 16:
  8565. store.insertStore("$", real_value);
  8566. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8567. return _context16.abrupt("return", store);
  8568. case 19:
  8569. case "end":
  8570. return _context16.stop();
  8571. }
  8572. }
  8573. }, _callee16, this);
  8574. }));
  8575. function executeReturn(_x37, _x38) {
  8576. return _executeReturn.apply(this, arguments);
  8577. }
  8578. return executeReturn;
  8579. }()
  8580. /**
  8581. *
  8582. * @param {Store} store
  8583. * @param {Commands.Break} cmd
  8584. *
  8585. * @returns {Promise<Store>}
  8586. */
  8587. }, {
  8588. key: "executeBreak",
  8589. value: function () {
  8590. 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) {
  8591. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee17$(_context17) {
  8592. while (1) {
  8593. switch (_context17.prev = _context17.next) {
  8594. case 0:
  8595. if (!this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE)) {
  8596. _context17.next = 5;
  8597. break;
  8598. }
  8599. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK;
  8600. return _context17.abrupt("return", store);
  8601. case 5:
  8602. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unexpected_break_command_full(cmd.sourceInfo);
  8603. case 6:
  8604. case "end":
  8605. return _context17.stop();
  8606. }
  8607. }
  8608. }, _callee17, this);
  8609. }));
  8610. function executeBreak(_x39, _x40) {
  8611. return _executeBreak.apply(this, arguments);
  8612. }
  8613. return executeBreak;
  8614. }()
  8615. /**
  8616. *
  8617. * @param {Store} store
  8618. * @param {Commands.Assign} cmd
  8619. *
  8620. * @returns {Promise<Store>}
  8621. */
  8622. }, {
  8623. key: "executeAssign",
  8624. value: function () {
  8625. 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) {
  8626. var inStore, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp, columns, _exp;
  8627. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee18$(_context18) {
  8628. while (1) {
  8629. switch (_context18.prev = _context18.next) {
  8630. case 0:
  8631. inStore = store.applyStore(cmd.id);
  8632. if (!inStore.isConst) {
  8633. _context18.next = 3;
  8634. break;
  8635. }
  8636. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8637. case 3:
  8638. _context18.next = 5;
  8639. return this.evaluateExpression(store, cmd.expression);
  8640. case 5:
  8641. value = _context18.sent;
  8642. realValue = value;
  8643. if (inStore.type.isCompatible(realValue.type)) {
  8644. _context18.next = 18;
  8645. break;
  8646. }
  8647. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(inStore.type, value.type))) {
  8648. _context18.next = 12;
  8649. break;
  8650. }
  8651. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(inStore.type, realValue);
  8652. _context18.next = 18;
  8653. break;
  8654. case 12:
  8655. stringInfo = inStore.type.stringInfo();
  8656. info = stringInfo[0];
  8657. exp_type_string_info = value.type.stringInfo();
  8658. exp_type_info = exp_type_string_info[0];
  8659. exp = cmd.expression.toString();
  8660. 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);
  8661. case 18:
  8662. if (!(inStore instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8663. _context18.next = 27;
  8664. break;
  8665. }
  8666. columns = realValue.columns == null ? 0 : realValue.columns;
  8667. if (!(inStore.lines !== realValue.lines || inStore.columns !== columns)) {
  8668. _context18.next = 27;
  8669. break;
  8670. }
  8671. _exp = cmd.expression.toString();
  8672. if (!inStore.isVector()) {
  8673. _context18.next = 26;
  8674. break;
  8675. }
  8676. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_vector_assignment_full(cmd.id, inStore.lines, _exp, realValue.lines, cmd.sourceInfo);
  8677. case 26:
  8678. 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);
  8679. case 27:
  8680. store.updateStore(cmd.id, realValue);
  8681. return _context18.abrupt("return", store);
  8682. case 29:
  8683. case "end":
  8684. return _context18.stop();
  8685. }
  8686. }
  8687. }, _callee18, this);
  8688. }));
  8689. function executeAssign(_x41, _x42) {
  8690. return _executeAssign.apply(this, arguments);
  8691. }
  8692. return executeAssign;
  8693. }()
  8694. /**
  8695. *
  8696. * @param {Store} store
  8697. * @param {Commands.ArrayIndexAssign} cmd
  8698. *
  8699. * @returns {Promise<Store>}
  8700. */
  8701. }, {
  8702. key: "executeArrayIndexAssign",
  8703. value: function () {
  8704. 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) {
  8705. var mustBeArray, used_dims, lineSV, line, columnSV, column, value, actualValue, type, stringInfo, info, exp_type_string_info, exp_type_info, exp, current_value, _exp2;
  8706. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee19$(_context19) {
  8707. while (1) {
  8708. switch (_context19.prev = _context19.next) {
  8709. case 0:
  8710. mustBeArray = store.applyStore(cmd.id);
  8711. used_dims = 0;
  8712. if (!mustBeArray.isConst) {
  8713. _context19.next = 4;
  8714. break;
  8715. }
  8716. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8717. case 4:
  8718. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  8719. _context19.next = 6;
  8720. break;
  8721. }
  8722. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  8723. case 6:
  8724. _context19.next = 8;
  8725. return this.evaluateExpression(store, cmd.line);
  8726. case 8:
  8727. lineSV = _context19.sent;
  8728. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  8729. _context19.next = 11;
  8730. break;
  8731. }
  8732. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8733. case 11:
  8734. used_dims += 1;
  8735. line = lineSV.get().toNumber();
  8736. _context19.next = 15;
  8737. return this.evaluateExpression(store, cmd.column);
  8738. case 15:
  8739. columnSV = _context19.sent;
  8740. column = null;
  8741. if (!(columnSV != null)) {
  8742. _context19.next = 22;
  8743. break;
  8744. }
  8745. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  8746. _context19.next = 20;
  8747. break;
  8748. }
  8749. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8750. case 20:
  8751. column = columnSV.get().toNumber();
  8752. used_dims += 1;
  8753. case 22:
  8754. _context19.next = 24;
  8755. return this.evaluateExpression(store, cmd.expression);
  8756. case 24:
  8757. value = _context19.sent;
  8758. actualValue = value;
  8759. if (!(line >= mustBeArray.lines)) {
  8760. _context19.next = 34;
  8761. break;
  8762. }
  8763. if (!mustBeArray.isVector) {
  8764. _context19.next = 31;
  8765. break;
  8766. }
  8767. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8768. case 31:
  8769. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8770. case 32:
  8771. _context19.next = 36;
  8772. break;
  8773. case 34:
  8774. if (!(line < 0)) {
  8775. _context19.next = 36;
  8776. break;
  8777. }
  8778. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8779. case 36:
  8780. if (!(column != null && mustBeArray.columns === 0)) {
  8781. _context19.next = 38;
  8782. break;
  8783. }
  8784. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(cmd.id, cmd.sourceInfo);
  8785. case 38:
  8786. if (!(column != null)) {
  8787. _context19.next = 45;
  8788. break;
  8789. }
  8790. if (!(column >= mustBeArray.columns)) {
  8791. _context19.next = 43;
  8792. break;
  8793. }
  8794. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(cmd.id, column, mustBeArray.columns, cmd.sourceInfo);
  8795. case 43:
  8796. if (!(column < 0)) {
  8797. _context19.next = 45;
  8798. break;
  8799. }
  8800. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8801. case 45:
  8802. if (mustBeArray.type.canAccept(value.type, used_dims)) {
  8803. _context19.next = 55;
  8804. break;
  8805. }
  8806. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(mustBeArray.type.innerType, value.type))) {
  8807. _context19.next = 54;
  8808. break;
  8809. }
  8810. type = mustBeArray.type.innerType;
  8811. stringInfo = type.stringInfo();
  8812. info = stringInfo[0];
  8813. exp_type_string_info = value.type.stringInfo();
  8814. exp_type_info = exp_type_string_info[0];
  8815. exp = cmd.expression.toString();
  8816. 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);
  8817. case 54:
  8818. actualValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(mustBeArray.type.innerType, value);
  8819. case 55:
  8820. current_value = mustBeArray.getAt(line, column);
  8821. if (!(current_value instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8822. _context19.next = 60;
  8823. break;
  8824. }
  8825. if (!(current_value.lines !== actualValue.lines || current_value.columns !== actualValue.columns)) {
  8826. _context19.next = 60;
  8827. break;
  8828. }
  8829. _exp2 = cmd.expression.toString();
  8830. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_matrix_index_assign_full(cmd.id, line, current_value.lines, _exp2, actualValue.lines, cmd.sourceInfo);
  8831. case 60:
  8832. return _context19.abrupt("return", store.updateStoreArray(cmd.id, actualValue, line, column));
  8833. case 61:
  8834. case "end":
  8835. return _context19.stop();
  8836. }
  8837. }
  8838. }, _callee19, this);
  8839. }));
  8840. function executeArrayIndexAssign(_x43, _x44) {
  8841. return _executeArrayIndexAssign.apply(this, arguments);
  8842. }
  8843. return executeArrayIndexAssign;
  8844. }()
  8845. /**
  8846. *
  8847. * @param {Store} store
  8848. * @param {Commands.Declaration} cmd
  8849. *
  8850. * @returns {Promise<Store>}
  8851. */
  8852. }, {
  8853. key: "executeDeclaration",
  8854. value: function () {
  8855. 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) {
  8856. var temp, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp;
  8857. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee20$(_context20) {
  8858. while (1) {
  8859. switch (_context20.prev = _context20.next) {
  8860. case 0:
  8861. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayDeclaration"])) {
  8862. _context20.next = 4;
  8863. break;
  8864. }
  8865. return _context20.abrupt("return", this.executeArrayDeclaration(store, cmd));
  8866. case 4:
  8867. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, null, null, cmd.isConst);
  8868. if (!(cmd.initial !== null)) {
  8869. _context20.next = 22;
  8870. break;
  8871. }
  8872. _context20.next = 8;
  8873. return this.evaluateExpression(store, cmd.initial);
  8874. case 8:
  8875. value = _context20.sent;
  8876. realValue = value;
  8877. if (value.type.isCompatible(cmd.type)) {
  8878. _context20.next = 21;
  8879. break;
  8880. }
  8881. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(cmd.type, value.type))) {
  8882. _context20.next = 15;
  8883. break;
  8884. }
  8885. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(cmd.type, realValue);
  8886. _context20.next = 21;
  8887. break;
  8888. case 15:
  8889. stringInfo = value.type.stringInfo();
  8890. info = stringInfo[0];
  8891. exp_type_string_info = value.type.stringInfo();
  8892. exp_type_info = exp_type_string_info[0];
  8893. exp = cmd.expression.toString();
  8894. 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);
  8895. case 21:
  8896. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, realValue.get(), null, cmd.isConst);
  8897. case 22:
  8898. store.insertStore(cmd.id, temp);
  8899. return _context20.abrupt("return", store);
  8900. case 24:
  8901. case "end":
  8902. return _context20.stop();
  8903. }
  8904. }
  8905. }, _callee20, this);
  8906. }));
  8907. function executeDeclaration(_x45, _x46) {
  8908. return _executeDeclaration.apply(this, arguments);
  8909. }
  8910. return executeDeclaration;
  8911. }()
  8912. /**
  8913. *
  8914. * @param {Store} store
  8915. * @param {Commands.ArrayDeclaration} cmd
  8916. *
  8917. * @returns {Promise<Store>}
  8918. */
  8919. }, {
  8920. key: "executeArrayDeclaration",
  8921. value: function () {
  8922. 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) {
  8923. var linesSV, line, columnsSV, column, temp, valueList;
  8924. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee21$(_context21) {
  8925. while (1) {
  8926. switch (_context21.prev = _context21.next) {
  8927. case 0:
  8928. _context21.next = 2;
  8929. return this.evaluateExpression(store, cmd.lines);
  8930. case 2:
  8931. linesSV = _context21.sent;
  8932. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(linesSV.type)) {
  8933. _context21.next = 5;
  8934. break;
  8935. }
  8936. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8937. case 5:
  8938. line = linesSV.get().toNumber();
  8939. _context21.next = 8;
  8940. return this.evaluateExpression(store, cmd.columns);
  8941. case 8:
  8942. columnsSV = _context21.sent;
  8943. column = null;
  8944. if (!(columnsSV !== null)) {
  8945. _context21.next = 16;
  8946. break;
  8947. }
  8948. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnsSV.type)) {
  8949. _context21.next = 13;
  8950. break;
  8951. }
  8952. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8953. case 13:
  8954. column = columnsSV.get().toNumber();
  8955. if (!(column < 0)) {
  8956. _context21.next = 16;
  8957. break;
  8958. }
  8959. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8960. case 16:
  8961. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, [], line, column, null, cmd.isConst);
  8962. if (!(cmd.initial !== null)) {
  8963. _context21.next = 22;
  8964. break;
  8965. }
  8966. _context21.next = 20;
  8967. return this.evaluateArrayLiteral(store, cmd.initial, cmd.type, line, column);
  8968. case 20:
  8969. valueList = _context21.sent;
  8970. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, valueList, line, column, null, cmd.isConst);
  8971. case 22:
  8972. store.insertStore(cmd.id, temp);
  8973. return _context21.abrupt("return", store);
  8974. case 24:
  8975. case "end":
  8976. return _context21.stop();
  8977. }
  8978. }
  8979. }, _callee21, this);
  8980. }));
  8981. function executeArrayDeclaration(_x47, _x48) {
  8982. return _executeArrayDeclaration.apply(this, arguments);
  8983. }
  8984. return executeArrayDeclaration;
  8985. }()
  8986. /**
  8987. *
  8988. * @param {Store} store
  8989. * @param {Expression} exp
  8990. *
  8991. * @returns {Promise<import('./store/value/istore_value').IStoreValue>}
  8992. */
  8993. }, {
  8994. key: "evaluateExpression",
  8995. value: function () {
  8996. 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) {
  8997. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee22$(_context22) {
  8998. while (1) {
  8999. switch (_context22.prev = _context22.next) {
  9000. case 0:
  9001. this.instruction_count += 1;
  9002. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  9003. _context22.next = 4;
  9004. break;
  9005. }
  9006. _context22.next = 4;
  9007. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
  9008. case 4:
  9009. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  9010. _context22.next = 6;
  9011. break;
  9012. }
  9013. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  9014. case 6:
  9015. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  9016. _context22.next = 8;
  9017. break;
  9018. }
  9019. 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.");
  9020. case 8:
  9021. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["UnaryApp"])) {
  9022. _context22.next = 12;
  9023. break;
  9024. }
  9025. return _context22.abrupt("return", this.evaluateUnaryApp(store, exp));
  9026. case 12:
  9027. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"])) {
  9028. _context22.next = 16;
  9029. break;
  9030. }
  9031. return _context22.abrupt("return", this.evaluateInfixApp(store, exp));
  9032. case 16:
  9033. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayAccess"])) {
  9034. _context22.next = 20;
  9035. break;
  9036. }
  9037. return _context22.abrupt("return", this.evaluateArrayAccess(store, exp));
  9038. case 20:
  9039. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["VariableLiteral"])) {
  9040. _context22.next = 24;
  9041. break;
  9042. }
  9043. return _context22.abrupt("return", this.evaluateVariableLiteral(store, exp));
  9044. case 24:
  9045. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"])) {
  9046. _context22.next = 28;
  9047. break;
  9048. }
  9049. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9050. case 28:
  9051. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["RealLiteral"])) {
  9052. _context22.next = 32;
  9053. break;
  9054. }
  9055. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9056. case 32:
  9057. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["BoolLiteral"])) {
  9058. _context22.next = 36;
  9059. break;
  9060. }
  9061. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9062. case 36:
  9063. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["StringLiteral"])) {
  9064. _context22.next = 40;
  9065. break;
  9066. }
  9067. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9068. case 40:
  9069. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["CharLiteral"])) {
  9070. _context22.next = 44;
  9071. break;
  9072. }
  9073. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9074. case 44:
  9075. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayLiteral"])) {
  9076. _context22.next = 48;
  9077. break;
  9078. }
  9079. throw new Error("Internal Error: The system should not eval an array literal.");
  9080. case 48:
  9081. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  9082. _context22.next = 50;
  9083. break;
  9084. }
  9085. return _context22.abrupt("return", this.evaluateFunctionCall(store, exp));
  9086. case 50:
  9087. return _context22.abrupt("return", null);
  9088. case 51:
  9089. case "end":
  9090. return _context22.stop();
  9091. }
  9092. }
  9093. }, _callee22, this);
  9094. }));
  9095. function evaluateExpression(_x49, _x50) {
  9096. return _evaluateExpression.apply(this, arguments);
  9097. }
  9098. return evaluateExpression;
  9099. }()
  9100. }, {
  9101. key: "evaluateFunctionCall",
  9102. value: function () {
  9103. 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) {
  9104. var func, sto, val;
  9105. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee23$(_context23) {
  9106. while (1) {
  9107. switch (_context23.prev = _context23.next) {
  9108. case 0:
  9109. if (!exp.isMainCall) {
  9110. _context23.next = 2;
  9111. break;
  9112. }
  9113. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName(), exp.sourceInfo);
  9114. case 2:
  9115. func = this.findFunction(exp.id);
  9116. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType)) {
  9117. _context23.next = 5;
  9118. break;
  9119. }
  9120. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(exp.id, exp.sourceInfo);
  9121. case 5:
  9122. if (!(this.function_call_stack.length >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_call_stack)) {
  9123. _context23.next = 7;
  9124. break;
  9125. }
  9126. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceeded_recursive_calls(exp.sourceInfo);
  9127. case 7:
  9128. this.function_call_stack.push(exp.sourceInfo);
  9129. _context23.next = 10;
  9130. return this.runFunction(func, exp.actualParameters, store);
  9131. case 10:
  9132. sto = _context23.sent;
  9133. if (!(sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  9134. _context23.next = 13;
  9135. break;
  9136. }
  9137. 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);
  9138. case 13:
  9139. val = sto.applyStore("$");
  9140. sto.destroy();
  9141. this.function_call_stack.pop();
  9142. return _context23.abrupt("return", val);
  9143. case 17:
  9144. case "end":
  9145. return _context23.stop();
  9146. }
  9147. }
  9148. }, _callee23, this);
  9149. }));
  9150. function evaluateFunctionCall(_x51, _x52) {
  9151. return _evaluateFunctionCall.apply(this, arguments);
  9152. }
  9153. return evaluateFunctionCall;
  9154. }()
  9155. /**
  9156. *
  9157. * @param {Store} store
  9158. * @param {Expressions.ArrayLiteral} exp
  9159. * @param {ArrayType} type
  9160. *
  9161. * @returns {Promise<StoreValue[]>}
  9162. */
  9163. }, {
  9164. key: "evaluateArrayLiteral",
  9165. value: function () {
  9166. 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) {
  9167. var storeValueMatrix;
  9168. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee24$(_context24) {
  9169. while (1) {
  9170. switch (_context24.prev = _context24.next) {
  9171. case 0:
  9172. if (exp.isVector) {
  9173. _context24.next = 9;
  9174. break;
  9175. }
  9176. if (!(columns == null)) {
  9177. _context24.next = 3;
  9178. break;
  9179. }
  9180. throw new Error("This should never happen: Vector cannot be initialized by a matrix");
  9181. case 3:
  9182. _context24.next = 5;
  9183. return this.evaluateMatrix(store, exp, type, lines, columns);
  9184. case 5:
  9185. storeValueMatrix = _context24.sent;
  9186. return _context24.abrupt("return", storeValueMatrix.reduce(function (prev, next) {
  9187. return prev.concat(next);
  9188. }, []));
  9189. case 9:
  9190. if (!(columns != null)) {
  9191. _context24.next = 11;
  9192. break;
  9193. }
  9194. throw new Error("This should never happen: Matrix cannot be initialized by a vector");
  9195. case 11:
  9196. return _context24.abrupt("return", this.evaluateVector(store, exp, type, lines));
  9197. case 12:
  9198. case "end":
  9199. return _context24.stop();
  9200. }
  9201. }
  9202. }, _callee24, this);
  9203. }));
  9204. function evaluateArrayLiteral(_x53, _x54, _x55, _x56, _x57) {
  9205. return _evaluateArrayLiteral.apply(this, arguments);
  9206. }
  9207. return evaluateArrayLiteral;
  9208. }()
  9209. /**
  9210. * Evalautes a list of literals and expression composing the vector
  9211. * @param {Store} store
  9212. * @param {Expressions.ArrayLiteral} exps
  9213. * @param {ArrayType} type
  9214. * @param {number} n_elements
  9215. *
  9216. * @returns {Promise<StoreValue[]>} store object list
  9217. */
  9218. }, {
  9219. key: "evaluateVector",
  9220. value: function () {
  9221. 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) {
  9222. var _this = this;
  9223. var values, actualValues;
  9224. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee25$(_context25) {
  9225. while (1) {
  9226. switch (_context25.prev = _context25.next) {
  9227. case 0:
  9228. values = exps.value;
  9229. if (!(n_elements !== values.length)) {
  9230. _context25.next = 3;
  9231. break;
  9232. }
  9233. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_elements_vector(n_elements, exps.toString(), values.length, exps.sourceInfo);
  9234. case 3:
  9235. _context25.next = 5;
  9236. return Promise.all(values.map(function (exp) {
  9237. return _this.evaluateExpression(store, exp);
  9238. }));
  9239. case 5:
  9240. actualValues = _context25.sent;
  9241. return _context25.abrupt("return", actualValues.map(function (v, index) {
  9242. if (!type.canAccept(v.type, 1)) {
  9243. if (!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(type.innerType, v.type)) {
  9244. // const stringInfo = v.type.stringInfo();
  9245. // const info = stringInfo[0];
  9246. var exp_str = values[index].toString(); // TODO - fix error message
  9247. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_literal_type_full(exp_str, values[index].sourceInfo);
  9248. }
  9249. var newValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(type.innerType, v);
  9250. return newValue;
  9251. }
  9252. return v;
  9253. }));
  9254. case 7:
  9255. case "end":
  9256. return _context25.stop();
  9257. }
  9258. }
  9259. }, _callee25);
  9260. }));
  9261. function evaluateVector(_x58, _x59, _x60, _x61) {
  9262. return _evaluateVector.apply(this, arguments);
  9263. }
  9264. return evaluateVector;
  9265. }()
  9266. /**
  9267. * Evaluates a list of array literals composing the matrix
  9268. * @param {Store} store
  9269. * @param {Expressions.ArrayLiteral} exps
  9270. * @param {ArrayType} type
  9271. *
  9272. * @returns {Promise<StoreValue[][]>}
  9273. */
  9274. }, {
  9275. key: "evaluateMatrix",
  9276. value: function () {
  9277. 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) {
  9278. var _this2 = this;
  9279. var values, vectors;
  9280. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee26$(_context26) {
  9281. while (1) {
  9282. switch (_context26.prev = _context26.next) {
  9283. case 0:
  9284. values = exps.value;
  9285. if (!(values.length !== lines)) {
  9286. _context26.next = 3;
  9287. break;
  9288. }
  9289. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_lines_matrix(lines, exps.toString(), values.length, exps.sourceInfo);
  9290. case 3:
  9291. vectors = values.map(function (vector) {
  9292. var vec_type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"](type.innerType, 1);
  9293. return _this2.evaluateVector(store, vector, vec_type, columns);
  9294. });
  9295. _context26.next = 6;
  9296. return Promise.all(vectors);
  9297. case 6:
  9298. return _context26.abrupt("return", _context26.sent);
  9299. case 7:
  9300. case "end":
  9301. return _context26.stop();
  9302. }
  9303. }
  9304. }, _callee26);
  9305. }));
  9306. function evaluateMatrix(_x62, _x63, _x64, _x65, _x66) {
  9307. return _evaluateMatrix.apply(this, arguments);
  9308. }
  9309. return evaluateMatrix;
  9310. }()
  9311. /**
  9312. *
  9313. * @param {Store} _
  9314. * @param {import('../ast/expressions/literal').Literal} exp
  9315. *
  9316. * @returns {import('./store/value/istore_value').IStoreValue}
  9317. */
  9318. }, {
  9319. key: "evaluateLiteral",
  9320. value: function () {
  9321. 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) {
  9322. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee27$(_context27) {
  9323. while (1) {
  9324. switch (_context27.prev = _context27.next) {
  9325. case 0:
  9326. return _context27.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](exp.type, exp.value));
  9327. case 1:
  9328. case "end":
  9329. return _context27.stop();
  9330. }
  9331. }
  9332. }, _callee27);
  9333. }));
  9334. function evaluateLiteral(_x67, _x68) {
  9335. return _evaluateLiteral.apply(this, arguments);
  9336. }
  9337. return evaluateLiteral;
  9338. }()
  9339. /**
  9340. *
  9341. * @param {Store} store
  9342. * @param {Expressions.VariableLiteral} exp
  9343. *
  9344. * @returns {import('./store/value/istore_value').IStoreValue}
  9345. */
  9346. }, {
  9347. key: "evaluateVariableLiteral",
  9348. value: function () {
  9349. 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) {
  9350. var val;
  9351. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee28$(_context28) {
  9352. while (1) {
  9353. switch (_context28.prev = _context28.next) {
  9354. case 0:
  9355. val = store.applyStore(exp.id);
  9356. return _context28.abrupt("return", val);
  9357. case 2:
  9358. case "end":
  9359. return _context28.stop();
  9360. }
  9361. }
  9362. }, _callee28);
  9363. }));
  9364. function evaluateVariableLiteral(_x69, _x70) {
  9365. return _evaluateVariableLiteral.apply(this, arguments);
  9366. }
  9367. return evaluateVariableLiteral;
  9368. }()
  9369. /**
  9370. *
  9371. * @param {Store} store
  9372. * @param {Expressions.ArrayAccess} exp
  9373. *
  9374. * @returns {import('./store/value/istore_value').IStoreValue}
  9375. */
  9376. }, {
  9377. key: "evaluateArrayAccess",
  9378. value: function () {
  9379. 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) {
  9380. var mustBeArray, lineSV, line, columnSV, column, result, type, values;
  9381. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee29$(_context29) {
  9382. while (1) {
  9383. switch (_context29.prev = _context29.next) {
  9384. case 0:
  9385. mustBeArray = store.getStoreObject(exp.id);
  9386. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  9387. _context29.next = 3;
  9388. break;
  9389. }
  9390. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(exp.id, exp.sourceInfo);
  9391. case 3:
  9392. _context29.next = 5;
  9393. return this.evaluateExpression(store, exp.line);
  9394. case 5:
  9395. lineSV = _context29.sent;
  9396. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  9397. _context29.next = 8;
  9398. break;
  9399. }
  9400. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  9401. case 8:
  9402. line = lineSV.get().toNumber();
  9403. _context29.next = 11;
  9404. return this.evaluateExpression(store, exp.column);
  9405. case 11:
  9406. columnSV = _context29.sent;
  9407. column = null;
  9408. if (!(columnSV !== null)) {
  9409. _context29.next = 17;
  9410. break;
  9411. }
  9412. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  9413. _context29.next = 16;
  9414. break;
  9415. }
  9416. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  9417. case 16:
  9418. column = columnSV.get().toNumber();
  9419. case 17:
  9420. if (!(line >= mustBeArray.lines)) {
  9421. _context29.next = 25;
  9422. break;
  9423. }
  9424. if (!mustBeArray.isVector) {
  9425. _context29.next = 22;
  9426. break;
  9427. }
  9428. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  9429. case 22:
  9430. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  9431. case 23:
  9432. _context29.next = 27;
  9433. break;
  9434. case 25:
  9435. if (!(line < 0)) {
  9436. _context29.next = 27;
  9437. break;
  9438. }
  9439. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9440. case 27:
  9441. if (!(column !== null && mustBeArray.columns === 0)) {
  9442. _context29.next = 29;
  9443. break;
  9444. }
  9445. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(exp.id, exp.sourceInfo);
  9446. case 29:
  9447. if (!(column !== null)) {
  9448. _context29.next = 36;
  9449. break;
  9450. }
  9451. if (!(column >= mustBeArray.columns)) {
  9452. _context29.next = 34;
  9453. break;
  9454. }
  9455. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(exp.id, column, mustBeArray.columns, exp.sourceInfo);
  9456. case 34:
  9457. if (!(column < 0)) {
  9458. _context29.next = 36;
  9459. break;
  9460. }
  9461. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9462. case 36:
  9463. result = mustBeArray.getAt(line, column);
  9464. type = mustBeArray.type.innerType;
  9465. if (!Array.isArray(result)) {
  9466. _context29.next = 43;
  9467. break;
  9468. }
  9469. values = result.map(function (val, col) {
  9470. return new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, val, line, col, mustBeArray.id, mustBeArray.readOnly);
  9471. });
  9472. 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));
  9473. case 43:
  9474. return _context29.abrupt("return", new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, result, line, column, mustBeArray.id, mustBeArray.readOnly));
  9475. case 44:
  9476. case "end":
  9477. return _context29.stop();
  9478. }
  9479. }
  9480. }, _callee29, this);
  9481. }));
  9482. function evaluateArrayAccess(_x71, _x72) {
  9483. return _evaluateArrayAccess.apply(this, arguments);
  9484. }
  9485. return evaluateArrayAccess;
  9486. }()
  9487. /**
  9488. *
  9489. * @param {Store} store
  9490. * @param {Expressions.UnaryApp} unaryApp
  9491. *
  9492. * @returns {import('./store/value/istore_value').IStoreValue}
  9493. */
  9494. }, {
  9495. key: "evaluateUnaryApp",
  9496. value: function () {
  9497. 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) {
  9498. var left, resultType, stringInfo, info;
  9499. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee30$(_context30) {
  9500. while (1) {
  9501. switch (_context30.prev = _context30.next) {
  9502. case 0:
  9503. _context30.next = 2;
  9504. return this.evaluateExpression(store, unaryApp.left);
  9505. case 2:
  9506. left = _context30.sent;
  9507. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterUnaryOp"])(unaryApp.op, left.type);
  9508. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9509. _context30.next = 8;
  9510. break;
  9511. }
  9512. stringInfo = left.type.stringInfo();
  9513. info = stringInfo[0];
  9514. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_unary_op_full(unaryApp.op, info.type, info.dim, unaryApp.sourceInfo);
  9515. case 8:
  9516. _context30.t0 = unaryApp.op.ord;
  9517. _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;
  9518. break;
  9519. case 11:
  9520. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get()));
  9521. case 12:
  9522. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().negated()));
  9523. case 13:
  9524. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, !left.get()));
  9525. case 14:
  9526. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid UnaryApp " + unaryApp.op);
  9527. case 15:
  9528. case "end":
  9529. return _context30.stop();
  9530. }
  9531. }
  9532. }, _callee30, this);
  9533. }));
  9534. function evaluateUnaryApp(_x73, _x74) {
  9535. return _evaluateUnaryApp.apply(this, arguments);
  9536. }
  9537. return evaluateUnaryApp;
  9538. }()
  9539. /**
  9540. *
  9541. * @param {Store} store
  9542. * @param {Expressions.InfixApp} infixApp
  9543. *
  9544. * @returns {import('./store/value/istore_value').IStoreValue}
  9545. */
  9546. }, {
  9547. key: "evaluateInfixApp",
  9548. value: function () {
  9549. 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) {
  9550. 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;
  9551. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee31$(_context31) {
  9552. while (1) {
  9553. switch (_context31.prev = _context31.next) {
  9554. case 0:
  9555. _context31.next = 2;
  9556. return this.evaluateExpression(store, infixApp.left);
  9557. case 2:
  9558. left = _context31.sent;
  9559. _context31.next = 5;
  9560. return this.evaluateExpression(store, infixApp.right);
  9561. case 5:
  9562. right = _context31.sent;
  9563. shouldImplicitCast = false;
  9564. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterInfixOp"])(infixApp.op, left.type, right.type);
  9565. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9566. _context31.next = 18;
  9567. break;
  9568. }
  9569. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(left.type, right.type))) {
  9570. _context31.next = 13;
  9571. break;
  9572. }
  9573. shouldImplicitCast = true;
  9574. _context31.next = 18;
  9575. break;
  9576. case 13:
  9577. stringInfoLeft = left.type.stringInfo();
  9578. infoLeft = stringInfoLeft[0];
  9579. stringInfoRight = right.type.stringInfo();
  9580. infoRight = stringInfoRight[0];
  9581. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_infix_op_full(infixApp.op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, infixApp.sourceInfo);
  9582. case 18:
  9583. result = null;
  9584. _context31.t0 = infixApp.op.ord;
  9585. _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;
  9586. break;
  9587. case 22:
  9588. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9589. _context31.next = 27;
  9590. break;
  9591. }
  9592. rightStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9593. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() + rightStr));
  9594. case 27:
  9595. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(right.type)) {
  9596. _context31.next = 32;
  9597. break;
  9598. }
  9599. leftStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9600. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, leftStr + right.get()));
  9601. case 32:
  9602. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9603. _context31.next = 38;
  9604. break;
  9605. }
  9606. strLeft = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9607. strRight = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9608. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, strLeft + strRight));
  9609. case 38:
  9610. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().plus(right.get())));
  9611. case 39:
  9612. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().minus(right.get())));
  9613. case 40:
  9614. result = left.get().times(right.get());
  9615. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9616. case 42:
  9617. if (!(right.get() == 0)) {
  9618. _context31.next = 44;
  9619. break;
  9620. }
  9621. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].divsion_by_zero_full(infixApp.toString(), infixApp.sourceInfo);
  9622. case 44:
  9623. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(resultType)) result = left.get().divToInt(right.get());else result = left.get().div(right.get());
  9624. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9625. case 46:
  9626. leftValue = left.get();
  9627. rightValue = right.get();
  9628. if (shouldImplicitCast) {
  9629. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER;
  9630. leftValue = leftValue.trunc();
  9631. rightValue = rightValue.trunc();
  9632. }
  9633. result = leftValue.modulo(rightValue);
  9634. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9635. case 51:
  9636. _leftValue = left.get();
  9637. _rightValue = right.get();
  9638. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9639. result = _leftValue.length > _rightValue.length;
  9640. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9641. result = _leftValue.charCodeAt(0) > _rightValue.charCodeAt(0);
  9642. } else {
  9643. if (shouldImplicitCast) {
  9644. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9645. _leftValue = _leftValue.trunc();
  9646. _rightValue = _rightValue.trunc();
  9647. }
  9648. result = _leftValue.gt(_rightValue);
  9649. }
  9650. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9651. case 55:
  9652. _leftValue2 = left.get();
  9653. _rightValue2 = right.get();
  9654. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9655. result = _leftValue2.length >= _rightValue2.length;
  9656. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9657. result = _leftValue2.charCodeAt(0) >= _rightValue2.charCodeAt(0);
  9658. } else {
  9659. if (shouldImplicitCast) {
  9660. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9661. _leftValue2 = _leftValue2.trunc();
  9662. _rightValue2 = _rightValue2.trunc();
  9663. }
  9664. result = _leftValue2.gte(_rightValue2);
  9665. }
  9666. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9667. case 59:
  9668. _leftValue3 = left.get();
  9669. _rightValue3 = right.get();
  9670. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9671. result = _leftValue3.length < _rightValue3.length;
  9672. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9673. result = _leftValue3.charCodeAt(0) < _rightValue3.charCodeAt(0);
  9674. } else {
  9675. if (shouldImplicitCast) {
  9676. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9677. _leftValue3 = _leftValue3.trunc();
  9678. _rightValue3 = _rightValue3.trunc();
  9679. }
  9680. result = _leftValue3.lt(_rightValue3);
  9681. }
  9682. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9683. case 63:
  9684. _leftValue4 = left.get();
  9685. _rightValue4 = right.get();
  9686. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9687. result = _leftValue4.length <= _rightValue4.length;
  9688. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9689. result = _leftValue4.charCodeAt(0) <= _rightValue4.charCodeAt(0);
  9690. } else {
  9691. if (shouldImplicitCast) {
  9692. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9693. _leftValue4 = _leftValue4.trunc();
  9694. _rightValue4 = _rightValue4.trunc();
  9695. }
  9696. result = _leftValue4.lte(_rightValue4);
  9697. }
  9698. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9699. case 67:
  9700. _leftValue5 = left.get();
  9701. _rightValue5 = right.get();
  9702. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9703. if (shouldImplicitCast) {
  9704. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9705. _leftValue5 = _leftValue5.trunc();
  9706. _rightValue5 = _rightValue5.trunc();
  9707. }
  9708. result = _leftValue5.eq(_rightValue5);
  9709. } else {
  9710. result = _leftValue5 === _rightValue5;
  9711. }
  9712. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9713. case 71:
  9714. _leftValue6 = left.get();
  9715. _rightValue6 = right.get();
  9716. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9717. if (shouldImplicitCast) {
  9718. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9719. _leftValue6 = _leftValue6.trunc();
  9720. _rightValue6 = _rightValue6.trunc();
  9721. }
  9722. result = !_leftValue6.eq(_rightValue6);
  9723. } else {
  9724. result = _leftValue6 !== _rightValue6;
  9725. }
  9726. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9727. case 75:
  9728. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() && right.get()));
  9729. case 76:
  9730. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() || right.get()));
  9731. case 77:
  9732. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid InfixApp " + infixApp.op);
  9733. case 78:
  9734. case "end":
  9735. return _context31.stop();
  9736. }
  9737. }
  9738. }, _callee31, this);
  9739. }));
  9740. function evaluateInfixApp(_x75, _x76) {
  9741. return _evaluateInfixApp.apply(this, arguments);
  9742. }
  9743. return evaluateInfixApp;
  9744. }()
  9745. }]);
  9746. return IVProgProcessor;
  9747. }();
  9748. /***/ }),
  9749. /***/ "./js/processor/lib/arrays.js":
  9750. /*!************************************!*\
  9751. !*** ./js/processor/lib/arrays.js ***!
  9752. \************************************/
  9753. /*! exports provided: createNumElementsFun, createMatrixLinesFun, createMatrixColumnsFun */
  9754. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9755. "use strict";
  9756. __webpack_require__.r(__webpack_exports__);
  9757. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumElementsFun", function() { return createNumElementsFun; });
  9758. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixLinesFun", function() { return createMatrixLinesFun; });
  9759. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixColumnsFun", function() { return createMatrixColumnsFun; });
  9760. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9761. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9762. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9763. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9764. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9765. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9766. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  9767. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9768. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  9769. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__);
  9770. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9771. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  9772. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9773. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  9774. /**
  9775. * num_elements
  9776. * matrix_lines
  9777. * matrix_columns
  9778. */
  9779. function createNumElementsFun() {
  9780. var numElementsFun = /*#__PURE__*/function () {
  9781. 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, _) {
  9782. var vector, temp;
  9783. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9784. while (1) {
  9785. switch (_context.prev = _context.next) {
  9786. case 0:
  9787. vector = sto.applyStore("vector");
  9788. 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));
  9789. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9790. sto.insertStore("$", temp);
  9791. return _context.abrupt("return", sto);
  9792. case 5:
  9793. case "end":
  9794. return _context.stop();
  9795. }
  9796. }
  9797. }, _callee);
  9798. }));
  9799. return function numElementsFun(_x, _x2) {
  9800. return _ref.apply(this, arguments);
  9801. };
  9802. }();
  9803. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](numElementsFun)]);
  9804. 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);
  9805. return func;
  9806. }
  9807. function createMatrixLinesFun() {
  9808. var matrixLinesFun = /*#__PURE__*/function () {
  9809. 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, _) {
  9810. var matrix, temp;
  9811. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9812. while (1) {
  9813. switch (_context2.prev = _context2.next) {
  9814. case 0:
  9815. matrix = sto.applyStore("matrix");
  9816. 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));
  9817. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9818. sto.insertStore("$", temp);
  9819. return _context2.abrupt("return", sto);
  9820. case 5:
  9821. case "end":
  9822. return _context2.stop();
  9823. }
  9824. }
  9825. }, _callee2);
  9826. }));
  9827. return function matrixLinesFun(_x3, _x4) {
  9828. return _ref2.apply(this, arguments);
  9829. };
  9830. }();
  9831. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixLinesFun)]);
  9832. 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);
  9833. return func;
  9834. }
  9835. function createMatrixColumnsFun() {
  9836. var matrixColumnsFun = /*#__PURE__*/function () {
  9837. 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, _) {
  9838. var matrix, temp;
  9839. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  9840. while (1) {
  9841. switch (_context3.prev = _context3.next) {
  9842. case 0:
  9843. matrix = sto.applyStore("matrix");
  9844. 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));
  9845. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9846. sto.insertStore("$", temp);
  9847. return _context3.abrupt("return", sto);
  9848. case 5:
  9849. case "end":
  9850. return _context3.stop();
  9851. }
  9852. }
  9853. }, _callee3);
  9854. }));
  9855. return function matrixColumnsFun(_x5, _x6) {
  9856. return _ref3.apply(this, arguments);
  9857. };
  9858. }();
  9859. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixColumnsFun)]);
  9860. 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);
  9861. return func;
  9862. }
  9863. /***/ }),
  9864. /***/ "./js/processor/lib/io.js":
  9865. /*!********************************!*\
  9866. !*** ./js/processor/lib/io.js ***!
  9867. \********************************/
  9868. /*! exports provided: createOutputFun, createInputFun */
  9869. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9870. "use strict";
  9871. __webpack_require__.r(__webpack_exports__);
  9872. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createOutputFun", function() { return createOutputFun; });
  9873. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInputFun", function() { return createInputFun; });
  9874. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9875. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9876. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9877. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9878. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9879. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9880. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_3__);
  9881. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9882. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9883. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__);
  9884. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9885. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9886. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  9887. function createOutputFun() {
  9888. var writeFunction = /*#__PURE__*/function () {
  9889. 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, _) {
  9890. var totalSV, total, i, val;
  9891. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9892. while (1) {
  9893. switch (_context.prev = _context.next) {
  9894. case 0:
  9895. totalSV = store.applyStore("p1.0");
  9896. total = totalSV.get();
  9897. for (i = 1; i < total; i += 1) {
  9898. val = store.applyStore("p1.".concat(i));
  9899. this.output.sendOutput(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type));
  9900. }
  9901. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9902. return _context.abrupt("return", store);
  9903. case 5:
  9904. case "end":
  9905. return _context.stop();
  9906. }
  9907. }
  9908. }, _callee, this);
  9909. }));
  9910. return function writeFunction(_x, _x2) {
  9911. return _ref.apply(this, arguments);
  9912. };
  9913. }();
  9914. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](writeFunction)]);
  9915. 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);
  9916. return func;
  9917. }
  9918. function createInputFun() {
  9919. var readFunction = /*#__PURE__*/function () {
  9920. 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, _) {
  9921. var text, typeToConvert, type, result, stringInfo, realObject, arrayInfo, dim, stoValue;
  9922. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9923. while (1) {
  9924. switch (_context2.prev = _context2.next) {
  9925. case 0:
  9926. _context2.next = 2;
  9927. return this.input.requestInput();
  9928. case 2:
  9929. text = _context2.sent;
  9930. typeToConvert = store.applyStore("p1").type;
  9931. type = null;
  9932. result = null;
  9933. _context2.prev = 6;
  9934. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER)) {
  9935. _context2.next = 12;
  9936. break;
  9937. }
  9938. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"](text.trim()).trunc();
  9939. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER;
  9940. _context2.next = 33;
  9941. break;
  9942. case 12:
  9943. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL)) {
  9944. _context2.next = 17;
  9945. break;
  9946. }
  9947. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toReal"](text.trim());
  9948. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL;
  9949. _context2.next = 33;
  9950. break;
  9951. case 17:
  9952. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN)) {
  9953. _context2.next = 22;
  9954. break;
  9955. }
  9956. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toBool"](text.trim());
  9957. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN;
  9958. _context2.next = 33;
  9959. break;
  9960. case 22:
  9961. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING)) {
  9962. _context2.next = 27;
  9963. break;
  9964. }
  9965. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toString"](text);
  9966. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING;
  9967. _context2.next = 33;
  9968. break;
  9969. case 27:
  9970. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR)) {
  9971. _context2.next = 32;
  9972. break;
  9973. }
  9974. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toChar"](text);
  9975. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR;
  9976. _context2.next = 33;
  9977. break;
  9978. case 32:
  9979. throw new Error("!!!!Critical error: Unknown type in readFunction!!!!");
  9980. case 33:
  9981. _context2.next = 47;
  9982. break;
  9983. case 35:
  9984. _context2.prev = 35;
  9985. _context2.t0 = _context2["catch"](6);
  9986. if (!(this.mode == _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].ABORT)) {
  9987. _context2.next = 40;
  9988. break;
  9989. }
  9990. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9991. return _context2.abrupt("return", store);
  9992. case 40:
  9993. stringInfo = typeToConvert.stringInfo()[0];
  9994. realObject = store.getStoreObject("p1");
  9995. if (!(realObject.getReferenceDimension() > 0)) {
  9996. _context2.next = 46;
  9997. break;
  9998. }
  9999. arrayInfo = realObject.type.stringInfo()[0];
  10000. dim = realObject.getReferenceDimension();
  10001. 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());
  10002. case 46:
  10003. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__["ProcessorErrorFactory"].invalid_read_type(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), this.function_call_stack.pop());
  10004. case 47:
  10005. stoValue = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](type, result);
  10006. store.updateStore("p1", stoValue);
  10007. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  10008. return _context2.abrupt("return", store);
  10009. case 51:
  10010. case "end":
  10011. return _context2.stop();
  10012. }
  10013. }
  10014. }, _callee2, this, [[6, 35]]);
  10015. }));
  10016. return function readFunction(_x3, _x4) {
  10017. return _ref2.apply(this, arguments);
  10018. };
  10019. }();
  10020. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](readFunction)]);
  10021. 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);
  10022. return func;
  10023. }
  10024. /***/ }),
  10025. /***/ "./js/processor/lib/lang.js":
  10026. /*!**********************************!*\
  10027. !*** ./js/processor/lib/lang.js ***!
  10028. \**********************************/
  10029. /*! exports provided: createIsRealFun, createIsIntFun, createIsBoolFun, createCastRealFun, createCastIntFun, createCastBoolFun, createCastStringFun, createCastCharFun */
  10030. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10031. "use strict";
  10032. __webpack_require__.r(__webpack_exports__);
  10033. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsRealFun", function() { return createIsRealFun; });
  10034. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsIntFun", function() { return createIsIntFun; });
  10035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsBoolFun", function() { return createIsBoolFun; });
  10036. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastRealFun", function() { return createCastRealFun; });
  10037. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastIntFun", function() { return createCastIntFun; });
  10038. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastBoolFun", function() { return createCastBoolFun; });
  10039. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastStringFun", function() { return createCastStringFun; });
  10040. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastCharFun", function() { return createCastCharFun; });
  10041. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10042. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  10043. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10044. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  10045. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10046. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10047. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  10048. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10049. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  10050. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  10051. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10052. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_7__);
  10053. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  10054. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__);
  10055. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10056. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10057. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  10058. /**
  10059. *
  10060. * is_real
  10061. * is_int
  10062. * is_bool
  10063. * cast_real
  10064. * cast_int
  10065. * cast_bool
  10066. * cast_string
  10067. * cast_char
  10068. */
  10069. function createIsRealFun() {
  10070. var isRealFun = /*#__PURE__*/function () {
  10071. 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, _) {
  10072. var str, parser, result, val, temp;
  10073. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  10074. while (1) {
  10075. switch (_context.prev = _context.next) {
  10076. case 0:
  10077. str = sto.applyStore("str");
  10078. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  10079. result = false;
  10080. try {
  10081. val = parser.parseTerm();
  10082. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"]) {
  10083. result = true;
  10084. }
  10085. } catch (error) {// ignore
  10086. }
  10087. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  10088. sto.insertStore("$", temp);
  10089. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10090. return _context.abrupt("return", sto);
  10091. case 8:
  10092. case "end":
  10093. return _context.stop();
  10094. }
  10095. }
  10096. }, _callee);
  10097. }));
  10098. return function isRealFun(_x, _x2) {
  10099. return _ref.apply(this, arguments);
  10100. };
  10101. }();
  10102. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isRealFun)]);
  10103. 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);
  10104. return func;
  10105. }
  10106. function createIsIntFun() {
  10107. var isIntFun = /*#__PURE__*/function () {
  10108. 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, _) {
  10109. var str, parser, result, val, temp;
  10110. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  10111. while (1) {
  10112. switch (_context2.prev = _context2.next) {
  10113. case 0:
  10114. str = sto.applyStore("str");
  10115. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  10116. result = false;
  10117. try {
  10118. val = parser.parseTerm();
  10119. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"]) {
  10120. result = true;
  10121. }
  10122. } catch (_unused) {// ignore
  10123. }
  10124. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  10125. sto.insertStore("$", temp);
  10126. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10127. return _context2.abrupt("return", sto);
  10128. case 8:
  10129. case "end":
  10130. return _context2.stop();
  10131. }
  10132. }
  10133. }, _callee2);
  10134. }));
  10135. return function isIntFun(_x3, _x4) {
  10136. return _ref2.apply(this, arguments);
  10137. };
  10138. }();
  10139. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isIntFun)]);
  10140. 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);
  10141. return func;
  10142. }
  10143. function createIsBoolFun() {
  10144. var isBoolFun = function isBoolFun(sto, _) {
  10145. var str = sto.applyStore("str");
  10146. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  10147. var result = false;
  10148. try {
  10149. var val = parser.parseTerm();
  10150. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"]) {
  10151. result = true;
  10152. }
  10153. } catch (error) {// ignore
  10154. }
  10155. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  10156. sto.insertStore("$", temp);
  10157. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10158. return sto;
  10159. };
  10160. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isBoolFun)]);
  10161. 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);
  10162. return func;
  10163. }
  10164. function createCastRealFun() {
  10165. var castRealFun = /*#__PURE__*/function () {
  10166. 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, _) {
  10167. var val, value, temp, parser, result, _temp, typeStringInfoArray, typeInfo;
  10168. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  10169. while (1) {
  10170. switch (_context3.prev = _context3.next) {
  10171. case 0:
  10172. val = sto.applyStore("val");
  10173. value = val.get();
  10174. _context3.t0 = val.type.ord;
  10175. _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;
  10176. break;
  10177. case 5:
  10178. value = value.toNumber();
  10179. 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));
  10180. sto.insertStore("$", temp);
  10181. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10182. return _context3.abrupt("return", sto);
  10183. case 10:
  10184. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  10185. _context3.prev = 11;
  10186. result = parser.parseTerm();
  10187. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"])) {
  10188. _context3.next = 18;
  10189. break;
  10190. }
  10191. _temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, result.value);
  10192. sto.insertStore("$", _temp);
  10193. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10194. return _context3.abrupt("return", sto);
  10195. case 18:
  10196. _context3.next = 22;
  10197. break;
  10198. case 20:
  10199. _context3.prev = 20;
  10200. _context3.t1 = _context3["catch"](11);
  10201. case 22:
  10202. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.stringInfo();
  10203. typeInfo = typeStringInfoArray[0];
  10204. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  10205. case 25:
  10206. case "end":
  10207. return _context3.stop();
  10208. }
  10209. }
  10210. }, _callee3, null, [[11, 20]]);
  10211. }));
  10212. return function castRealFun(_x5, _x6) {
  10213. return _ref3.apply(this, arguments);
  10214. };
  10215. }();
  10216. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castRealFun)]);
  10217. 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);
  10218. return func;
  10219. }
  10220. function createCastIntFun() {
  10221. var castIntFun = /*#__PURE__*/function () {
  10222. 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, _) {
  10223. var val, value, temp, _temp2, parser, result, _temp3, typeStringInfoArray, typeInfo;
  10224. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  10225. while (1) {
  10226. switch (_context4.prev = _context4.next) {
  10227. case 0:
  10228. val = sto.applyStore("val");
  10229. value = val.get();
  10230. _context4.t0 = val.type.ord;
  10231. _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;
  10232. break;
  10233. case 5:
  10234. value = value.toNumber();
  10235. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Math.floor(value));
  10236. sto.insertStore("$", temp);
  10237. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10238. return _context4.abrupt("return", sto);
  10239. case 10:
  10240. _temp2 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, value.charCodeAt(0));
  10241. sto.insertStore("$", _temp2);
  10242. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10243. return _context4.abrupt("return", sto);
  10244. case 14:
  10245. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  10246. _context4.prev = 15;
  10247. result = parser.parseTerm();
  10248. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"])) {
  10249. _context4.next = 22;
  10250. break;
  10251. }
  10252. _temp3 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, result.value);
  10253. sto.insertStore("$", _temp3);
  10254. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10255. return _context4.abrupt("return", sto);
  10256. case 22:
  10257. _context4.next = 26;
  10258. break;
  10259. case 24:
  10260. _context4.prev = 24;
  10261. _context4.t1 = _context4["catch"](15);
  10262. case 26:
  10263. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.stringInfo();
  10264. typeInfo = typeStringInfoArray[0];
  10265. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  10266. case 29:
  10267. case "end":
  10268. return _context4.stop();
  10269. }
  10270. }
  10271. }, _callee4, null, [[15, 24]]);
  10272. }));
  10273. return function castIntFun(_x7, _x8) {
  10274. return _ref4.apply(this, arguments);
  10275. };
  10276. }();
  10277. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castIntFun)]);
  10278. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castInt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING]), 'val', false)], block);
  10279. return func;
  10280. }
  10281. function createCastBoolFun() {
  10282. var castBoolFun = /*#__PURE__*/function () {
  10283. 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, _) {
  10284. var str, value, parser, val, temp, typeStringInfoArray, typeInfo;
  10285. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  10286. while (1) {
  10287. switch (_context5.prev = _context5.next) {
  10288. case 0:
  10289. str = sto.applyStore("str");
  10290. value = str.get();
  10291. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  10292. _context5.prev = 3;
  10293. val = parser.parseTerm();
  10294. if (!(val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"])) {
  10295. _context5.next = 10;
  10296. break;
  10297. }
  10298. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, val.value);
  10299. sto.insertStore("$", temp);
  10300. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10301. return _context5.abrupt("return", sto);
  10302. case 10:
  10303. _context5.next = 14;
  10304. break;
  10305. case 12:
  10306. _context5.prev = 12;
  10307. _context5.t0 = _context5["catch"](3);
  10308. case 14:
  10309. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN.stringInfo();
  10310. typeInfo = typeStringInfoArray[0];
  10311. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  10312. case 17:
  10313. case "end":
  10314. return _context5.stop();
  10315. }
  10316. }
  10317. }, _callee5, null, [[3, 12]]);
  10318. }));
  10319. return function castBoolFun(_x9, _x10) {
  10320. return _ref5.apply(this, arguments);
  10321. };
  10322. }();
  10323. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castBoolFun)]);
  10324. 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);
  10325. return func;
  10326. }
  10327. function createCastStringFun() {
  10328. var castStringFun = /*#__PURE__*/function () {
  10329. 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, _) {
  10330. var val, result, temp;
  10331. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee6$(_context6) {
  10332. while (1) {
  10333. switch (_context6.prev = _context6.next) {
  10334. case 0:
  10335. val = store.applyStore('str');
  10336. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type);
  10337. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  10338. store.insertStore("$", temp);
  10339. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10340. return _context6.abrupt("return", store);
  10341. case 6:
  10342. case "end":
  10343. return _context6.stop();
  10344. }
  10345. }
  10346. }, _callee6);
  10347. }));
  10348. return function castStringFun(_x11, _x12) {
  10349. return _ref6.apply(this, arguments);
  10350. };
  10351. }();
  10352. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castStringFun)]);
  10353. 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);
  10354. return func;
  10355. }
  10356. function createCastCharFun() {
  10357. var castCharFun = function castCharFun(store, _) {
  10358. var valSV = store.applyStore('charCode'); // Force the int value to the range [0, 255]
  10359. var value = valSV.get().toNumber() & 0xFF;
  10360. var result = String.fromCharCode(value);
  10361. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, result);
  10362. store.insertStore("$", temp);
  10363. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10364. return store;
  10365. };
  10366. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castCharFun)]);
  10367. 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);
  10368. return func;
  10369. }
  10370. /***/ }),
  10371. /***/ "./js/processor/lib/math.js":
  10372. /*!**********************************!*\
  10373. !*** ./js/processor/lib/math.js ***!
  10374. \**********************************/
  10375. /*! exports provided: createSinFun, createCosFun, createTanFun, createSqrtFun, createPowFun, createLogFun, createAbsFun, createNegateFun, createInvertFun, createMaxFun, createMinFun, createRandFun, createSetSeedFun */
  10376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10377. "use strict";
  10378. __webpack_require__.r(__webpack_exports__);
  10379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSinFun", function() { return createSinFun; });
  10380. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCosFun", function() { return createCosFun; });
  10381. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTanFun", function() { return createTanFun; });
  10382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSqrtFun", function() { return createSqrtFun; });
  10383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPowFun", function() { return createPowFun; });
  10384. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLogFun", function() { return createLogFun; });
  10385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAbsFun", function() { return createAbsFun; });
  10386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNegateFun", function() { return createNegateFun; });
  10387. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInvertFun", function() { return createInvertFun; });
  10388. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMaxFun", function() { return createMaxFun; });
  10389. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMinFun", function() { return createMinFun; });
  10390. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRandFun", function() { return createRandFun; });
  10391. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSetSeedFun", function() { return createSetSeedFun; });
  10392. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  10393. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  10394. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10395. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  10396. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10397. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  10398. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10399. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10400. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__);
  10401. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10402. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  10403. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_6__);
  10404. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  10405. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__);
  10406. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  10407. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  10408. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10409. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_9__);
  10410. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10411. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  10412. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10413. /**
  10414. * sin
  10415. * cos
  10416. * tan
  10417. * sqrt
  10418. * pow
  10419. * log
  10420. * abs
  10421. * negate
  10422. * invert
  10423. * max
  10424. * min
  10425. */
  10426. function convertToRadians(degrees) {
  10427. return degrees.times(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].acos(-1)).div(180);
  10428. }
  10429. function createSinFun() {
  10430. var sinFun = /*#__PURE__*/function () {
  10431. 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, _) {
  10432. var x, angle, result, temp;
  10433. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  10434. while (1) {
  10435. switch (_context.prev = _context.next) {
  10436. case 0:
  10437. x = sto.applyStore('x');
  10438. angle = x.get().mod(360);
  10439. result = null;
  10440. if (angle.eq(90)) {
  10441. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](1);
  10442. } else if (angle.eq(180)) {
  10443. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10444. } else if (angle.eq(270)) {
  10445. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10446. } else {
  10447. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].sin(convertToRadians(angle));
  10448. }
  10449. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10450. sto.insertStore("$", temp);
  10451. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10452. return _context.abrupt("return", sto);
  10453. case 8:
  10454. case "end":
  10455. return _context.stop();
  10456. }
  10457. }
  10458. }, _callee);
  10459. }));
  10460. return function sinFun(_x, _x2) {
  10461. return _ref.apply(this, arguments);
  10462. };
  10463. }();
  10464. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sinFun)]);
  10465. 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);
  10466. return func;
  10467. }
  10468. function createCosFun() {
  10469. var cosFun = /*#__PURE__*/function () {
  10470. 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, _) {
  10471. var x, angle, result, temp;
  10472. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  10473. while (1) {
  10474. switch (_context2.prev = _context2.next) {
  10475. case 0:
  10476. x = sto.applyStore('x');
  10477. angle = x.get().mod(360);
  10478. result = null;
  10479. if (angle.eq(90)) {
  10480. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10481. } else if (angle.eq(180)) {
  10482. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10483. } else if (angle.eq(270)) {
  10484. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10485. }
  10486. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].cos(convertToRadians(angle));
  10487. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10488. sto.insertStore("$", temp);
  10489. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10490. return _context2.abrupt("return", sto);
  10491. case 9:
  10492. case "end":
  10493. return _context2.stop();
  10494. }
  10495. }
  10496. }, _callee2);
  10497. }));
  10498. return function cosFun(_x3, _x4) {
  10499. return _ref2.apply(this, arguments);
  10500. };
  10501. }();
  10502. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](cosFun)]);
  10503. 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);
  10504. return func;
  10505. }
  10506. function createTanFun() {
  10507. var tanFun = /*#__PURE__*/function () {
  10508. 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, _) {
  10509. var x, angle, result, temp;
  10510. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  10511. while (1) {
  10512. switch (_context3.prev = _context3.next) {
  10513. case 0:
  10514. x = sto.applyStore('x');
  10515. angle = x.get().mod(360);
  10516. if (!(angle.eq(90) || angle.eq(270))) {
  10517. _context3.next = 4;
  10518. break;
  10519. }
  10520. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].undefined_tanget_value(x.get().toNumber(), this.function_call_stack.pop());
  10521. case 4:
  10522. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].tan(convertToRadians(angle));
  10523. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10524. sto.insertStore("$", temp);
  10525. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10526. return _context3.abrupt("return", sto);
  10527. case 9:
  10528. case "end":
  10529. return _context3.stop();
  10530. }
  10531. }
  10532. }, _callee3, this);
  10533. }));
  10534. return function tanFun(_x5, _x6) {
  10535. return _ref3.apply(this, arguments);
  10536. };
  10537. }();
  10538. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](tanFun)]);
  10539. 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);
  10540. return func;
  10541. }
  10542. function createSqrtFun() {
  10543. var sqrtFun = /*#__PURE__*/function () {
  10544. 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, _) {
  10545. var x, result, temp;
  10546. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  10547. while (1) {
  10548. switch (_context4.prev = _context4.next) {
  10549. case 0:
  10550. x = sto.applyStore('x');
  10551. if (!x.get().isNeg()) {
  10552. _context4.next = 3;
  10553. break;
  10554. }
  10555. return _context4.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_sqrt_value(this.function_call_stack.pop())));
  10556. case 3:
  10557. result = x.get().sqrt();
  10558. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10559. sto.insertStore("$", temp);
  10560. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10561. return _context4.abrupt("return", sto);
  10562. case 8:
  10563. case "end":
  10564. return _context4.stop();
  10565. }
  10566. }
  10567. }, _callee4, this);
  10568. }));
  10569. return function sqrtFun(_x7, _x8) {
  10570. return _ref4.apply(this, arguments);
  10571. };
  10572. }();
  10573. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sqrtFun)]);
  10574. 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);
  10575. return func;
  10576. }
  10577. function createPowFun() {
  10578. var powFun = /*#__PURE__*/function () {
  10579. 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, _) {
  10580. var x, y, result, temp;
  10581. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  10582. while (1) {
  10583. switch (_context5.prev = _context5.next) {
  10584. case 0:
  10585. x = sto.applyStore('x');
  10586. y = sto.applyStore('y');
  10587. result = x.get().pow(y.get());
  10588. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10589. sto.insertStore("$", temp);
  10590. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10591. return _context5.abrupt("return", sto);
  10592. case 7:
  10593. case "end":
  10594. return _context5.stop();
  10595. }
  10596. }
  10597. }, _callee5);
  10598. }));
  10599. return function powFun(_x9, _x10) {
  10600. return _ref5.apply(this, arguments);
  10601. };
  10602. }();
  10603. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](powFun)]);
  10604. 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);
  10605. return func;
  10606. }
  10607. function createLogFun() {
  10608. var logFun = /*#__PURE__*/function () {
  10609. 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, _) {
  10610. var x, result, temp;
  10611. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  10612. while (1) {
  10613. switch (_context6.prev = _context6.next) {
  10614. case 0:
  10615. x = sto.applyStore('x');
  10616. if (!x.get().isNegative()) {
  10617. _context6.next = 3;
  10618. break;
  10619. }
  10620. return _context6.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_log_value(this.function_call_stack.pop())));
  10621. case 3:
  10622. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].log10(x.get());
  10623. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10624. sto.insertStore("$", temp);
  10625. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10626. return _context6.abrupt("return", sto);
  10627. case 8:
  10628. case "end":
  10629. return _context6.stop();
  10630. }
  10631. }
  10632. }, _callee6, this);
  10633. }));
  10634. return function logFun(_x11, _x12) {
  10635. return _ref6.apply(this, arguments);
  10636. };
  10637. }();
  10638. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](logFun)]);
  10639. 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);
  10640. return func;
  10641. }
  10642. function createAbsFun() {
  10643. var absFun = /*#__PURE__*/function () {
  10644. 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, _) {
  10645. var x, result, temp;
  10646. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  10647. while (1) {
  10648. switch (_context7.prev = _context7.next) {
  10649. case 0:
  10650. x = sto.applyStore('x');
  10651. result = x.get().abs();
  10652. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10653. sto.insertStore("$", temp);
  10654. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10655. return _context7.abrupt("return", sto);
  10656. case 6:
  10657. case "end":
  10658. return _context7.stop();
  10659. }
  10660. }
  10661. }, _callee7);
  10662. }));
  10663. return function absFun(_x13, _x14) {
  10664. return _ref7.apply(this, arguments);
  10665. };
  10666. }();
  10667. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](absFun)]);
  10668. 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);
  10669. return func;
  10670. }
  10671. function createNegateFun() {
  10672. var negateFun = /*#__PURE__*/function () {
  10673. 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, _) {
  10674. var x, result, temp;
  10675. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  10676. while (1) {
  10677. switch (_context8.prev = _context8.next) {
  10678. case 0:
  10679. x = sto.applyStore('x');
  10680. result = x.get().negated();
  10681. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10682. sto.insertStore("$", temp);
  10683. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10684. return _context8.abrupt("return", sto);
  10685. case 6:
  10686. case "end":
  10687. return _context8.stop();
  10688. }
  10689. }
  10690. }, _callee8);
  10691. }));
  10692. return function negateFun(_x15, _x16) {
  10693. return _ref8.apply(this, arguments);
  10694. };
  10695. }();
  10696. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](negateFun)]);
  10697. 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);
  10698. return func;
  10699. }
  10700. function createInvertFun() {
  10701. var invertFun = /*#__PURE__*/function () {
  10702. 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, _) {
  10703. var x, result, temp;
  10704. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  10705. while (1) {
  10706. switch (_context9.prev = _context9.next) {
  10707. case 0:
  10708. x = sto.applyStore('x');
  10709. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__["toReal"](1).dividedBy(x.get());
  10710. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10711. sto.insertStore("$", temp);
  10712. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10713. return _context9.abrupt("return", sto);
  10714. case 6:
  10715. case "end":
  10716. return _context9.stop();
  10717. }
  10718. }
  10719. }, _callee9);
  10720. }));
  10721. return function invertFun(_x17, _x18) {
  10722. return _ref9.apply(this, arguments);
  10723. };
  10724. }();
  10725. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](invertFun)]);
  10726. 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);
  10727. return func;
  10728. }
  10729. function createMaxFun() {
  10730. var maxFun = /*#__PURE__*/function () {
  10731. 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, _) {
  10732. var x, numbers, result, temp;
  10733. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  10734. while (1) {
  10735. switch (_context10.prev = _context10.next) {
  10736. case 0:
  10737. x = sto.applyStore('x');
  10738. numbers = x.get().map(function (sto_addrs) {
  10739. return sto_addrs.get();
  10740. });
  10741. 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));
  10742. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10743. sto.insertStore("$", temp);
  10744. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10745. return _context10.abrupt("return", sto);
  10746. case 7:
  10747. case "end":
  10748. return _context10.stop();
  10749. }
  10750. }
  10751. }, _callee10);
  10752. }));
  10753. return function maxFun(_x19, _x20) {
  10754. return _ref10.apply(this, arguments);
  10755. };
  10756. }();
  10757. 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);
  10758. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](maxFun)]);
  10759. 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);
  10760. return func;
  10761. }
  10762. function createMinFun() {
  10763. var minFun = /*#__PURE__*/function () {
  10764. 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, _) {
  10765. var x, numbers, result, temp;
  10766. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  10767. while (1) {
  10768. switch (_context11.prev = _context11.next) {
  10769. case 0:
  10770. x = sto.applyStore('x');
  10771. numbers = x.get().map(function (sto_addrs) {
  10772. return sto_addrs.get();
  10773. });
  10774. 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));
  10775. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10776. sto.insertStore("$", temp);
  10777. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10778. return _context11.abrupt("return", sto);
  10779. case 7:
  10780. case "end":
  10781. return _context11.stop();
  10782. }
  10783. }
  10784. }, _callee11);
  10785. }));
  10786. return function minFun(_x21, _x22) {
  10787. return _ref11.apply(this, arguments);
  10788. };
  10789. }();
  10790. 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);
  10791. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](minFun)]);
  10792. 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);
  10793. return func;
  10794. }
  10795. var seed = Date.now();
  10796. function createRandFun() {
  10797. var a = 16807;
  10798. var m = 2147483647;
  10799. var c = 12345;
  10800. var randFun = /*#__PURE__*/function () {
  10801. 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, _) {
  10802. var val, temp;
  10803. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  10804. while (1) {
  10805. switch (_context12.prev = _context12.next) {
  10806. case 0:
  10807. seed = (a * seed + c) % m;
  10808. val = seed / (m - 1);
  10809. 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));
  10810. sto.insertStore("$", temp);
  10811. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10812. return _context12.abrupt("return", sto);
  10813. case 6:
  10814. case "end":
  10815. return _context12.stop();
  10816. }
  10817. }
  10818. }, _callee12);
  10819. }));
  10820. return function randFun(_x23, _x24) {
  10821. return _ref12.apply(this, arguments);
  10822. };
  10823. }();
  10824. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](randFun)]);
  10825. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$rand", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [], block);
  10826. return func;
  10827. }
  10828. function createSetSeedFun() {
  10829. var setSeedFun = /*#__PURE__*/function () {
  10830. 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, _) {
  10831. var value;
  10832. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  10833. while (1) {
  10834. switch (_context13.prev = _context13.next) {
  10835. case 0:
  10836. value = sto.applyStore("x");
  10837. seed = value.get().toNumber();
  10838. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10839. return _context13.abrupt("return", sto);
  10840. case 4:
  10841. case "end":
  10842. return _context13.stop();
  10843. }
  10844. }
  10845. }, _callee13);
  10846. }));
  10847. return function setSeedFun(_x25, _x26) {
  10848. return _ref13.apply(this, arguments);
  10849. };
  10850. }();
  10851. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](setSeedFun)]);
  10852. 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);
  10853. return func;
  10854. }
  10855. /***/ }),
  10856. /***/ "./js/processor/lib/strings.js":
  10857. /*!*************************************!*\
  10858. !*** ./js/processor/lib/strings.js ***!
  10859. \*************************************/
  10860. /*! exports provided: createSubstringFun, createLengthFun, createUppercaseFun, createLowercaseFun, createrCharAtFun */
  10861. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10862. "use strict";
  10863. __webpack_require__.r(__webpack_exports__);
  10864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSubstringFun", function() { return createSubstringFun; });
  10865. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLengthFun", function() { return createLengthFun; });
  10866. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUppercaseFun", function() { return createUppercaseFun; });
  10867. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLowercaseFun", function() { return createLowercaseFun; });
  10868. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createrCharAtFun", function() { return createrCharAtFun; });
  10869. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10870. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  10871. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10872. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  10873. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10874. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10875. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  10876. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10877. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10878. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_5__);
  10879. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10880. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_6__);
  10881. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10882. /*
  10883. * substring
  10884. * length
  10885. * uppercase
  10886. * lowercase
  10887. * charAt
  10888. **/
  10889. function createSubstringFun() {
  10890. var substringFun = /*#__PURE__*/function () {
  10891. 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, _) {
  10892. var str, start, end, result, temp;
  10893. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  10894. while (1) {
  10895. switch (_context.prev = _context.next) {
  10896. case 0:
  10897. str = sto.applyStore("str");
  10898. start = sto.applyStore("start");
  10899. end = sto.applyStore("end");
  10900. result = str.get().substring(start.get(), end.get());
  10901. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  10902. sto.insertStore("$", temp);
  10903. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10904. return _context.abrupt("return", sto);
  10905. case 8:
  10906. case "end":
  10907. return _context.stop();
  10908. }
  10909. }
  10910. }, _callee);
  10911. }));
  10912. return function substringFun(_x, _x2) {
  10913. return _ref.apply(this, arguments);
  10914. };
  10915. }();
  10916. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](substringFun)]);
  10917. 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);
  10918. return func;
  10919. }
  10920. function createLengthFun() {
  10921. var lengthFun = /*#__PURE__*/function () {
  10922. 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, _) {
  10923. var str, temp;
  10924. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  10925. while (1) {
  10926. switch (_context2.prev = _context2.next) {
  10927. case 0:
  10928. str = sto.applyStore("str");
  10929. 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));
  10930. sto.insertStore("$", temp);
  10931. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10932. return _context2.abrupt("return", sto);
  10933. case 5:
  10934. case "end":
  10935. return _context2.stop();
  10936. }
  10937. }
  10938. }, _callee2);
  10939. }));
  10940. return function lengthFun(_x3, _x4) {
  10941. return _ref2.apply(this, arguments);
  10942. };
  10943. }();
  10944. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lengthFun)]);
  10945. 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);
  10946. return func;
  10947. }
  10948. function createUppercaseFun() {
  10949. var uppercaseFun = /*#__PURE__*/function () {
  10950. 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, _) {
  10951. var str, temp;
  10952. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  10953. while (1) {
  10954. switch (_context3.prev = _context3.next) {
  10955. case 0:
  10956. str = sto.applyStore("str");
  10957. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toUpperCase());
  10958. sto.insertStore("$", temp);
  10959. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10960. return _context3.abrupt("return", sto);
  10961. case 5:
  10962. case "end":
  10963. return _context3.stop();
  10964. }
  10965. }
  10966. }, _callee3);
  10967. }));
  10968. return function uppercaseFun(_x5, _x6) {
  10969. return _ref3.apply(this, arguments);
  10970. };
  10971. }();
  10972. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](uppercaseFun)]);
  10973. 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);
  10974. return func;
  10975. }
  10976. function createLowercaseFun() {
  10977. var lowercaseFun = /*#__PURE__*/function () {
  10978. 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, _) {
  10979. var str, temp;
  10980. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  10981. while (1) {
  10982. switch (_context4.prev = _context4.next) {
  10983. case 0:
  10984. str = sto.applyStore("str");
  10985. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toLowerCase());
  10986. sto.insertStore("$", temp);
  10987. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  10988. return _context4.abrupt("return", sto);
  10989. case 5:
  10990. case "end":
  10991. return _context4.stop();
  10992. }
  10993. }
  10994. }, _callee4);
  10995. }));
  10996. return function lowercaseFun(_x7, _x8) {
  10997. return _ref4.apply(this, arguments);
  10998. };
  10999. }();
  11000. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lowercaseFun)]);
  11001. 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);
  11002. return func;
  11003. }
  11004. function createrCharAtFun() {
  11005. var charAtFun = /*#__PURE__*/function () {
  11006. 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, _) {
  11007. var str, idx, temp;
  11008. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  11009. while (1) {
  11010. switch (_context5.prev = _context5.next) {
  11011. case 0:
  11012. str = sto.applyStore("str");
  11013. idx = sto.applyStore("index");
  11014. if (!(idx.get().toNumber() < 0 || idx.get().toNumber() >= str.get().length)) {
  11015. _context5.next = 4;
  11016. break;
  11017. }
  11018. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__["ProcessorErrorFactory"].invalid_string_index(idx.get().toNumber(), str.get(), this.function_call_stack.pop());
  11019. case 4:
  11020. 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()));
  11021. sto.insertStore("$", temp);
  11022. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  11023. return _context5.abrupt("return", sto);
  11024. case 8:
  11025. case "end":
  11026. return _context5.stop();
  11027. }
  11028. }
  11029. }, _callee5, this);
  11030. }));
  11031. return function charAtFun(_x9, _x10) {
  11032. return _ref5.apply(this, arguments);
  11033. };
  11034. }();
  11035. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](charAtFun)]);
  11036. 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);
  11037. return func;
  11038. }
  11039. /***/ }),
  11040. /***/ "./js/processor/modes.ts":
  11041. /*!*******************************!*\
  11042. !*** ./js/processor/modes.ts ***!
  11043. \*******************************/
  11044. /*! no static exports found */
  11045. /***/ (function(module, exports, __webpack_require__) {
  11046. "use strict";
  11047. Object.defineProperty(exports, "__esModule", { value: true });
  11048. exports.Modes = void 0;
  11049. exports.Modes = Object.freeze({
  11050. RETURN: Symbol('mode:return'),
  11051. BREAK: Symbol('mode:break'),
  11052. PAUSE: Symbol('mode:pause'),
  11053. RUN: Symbol('mode:run'),
  11054. ABORT: Symbol('mode:abort')
  11055. });
  11056. /***/ }),
  11057. /***/ "./js/processor/semantic/semanticAnalyser.js":
  11058. /*!***************************************************!*\
  11059. !*** ./js/processor/semantic/semanticAnalyser.js ***!
  11060. \***************************************************/
  11061. /*! exports provided: SemanticAnalyser */
  11062. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11063. "use strict";
  11064. __webpack_require__.r(__webpack_exports__);
  11065. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticAnalyser", function() { return SemanticAnalyser; });
  11066. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  11067. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  11068. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  11069. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  11070. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  11071. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../definedFunctions */ "./js/processor/definedFunctions.js");
  11072. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../services/languageService */ "./js/services/languageService.js");
  11073. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/commands */ "./js/ast/commands/index.js");
  11074. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  11075. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  11076. /* harmony import */ var _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ast/expressions/literal */ "./js/ast/expressions/literal.js");
  11077. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../compatibilityTable */ "./js/processor/compatibilityTable.ts");
  11078. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__);
  11079. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  11080. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__);
  11081. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11082. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__);
  11083. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  11084. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__);
  11085. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
  11086. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_13__);
  11087. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../store/store */ "./js/processor/store/store.ts");
  11088. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_14__);
  11089. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  11090. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  11091. var SemanticAnalyser = /*#__PURE__*/function () {
  11092. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, null, [{
  11093. key: "analyseFromSource",
  11094. value: function analyseFromSource(stringCode) {
  11095. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__["IVProgParser"].createParser(stringCode);
  11096. var semantic = new SemanticAnalyser(parser.parseTree());
  11097. return semantic.analyseTree();
  11098. }
  11099. }]);
  11100. function SemanticAnalyser(ast) {
  11101. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticAnalyser);
  11102. this.ast = ast;
  11103. this.lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_4__["LanguageService"].getCurrentLexer();
  11104. var lexer = new this.lexerClass(null);
  11105. this.literalNames = lexer.literalNames;
  11106. this.symbolMap = null;
  11107. this.currentFunction = null;
  11108. }
  11109. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, [{
  11110. key: "pushMap",
  11111. value: function pushMap() {
  11112. if (this.symbolMap === null) {
  11113. this.symbolMap = {
  11114. map: {},
  11115. next: null
  11116. };
  11117. } else {
  11118. var n = {
  11119. map: {},
  11120. next: this.symbolMap
  11121. };
  11122. this.symbolMap = n;
  11123. }
  11124. }
  11125. }, {
  11126. key: "popMap",
  11127. value: function popMap() {
  11128. if (this.symbolMap !== null) {
  11129. this.symbolMap = this.symbolMap.next;
  11130. }
  11131. }
  11132. }, {
  11133. key: "insertSymbol",
  11134. value: function insertSymbol(id, typeInfo) {
  11135. this.symbolMap.map[id] = typeInfo;
  11136. }
  11137. }, {
  11138. key: "findSymbol",
  11139. value: function findSymbol(id, symbol_map) {
  11140. if (!symbol_map.map[id]) {
  11141. if (symbol_map.next) {
  11142. return this.findSymbol(id, symbol_map.next);
  11143. }
  11144. return null;
  11145. } else {
  11146. return symbol_map.map[id];
  11147. }
  11148. }
  11149. }, {
  11150. key: "getMainFunction",
  11151. value: function getMainFunction() {
  11152. return this.ast.functions.find(function (v) {
  11153. return v.isMain;
  11154. });
  11155. }
  11156. }, {
  11157. key: "findFunction",
  11158. value: function findFunction(name) {
  11159. if (name.match(/^\$.+$/)) {
  11160. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getFunction(name);
  11161. if (!fun) {
  11162. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].not_implemented(name);
  11163. }
  11164. return fun;
  11165. } else {
  11166. var val = this.ast.functions.find(function (v) {
  11167. return v.name === name;
  11168. });
  11169. if (!val) {
  11170. return null;
  11171. }
  11172. return val;
  11173. }
  11174. }
  11175. }, {
  11176. key: "analyseTree",
  11177. value: function analyseTree() {
  11178. var globalVars = this.ast.global;
  11179. this.pushMap();
  11180. this.assertDeclarations(globalVars);
  11181. var functions = this.ast.functions;
  11182. var mainFunc = functions.filter(function (f) {
  11183. return f.name === null;
  11184. });
  11185. if (mainFunc.length <= 0) {
  11186. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].main_missing();
  11187. }
  11188. for (var i = 0; i < functions.length; i++) {
  11189. var fun = functions[i];
  11190. this.assertFunction(fun);
  11191. }
  11192. return this.ast;
  11193. }
  11194. }, {
  11195. key: "assertDeclarations",
  11196. value: function assertDeclarations(list) {
  11197. for (var i = 0; i < list.length; i++) {
  11198. this.assertDeclaration(list[i]);
  11199. }
  11200. }
  11201. }, {
  11202. key: "assertDeclaration",
  11203. value: function assertDeclaration(declaration) {
  11204. if (declaration instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]) {
  11205. this.assertArrayDeclaration(declaration);
  11206. this.insertSymbol(declaration.id, {
  11207. id: declaration.id,
  11208. lines: declaration.lines,
  11209. columns: declaration.columns,
  11210. type: declaration.type,
  11211. isConst: declaration.isConst
  11212. });
  11213. } else {
  11214. if (declaration.initial === null) {
  11215. this.insertSymbol(declaration.id, {
  11216. id: declaration.id,
  11217. type: declaration.type,
  11218. isConst: declaration.isConst
  11219. });
  11220. return;
  11221. }
  11222. var resultType = this.evaluateExpressionType(declaration.initial);
  11223. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11224. if (!resultType.isCompatible(declaration.type)) {
  11225. var stringInfo = declaration.type.stringInfo();
  11226. var info = stringInfo[0];
  11227. var result_string_info = resultType.stringInfo();
  11228. var result_info = result_string_info[0];
  11229. var exp = declaration.initial;
  11230. 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);
  11231. }
  11232. this.insertSymbol(declaration.id, {
  11233. id: declaration.id,
  11234. type: declaration.type,
  11235. isConst: declaration.isConst
  11236. });
  11237. } 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)) {
  11238. var _stringInfo = declaration.type.stringInfo();
  11239. var _info = _stringInfo[0];
  11240. var _result_string_info = resultType.stringInfo();
  11241. var _result_info = _result_string_info[0];
  11242. var _exp = declaration.initial;
  11243. 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);
  11244. } else {
  11245. this.insertSymbol(declaration.id, {
  11246. id: declaration.id,
  11247. type: declaration.type,
  11248. isConst: declaration.isConst
  11249. });
  11250. }
  11251. }
  11252. }
  11253. }, {
  11254. key: "assertArrayDeclaration",
  11255. value: function assertArrayDeclaration(declaration) {
  11256. if (declaration.initial === null) {
  11257. var lineType = this.evaluateExpressionType(declaration.lines);
  11258. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11259. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  11260. }
  11261. if (declaration.columns !== null) {
  11262. var columnType = this.evaluateExpressionType(declaration.columns);
  11263. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11264. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  11265. }
  11266. }
  11267. } else {
  11268. this.evaluateArrayLiteral(declaration);
  11269. }
  11270. this.insertSymbol(declaration.id, {
  11271. id: declaration.id,
  11272. lines: declaration.lines,
  11273. columns: declaration.columns,
  11274. type: declaration.type
  11275. });
  11276. return;
  11277. }
  11278. }, {
  11279. key: "evaluateExpressionType",
  11280. value: function evaluateExpressionType(expression) {
  11281. // TODO: Throw operator error in case type == UNDEFINED
  11282. if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["UnaryApp"]) {
  11283. var op = expression.op;
  11284. var resultType = this.evaluateExpressionType(expression.left);
  11285. var finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterUnaryOp"])(op, resultType);
  11286. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(finalResult)) {
  11287. var stringInfo = resultType.stringInfo();
  11288. var info = stringInfo[0];
  11289. var expString = expression.toString();
  11290. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_unary_op_full(expString, op, info.type, info.dim, expression.sourceInfo);
  11291. }
  11292. return finalResult;
  11293. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["InfixApp"]) {
  11294. var _op = expression.op;
  11295. var resultTypeLeft = this.evaluateExpressionType(expression.left);
  11296. var resultTypeRight = this.evaluateExpressionType(expression.right);
  11297. var _finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterInfixOp"])(_op, resultTypeLeft, resultTypeRight);
  11298. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(_finalResult)) {
  11299. var stringInfoLeft = resultTypeLeft.stringInfo();
  11300. var infoLeft = stringInfoLeft[0];
  11301. var stringInfoRight = resultTypeRight.stringInfo();
  11302. var infoRight = stringInfoRight[0];
  11303. var _expString = expression.toString();
  11304. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_infix_op_full(_expString, _op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, expression.sourceInfo);
  11305. }
  11306. return _finalResult;
  11307. } else if (expression instanceof _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__["Literal"]) {
  11308. return this.evaluateLiteralType(expression);
  11309. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  11310. if (expression.isMainCall) {
  11311. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName(), expression.sourceInfo);
  11312. }
  11313. var fun = this.findFunction(expression.id);
  11314. if (fun === null) {
  11315. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(expression.id, expression.sourceInfo);
  11316. }
  11317. if (fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  11318. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(expression.id, expression.sourceInfo);
  11319. }
  11320. this.assertParameters(fun, expression.actualParameters);
  11321. return fun.returnType;
  11322. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"]) {
  11323. var arrayTypeInfo = this.findSymbol(expression.id, this.symbolMap);
  11324. if (arrayTypeInfo === null) {
  11325. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(expression.id, expression.sourceInfo);
  11326. }
  11327. if (!(arrayTypeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11328. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(expression.id, expression.sourceInfo);
  11329. }
  11330. var lineType = this.evaluateExpressionType(expression.line);
  11331. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11332. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  11333. }
  11334. if (expression.column !== null) {
  11335. if (arrayTypeInfo.columns === null) {
  11336. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(expression.id, expression.sourceInfo);
  11337. }
  11338. var columnType = this.evaluateExpressionType(expression.column);
  11339. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11340. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  11341. }
  11342. }
  11343. var arrType = arrayTypeInfo.type;
  11344. if (expression.column !== null) {
  11345. // indexing matrix
  11346. return arrType.innerType;
  11347. } else {
  11348. if (arrayTypeInfo.columns === null) {
  11349. return arrType.innerType;
  11350. }
  11351. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](arrType.innerType, 1);
  11352. }
  11353. }
  11354. }
  11355. }, {
  11356. key: "evaluateLiteralType",
  11357. value: function evaluateLiteralType(literal) {
  11358. if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["IntLiteral"]) {
  11359. return literal.type;
  11360. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["RealLiteral"]) {
  11361. return literal.type;
  11362. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["StringLiteral"]) {
  11363. return literal.type;
  11364. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["BoolLiteral"]) {
  11365. return literal.type;
  11366. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["CharLiteral"]) {
  11367. return literal.type;
  11368. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  11369. var typeInfo = this.findSymbol(literal.id, this.symbolMap);
  11370. if (typeInfo === null) {
  11371. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(literal.id, literal.sourceInfo);
  11372. }
  11373. if (typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11374. return typeInfo.type;
  11375. }
  11376. return typeInfo.type;
  11377. } else {
  11378. // console.warn("Evaluating type only for an array literal...");
  11379. var last = null;
  11380. if (literal.value.length === 1) {
  11381. last = this.evaluateExpressionType(literal.value[0]);
  11382. } else {
  11383. for (var i = 0; i < literal.value.length; i++) {
  11384. var e = this.evaluateExpressionType(literal.value[i]);
  11385. if (last === null) {
  11386. last = e;
  11387. } else if (!last.isCompatible(e)) {
  11388. var strInfo = last.stringInfo();
  11389. var info = strInfo[0];
  11390. var strExp = literal.toString();
  11391. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_array_full(strExp, info.type, info.dim, literal.sourceInfo);
  11392. }
  11393. }
  11394. }
  11395. if (last instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11396. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last.innerType, last.dimensions + 1);
  11397. }
  11398. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last, 1);
  11399. }
  11400. }
  11401. }, {
  11402. key: "evaluateArrayLiteral",
  11403. value: function evaluateArrayLiteral(arrayDeclaration) {
  11404. var type = arrayDeclaration.type;
  11405. var literal = arrayDeclaration.initial; // console.log(arrayDeclaration);
  11406. if (arrayDeclaration.isVector) {
  11407. this.evaluateVectorLiteralType(literal, type);
  11408. } else {
  11409. // TODO matrix type check
  11410. for (var i = 0; i < literal.lines; ++i) {
  11411. var line_literal = literal.value[i];
  11412. this.evaluateVectorLiteralType(line_literal, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](type.innerType, 1));
  11413. }
  11414. }
  11415. return true;
  11416. }
  11417. }, {
  11418. key: "assertFunction",
  11419. value: function assertFunction(fun) {
  11420. var _this = this;
  11421. this.pushMap();
  11422. this.currentFunction = fun;
  11423. fun.formalParameters.forEach(function (formalParam) {
  11424. if (formalParam.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11425. if (formalParam.type.dimensions > 1) {
  11426. _this.insertSymbol(formalParam.id, {
  11427. id: formalParam.id,
  11428. lines: -1,
  11429. columns: -1,
  11430. type: formalParam.type
  11431. });
  11432. } else {
  11433. _this.insertSymbol(formalParam.id, {
  11434. id: formalParam.id,
  11435. lines: -1,
  11436. columns: null,
  11437. type: formalParam.type
  11438. });
  11439. }
  11440. } else {
  11441. _this.insertSymbol(formalParam.id, {
  11442. id: formalParam.id,
  11443. type: formalParam.type
  11444. });
  11445. }
  11446. });
  11447. this.assertDeclarations(fun.variablesDeclarations);
  11448. var optional = fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID);
  11449. var valid = this.assertReturn(fun, optional);
  11450. if (!valid) {
  11451. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_no_return(fun.name);
  11452. }
  11453. this.popMap();
  11454. }
  11455. }, {
  11456. key: "assertReturn",
  11457. value: function assertReturn(fun, optional) {
  11458. var _this2 = this;
  11459. return fun.commands.reduce(function (last, next) {
  11460. return _this2.checkCommand(fun.returnType, next, optional) || last;
  11461. }, optional);
  11462. }
  11463. }, {
  11464. key: "checkCommand",
  11465. value: function checkCommand(type, cmd, optional) {
  11466. if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["While"]) {
  11467. var resultType = this.evaluateExpressionType(cmd.expression);
  11468. if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11469. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  11470. }
  11471. this.checkCommands(type, cmd.commands, optional);
  11472. return false;
  11473. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["For"]) {
  11474. var var_type = this.evaluateExpressionType(cmd.for_id);
  11475. if (!var_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11476. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_variable(cmd.for_id, cmd.sourceInfo);
  11477. }
  11478. var from_type = this.evaluateExpressionType(cmd.for_from);
  11479. if (!from_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11480. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_from(cmd.for_from, cmd.sourceInfo);
  11481. }
  11482. var to_type = this.evaluateExpressionType(cmd.for_to);
  11483. if (!to_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11484. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_to(cmd.for_to, cmd.sourceInfo);
  11485. }
  11486. if (cmd.for_pass != null) {
  11487. var pass_type = this.evaluateExpressionType(cmd.for_pass);
  11488. if (!pass_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11489. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_pass(cmd.for_pass, cmd.sourceInfo);
  11490. }
  11491. }
  11492. this.checkCommands(type, cmd.commands, optional);
  11493. return false;
  11494. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Switch"]) {
  11495. var sType = this.evaluateExpressionType(cmd.expression);
  11496. var result = optional;
  11497. var hasDefault = false;
  11498. for (var i = 0; i < cmd.cases.length; i++) {
  11499. var aCase = cmd.cases[i];
  11500. if (aCase.expression !== null) {
  11501. var caseType = this.evaluateExpressionType(aCase.expression);
  11502. if (!sType.isCompatible(caseType)) {
  11503. var strInfo = sType.stringInfo();
  11504. var info = strInfo[0];
  11505. var strExp = aCase.expression.toString();
  11506. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_case_type_full(strExp, info.type, info.dim, aCase.sourceInfo);
  11507. }
  11508. } else {
  11509. hasDefault = true;
  11510. }
  11511. result = result && this.checkCommands(type, aCase.commands, result);
  11512. }
  11513. return result && hasDefault;
  11514. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayIndexAssign"]) {
  11515. // TODO - rework!!!!!
  11516. var used_dims = 0;
  11517. var typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11518. if (typeInfo === null) {
  11519. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11520. }
  11521. if (typeInfo.isConst) {
  11522. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11523. }
  11524. if (!(typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11525. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  11526. }
  11527. var exp = cmd.expression;
  11528. var lineExp = cmd.line;
  11529. var lineType = this.evaluateExpressionType(lineExp);
  11530. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11531. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11532. }
  11533. used_dims += 1;
  11534. var columnExp = cmd.column;
  11535. if (typeInfo.columns === null && columnExp !== null) {
  11536. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(cmd.id, cmd.sourceInfo);
  11537. } else if (columnExp !== null) {
  11538. var columnType = this.evaluateExpressionType(columnExp);
  11539. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11540. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11541. }
  11542. used_dims += 1;
  11543. } // exp a single value exp or an array access
  11544. var exp_type = this.evaluateExpressionType(exp);
  11545. var access_type = typeInfo.type;
  11546. var compatible = false;
  11547. if (exp_type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11548. var _type = access_type;
  11549. if (access_type.dimensions - used_dims == 0) {
  11550. _type = access_type.innerType;
  11551. } else {
  11552. _type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](access_type.innerType, Math.max(0, access_type.dimensions - used_dims));
  11553. }
  11554. compatible = exp_type.isCompatible(_type);
  11555. } else {
  11556. compatible = access_type.canAccept(exp_type, used_dims);
  11557. }
  11558. if (!compatible) {
  11559. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(access_type, exp_type)) {
  11560. var access_type_string_info = access_type.stringInfo();
  11561. var access_type_info = access_type_string_info[0];
  11562. var exp_type_string_info = exp_type.stringInfo();
  11563. var exp_type_info = exp_type_string_info[0];
  11564. 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);
  11565. }
  11566. }
  11567. return optional;
  11568. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Assign"]) {
  11569. // TODO - rework since there is no literal array assignment
  11570. var _typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11571. if (_typeInfo === null) {
  11572. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11573. }
  11574. if (_typeInfo.isConst) {
  11575. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11576. }
  11577. var _exp2 = cmd.expression;
  11578. var _exp_type = this.evaluateExpressionType(_exp2);
  11579. if (_exp_type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11580. if (!(_typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11581. // TODO better error message
  11582. throw new Error("Cannot assign an array to a non-array variable ");
  11583. } // Both are arrays...
  11584. // if both don't have same dimensions and type, cannot perform assignment
  11585. if (!_exp_type.isCompatible(_typeInfo.type)) {
  11586. if (_exp_type.dimensions === _typeInfo.type.dimensions && !_exp_type.innerType.isCompatible(_typeInfo.type.innerType)) {
  11587. 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)) {
  11588. var stringInfo = _typeInfo.type.stringInfo();
  11589. var _info2 = stringInfo[0];
  11590. var _exp_type_string_info = _exp_type.stringInfo();
  11591. var _exp_type_info = _exp_type_string_info[0];
  11592. 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);
  11593. }
  11594. } else {
  11595. switch (_exp_type.dimensions) {
  11596. case 1:
  11597. {
  11598. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].vector_to_matrix_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11599. }
  11600. case 2:
  11601. {
  11602. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].matrix_to_vector_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11603. }
  11604. }
  11605. }
  11606. }
  11607. } else if (!_exp_type.isCompatible(_typeInfo.type)) {
  11608. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(_typeInfo.type, _exp_type)) {
  11609. var _stringInfo2 = _typeInfo.type.stringInfo();
  11610. var _info3 = _stringInfo2[0];
  11611. var _exp_type_string_info2 = _exp_type.stringInfo();
  11612. var _exp_type_info2 = _exp_type_string_info2[0];
  11613. 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);
  11614. }
  11615. }
  11616. return optional;
  11617. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Break"]) {
  11618. return optional;
  11619. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11620. var _resultType = this.evaluateExpressionType(cmd.condition);
  11621. if (!_resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11622. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  11623. }
  11624. if (cmd.ifFalse instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11625. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommand(type, cmd.ifFalse, optional);
  11626. } else if (cmd.ifFalse != null) {
  11627. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommands(type, cmd.ifFalse.commands, optional);
  11628. } else {
  11629. return this.checkCommands(type, cmd.ifTrue.commands, optional);
  11630. }
  11631. } else if (cmd instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  11632. var fun = null;
  11633. if (cmd.isMainCall) {
  11634. fun = this.getMainFunction();
  11635. } else {
  11636. fun = this.findFunction(cmd.id);
  11637. }
  11638. if (fun === null) {
  11639. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(cmd.id, cmd.sourceInfo);
  11640. }
  11641. this.assertParameters(fun, cmd.actualParameters);
  11642. return optional;
  11643. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Return"]) {
  11644. var funcName = this.currentFunction.isMain ? _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName() : this.currentFunction.name;
  11645. if (cmd.expression === null && !type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  11646. var _stringInfo3 = type.stringInfo();
  11647. var _info4 = _stringInfo3[0];
  11648. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_void_return_full(funcName, _info4.type, _info4.dim, cmd.sourceInfo);
  11649. } else if (cmd.expression !== null) {
  11650. var _resultType2 = this.evaluateExpressionType(cmd.expression);
  11651. if (!type.isCompatible(_resultType2)) {
  11652. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type, _resultType2)) {
  11653. var _stringInfo4 = type.stringInfo();
  11654. var _info5 = _stringInfo4[0];
  11655. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_return_type_full(funcName, _info5.type, _info5.dim, cmd.sourceInfo);
  11656. }
  11657. }
  11658. return true;
  11659. } else {
  11660. return true;
  11661. }
  11662. }
  11663. }
  11664. }, {
  11665. key: "checkCommands",
  11666. value: function checkCommands(type, cmds, optional) {
  11667. var _this3 = this;
  11668. return cmds.reduce(function (last, next) {
  11669. return _this3.checkCommand(type, next, optional) || last;
  11670. }, optional);
  11671. }
  11672. /**
  11673. *
  11674. * @param {import('./../../ast/commands/function').Function} fun
  11675. * @param {Expression[]} actualParametersList
  11676. */
  11677. }, {
  11678. key: "assertParameters",
  11679. value: function assertParameters(fun, actualParametersList) {
  11680. var parameterList = fun.formalParameters;
  11681. if (parameterList.length > actualParametersList.length || parameterList.length !== actualParametersList.length && !fun.hasVariadic()) {
  11682. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameters_size_full(fun.name, actualParametersList.length, fun.formalParameters.length, null);
  11683. }
  11684. for (var i = 0, j = 0; i < parameterList.length && j < actualParametersList.length; i += 1, j += 1) {
  11685. var formalParam = parameterList[i];
  11686. if (formalParam.variadic && i + 1 !== parameterList.length) {
  11687. throw "A function variadic parameter must be its last parameter!";
  11688. }
  11689. if (formalParam.variadic) {
  11690. j = this.assertVariadicParameter(fun, formalParam, j, actualParametersList);
  11691. } else {
  11692. var param = actualParametersList[j];
  11693. this.assertParameter(fun, formalParam, param);
  11694. }
  11695. }
  11696. }
  11697. }, {
  11698. key: "evaluateVectorLiteralType",
  11699. value: function evaluateVectorLiteralType(literal, type) {
  11700. // console.log(literal);
  11701. for (var i = 0; i < literal.value.length; i += 1) {
  11702. var exp = literal.value[i];
  11703. var expType = this.evaluateExpressionType(exp);
  11704. var compatible = false;
  11705. if (expType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11706. compatible = expType.isCompatible(type.innerType);
  11707. } else {
  11708. compatible = type.canAccept(expType, 1);
  11709. }
  11710. if (!compatible) {
  11711. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type.innerType, expType)) {
  11712. var stringInfo = type.stringInfo();
  11713. var info = stringInfo[0];
  11714. var result_string_info = expType.stringInfo();
  11715. var result_info = result_string_info[0];
  11716. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(info.type, 0, result_info.type, result_info.dim, exp.toString(), literal.sourceInfo);
  11717. }
  11718. }
  11719. }
  11720. return type;
  11721. }
  11722. /**
  11723. *
  11724. * @param {import('./../../ast/commands/function').Function} fun
  11725. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11726. * @param {number} index
  11727. * @param {Expression[]} actualParametersList
  11728. */
  11729. }, {
  11730. key: "assertVariadicParameter",
  11731. value: function assertVariadicParameter(fun, formalParam, index, actualParametersList) {
  11732. var i;
  11733. for (i = index; i < actualParametersList.length; i += 1) {
  11734. this.assertParameter(fun, formalParam, actualParametersList[i]);
  11735. }
  11736. return i - 1;
  11737. }
  11738. /**
  11739. *
  11740. * @param {import('./../../ast/commands/function').Function} fun
  11741. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11742. * @param {Expression} actualParameter
  11743. */
  11744. }, {
  11745. key: "assertParameter",
  11746. value: function assertParameter(fun, formalParam, actualParameter) {
  11747. // const id = formalParam.id;
  11748. if (formalParam.byRef) {
  11749. if (actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  11750. var variable = this.findSymbol(actualParameter.id, this.symbolMap);
  11751. if (variable.isConst) {
  11752. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_ref_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11753. }
  11754. } else if (!(actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"] || actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"])) {
  11755. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11756. }
  11757. }
  11758. var resultType = this.evaluateExpressionType(actualParameter);
  11759. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"] && formalParam.type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11760. var shared = 0;
  11761. for (var j = 0; j < resultType.types.length; ++j) {
  11762. var element = resultType.types[j];
  11763. if (formalParam.type.types.indexOf(element) !== -1) {
  11764. shared += 1;
  11765. }
  11766. }
  11767. if (shared <= 0) {
  11768. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11769. 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)) {
  11770. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11771. }
  11772. }
  11773. }
  11774. } else if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11775. if (!resultType.isCompatible(formalParam.type)) {
  11776. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11777. 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)) {
  11778. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11779. }
  11780. }
  11781. }
  11782. } else if (!formalParam.type.isCompatible(resultType)) {
  11783. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11784. if (!_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(formalParam.type, resultType)) {
  11785. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11786. }
  11787. }
  11788. }
  11789. }
  11790. }]);
  11791. return SemanticAnalyser;
  11792. }();
  11793. /***/ }),
  11794. /***/ "./js/processor/store/store.ts":
  11795. /*!*************************************!*\
  11796. !*** ./js/processor/store/store.ts ***!
  11797. \*************************************/
  11798. /*! no static exports found */
  11799. /***/ (function(module, exports, __webpack_require__) {
  11800. "use strict";
  11801. Object.defineProperty(exports, "__esModule", { value: true });
  11802. exports.Store = void 0;
  11803. /* eslint-disable @typescript-eslint/no-non-null-assertion */
  11804. const modes_1 = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  11805. const types_1 = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  11806. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  11807. const storeObjectRef_1 = __webpack_require__(/*! ./storeObjectRef */ "./js/processor/store/storeObjectRef.ts");
  11808. const array_type_1 = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11809. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  11810. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  11811. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  11812. const store_value_1 = __webpack_require__(/*! ./value/store_value */ "./js/processor/store/value/store_value.ts");
  11813. const store_value_address_1 = __webpack_require__(/*! ./value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
  11814. const store_value_ref_1 = __webpack_require__(/*! ./value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
  11815. const array_store_value_ref_1 = __webpack_require__(/*! ./value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
  11816. const store_object_array_ref_1 = __webpack_require__(/*! ./store_object_array_ref */ "./js/processor/store/store_object_array_ref.ts");
  11817. class Store {
  11818. constructor(name) {
  11819. this.name = name;
  11820. this.store = new Map();
  11821. this.mode = modes_1.Modes.RUN;
  11822. }
  11823. static canImplicitTypeCast(castType, sourceType) {
  11824. if (castType.isCompatible(types_1.Types.INTEGER) || castType.isCompatible(types_1.Types.REAL)) {
  11825. if (sourceType.isCompatible(types_1.Types.INTEGER) || sourceType.isCompatible(types_1.Types.REAL)) {
  11826. return true;
  11827. }
  11828. }
  11829. return false;
  11830. }
  11831. static doImplicitCasting(castType, stoObj) {
  11832. if (!Store.canImplicitTypeCast(castType, stoObj.type)) {
  11833. throw new Error("!!!Critical error: attempted to type cast invalid types");
  11834. }
  11835. if (castType.isCompatible(types_1.Types.INTEGER)) {
  11836. return new store_value_1.StoreValue(types_1.Types.INTEGER, stoObj.get().trunc());
  11837. }
  11838. else {
  11839. return new store_value_1.StoreValue(types_1.Types.REAL, stoObj.get());
  11840. }
  11841. }
  11842. extendStore(nextStore) {
  11843. this.nextStore = nextStore;
  11844. }
  11845. applyStore(id) {
  11846. if (!this.store.has(id)) {
  11847. if (this.nextStore != null) {
  11848. return this.nextStore.applyStore(id);
  11849. }
  11850. else {
  11851. throw new Error(`Variable ${id} not found.`);
  11852. }
  11853. }
  11854. const val = this.store.get(id);
  11855. let result = null;
  11856. if (val.type instanceof array_type_1.ArrayType) {
  11857. const array = val;
  11858. const array_type = array.type;
  11859. let l = 0, c = 0;
  11860. const values = array.value.map(v => {
  11861. if (array.isVector) {
  11862. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l++, undefined, array.id, array.readOnly);
  11863. }
  11864. else {
  11865. if (c >= array.columns) {
  11866. c = 0;
  11867. l += 1;
  11868. }
  11869. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l, c++, array.id, array.readOnly);
  11870. }
  11871. });
  11872. result = new array_store_value_1.ArrayStoreValue(array_type, values, array.lines, array.columns, val.id, val.readOnly);
  11873. }
  11874. else {
  11875. result = new store_value_1.StoreValue(val.type, val.value, val.id, val.readOnly);
  11876. }
  11877. return result;
  11878. }
  11879. updateStore(id, stoValue) {
  11880. if (!this.store.has(id)) {
  11881. if (this.nextStore != null) {
  11882. this.nextStore.updateStore(id, stoValue);
  11883. return this;
  11884. }
  11885. else {
  11886. // TODO: better error message
  11887. throw new Error(`Variable ${id} not found.`);
  11888. }
  11889. }
  11890. else {
  11891. const oldObj = this.store.get(id);
  11892. if (oldObj.readOnly) {
  11893. // TODO: better error message
  11894. throw new Error("Cannot change value of a read only variable: " + id);
  11895. }
  11896. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  11897. const array_value = stoValue;
  11898. if (oldObj.isCompatible(array_value)) {
  11899. if (oldObj.isVector) {
  11900. array_value.get().forEach((val, index) => {
  11901. oldObj.setAt(val, index, undefined);
  11902. });
  11903. }
  11904. else {
  11905. let line = 0;
  11906. let column = 0;
  11907. array_value.get().forEach((val) => {
  11908. oldObj.setAt(val, line, column);
  11909. column += 1;
  11910. if (column >= oldObj.columns) {
  11911. line += 1;
  11912. column = 0;
  11913. }
  11914. });
  11915. }
  11916. return this;
  11917. }
  11918. }
  11919. else if (oldObj.isCompatible(stoValue)) {
  11920. const loc_address = oldObj.locAddress;
  11921. location_1.Location.updateAddress(loc_address, stoValue.get());
  11922. return this;
  11923. }
  11924. const oldType = oldObj.type;
  11925. const stoType = stoValue.type;
  11926. // TODO: better error message
  11927. throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  11928. }
  11929. }
  11930. /**
  11931. * Method used to update regions of an array (vector or matrix). The should only be used when update an specific
  11932. * possition since it will only update the required addresses.
  11933. * @param {string} id the variable id to be updated
  11934. * @param {IStoreValue} sto_value the value to be used in the update process
  11935. * @param {number} line the line address of the vector/matrix
  11936. * @param {number} column the matrix column, which can be undefined
  11937. */
  11938. updateStoreArray(id, sto_value, line, column) {
  11939. if (!this.store.has(id)) {
  11940. if (this.nextStore != null) {
  11941. this.nextStore.updateStoreArray(id, sto_value, line, column);
  11942. return this;
  11943. }
  11944. else {
  11945. // TODO: better error message
  11946. throw new Error(`Variable ${id} not found.`);
  11947. }
  11948. }
  11949. else {
  11950. const oldObj = this.store.get(id);
  11951. if (oldObj.readOnly) {
  11952. // TODO: better error message
  11953. throw new Error("Cannot change value of a read only variable: " + id);
  11954. }
  11955. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  11956. if (sto_value instanceof array_store_value_1.ArrayStoreValue) {
  11957. // this must be a vector or matrix line update
  11958. const actual_values = sto_value.get();
  11959. if (oldObj.isVector && sto_value.isVector()) {
  11960. for (let i = 0; i < sto_value.lines; i += 1) {
  11961. const val = actual_values[i];
  11962. oldObj.setAt(val, i, undefined);
  11963. }
  11964. }
  11965. else if (!oldObj.isVector && column == null && sto_value.isVector()) {
  11966. for (let i = 0; i < oldObj.columns; i += 1) {
  11967. const val = actual_values[i];
  11968. oldObj.setAt(val, line, i);
  11969. }
  11970. }
  11971. else {
  11972. // TODO: better error message
  11973. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  11974. }
  11975. }
  11976. else {
  11977. if (!oldObj.isVector && column == null) {
  11978. // TODO: better error message
  11979. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  11980. }
  11981. oldObj.setAt(sto_value, line, column);
  11982. }
  11983. }
  11984. else {
  11985. throw new Error("Cannot update a non-array variable using updateStoreArray");
  11986. }
  11987. // const oldType = oldObj.type;
  11988. // const stoType = sto_value.type;
  11989. // // TODO: better error message
  11990. // throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  11991. return this;
  11992. }
  11993. }
  11994. /**
  11995. * Inserts a new variable into the Store. This method should be used when declaring a new variable,
  11996. * including the special return variable $.
  11997. * @param id variable id
  11998. * @param stoValue the value to be used as the initial value of id
  11999. */
  12000. insertStore(id, stoValue) {
  12001. if (this.store.has(id)) {
  12002. // TODO: better error message
  12003. throw new Error(`${id} is already defined`);
  12004. }
  12005. // TODO check for array....
  12006. let newObj;
  12007. if (stoValue instanceof store_value_ref_1.StoreValueRef) {
  12008. newObj = new storeObjectRef_1.StoreObjectRef(stoValue);
  12009. }
  12010. else if (stoValue instanceof array_store_value_ref_1.ArrayStoreValueRef) {
  12011. newObj = new store_object_array_ref_1.StoreObjectArrayRef(stoValue, stoValue.lines, stoValue.columns);
  12012. }
  12013. else if (stoValue instanceof array_store_value_1.ArrayStoreValue) {
  12014. const columns = stoValue.isVector() ? 0 : stoValue.columns;
  12015. const addresses = [];
  12016. const all_values = stoValue.get();
  12017. if (all_values.length > 0) {
  12018. for (let i = 0; i < stoValue.get().length; i += 1) {
  12019. const val = all_values[i].get();
  12020. addresses.push(location_1.Location.allocate(val));
  12021. }
  12022. }
  12023. else {
  12024. let total = stoValue.lines;
  12025. total = stoValue.isVector() ? total : total * columns;
  12026. for (let i = 0; i < total; i += 1) {
  12027. addresses.push(location_1.Location.allocate(null));
  12028. }
  12029. }
  12030. newObj = new storeObjectArray_1.StoreObjectArray(stoValue.type, stoValue.lines, columns, addresses, stoValue.isConst);
  12031. }
  12032. else {
  12033. const loc_address = location_1.Location.allocate(stoValue.get());
  12034. newObj = new storeObject_1.StoreObject(stoValue.type, loc_address, stoValue.isConst);
  12035. }
  12036. newObj.setID(id);
  12037. this.store.set(id, newObj);
  12038. return this;
  12039. }
  12040. /**
  12041. * Helper function similar to applyStore. But it returns the actual object in the store be it ref or not
  12042. * applyStore will return the refferenced object if the object in the store is a ref
  12043. */
  12044. getStoreObject(id) {
  12045. if (!this.store.has(id)) {
  12046. if (this.nextStore != null) {
  12047. return this.nextStore.getStoreObject(id);
  12048. }
  12049. else {
  12050. throw new Error(`Variable ${id} not found.`);
  12051. }
  12052. }
  12053. return this.store.get(id);
  12054. }
  12055. destroy() {
  12056. this.store.forEach(sto => sto.destroy(), this);
  12057. }
  12058. isDefined(id) {
  12059. if (!this.store.has(id)) {
  12060. if (this.nextStore != null) {
  12061. return this.nextStore.isDefined(id);
  12062. }
  12063. else {
  12064. return false;
  12065. }
  12066. }
  12067. return true;
  12068. }
  12069. }
  12070. exports.Store = Store;
  12071. /***/ }),
  12072. /***/ "./js/processor/store/storeObject.ts":
  12073. /*!*******************************************!*\
  12074. !*** ./js/processor/store/storeObject.ts ***!
  12075. \*******************************************/
  12076. /*! no static exports found */
  12077. /***/ (function(module, exports, __webpack_require__) {
  12078. "use strict";
  12079. Object.defineProperty(exports, "__esModule", { value: true });
  12080. exports.StoreObject = void 0;
  12081. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  12082. class StoreObject {
  12083. /**
  12084. *
  12085. * @param {Type} type
  12086. * @param {Number} loc_address
  12087. * @param {Boolean} readOnly
  12088. */
  12089. constructor(type, loc_address, readOnly = false) {
  12090. this._loc_address = loc_address;
  12091. this._type = type;
  12092. this._readOnly = readOnly;
  12093. this._id = undefined;
  12094. }
  12095. setID(id) {
  12096. this._id = id;
  12097. }
  12098. get id() {
  12099. return this._id;
  12100. }
  12101. get inStore() {
  12102. return this.id !== null;
  12103. }
  12104. get type() {
  12105. return this._type;
  12106. }
  12107. /**
  12108. * Returns the actual value stored at the loccation address present in this object.
  12109. * The returned value is compatible with @prop{StoreObject.type}
  12110. */
  12111. get value() {
  12112. const address = location_1.Location.find(this._loc_address);
  12113. if (address != null) {
  12114. return address.value;
  12115. }
  12116. else {
  12117. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  12118. }
  12119. }
  12120. get number() {
  12121. throw new Error("DOT NOT USE THIS PROPERTY!");
  12122. }
  12123. get readOnly() {
  12124. return this._readOnly;
  12125. }
  12126. set readOnly(value) {
  12127. this._readOnly = value;
  12128. }
  12129. isCompatible(another) {
  12130. return this.type.isCompatible(another.type);
  12131. }
  12132. destroy() {
  12133. return location_1.Location.deallocate(this._loc_address);
  12134. }
  12135. get locAddress() {
  12136. return this._loc_address;
  12137. }
  12138. }
  12139. exports.StoreObject = StoreObject;
  12140. /***/ }),
  12141. /***/ "./js/processor/store/storeObjectArray.ts":
  12142. /*!************************************************!*\
  12143. !*** ./js/processor/store/storeObjectArray.ts ***!
  12144. \************************************************/
  12145. /*! no static exports found */
  12146. /***/ (function(module, exports, __webpack_require__) {
  12147. "use strict";
  12148. Object.defineProperty(exports, "__esModule", { value: true });
  12149. exports.StoreObjectArray = void 0;
  12150. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  12151. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  12152. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  12153. class StoreObjectArray extends storeObject_1.StoreObject {
  12154. constructor(type, _lines, _columns, loc_addresses, readOnly = false) {
  12155. super(type, -1, readOnly);
  12156. this._lines = _lines;
  12157. this._columns = _columns;
  12158. this.loc_addresses = loc_addresses;
  12159. }
  12160. get lines() {
  12161. return this._lines;
  12162. }
  12163. get columns() {
  12164. return this._columns;
  12165. }
  12166. isCompatible(another) {
  12167. if (another instanceof array_store_value_1.ArrayStoreValue) {
  12168. const cols = another.columns == null ? 0 : another.columns;
  12169. if (this.lines === another.lines && this.columns === cols) {
  12170. return super.isCompatible(another);
  12171. }
  12172. }
  12173. return false;
  12174. }
  12175. get isVector() {
  12176. return this.type.dimensions === 1;
  12177. }
  12178. /**@override
  12179. * Returns the list of values stored by this array.
  12180. * All returned values are compatible with @prop{StoreObject.type}
  12181. */
  12182. get value() {
  12183. const values = [];
  12184. for (let i = 0; i < this.addresses.length; i += 1) {
  12185. const address = location_1.Location.find(this.addresses[i]);
  12186. if (address != null) {
  12187. values.push(address.value);
  12188. }
  12189. else {
  12190. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  12191. }
  12192. }
  12193. return values;
  12194. }
  12195. destroy() {
  12196. let bool = true;
  12197. for (let i = 0; i < this.addresses.length; i += 1) {
  12198. bool = bool && location_1.Location.deallocate(this.addresses[i]);
  12199. }
  12200. return bool;
  12201. }
  12202. /**
  12203. * @override
  12204. *
  12205. * Returns the address that contains a list of all addresses of the values present in the array
  12206. */
  12207. get locAddress() {
  12208. throw new Error("!!!Internal Error: Cannot invoke locAddress on StoreObjectArray");
  12209. }
  12210. get addresses() {
  12211. return this.loc_addresses;
  12212. }
  12213. getAt(line, column) {
  12214. if (this.isVector) {
  12215. if (column != null) {
  12216. throw new Error(this.id + " is not a matrix!");
  12217. }
  12218. column = line;
  12219. line = 0;
  12220. }
  12221. else if (column == null) {
  12222. // this is a whole line...
  12223. const values = [];
  12224. for (let col = 0; col < this.columns; col += 1) {
  12225. const index = this.getIndexOf(line, col);
  12226. const address = location_1.Location.find(this.addresses[index]);
  12227. values.push(address.value);
  12228. }
  12229. return values;
  12230. }
  12231. const index = this.getIndexOf(line, column);
  12232. const address = location_1.Location.find(this.addresses[index]);
  12233. return address.value;
  12234. }
  12235. setAt(value, line, column) {
  12236. let used_dims = 1;
  12237. if (column != null) {
  12238. used_dims += 1;
  12239. }
  12240. if (!this.type.canAccept(value.type, used_dims)) {
  12241. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  12242. }
  12243. if (this.isVector) {
  12244. if (column != null) {
  12245. throw new Error(this.id + " is not a matrix!");
  12246. }
  12247. column = line;
  12248. line = 0;
  12249. }
  12250. else if (column == null) {
  12251. throw new Error("!!!Internal Error: Attempting to insert a line into matrix " + this.id);
  12252. }
  12253. const pos = this.getIndexOf(line, column);
  12254. location_1.Location.updateAddress(this.addresses[pos], value.get());
  12255. }
  12256. getIndexOf(line, column) {
  12257. return line * this.columns + column;
  12258. }
  12259. getLocAddressOf(line, column) {
  12260. if (this.isVector) {
  12261. if (column != null) {
  12262. throw new Error(this.id + " is not a matrix!");
  12263. }
  12264. column = line;
  12265. line = 0;
  12266. }
  12267. else if (column == null) {
  12268. // this is a whole line...
  12269. const values = [];
  12270. for (let col = 0; col < this.columns; col += 1) {
  12271. const index = this.getIndexOf(line, col);
  12272. values.push(this.addresses[index]);
  12273. }
  12274. return values;
  12275. }
  12276. const index = this.getIndexOf(line, column);
  12277. return this.addresses[index];
  12278. }
  12279. }
  12280. exports.StoreObjectArray = StoreObjectArray;
  12281. /***/ }),
  12282. /***/ "./js/processor/store/storeObjectRef.ts":
  12283. /*!**********************************************!*\
  12284. !*** ./js/processor/store/storeObjectRef.ts ***!
  12285. \**********************************************/
  12286. /*! no static exports found */
  12287. /***/ (function(module, exports, __webpack_require__) {
  12288. "use strict";
  12289. Object.defineProperty(exports, "__esModule", { value: true });
  12290. exports.StoreObjectRef = void 0;
  12291. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  12292. class StoreObjectRef extends storeObject_1.StoreObject {
  12293. /**
  12294. *
  12295. * @param {StoreObject} stoValue
  12296. */
  12297. constructor(stoValue) {
  12298. super(stoValue.type, stoValue.getRefAddress(), false);
  12299. this.refObj = stoValue.id;
  12300. this.reference_dimension = stoValue.getReferenceDimension();
  12301. }
  12302. get isRef() {
  12303. return true;
  12304. }
  12305. getRefObj() {
  12306. return this.refObj;
  12307. }
  12308. getReferenceDimension() {
  12309. return this.reference_dimension;
  12310. }
  12311. destroy() {
  12312. return false;
  12313. }
  12314. }
  12315. exports.StoreObjectRef = StoreObjectRef;
  12316. /***/ }),
  12317. /***/ "./js/processor/store/store_object_array_ref.ts":
  12318. /*!******************************************************!*\
  12319. !*** ./js/processor/store/store_object_array_ref.ts ***!
  12320. \******************************************************/
  12321. /*! no static exports found */
  12322. /***/ (function(module, exports, __webpack_require__) {
  12323. "use strict";
  12324. Object.defineProperty(exports, "__esModule", { value: true });
  12325. exports.StoreObjectArrayRef = void 0;
  12326. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  12327. class StoreObjectArrayRef extends storeObjectArray_1.StoreObjectArray {
  12328. constructor(stoValue, lines, columns) {
  12329. super(stoValue.type, lines, columns, stoValue.getAddresses(), false);
  12330. this.refObj = stoValue.id;
  12331. }
  12332. get isRef() {
  12333. return true;
  12334. }
  12335. getRefObj() {
  12336. return this.refObj;
  12337. }
  12338. destroy() {
  12339. return false;
  12340. }
  12341. }
  12342. exports.StoreObjectArrayRef = StoreObjectArrayRef;
  12343. /***/ }),
  12344. /***/ "./js/processor/store/value/array_store_value.ts":
  12345. /*!*******************************************************!*\
  12346. !*** ./js/processor/store/value/array_store_value.ts ***!
  12347. \*******************************************************/
  12348. /*! no static exports found */
  12349. /***/ (function(module, exports, __webpack_require__) {
  12350. "use strict";
  12351. Object.defineProperty(exports, "__esModule", { value: true });
  12352. exports.ArrayStoreValue = void 0;
  12353. const array_type_1 = __webpack_require__(/*! ../../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  12354. const store_value_address_1 = __webpack_require__(/*! ./store_value_address */ "./js/processor/store/value/store_value_address.ts");
  12355. class ArrayStoreValue {
  12356. constructor(type, values, lines, columns, id, isConst = false) {
  12357. this.type = type;
  12358. this.id = id;
  12359. this.isConst = isConst;
  12360. this.values = values;
  12361. this.lines = lines;
  12362. this.columns = columns;
  12363. }
  12364. get() {
  12365. return this.values;
  12366. }
  12367. /**
  12368. * @deprecated
  12369. * Potential not necessary since array access is occuring directly in the StoreObject
  12370. * @param line
  12371. * @param column
  12372. */
  12373. getAt(line, column) {
  12374. console.log("Column ", column);
  12375. if (this.isVector()) {
  12376. if (column != null) {
  12377. throw new Error(this.id + " is not a matrix!");
  12378. }
  12379. column = line;
  12380. line = 0;
  12381. }
  12382. else if (column == null) {
  12383. const values = [];
  12384. for (let col = 0; col < this.columns; col += 1) {
  12385. const index = line * this.lines + col;
  12386. values.push(this.values[index]);
  12387. }
  12388. const array_type = this.type;
  12389. const vector_type = new array_type_1.ArrayType(array_type.innerType, array_type.dimensions - 1);
  12390. return new ArrayStoreValue(vector_type, values, this.columns, 0, this.id, this.isConst);
  12391. }
  12392. const index = line * this.lines + column;
  12393. console.log("Get at: ", index);
  12394. return this.values[index];
  12395. }
  12396. setAt(value, line, column) {
  12397. let used_dims = 1;
  12398. if (column != null) {
  12399. used_dims += 1;
  12400. }
  12401. let actual_line = line;
  12402. let actual_column = column;
  12403. if (!this.type.canAccept(value.type, used_dims)) {
  12404. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  12405. }
  12406. if (this.isVector()) {
  12407. if (column != null) {
  12408. throw new Error(this.id + " is not a matrix!");
  12409. }
  12410. actual_column = actual_line;
  12411. actual_line = 0;
  12412. }
  12413. else if (column == null) {
  12414. if (!(value instanceof ArrayStoreValue)) {
  12415. throw new Error("Attempting to insert a single value as a line of matrix " + this.id);
  12416. }
  12417. const actual_values = value.get();
  12418. for (let i = 0; i < this.columns; i += 1) {
  12419. const pos = actual_line * this.columns + i;
  12420. const val = actual_values[i];
  12421. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, val.get(), actual_line, i, this.id, this.isConst);
  12422. }
  12423. }
  12424. const columns = this.columns == null ? 0 : this.columns;
  12425. const pos = actual_line * columns + actual_column;
  12426. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, value.get(), line, column, this.id, this.isConst);
  12427. }
  12428. inStore() {
  12429. return this.id != null;
  12430. }
  12431. isVector() {
  12432. return this.type.dimensions == 1;
  12433. }
  12434. }
  12435. exports.ArrayStoreValue = ArrayStoreValue;
  12436. /***/ }),
  12437. /***/ "./js/processor/store/value/array_store_value_ref.ts":
  12438. /*!***********************************************************!*\
  12439. !*** ./js/processor/store/value/array_store_value_ref.ts ***!
  12440. \***********************************************************/
  12441. /*! no static exports found */
  12442. /***/ (function(module, exports, __webpack_require__) {
  12443. "use strict";
  12444. Object.defineProperty(exports, "__esModule", { value: true });
  12445. exports.ArrayStoreValueRef = void 0;
  12446. class ArrayStoreValueRef {
  12447. constructor(type, values, addresses, lines, columns, id) {
  12448. this.type = type;
  12449. this.values = values;
  12450. this.addresses = addresses;
  12451. this.lines = lines;
  12452. this.columns = columns;
  12453. this.id = id;
  12454. this.isConst = false;
  12455. }
  12456. get() {
  12457. return this.values;
  12458. }
  12459. getAddresses() {
  12460. return this.addresses;
  12461. }
  12462. inStore() {
  12463. return this.id != null;
  12464. }
  12465. }
  12466. exports.ArrayStoreValueRef = ArrayStoreValueRef;
  12467. /***/ }),
  12468. /***/ "./js/processor/store/value/store_value.ts":
  12469. /*!*************************************************!*\
  12470. !*** ./js/processor/store/value/store_value.ts ***!
  12471. \*************************************************/
  12472. /*! no static exports found */
  12473. /***/ (function(module, exports, __webpack_require__) {
  12474. "use strict";
  12475. Object.defineProperty(exports, "__esModule", { value: true });
  12476. exports.StoreValue = void 0;
  12477. class StoreValue {
  12478. constructor(type, value, id, isConst = false) {
  12479. this.type = type;
  12480. this.id = id;
  12481. this.isConst = isConst;
  12482. this.value = value;
  12483. }
  12484. get() {
  12485. return this.value;
  12486. }
  12487. inStore() {
  12488. return this.id != null;
  12489. }
  12490. }
  12491. exports.StoreValue = StoreValue;
  12492. /***/ }),
  12493. /***/ "./js/processor/store/value/store_value_address.ts":
  12494. /*!*********************************************************!*\
  12495. !*** ./js/processor/store/value/store_value_address.ts ***!
  12496. \*********************************************************/
  12497. /*! no static exports found */
  12498. /***/ (function(module, exports, __webpack_require__) {
  12499. "use strict";
  12500. Object.defineProperty(exports, "__esModule", { value: true });
  12501. exports.StoreValueAddress = void 0;
  12502. const store_value_1 = __webpack_require__(/*! ./store_value */ "./js/processor/store/value/store_value.ts");
  12503. class StoreValueAddress extends store_value_1.StoreValue {
  12504. constructor(type, value, line, column, id, isConst = false) {
  12505. super(type, value, id, isConst);
  12506. this.line = line;
  12507. this.column = column;
  12508. }
  12509. }
  12510. exports.StoreValueAddress = StoreValueAddress;
  12511. /***/ }),
  12512. /***/ "./js/processor/store/value/store_value_ref.ts":
  12513. /*!*****************************************************!*\
  12514. !*** ./js/processor/store/value/store_value_ref.ts ***!
  12515. \*****************************************************/
  12516. /*! no static exports found */
  12517. /***/ (function(module, exports, __webpack_require__) {
  12518. "use strict";
  12519. Object.defineProperty(exports, "__esModule", { value: true });
  12520. exports.StoreValueRef = void 0;
  12521. class StoreValueRef {
  12522. constructor(type, value, loc_address, id) {
  12523. this.type = type;
  12524. this.value = value;
  12525. this.loc_address = loc_address;
  12526. this.id = id;
  12527. this.isConst = false;
  12528. this.reference_dimesion = 0;
  12529. }
  12530. get() {
  12531. return this.value;
  12532. }
  12533. getRefAddress() {
  12534. return this.loc_address;
  12535. }
  12536. inStore() {
  12537. return this.id != null;
  12538. }
  12539. getReferenceDimension() {
  12540. return this.reference_dimesion;
  12541. }
  12542. setReferenceDimension(dimension) {
  12543. this.reference_dimesion = dimension;
  12544. }
  12545. }
  12546. exports.StoreValueRef = StoreValueRef;
  12547. /***/ }),
  12548. /***/ "./js/runner.js":
  12549. /*!**********************!*\
  12550. !*** ./js/runner.js ***!
  12551. \**********************/
  12552. /*! exports provided: runner */
  12553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12554. "use strict";
  12555. __webpack_require__.r(__webpack_exports__);
  12556. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return runner; });
  12557. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast/ivprogParser */ "./js/ast/ivprogParser.js");
  12558. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  12559. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./io/domConsole */ "./js/io/domConsole.js");
  12560. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/languageService */ "./js/services/languageService.js");
  12561. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  12562. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memory/location */ "./js/memory/location.ts");
  12563. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_5__);
  12564. function runner() {
  12565. var ivprogLexer = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer(); // const lexer = new ivprogLexer(new InputStream(input));
  12566. // const stream = new CommonTokenStream(lexer);
  12567. // stream.fill();
  12568. // let i = 1;
  12569. // let token = null;
  12570. // while ((token = stream.LT(i)).type !== ivprogLexer.EOF && token.type !== ivprogLexer.WHITESPACE) {
  12571. // console.log(`${token.type}-${token.text}`);
  12572. // console.log('\n')
  12573. // i++;
  12574. // }
  12575. // const anaSin = new IVProgParser(input, ivprogLexer);
  12576. var editor = new window.JsonEditor('#json-renderer', {});
  12577. var domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"]("#console", true);
  12578. domConsole.hide(); // proc.interpretAST().then( sto => {
  12579. // console.log(sto.applyStore('a'));
  12580. // }).catch(e => console.log(e));
  12581. try {
  12582. window.$('#btn').click(function () {
  12583. var input = window.$('#input').val();
  12584. var analiser = new _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__["IVProgParser"](input, ivprogLexer);
  12585. try {
  12586. var data = analiser.parseTree();
  12587. var semAna = new _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__["SemanticAnalyser"](data);
  12588. var proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](semAna.analyseTree());
  12589. proc.registerInput(domConsole);
  12590. domConsole.clear();
  12591. proc.registerOutput(domConsole);
  12592. proc.interpretAST().then(function (sto) {
  12593. console.log(sto);
  12594. editor.load(sto.store);
  12595. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12596. })["catch"](function (e) {
  12597. alert(e);
  12598. console.log(e);
  12599. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12600. });
  12601. } catch (error) {
  12602. alert(error);
  12603. console.log(error);
  12604. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12605. }
  12606. });
  12607. } catch (a) {
  12608. console.log(a);
  12609. }
  12610. }
  12611. /***/ }),
  12612. /***/ "./js/services/i18nHelper.js":
  12613. /*!***********************************!*\
  12614. !*** ./js/services/i18nHelper.js ***!
  12615. \***********************************/
  12616. /*! exports provided: i18nHelper */
  12617. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12618. "use strict";
  12619. __webpack_require__.r(__webpack_exports__);
  12620. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18nHelper", function() { return i18nHelper; });
  12621. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12622. /* harmony import */ var _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localizedStringsService */ "./js/services/localizedStringsService.js");
  12623. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_0__["default"].StringTypes;
  12624. var i18nHelper = Object.freeze({
  12625. i18n: function i18n(identifier) {
  12626. var opts = identifier.split(':');
  12627. var type = opts[0].toLowerCase();
  12628. var id = opts[1];
  12629. if (StringTypes.ERROR === type) {
  12630. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getError(id);
  12631. } else if (StringTypes.MESSAGE === type) {
  12632. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getMessage(id);
  12633. } else if (StringTypes.UI === type) {
  12634. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI(id);
  12635. } else {
  12636. console.warn("A string has been passed to the i18n helper function that was not in the form type:id -> " + identifier);
  12637. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getString(identifier, type);
  12638. }
  12639. }
  12640. });
  12641. /***/ }),
  12642. /***/ "./js/services/languageService.js":
  12643. /*!****************************************!*\
  12644. !*** ./js/services/languageService.js ***!
  12645. \****************************************/
  12646. /*! exports provided: LanguageService */
  12647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12648. "use strict";
  12649. __webpack_require__.r(__webpack_exports__);
  12650. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageService", function() { return LanguageService; });
  12651. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12652. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12653. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12654. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12655. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12656. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12657. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12658. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12659. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12660. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12661. /* harmony import */ var _grammar___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../grammar/ */ "./grammar/index.js");
  12662. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12663. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  12664. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  12665. 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); }; }
  12666. 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; } }
  12667. /* global iLMparameters*/
  12668. var LanguageServiceExtended = /*#__PURE__*/function (_line_i18n$LanguageSe) {
  12669. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(LanguageServiceExtended, _line_i18n$LanguageSe);
  12670. var _super = _createSuper(LanguageServiceExtended);
  12671. function LanguageServiceExtended() {
  12672. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, LanguageServiceExtended);
  12673. return _super.call(this, typeof iLMparameters === "undefined" ? _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].default_lang : iLMparameters.lang);
  12674. }
  12675. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(LanguageServiceExtended, [{
  12676. key: "getDefaultLang",
  12677. value: function getDefaultLang() {
  12678. return "en";
  12679. }
  12680. }, {
  12681. key: "getCurrentLexer",
  12682. value: function getCurrentLexer() {
  12683. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12684. if (langInfo === null || langInfo === undefined) {
  12685. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].lexer;
  12686. } else {
  12687. return langInfo.lexer;
  12688. }
  12689. }
  12690. }, {
  12691. key: "getCurrentLangFuncs",
  12692. value: function getCurrentLangFuncs() {
  12693. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12694. if (langInfo === null || langInfo === undefined) {
  12695. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langFuncs;
  12696. } else {
  12697. return langInfo.langFuncs;
  12698. }
  12699. }
  12700. }, {
  12701. key: "getCurrentLangLibs",
  12702. value: function getCurrentLangLibs() {
  12703. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12704. if (langInfo === null || langInfo === undefined) {
  12705. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langLibs;
  12706. }
  12707. return langInfo.langLibs;
  12708. }
  12709. }]);
  12710. return LanguageServiceExtended;
  12711. }(line_i18n__WEBPACK_IMPORTED_MODULE_6__["default"].LanguageServiceNoLS);
  12712. var LanguageService = new LanguageServiceExtended();
  12713. /***/ }),
  12714. /***/ "./js/services/localizedStringsService.js":
  12715. /*!************************************************!*\
  12716. !*** ./js/services/localizedStringsService.js ***!
  12717. \************************************************/
  12718. /*! exports provided: LocalizedStrings, getInstance */
  12719. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12720. "use strict";
  12721. __webpack_require__.r(__webpack_exports__);
  12722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  12723. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInstance", function() { return getInstance; });
  12724. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12725. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12726. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12727. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12728. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12729. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12730. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12731. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12732. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12733. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12734. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12735. /* harmony import */ var _languageService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./languageService */ "./js/services/languageService.js");
  12736. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  12737. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../i18n */ "./i18n/index.ts");
  12738. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_i18n__WEBPACK_IMPORTED_MODULE_8__);
  12739. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  12740. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  12741. 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); }; }
  12742. 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; } }
  12743. var IVProgLocalizedStrings = /*#__PURE__*/function (_line_i18n$LocalizedS) {
  12744. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IVProgLocalizedStrings, _line_i18n$LocalizedS);
  12745. var _super = _createSuper(IVProgLocalizedStrings);
  12746. function IVProgLocalizedStrings(langService, langsJsons) {
  12747. var shouldListenToChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  12748. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgLocalizedStrings);
  12749. return _super.call(this, langService, langsJsons, shouldListenToChange);
  12750. }
  12751. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgLocalizedStrings, [{
  12752. key: "translateType",
  12753. value: function translateType(type, dim) {
  12754. var type_string = this.getUI("type_".concat(type));
  12755. switch (dim) {
  12756. case 0:
  12757. return type_string;
  12758. default:
  12759. if (dim > 1) return this.getUI("matrix_info_string", [type_string]);else return this.getUI("vector_info_string", [type_string]);
  12760. }
  12761. }
  12762. }, {
  12763. key: "translateOp",
  12764. value: function translateOp(op) {
  12765. switch (op.ord) {
  12766. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].AND.ord:
  12767. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].OR.ord:
  12768. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NOT.ord:
  12769. return this.getUI("logic_operator_".concat(op.value));
  12770. default:
  12771. return op.value;
  12772. }
  12773. }
  12774. }, {
  12775. key: "translateInternalFunction",
  12776. value: function translateInternalFunction(name) {
  12777. var category = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  12778. if (category == null) {
  12779. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName(name);
  12780. } else {
  12781. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName("".concat(category, ".").concat(name));
  12782. }
  12783. }
  12784. }]);
  12785. return IVProgLocalizedStrings;
  12786. }(line_i18n__WEBPACK_IMPORTED_MODULE_5__["default"].LocalizedStrings);
  12787. var LocalizedStrings = Object.freeze(new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a, true));
  12788. var _instance = null;
  12789. function getInstance() {
  12790. if (_instance == null) {
  12791. _instance = new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a);
  12792. }
  12793. return _instance;
  12794. }
  12795. /***/ }),
  12796. /***/ "./js/services/userLog.js":
  12797. /*!********************************!*\
  12798. !*** ./js/services/userLog.js ***!
  12799. \********************************/
  12800. /*! exports provided: ActionTypes, registerClick, registerUserEvent, registerSystemEvent, getLogs, setRebuildMode, getLogsAsString, parseLogs */
  12801. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12802. "use strict";
  12803. __webpack_require__.r(__webpack_exports__);
  12804. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return ActionTypes; });
  12805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return registerClick; });
  12806. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return registerUserEvent; });
  12807. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSystemEvent", function() { return registerSystemEvent; });
  12808. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return getLogs; });
  12809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setRebuildMode", function() { return setRebuildMode; });
  12810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return getLogsAsString; });
  12811. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return parseLogs; });
  12812. var clicks = [];
  12813. var inRebuildMode = false;
  12814. var ActionTypes = Object.freeze({
  12815. // registerUserEvent payload:
  12816. // (function_name, insert action)
  12817. INSERT_FUNCTION: "INSERT_FUNCTION",
  12818. // (function_name, remove action)
  12819. REMOVE_FUNCTION: "REMOVE_FUNCTION",
  12820. // (var_name,insert action, type, dim)
  12821. INSERT_GLOBAL_VAR: "INSERT_GLOBAL_VAR",
  12822. // (var name, remove action)
  12823. REMOVE_GLOBAL_VAR: "REMOVE_GLOBAL_VAR",
  12824. // (old function name, rename action, new function name)
  12825. RENAME_FUNCTION: "RENAME_FUNCTION",
  12826. // (old var name, rename action. new var name)
  12827. RENAME_GLOBAL_VAR: "RENAME_GLOBAL_VAR",
  12828. // (var name, set const action)
  12829. SET_GLOBAL_CONST: "SET_GLOBAL_CONST",
  12830. // (function name, change return action, type, dim)
  12831. CHANGE_FUNCTION_RETURN: "CHANGE_FUNCTION_RETURN",
  12832. // (var name, change type action, type, dim, rows?, columns?)
  12833. CHANGE_GLOBAL_TYPE: "CHANGE_GLOBAL_TYPE",
  12834. // (var name, change value action, value)
  12835. CHANGE_GLOBAL_VALUE: "CHANGE_GLOBAL_VALUE",
  12836. // (function name, insert param action, param varname, type, dim)
  12837. INSERT_FUNCTION_PARAM: "INSERT_FUNCTION_PARAM",
  12838. // (function name, remove param action, param varname)
  12839. REMOVE_FUNCTION_PARAM: "REMOVE_FUNCTION_PARAM",
  12840. // (function name, change param type action, type, dim)
  12841. CHANGE_PARAM_TYPE: "CHANGE_PARAM_TYPE",
  12842. // (function name, rename param action, old param name, new param name)
  12843. RENAME_FUNCTION_PARAM: "RENAME_FUNCTION_PARAM",
  12844. // (function name, insert var action, var name, type, dim)
  12845. INSERT_FUNCTION_VAR: "INSERT_FUCNTION_VAR",
  12846. // (function name, remove var action, var name)
  12847. REMOVE_FUNCTION_VAR: "REMOVE_FUNCTION_VAR",
  12848. // (function name, rename var action, old var name, new var name)
  12849. RENAME_FUNCTION_VAR: "RENAME_FUNCTION_VAR",
  12850. // (function name, change var type action, var name, type, dim, rows?, columns?)
  12851. CHANGE_VAR_TYPE: "CHANGE_VAR_TYPE",
  12852. // (function name, change var value action, var name, value)
  12853. CHANGE_VAR_VALUE: "CHANGE_VAR_VALUE",
  12854. // (function name, insert command action, command, path)
  12855. INSERT_COMMAND: "INSERT_COMMAND",
  12856. // (function name, remove command action, path)
  12857. REMOVE_COMMAND: "REMOVE_COMMAND",
  12858. // (function name, change command exp action, path, exp)
  12859. CHANGE_COMMAND_EXP: "CHANGE_COMMAND_EXP",
  12860. // (function name, change attrib exp action, path, exp)
  12861. CHANGE_ATTRIB_EXP: "CHANGE_ATTRIB_EXP",
  12862. // (function name, change attrib var action, path, var name, row_exp?, column_exp?)
  12863. CHANGE_ATTRIB_VAR: "CHANGE_ATTRIB_VAR",
  12864. // (function name, move command action, old path, new path)
  12865. MOVE_COMMAND: "MOVE_COMMAND",
  12866. // (function name, enter change name action, var name)
  12867. ENTER_CHANGE_VAR_NAME: 'ENTER_CHANGE_VAR_NAME',
  12868. // (function name, enter change value action, var name)
  12869. ENTER_CHANGE_VAR_VALUE: 'ENTER_CHANGE_VAR_VALUE',
  12870. // (var name, enter change name action)
  12871. ENTER_CHANGE_GLOBAL_NAME: 'ENTER_CHANGE_GLOBAL_NAME',
  12872. // (var name, enter change value action)
  12873. ENTER_CHANGE_GLOBAL_VALUE: 'ENTER_CHANGE_GLOBAL_VALUE',
  12874. // (function name, enter change name action, param name)
  12875. ENTER_CHANGE_PARAM_NAME: 'ENTER_CHANGE_PARAM_NAME'
  12876. });
  12877. function registerClick(x, y, details) {
  12878. if (inRebuildMode) {
  12879. return;
  12880. }
  12881. clicks.push([x, y, Date.now(), details]);
  12882. }
  12883. function registerUserEvent(command, action) {
  12884. for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  12885. params[_key - 2] = arguments[_key];
  12886. }
  12887. registerEvent('user_event', command, action, params);
  12888. }
  12889. function registerSystemEvent(command, action) {
  12890. for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  12891. params[_key2 - 2] = arguments[_key2];
  12892. }
  12893. registerEvent('system_event', command, action, params);
  12894. }
  12895. function registerEvent(tag, command, action, params) {
  12896. if (inRebuildMode) {
  12897. return;
  12898. }
  12899. var event = {
  12900. context: command,
  12901. action: action,
  12902. params: params
  12903. };
  12904. clicks.push([tag, Date.now(), event]);
  12905. }
  12906. function getLogs() {
  12907. return clicks;
  12908. }
  12909. function setRebuildMode(flag) {
  12910. inRebuildMode = flag;
  12911. }
  12912. function getLogsAsString() {
  12913. return JSON.stringify(clicks);
  12914. }
  12915. function parseLogs(logData) {
  12916. clicks = JSON.parse(logData);
  12917. }
  12918. /***/ }),
  12919. /***/ "./js/typeSystem/array_type.ts":
  12920. /*!*************************************!*\
  12921. !*** ./js/typeSystem/array_type.ts ***!
  12922. \*************************************/
  12923. /*! no static exports found */
  12924. /***/ (function(module, exports, __webpack_require__) {
  12925. "use strict";
  12926. Object.defineProperty(exports, "__esModule", { value: true });
  12927. exports.ArrayType = void 0;
  12928. class ArrayType {
  12929. constructor(type, dimensions) {
  12930. this.dimensions = dimensions;
  12931. this.innerType = type;
  12932. }
  12933. get isVector() {
  12934. return this.dimensions == 1;
  12935. }
  12936. isCompatible(another) {
  12937. if (another instanceof ArrayType) {
  12938. if (this.dimensions !== another.dimensions) {
  12939. return false;
  12940. }
  12941. return this.innerType.isCompatible(another.innerType);
  12942. }
  12943. return false;
  12944. }
  12945. stringInfo() {
  12946. const list = this.innerType.stringInfo();
  12947. list.forEach(v => {
  12948. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  12949. const tmp = v;
  12950. tmp.dim = this.dimensions;
  12951. });
  12952. return list;
  12953. }
  12954. get value() {
  12955. return undefined;
  12956. }
  12957. get ord() {
  12958. return undefined;
  12959. }
  12960. canAccept(another, used_dims) {
  12961. const free_dims = this.dimensions - used_dims;
  12962. if (another instanceof ArrayType) {
  12963. return free_dims == another.dimensions && this.innerType.isCompatible(another.innerType);
  12964. }
  12965. else {
  12966. return free_dims == 0 && this.innerType.isCompatible(another);
  12967. }
  12968. }
  12969. }
  12970. exports.ArrayType = ArrayType;
  12971. /***/ }),
  12972. /***/ "./js/typeSystem/multiType.ts":
  12973. /*!************************************!*\
  12974. !*** ./js/typeSystem/multiType.ts ***!
  12975. \************************************/
  12976. /*! no static exports found */
  12977. /***/ (function(module, exports, __webpack_require__) {
  12978. "use strict";
  12979. Object.defineProperty(exports, "__esModule", { value: true });
  12980. exports.MultiType = void 0;
  12981. class MultiType {
  12982. constructor(types) {
  12983. this.types = types;
  12984. }
  12985. get value() {
  12986. return undefined;
  12987. }
  12988. get ord() {
  12989. return undefined;
  12990. }
  12991. stringInfo() {
  12992. let list = [];
  12993. for (let i = 0; i < this.types.length; i++) {
  12994. const t = this.types[i];
  12995. list = list.concat(t.stringInfo());
  12996. }
  12997. return list;
  12998. }
  12999. isCompatible(another) {
  13000. for (let i = 0; i < this.types.length; i++) {
  13001. const t = this.types[i];
  13002. if (another.isCompatible(t)) {
  13003. return true;
  13004. }
  13005. }
  13006. return false;
  13007. }
  13008. }
  13009. exports.MultiType = MultiType;
  13010. /***/ }),
  13011. /***/ "./js/typeSystem/parsers.js":
  13012. /*!**********************************!*\
  13013. !*** ./js/typeSystem/parsers.js ***!
  13014. \**********************************/
  13015. /*! exports provided: toInt, toString, toChar, toReal, toBool, convertBoolToString, convertToString */
  13016. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13017. "use strict";
  13018. __webpack_require__.r(__webpack_exports__);
  13019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toInt", function() { return toInt; });
  13020. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return toString; });
  13021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toChar", function() { return toChar; });
  13022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toReal", function() { return toReal; });
  13023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toBool", function() { return toBool; });
  13024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBoolToString", function() { return convertBoolToString; });
  13025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToString", function() { return convertToString; });
  13026. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  13027. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ "./js/typeSystem/types.ts");
  13028. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_1__);
  13029. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  13030. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
  13031. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  13032. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_3__);
  13033. function toInt(str) {
  13034. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(str);
  13035. }
  13036. function toString(str) {
  13037. var value = str.replace(/^"/, "");
  13038. value = value.replace(/"$/, "");
  13039. value = value.replace(/\\b/g, "\b");
  13040. value = value.replace(/\\t/g, "\t");
  13041. value = value.replace(/\\n/g, "\n");
  13042. value = value.replace(/\\r/g, "\r");
  13043. value = value.replace(/\\"/g, '"');
  13044. value = value.replace(/\\'/g, "'");
  13045. value = value.replace(/\\\\/g, "\\");
  13046. return value;
  13047. }
  13048. function toChar(str) {
  13049. console.debug(str, str.length);
  13050. var value = str.replace(/^'/, "");
  13051. value = value.replace(/'$/, "");
  13052. value = value.replace(/\\b/g, "\b");
  13053. value = value.replace(/\\t/g, "\t");
  13054. value = value.replace(/\\n/g, "\n");
  13055. value = value.replace(/\\r/g, "\r");
  13056. value = value.replace(/\\"/g, '"');
  13057. value = value.replace(/\\'/g, "'");
  13058. value = value[0];
  13059. return value;
  13060. }
  13061. function toReal(value) {
  13062. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(value);
  13063. }
  13064. function toBool(str) {
  13065. var val = "'" + str + "'";
  13066. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  13067. var instance = new lexer(null);
  13068. if (instance.literalNames[lexer.RK_TRUE] === val) {
  13069. return true;
  13070. } else if (instance.literalNames[lexer.RK_FALSE] === val) {
  13071. return false;
  13072. } else {
  13073. // TODO: better error message
  13074. throw new Error(str + "not a valid boolean");
  13075. }
  13076. }
  13077. function convertBoolToString(bool) {
  13078. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  13079. var instance = new lexer(null);
  13080. var result = null;
  13081. if (bool) {
  13082. result = instance.literalNames[lexer.RK_TRUE];
  13083. } else {
  13084. result = instance.literalNames[lexer.RK_FALSE];
  13085. }
  13086. return result.replace(/'/g, "");
  13087. }
  13088. function convertToString(value, type) {
  13089. switch (type.ord) {
  13090. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER.ord:
  13091. return value.toString();
  13092. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL.ord:
  13093. {
  13094. if (value.dp() <= 0) {
  13095. return value.toFixed(1);
  13096. } else {
  13097. return value.toFixed(_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].decimalPlaces);
  13098. }
  13099. }
  13100. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN.ord:
  13101. return convertBoolToString(value);
  13102. default:
  13103. return value;
  13104. }
  13105. }
  13106. /***/ }),
  13107. /***/ "./js/typeSystem/type.ts":
  13108. /*!*******************************!*\
  13109. !*** ./js/typeSystem/type.ts ***!
  13110. \*******************************/
  13111. /*! no static exports found */
  13112. /***/ (function(module, exports, __webpack_require__) {
  13113. "use strict";
  13114. Object.defineProperty(exports, "__esModule", { value: true });
  13115. exports.Type = void 0;
  13116. class Type {
  13117. constructor(value, ord) {
  13118. this.value = value;
  13119. this.ord = ord;
  13120. }
  13121. stringInfo() {
  13122. return [{ type: this.value, dim: 0 }];
  13123. }
  13124. isCompatible(another) {
  13125. return this.value === another.value && this.ord === another.ord;
  13126. }
  13127. }
  13128. exports.Type = Type;
  13129. /***/ }),
  13130. /***/ "./js/typeSystem/types.ts":
  13131. /*!********************************!*\
  13132. !*** ./js/typeSystem/types.ts ***!
  13133. \********************************/
  13134. /*! no static exports found */
  13135. /***/ (function(module, exports, __webpack_require__) {
  13136. "use strict";
  13137. Object.defineProperty(exports, "__esModule", { value: true });
  13138. exports.fromOrdToType = exports.Types = void 0;
  13139. const type_1 = __webpack_require__(/*! ./type */ "./js/typeSystem/type.ts");
  13140. const multiType_1 = __webpack_require__(/*! ./multiType */ "./js/typeSystem/multiType.ts");
  13141. const maybe_1 = __webpack_require__(/*! ../util/maybe */ "./js/util/maybe.ts");
  13142. const INTEGER = new type_1.Type("integer", 0);
  13143. const REAL = new type_1.Type("real", 1);
  13144. const STRING = new type_1.Type("text", 2);
  13145. const BOOLEAN = new type_1.Type("boolean", 3);
  13146. const CHAR = new type_1.Type("char", 4);
  13147. const VOID = new type_1.Type("void", 5);
  13148. const UNDEFINED = new type_1.Type("undefined", 6);
  13149. const ALL = new multiType_1.MultiType([INTEGER, REAL, STRING, CHAR, BOOLEAN]);
  13150. exports.Types = Object.freeze({
  13151. INTEGER: INTEGER,
  13152. REAL: REAL,
  13153. STRING: STRING,
  13154. CHAR: CHAR,
  13155. BOOLEAN: BOOLEAN,
  13156. VOID: VOID,
  13157. UNDEFINED: UNDEFINED,
  13158. ALL: ALL
  13159. });
  13160. function fromOrdToType(ord) {
  13161. const typeMap = exports.Types;
  13162. for (const t in typeMap) {
  13163. if (typeMap[t].ord && typeMap[t].ord === ord) {
  13164. return maybe_1.Maybe.some(typeMap[t]);
  13165. }
  13166. }
  13167. return maybe_1.Maybe.none();
  13168. }
  13169. exports.fromOrdToType = fromOrdToType;
  13170. /***/ }),
  13171. /***/ "./js/util/auto_gen_output.js":
  13172. /*!************************************!*\
  13173. !*** ./js/util/auto_gen_output.js ***!
  13174. \************************************/
  13175. /*! exports provided: autoGenerateTestCaseOutput */
  13176. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13177. "use strict";
  13178. __webpack_require__.r(__webpack_exports__);
  13179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return autoGenerateTestCaseOutput; });
  13180. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  13181. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  13182. /* harmony import */ var _inputTest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inputTest */ "./js/util/inputTest.js");
  13183. /* harmony import */ var _outputTest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./outputTest */ "./js/util/outputTest.js");
  13184. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13185. function autoGenerateTestCaseOutput(program_text, testCases) {
  13186. var copyTestCases = testCases.map(function (test) {
  13187. return Object.assign({}, test);
  13188. });
  13189. try {
  13190. var program = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__["SemanticAnalyser"].analyseFromSource(program_text);
  13191. var resultList = testCases.map(function (test, id) {
  13192. var input = new _inputTest__WEBPACK_IMPORTED_MODULE_2__["InputTest"](test.input);
  13193. var output = new _outputTest__WEBPACK_IMPORTED_MODULE_3__["OutputTest"]();
  13194. var exec = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](program);
  13195. exec.registerInput(input);
  13196. exec.registerOutput(output);
  13197. return exec.interpretAST().then(function (_) {
  13198. return {
  13199. id: id,
  13200. program: exec
  13201. };
  13202. });
  13203. });
  13204. return Promise.all(resultList).then(function (result_final) {
  13205. for (var i = 0; i < result_final.length; ++i) {
  13206. var result = result_final[i];
  13207. var output = result.program.output.list;
  13208. var input = result.program.input;
  13209. if (input.index != input.inputList.length) {
  13210. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_unused_input", [result.id + 1]));
  13211. return Promise.resolve(false);
  13212. }
  13213. if (output.length == 0) {
  13214. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_empty", [result.id + 1]));
  13215. }
  13216. copyTestCases[result.id].output = output;
  13217. }
  13218. window.outputGenerated(copyTestCases);
  13219. return Promise.resolve(true);
  13220. });
  13221. } catch (error) {
  13222. return Promise.reject(error);
  13223. }
  13224. }
  13225. /***/ }),
  13226. /***/ "./js/util/config.ts":
  13227. /*!***************************!*\
  13228. !*** ./js/util/config.ts ***!
  13229. \***************************/
  13230. /*! no static exports found */
  13231. /***/ (function(module, exports, __webpack_require__) {
  13232. "use strict";
  13233. Object.defineProperty(exports, "__esModule", { value: true });
  13234. exports.Config = void 0;
  13235. class ConfigObject {
  13236. constructor() {
  13237. this.decimalPlaces = 8;
  13238. this.intConvertRoundMode = 2;
  13239. this.default_lang = 'pt';
  13240. this.enable_type_casting = true;
  13241. this.idle_input_interval = 5000;
  13242. this.suspend_threshold = 100;
  13243. // this.max_instruction_count = 350250; - automated evaluation limit
  13244. this.max_instruction_count = Number.MAX_SAFE_INTEGER;
  13245. }
  13246. setConfig(opts) {
  13247. const otherConfig = opts;
  13248. for (const key in otherConfig) {
  13249. if (Object.prototype.hasOwnProperty.call(this, key)) {
  13250. this[key] = otherConfig[key];
  13251. }
  13252. }
  13253. }
  13254. }
  13255. const config = new ConfigObject();
  13256. exports.Config = config;
  13257. /***/ }),
  13258. /***/ "./js/util/editorMode2.js":
  13259. /*!********************************!*\
  13260. !*** ./js/util/editorMode2.js ***!
  13261. \********************************/
  13262. /*! exports provided: CodeEditorMode */
  13263. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13264. "use strict";
  13265. __webpack_require__.r(__webpack_exports__);
  13266. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditorMode", function() { return CodeEditorMode; });
  13267. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./js/util/utils.js");
  13268. /**
  13269. * Source: https://raw.githubusercontent.com/codemirror/CodeMirror/master/mode/clike/clike.js
  13270. * @author arijn Haverbeke and others
  13271. * @author Lucas de Souza
  13272. * @param {CodeMirror} CodeMirror
  13273. */
  13274. function CodeEditorMode(CodeMirror) {
  13275. "use strict";
  13276. function Context(indented, column, type, info, align, prev) {
  13277. this.indented = indented;
  13278. this.column = column;
  13279. this.type = type;
  13280. this.info = info;
  13281. this.align = align;
  13282. this.prev = prev;
  13283. }
  13284. function pushContext(state, col, type, info) {
  13285. var indent = state.indented;
  13286. if (state.context && state.context.type == "statement" && type != "statement") indent = state.context.indented;
  13287. return state.context = new Context(indent, col, type, info, null, state.context);
  13288. }
  13289. function popContext(state) {
  13290. var t = state.context.type;
  13291. if (t == ")" || t == "]" || t == "}") state.indented = state.context.indented;
  13292. return state.context = state.context.prev;
  13293. }
  13294. function typeBefore(stream, state, pos) {
  13295. if (state.prevToken == "variable" || state.prevToken == "type") return true;
  13296. if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
  13297. if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
  13298. }
  13299. function isTopScope(context) {
  13300. for (;;) {
  13301. if (!context || context.type == "top") return true;
  13302. if (context.type == "}" && context.prev.info != "namespace") return false;
  13303. context = context.prev;
  13304. }
  13305. }
  13306. function contains(words, word) {
  13307. if (typeof words === "function") {
  13308. return words(word);
  13309. } else {
  13310. return Object.propertyIsEnumerable.call(words, word);
  13311. }
  13312. }
  13313. function tokenComment(stream, state) {
  13314. var maybeEnd = false,
  13315. ch;
  13316. while (ch = stream.next()) {
  13317. if (ch == "/" && maybeEnd) {
  13318. state.tokenize = null;
  13319. break;
  13320. }
  13321. maybeEnd = ch == "*";
  13322. }
  13323. return "comment";
  13324. }
  13325. CodeMirror.defineMode("ivprog", function (config, parserConfig) {
  13326. var indentUnit = config.indentUnit,
  13327. statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
  13328. dontAlignCalls = parserConfig.dontAlignCalls,
  13329. keywords = parserConfig.keywords || {},
  13330. switchKeyword = parserConfig.switchKeyword,
  13331. caseKeyword = parserConfig.caseKeyword,
  13332. defaultKeyword = parserConfig.defaultKeyword,
  13333. caseRegex = new RegExp("^\\s*(?:".concat(caseKeyword, " .*?:|").concat(defaultKeyword, ":|\\{\\}?|\\})$")),
  13334. ////,
  13335. types = parserConfig.types || {},
  13336. builtin = parserConfig.builtin || {},
  13337. blockKeywords = parserConfig.blockKeywords || {},
  13338. defKeywords = parserConfig.defKeywords || {},
  13339. atoms = parserConfig.atoms || {},
  13340. hooks = parserConfig.hooks || {},
  13341. multiLineStrings = parserConfig.multiLineStrings,
  13342. indentStatements = false,
  13343. namespaceSeparator = null,
  13344. isPunctuationChar = /[[\]{}(),;:\n]/,
  13345. numberStart = /[\d.]/,
  13346. number = /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)$/i,
  13347. isOperatorChar = /[+\-*%=<>!/&]/,
  13348. isIdentifierChar = /[a-zA-Z0-9_]/,
  13349. // An optional function that takes a {string} token and returns true if it
  13350. // should be treated as a builtin.
  13351. isReservedIdentifier = parserConfig.isReservedIdentifier || false;
  13352. var curPunc, isDefKeyword;
  13353. var tokenString = function tokenString() {
  13354. /*SKIP*/
  13355. };
  13356. function tokenBase(stream, state) {
  13357. var ch = stream.next();
  13358. if (hooks[ch]) {
  13359. var result = hooks[ch](stream, state);
  13360. if (result !== false) return result;
  13361. }
  13362. if (ch == '"') {
  13363. state.tokenize = tokenString(ch);
  13364. return state.tokenize(stream, state);
  13365. }
  13366. if (isPunctuationChar.test(ch)) {
  13367. curPunc = ch;
  13368. return null;
  13369. }
  13370. if (numberStart.test(ch)) {
  13371. stream.backUp(1);
  13372. if (stream.match(number)) return "number";
  13373. stream.next();
  13374. }
  13375. if (ch == "/") {
  13376. if (stream.eat("*")) {
  13377. state.tokenize = tokenComment;
  13378. return tokenComment(stream, state);
  13379. }
  13380. if (stream.eat("/")) {
  13381. stream.skipToEnd();
  13382. return "comment";
  13383. }
  13384. }
  13385. if (isOperatorChar.test(ch)) {
  13386. while (!stream.match(/^\/[/*]/, false) && stream.eat(isOperatorChar)) {
  13387. /* SKIP */
  13388. }
  13389. return "operator";
  13390. }
  13391. stream.eatWhile(isIdentifierChar);
  13392. if (namespaceSeparator) while (stream.match(namespaceSeparator)) {
  13393. stream.eatWhile(isIdentifierChar);
  13394. }
  13395. var cur = stream.current();
  13396. if (contains(keywords, cur)) {
  13397. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  13398. if (contains(defKeywords, cur)) isDefKeyword = true;
  13399. return "keyword";
  13400. }
  13401. if (contains(types, cur)) return "type";
  13402. if (contains(builtin, cur) || isReservedIdentifier && isReservedIdentifier(cur)) {
  13403. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  13404. return "builtin";
  13405. }
  13406. if (contains(atoms, cur)) return "atom";
  13407. return "variable";
  13408. }
  13409. tokenString = function tokenString(quote) {
  13410. return function (stream, state) {
  13411. var escaped = false,
  13412. next,
  13413. end = false;
  13414. while ((next = stream.next()) != null) {
  13415. if (next == quote && !escaped) {
  13416. end = true;
  13417. break;
  13418. }
  13419. escaped = !escaped && next == "\\";
  13420. }
  13421. if (end || !(escaped || multiLineStrings)) state.tokenize = null;
  13422. return "string";
  13423. };
  13424. };
  13425. function maybeEOL(stream, state) {
  13426. if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) state.typeAtEndOfLine = typeBefore(stream, state, stream.pos);
  13427. } // Interface
  13428. return {
  13429. startState: function startState(basecolumn) {
  13430. return {
  13431. tokenize: null,
  13432. context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
  13433. indented: 0,
  13434. startOfLine: true,
  13435. prevToken: null
  13436. };
  13437. },
  13438. token: function token(stream, state) {
  13439. var ctx = state.context;
  13440. if (stream.sol()) {
  13441. if (ctx.align == null) ctx.align = false;
  13442. state.indented = stream.indentation();
  13443. state.startOfLine = true;
  13444. }
  13445. if (stream.eatSpace()) {
  13446. maybeEOL(stream, state);
  13447. return null;
  13448. }
  13449. curPunc = isDefKeyword = null;
  13450. var style = (state.tokenize || tokenBase)(stream, state);
  13451. if (style == "comment" || style == "meta") return style;
  13452. if (ctx.align == null) ctx.align = true;
  13453. if (curPunc == ";" || curPunc == ":" || curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)) while (state.context.type == "statement") {
  13454. popContext(state);
  13455. } else if (curPunc == "{") pushContext(state, stream.column(), "}");else if (curPunc == "[") pushContext(state, stream.column(), "]");else if (curPunc == "(") pushContext(state, stream.column(), ")");else if (curPunc == "}") {
  13456. while (ctx.type == "statement") {
  13457. ctx = popContext(state);
  13458. }
  13459. if (ctx.type == "}") ctx = popContext(state);
  13460. while (ctx.type == "statement") {
  13461. ctx = popContext(state);
  13462. }
  13463. } else if (curPunc == ctx.type) popContext(state);else if (indentStatements && ((ctx.type == "}" || ctx.type == "top") && curPunc != ";" || ctx.type == "statement" && curPunc == "newstatement")) {
  13464. pushContext(state, stream.column(), "statement", stream.current());
  13465. }
  13466. if (style == "variable" && (state.prevToken == "def" || parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && isTopScope(state.context) && stream.match(/^\s*\(/, false))) style = "def";
  13467. if (hooks.token) {
  13468. var result = hooks.token(stream, state, style);
  13469. if (result !== undefined) style = result;
  13470. }
  13471. if (style == "def" && parserConfig.styleDefs === false) style = "variable";
  13472. state.startOfLine = false;
  13473. state.prevToken = isDefKeyword ? "def" : style || curPunc;
  13474. maybeEOL(stream, state);
  13475. return style;
  13476. },
  13477. indent: function indent(state, textAfter) {
  13478. if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
  13479. var ctx = state.context;
  13480. var firstChar = textAfter && textAfter.charAt(0);
  13481. var closing = firstChar == ctx.type;
  13482. if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
  13483. if (parserConfig.dontIndentStatements) while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) {
  13484. ctx = ctx.prev;
  13485. }
  13486. if (hooks.indent) {
  13487. var hook = hooks.indent(state, ctx, textAfter, indentUnit);
  13488. if (typeof hook == "number") return hook;
  13489. }
  13490. var switchBlock = ctx.prev && ctx.prev.info == switchKeyword;
  13491. if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
  13492. while (ctx.type != "top" && ctx.type != "}") {
  13493. ctx = ctx.prev;
  13494. }
  13495. return ctx.indented;
  13496. }
  13497. if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
  13498. if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
  13499. if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
  13500. var caseTestRegex = new RegExp("^(?:".concat(caseKeyword, "|").concat(defaultKeyword, ")\b"));
  13501. return ctx.indented + (closing ? 0 : indentUnit) + (!closing && switchBlock && !caseTestRegex.test(textAfter) ? indentUnit : 0);
  13502. },
  13503. electricInput: caseRegex,
  13504. blockCommentStart: "/*",
  13505. blockCommentEnd: "*/",
  13506. blockCommentContinue: " * ",
  13507. lineComment: "//",
  13508. fold: "brace"
  13509. };
  13510. });
  13511. function words(str) {
  13512. var obj = {},
  13513. words = str.split(" ");
  13514. for (var i = 0; i < words.length; ++i) {
  13515. obj[words[i]] = true;
  13516. }
  13517. return obj;
  13518. }
  13519. var codeConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getCodeEditorModeConfig"])();
  13520. var ivprogKeywords = codeConfig.keywords.join(" ");
  13521. var basicTypes = words(codeConfig.types.join(" "));
  13522. function ivprogTypes(identifier) {
  13523. return contains(basicTypes, identifier);
  13524. }
  13525. var ivprogBlockKeywords = codeConfig.blocks.join(" ");
  13526. var ivprogDefKeywords = "funcao const";
  13527. function def(mimes, mode) {
  13528. if (typeof mimes == "string") mimes = [mimes];
  13529. var words = [];
  13530. function add(obj) {
  13531. if (obj) {
  13532. for (var prop in obj) {
  13533. if (Object.hasOwnProperty.call(obj, prop)) {
  13534. words.push(prop);
  13535. }
  13536. }
  13537. }
  13538. }
  13539. add(mode.keywords);
  13540. add(mode.types);
  13541. add(mode.builtin);
  13542. add(mode.atoms);
  13543. if (words.length) {
  13544. mode.helperType = mimes[0];
  13545. CodeMirror.registerHelper("hintWords", mimes[0], words);
  13546. }
  13547. for (var i = 0; i < mimes.length; ++i) {
  13548. CodeMirror.defineMIME(mimes[i], mode);
  13549. }
  13550. }
  13551. def(["text/x-ivprog"], {
  13552. name: "ivprog",
  13553. keywords: words(ivprogKeywords),
  13554. types: ivprogTypes,
  13555. blockKeywords: words(ivprogBlockKeywords),
  13556. defKeywords: words(ivprogDefKeywords),
  13557. typeFirstDefinitions: true,
  13558. atoms: words(codeConfig.atoms.join(" ")),
  13559. switchKeyword: codeConfig.switchString,
  13560. caseKeyword: codeConfig.case_default[0],
  13561. defaultKeyword: codeConfig.case_default[1],
  13562. modeProps: {
  13563. fold: ["brace"]
  13564. }
  13565. });
  13566. }
  13567. /***/ }),
  13568. /***/ "./js/util/iassignHelpers.js":
  13569. /*!***********************************!*\
  13570. !*** ./js/util/iassignHelpers.js ***!
  13571. \***********************************/
  13572. /*! exports provided: prepareActivityToStudentHelper, autoEval */
  13573. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13574. "use strict";
  13575. __webpack_require__.r(__webpack_exports__);
  13576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return prepareActivityToStudentHelper; });
  13577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return autoEval; });
  13578. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../visualUI/functions */ "./js/visualUI/functions.js");
  13579. /* harmony import */ var _visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../visualUI/code_generator */ "./js/visualUI/code_generator.js");
  13580. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  13581. /* harmony import */ var _testConsole__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./testConsole */ "./js/util/testConsole.js");
  13582. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  13583. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  13584. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./maybe */ "./js/util/maybe.ts");
  13585. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_maybe__WEBPACK_IMPORTED_MODULE_6__);
  13586. function parseActivityData(data) {
  13587. var algorithm_in_ilm = null;
  13588. if (data.split("\n::algorithm::")[1]) {
  13589. algorithm_in_ilm = data.split("\n::algorithm::")[1].split("\n::logs::")[0];
  13590. var logs = data.split("\n::algorithm::")[1].split("\n::logs::")[1];
  13591. if (logs != null) {
  13592. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"])(logs);
  13593. }
  13594. }
  13595. var content;
  13596. try {
  13597. content = JSON.parse(data.split("\n::algorithm::")[0]);
  13598. content["algorithm_in_ilm"] = algorithm_in_ilm;
  13599. } catch (e) {
  13600. console.error(e);
  13601. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].none();
  13602. }
  13603. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].some(content);
  13604. }
  13605. function prepareActivityToStudentHelper(ilm_cont) {
  13606. var maybe_content = parseActivityData(ilm_cont);
  13607. return maybe_content.map(function (content) {
  13608. var testCases = content.testcases;
  13609. Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["setTestCases"])(testCases);
  13610. var prog_type = null;
  13611. if (content.settings_programming_type) {
  13612. prog_type = content.settings_programming_type[0].value;
  13613. } else {
  13614. prog_type = "visual";
  13615. }
  13616. return {
  13617. settingsProgrammingType: prog_type,
  13618. settingsDataTypes: content.settings_data_types,
  13619. settingsCommands: content.settings_commands,
  13620. settingsFunctions: content.settings_functions,
  13621. algorithmInIlm: content.algorithm_in_ilm,
  13622. settingsFilter: content.settings_filter
  13623. };
  13624. });
  13625. }
  13626. function compareArray(a, b) {
  13627. for (var i = 0; i < a.length; ++i) {
  13628. var elementA = a[i];
  13629. var elementB = b[i];
  13630. if (elementA != elementB) {
  13631. return false;
  13632. }
  13633. }
  13634. return true;
  13635. }
  13636. function compareTestcases(original, student) {
  13637. if (original.length != student.length) {
  13638. return false;
  13639. }
  13640. for (var i = 0; i < original.length; ++i) {
  13641. var elementO = original[i];
  13642. var elementS = student[i];
  13643. if (!compareArray(elementO.input, elementS.input)) {
  13644. return false;
  13645. }
  13646. if (!compareArray(elementO.output, elementS.output)) {
  13647. return false;
  13648. }
  13649. }
  13650. return true;
  13651. }
  13652. function autoEval(originalData, callback) {
  13653. var code = Object(_visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__["generate"])(); //console.debug(code);
  13654. var original = parseActivityData(originalData).getOrElse(undefined);
  13655. if (original == null) {
  13656. alert("iAssign did not provide the original activity data!");
  13657. return callback(null);
  13658. }
  13659. if (code == null) {
  13660. return callback(-1); // @FeedbackConvention Casos de teste vazios
  13661. } else {
  13662. if (!compareTestcases(original.testcases, Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["getTestCases"])())) {
  13663. return callback(-2); // @FeedbackConvention Casos de teste alterados pelo aluno
  13664. }
  13665. try {
  13666. var ast_code = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__["SemanticAnalyser"].analyseFromSource(code);
  13667. var con = new _testConsole__WEBPACK_IMPORTED_MODULE_3__["TestConsole"]([]);
  13668. var autoAssessment = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__["IVProgAssessment"](ast_code, original.testcases, con);
  13669. autoAssessment.runTest().then(function (grade) {
  13670. return callback(grade);
  13671. })["catch"](function (err) {
  13672. console.log(err);
  13673. callback(-5); // @FeedbackConvention Falha na execução
  13674. });
  13675. } catch (e) {
  13676. console.error(e);
  13677. callback(-5);
  13678. }
  13679. }
  13680. }
  13681. /***/ }),
  13682. /***/ "./js/util/inputTest.js":
  13683. /*!******************************!*\
  13684. !*** ./js/util/inputTest.js ***!
  13685. \******************************/
  13686. /*! exports provided: InputTest */
  13687. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13688. "use strict";
  13689. __webpack_require__.r(__webpack_exports__);
  13690. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputTest", function() { return InputTest; });
  13691. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13692. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13693. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13694. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13695. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13696. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13697. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13698. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13699. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13700. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13701. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13702. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13703. 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); }; }
  13704. 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; } }
  13705. var InputTest = /*#__PURE__*/function (_Input) {
  13706. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputTest, _Input);
  13707. var _super = _createSuper(InputTest);
  13708. function InputTest(inputList) {
  13709. var _this;
  13710. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputTest);
  13711. _this = _super.call(this);
  13712. _this.index = 0;
  13713. _this.inputList = inputList;
  13714. return _this;
  13715. }
  13716. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputTest, [{
  13717. key: "requestInput",
  13718. value: function requestInput() {
  13719. var _this2 = this;
  13720. var promise = new Promise(function (resolve, reject) {
  13721. if (_this2.index < _this2.inputList.length) {
  13722. resolve(_this2.inputList[_this2.index]);
  13723. _this2.index++;
  13724. } else {
  13725. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13726. }
  13727. });
  13728. return promise;
  13729. }
  13730. }]);
  13731. return InputTest;
  13732. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13733. /***/ }),
  13734. /***/ "./js/util/input_assessment.js":
  13735. /*!*************************************!*\
  13736. !*** ./js/util/input_assessment.js ***!
  13737. \*************************************/
  13738. /*! exports provided: InputAssessment */
  13739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13740. "use strict";
  13741. __webpack_require__.r(__webpack_exports__);
  13742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputAssessment", function() { return InputAssessment; });
  13743. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13744. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13745. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13746. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13747. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13748. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13749. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13750. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13751. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13752. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13753. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13754. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13755. 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); }; }
  13756. 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; } }
  13757. var InputAssessment = /*#__PURE__*/function (_Input) {
  13758. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputAssessment, _Input);
  13759. var _super = _createSuper(InputAssessment);
  13760. function InputAssessment(input_list) {
  13761. var _this;
  13762. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputAssessment);
  13763. _this = _super.call(this);
  13764. _this.index = 0;
  13765. _this.input_list = input_list.map(function (val) {
  13766. return {
  13767. "value": val,
  13768. "read": false
  13769. };
  13770. });
  13771. return _this;
  13772. }
  13773. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputAssessment, [{
  13774. key: "requestInput",
  13775. value: function requestInput() {
  13776. var _this2 = this;
  13777. var promise = new Promise(function (resolve, reject) {
  13778. if (_this2.index < _this2.input_list.length) {
  13779. var input = _this2.input_list[_this2.index];
  13780. input.read = true;
  13781. _this2.index += 1;
  13782. resolve(input.value);
  13783. } else {
  13784. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13785. }
  13786. });
  13787. return promise;
  13788. }
  13789. }, {
  13790. key: "isInputAvailable",
  13791. value: function isInputAvailable() {
  13792. return this.index < this.input_list.length;
  13793. }
  13794. }]);
  13795. return InputAssessment;
  13796. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13797. /***/ }),
  13798. /***/ "./js/util/maybe.ts":
  13799. /*!**************************!*\
  13800. !*** ./js/util/maybe.ts ***!
  13801. \**************************/
  13802. /*! no static exports found */
  13803. /***/ (function(module, exports, __webpack_require__) {
  13804. "use strict";
  13805. Object.defineProperty(exports, "__esModule", { value: true });
  13806. exports.Maybe = void 0;
  13807. /**
  13808. *
  13809. * Maybe Monad
  13810. * @Source: https://codewithstyle.info/advanced-functional-programming-in-typescript-maybe-monad/
  13811. * @Modified by: @lucascalion - 28/08/2019
  13812. *
  13813. **/
  13814. class Maybe {
  13815. constructor(value) {
  13816. this.value = value;
  13817. }
  13818. static some(value) {
  13819. if (!value) {
  13820. throw Error("Provided value must not be empty");
  13821. }
  13822. return new Maybe(value);
  13823. }
  13824. static none() {
  13825. return new Maybe(null);
  13826. }
  13827. static fromValue(value) {
  13828. return value ? Maybe.some(value) : Maybe.none();
  13829. }
  13830. getOrElse(defaultValue) {
  13831. return this.value === null ? defaultValue : this.value;
  13832. }
  13833. map(f) {
  13834. if (this.value === null) {
  13835. return Maybe.none();
  13836. }
  13837. else {
  13838. return Maybe.fromValue(f(this.value));
  13839. }
  13840. }
  13841. }
  13842. exports.Maybe = Maybe;
  13843. /***/ }),
  13844. /***/ "./js/util/outputTest.js":
  13845. /*!*******************************!*\
  13846. !*** ./js/util/outputTest.js ***!
  13847. \*******************************/
  13848. /*! exports provided: OutputTest */
  13849. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13850. "use strict";
  13851. __webpack_require__.r(__webpack_exports__);
  13852. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputTest", function() { return OutputTest; });
  13853. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13854. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13855. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13856. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13857. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13858. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13859. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13860. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13861. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13862. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13863. /* harmony import */ var _io_output__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/output */ "./js/io/output.js");
  13864. 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); }; }
  13865. 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; } }
  13866. var OutputTest = /*#__PURE__*/function (_Output) {
  13867. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(OutputTest, _Output);
  13868. var _super = _createSuper(OutputTest);
  13869. function OutputTest() {
  13870. var _this;
  13871. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputTest);
  13872. _this = _super.call(this);
  13873. _this.list = [];
  13874. _this.currentLine = null;
  13875. return _this;
  13876. }
  13877. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputTest, [{
  13878. key: "write",
  13879. value: function write(text) {
  13880. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13881. if (this.currentLine == null) {
  13882. this.currentLine = this.list.push("") - 1;
  13883. }
  13884. this.list[this.currentLine] += text;
  13885. if (newLine) {
  13886. this.currentLine = null;
  13887. }
  13888. }
  13889. }, {
  13890. key: "sendOutput",
  13891. value: function sendOutput(text) {
  13892. var _this2 = this;
  13893. var output = "" + text;
  13894. if (output.indexOf("\n") !== -1) {
  13895. var outputList = output.split("\n");
  13896. var last = outputList.pop();
  13897. outputList.forEach(function (t) {
  13898. //t = t.replace(/\t/g, '&#x0020;&#x0020;');
  13899. //t = t.replace(/\s/g, "&#x0020;");
  13900. if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
  13901. }); //last = last.replace(/\t/g, '&#x0020;&#x0020;');
  13902. //last = last.replace(/\s/g, "&#x0020;");
  13903. if (last.length != 0) this.write(last);
  13904. } else {
  13905. //output = output.replace(/\t/g, '&#x0020;&#x0020;');
  13906. //output = output.replace(/\s/g, "&#x0020;");
  13907. this.write(output);
  13908. }
  13909. }
  13910. }]);
  13911. return OutputTest;
  13912. }(_io_output__WEBPACK_IMPORTED_MODULE_5__["Output"]);
  13913. /***/ }),
  13914. /***/ "./js/util/parseFromVisual.js":
  13915. /*!************************************!*\
  13916. !*** ./js/util/parseFromVisual.js ***!
  13917. \************************************/
  13918. /*! exports provided: parseExpression */
  13919. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13920. "use strict";
  13921. __webpack_require__.r(__webpack_exports__);
  13922. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseExpression", function() { return parseExpression; });
  13923. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  13924. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  13925. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  13926. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ast/expressions */ "./js/ast/expressions/index.js");
  13927. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  13928. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  13929. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  13930. var TYPES = {
  13931. VARIABLE: "var",
  13932. CONST: "const",
  13933. FUNCTION: "function",
  13934. RELATIONAL: "relational",
  13935. LOGIC: "logic",
  13936. ARITHMETIC: "arithmetic"
  13937. };
  13938. function translateOp(type, op) {
  13939. switch (type) {
  13940. case TYPES.ARITHMETIC:
  13941. return op.value;
  13942. case TYPES.RELATIONAL:
  13943. return op.value;
  13944. case TYPES.LOGIC:
  13945. {
  13946. if (op.ord === 11) {
  13947. return "and";
  13948. } else if (op.ord === 12) {
  13949. return "or";
  13950. } else {
  13951. return "not";
  13952. }
  13953. }
  13954. }
  13955. }
  13956. function getOpType(op) {
  13957. switch (op.ord) {
  13958. case 0:
  13959. case 1:
  13960. case 2:
  13961. case 3:
  13962. case 4:
  13963. return TYPES.ARITHMETIC;
  13964. case 5:
  13965. case 6:
  13966. case 7:
  13967. case 8:
  13968. case 9:
  13969. case 10:
  13970. return TYPES.RELATIONAL;
  13971. default:
  13972. return TYPES.LOGIC;
  13973. }
  13974. }
  13975. function expressionWalker(expression) {
  13976. var result;
  13977. if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["VariableLiteral"]) {
  13978. result = [{
  13979. instance: "expression",
  13980. type: TYPES.VARIABLE,
  13981. value: expression.id
  13982. }];
  13983. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["FunctionCall"]) {
  13984. var funcObj = {
  13985. instance: "expression",
  13986. type: TYPES.FUNCTION,
  13987. value: expression.id
  13988. };
  13989. var paramsList = expression.actualParameters.map(function (e) {
  13990. return expressionWalker(e);
  13991. }); //const params = Array.prototype.concat.apply([], paramsList);
  13992. funcObj.params = paramsList;
  13993. result = [funcObj];
  13994. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["UnaryApp"]) {
  13995. var left = expressionWalker(expression.left);
  13996. var opType = getOpType(expression.op);
  13997. var opValue = translateOp(opType, expression.op);
  13998. result = [{
  13999. instance: "operator",
  14000. type: opType,
  14001. value: opValue
  14002. }].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(left));
  14003. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["InfixApp"]) {
  14004. var _left = expressionWalker(expression.left);
  14005. var right = expressionWalker(expression.right);
  14006. var _opType = getOpType(expression.op);
  14007. var _opValue = translateOp(_opType, expression.op);
  14008. result = [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(_left), [{
  14009. instance: "operator",
  14010. type: _opType,
  14011. value: _opValue
  14012. }], _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(right));
  14013. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["ArrayAccess"]) {
  14014. var line = expressionWalker(expression.line);
  14015. var arrayClass = "vector";
  14016. var column = null;
  14017. if (expression.column) {
  14018. arrayClass = "matrix";
  14019. column = expressionWalker(expression.column);
  14020. }
  14021. result = [{
  14022. instance: "expression",
  14023. type: TYPES.VARIABLE,
  14024. "class": arrayClass,
  14025. column: column,
  14026. line: line,
  14027. value: expression.id
  14028. }];
  14029. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_2__["BoolLiteral"]) {
  14030. var value = expression.value;
  14031. result = [{
  14032. instance: "expression",
  14033. "class": "simple",
  14034. type: TYPES.CONST,
  14035. value: Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertBoolToString"])(value)
  14036. }];
  14037. } else {
  14038. var _value = expression.value;
  14039. if (expression.value.toNumber) {
  14040. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.isCompatible(expression.type) && expression.value.decimalPlaces() == 0) {
  14041. _value = expression.value.toFixed(2);
  14042. } else {
  14043. _value = expression.value.toNumber();
  14044. }
  14045. }
  14046. result = [{
  14047. instance: "expression",
  14048. "class": "simple",
  14049. type: TYPES.CONST,
  14050. value: _value
  14051. }];
  14052. }
  14053. if (expression.parenthesis) return ["("].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(result), [")"]);else return result;
  14054. }
  14055. function parseExpression(text) {
  14056. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_1__["IVProgParser"].createParser(text);
  14057. var expressionAST = parser.parseExpressionOR();
  14058. return expressionWalker(expressionAST);
  14059. }
  14060. /***/ }),
  14061. /***/ "./js/util/string_diff.js":
  14062. /*!********************************!*\
  14063. !*** ./js/util/string_diff.js ***!
  14064. \********************************/
  14065. /*! exports provided: default */
  14066. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14067. "use strict";
  14068. __webpack_require__.r(__webpack_exports__);
  14069. /**
  14070. * Author: @jhchen - https://github.com/jhchen
  14071. * Modified by: @lucascalion - 23/07/2019
  14072. * This library modifies the diff-patch-match library by Neil Fraser
  14073. * by removing the patch and match functionality and certain advanced
  14074. * options in the diff function. The original license is as follows:
  14075. *
  14076. * ===
  14077. *
  14078. * Diff Match and Patch
  14079. *
  14080. * Copyright 2006 Google Inc.
  14081. * http://code.google.com/p/google-diff-match-patch/
  14082. *
  14083. * Licensed under the Apache License, Version 2.0 (the "License");
  14084. * you may not use this file except in compliance with the License.
  14085. * You may obtain a copy of the License at
  14086. *
  14087. * http://www.apache.org/licenses/LICENSE-2.0
  14088. *
  14089. * Unless required by applicable law or agreed to in writing, software
  14090. * distributed under the License is distributed on an "AS IS" BASIS,
  14091. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14092. * See the License for the specific language governing permissions and
  14093. * limitations under the License.
  14094. */
  14095. /**
  14096. * The data structure representing a diff is an array of tuples:
  14097. * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
  14098. * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
  14099. */
  14100. var DIFF_DELETE = -1;
  14101. var DIFF_INSERT = 1;
  14102. var DIFF_EQUAL = 0;
  14103. /**
  14104. * Find the differences between two texts. Simplifies the problem by stripping
  14105. * any common prefix or suffix off the texts before diffing.
  14106. * @param {string} text1 Old string to be diffed.
  14107. * @param {string} text2 New string to be diffed.
  14108. * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info
  14109. * @return {Array} Array of diff tuples.
  14110. */
  14111. function diff_main(text1, text2, cursor_pos, _fix_unicode) {
  14112. // Check for equality
  14113. if (text1 === text2) {
  14114. if (text1) {
  14115. return [[DIFF_EQUAL, text1]];
  14116. }
  14117. return [];
  14118. }
  14119. if (cursor_pos != null) {
  14120. var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
  14121. if (editdiff) {
  14122. return editdiff;
  14123. }
  14124. } // Trim off common prefix (speedup).
  14125. var commonlength = diff_commonPrefix(text1, text2);
  14126. var commonprefix = text1.substring(0, commonlength);
  14127. text1 = text1.substring(commonlength);
  14128. text2 = text2.substring(commonlength); // Trim off common suffix (speedup).
  14129. commonlength = diff_commonSuffix(text1, text2);
  14130. var commonsuffix = text1.substring(text1.length - commonlength);
  14131. text1 = text1.substring(0, text1.length - commonlength);
  14132. text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block.
  14133. var diffs = diff_compute_(text1, text2); // Restore the prefix and suffix.
  14134. if (commonprefix) {
  14135. diffs.unshift([DIFF_EQUAL, commonprefix]);
  14136. }
  14137. if (commonsuffix) {
  14138. diffs.push([DIFF_EQUAL, commonsuffix]);
  14139. }
  14140. diff_cleanupMerge(diffs, _fix_unicode);
  14141. return diffs;
  14142. }
  14143. /**
  14144. * Find the differences between two texts. Assumes that the texts do not
  14145. * have any common prefix or suffix.
  14146. * @param {string} text1 Old string to be diffed.
  14147. * @param {string} text2 New string to be diffed.
  14148. * @return {Array} Array of diff tuples.
  14149. */
  14150. function diff_compute_(text1, text2) {
  14151. var diffs;
  14152. if (!text1) {
  14153. // Just add some text (speedup).
  14154. return [[DIFF_INSERT, text2]];
  14155. }
  14156. if (!text2) {
  14157. // Just delete some text (speedup).
  14158. return [[DIFF_DELETE, text1]];
  14159. }
  14160. var longtext = text1.length > text2.length ? text1 : text2;
  14161. var shorttext = text1.length > text2.length ? text2 : text1;
  14162. var i = longtext.indexOf(shorttext);
  14163. if (i !== -1) {
  14164. // Shorter text is inside the longer text (speedup).
  14165. 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.
  14166. if (text1.length > text2.length) {
  14167. diffs[0][0] = diffs[2][0] = DIFF_DELETE;
  14168. }
  14169. return diffs;
  14170. }
  14171. if (shorttext.length === 1) {
  14172. // Single character string.
  14173. // After the previous speedup, the character can't be an equality.
  14174. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  14175. } // Check to see if the problem can be split in two.
  14176. var hm = diff_halfMatch_(text1, text2);
  14177. if (hm) {
  14178. // A half-match was found, sort out the return data.
  14179. var text1_a = hm[0];
  14180. var text1_b = hm[1];
  14181. var text2_a = hm[2];
  14182. var text2_b = hm[3];
  14183. var mid_common = hm[4]; // Send both pairs off for separate processing.
  14184. var diffs_a = diff_main(text1_a, text2_a);
  14185. var diffs_b = diff_main(text1_b, text2_b); // Merge the results.
  14186. return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
  14187. }
  14188. return diff_bisect_(text1, text2);
  14189. }
  14190. /**
  14191. * Find the 'middle snake' of a diff, split the problem in two
  14192. * and return the recursively constructed diff.
  14193. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
  14194. * @param {string} text1 Old string to be diffed.
  14195. * @param {string} text2 New string to be diffed.
  14196. * @return {Array} Array of diff tuples.
  14197. * @private
  14198. */
  14199. function diff_bisect_(text1, text2) {
  14200. // Cache the text lengths to prevent multiple calls.
  14201. var text1_length = text1.length;
  14202. var text2_length = text2.length;
  14203. var max_d = Math.ceil((text1_length + text2_length) / 2);
  14204. var v_offset = max_d;
  14205. var v_length = 2 * max_d;
  14206. var v1 = new Array(v_length);
  14207. var v2 = new Array(v_length); // Setting all elements to -1 is faster in Chrome & Firefox than mixing
  14208. // integers and undefined.
  14209. for (var x = 0; x < v_length; x++) {
  14210. v1[x] = -1;
  14211. v2[x] = -1;
  14212. }
  14213. v1[v_offset + 1] = 0;
  14214. v2[v_offset + 1] = 0;
  14215. var delta = text1_length - text2_length; // If the total number of characters is odd, then the front path will collide
  14216. // with the reverse path.
  14217. var front = delta % 2 !== 0; // Offsets for start and end of k loop.
  14218. // Prevents mapping of space beyond the grid.
  14219. var k1start = 0;
  14220. var k1end = 0;
  14221. var k2start = 0;
  14222. var k2end = 0;
  14223. for (var d = 0; d < max_d; d++) {
  14224. // Walk the front path one step.
  14225. for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
  14226. var k1_offset = v_offset + k1;
  14227. var x1 = void 0;
  14228. if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
  14229. x1 = v1[k1_offset + 1];
  14230. } else {
  14231. x1 = v1[k1_offset - 1] + 1;
  14232. }
  14233. var y1 = x1 - k1;
  14234. while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
  14235. x1++;
  14236. y1++;
  14237. }
  14238. v1[k1_offset] = x1;
  14239. if (x1 > text1_length) {
  14240. // Ran off the right of the graph.
  14241. k1end += 2;
  14242. } else if (y1 > text2_length) {
  14243. // Ran off the bottom of the graph.
  14244. k1start += 2;
  14245. } else if (front) {
  14246. var k2_offset = v_offset + delta - k1;
  14247. if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
  14248. // Mirror x2 onto top-left coordinate system.
  14249. var x2 = text1_length - v2[k2_offset];
  14250. if (x1 >= x2) {
  14251. // Overlap detfrontected.
  14252. return diff_bisectSplit_(text1, text2, x1, y1);
  14253. }
  14254. }
  14255. }
  14256. } // Walk the reverse path one step.
  14257. for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
  14258. var _k2_offset = v_offset + k2;
  14259. var _x = void 0;
  14260. if (k2 === -d || k2 !== d && v2[_k2_offset - 1] < v2[_k2_offset + 1]) {
  14261. _x = v2[_k2_offset + 1];
  14262. } else {
  14263. _x = v2[_k2_offset - 1] + 1;
  14264. }
  14265. var y2 = _x - k2;
  14266. while (_x < text1_length && y2 < text2_length && text1.charAt(text1_length - _x - 1) === text2.charAt(text2_length - y2 - 1)) {
  14267. _x++;
  14268. y2++;
  14269. }
  14270. v2[_k2_offset] = _x;
  14271. if (_x > text1_length) {
  14272. // Ran off the left of the graph.
  14273. k2end += 2;
  14274. } else if (y2 > text2_length) {
  14275. // Ran off the top of the graph.
  14276. k2start += 2;
  14277. } else if (!front) {
  14278. var _k1_offset = v_offset + delta - k2;
  14279. if (_k1_offset >= 0 && _k1_offset < v_length && v1[_k1_offset] !== -1) {
  14280. var _x2 = v1[_k1_offset];
  14281. var _y = v_offset + _x2 - _k1_offset; // Mirror x2 onto top-left coordinate system.
  14282. _x = text1_length - _x;
  14283. if (_x2 >= _x) {
  14284. // Overlap detected.
  14285. return diff_bisectSplit_(text1, text2, _x2, _y);
  14286. }
  14287. }
  14288. }
  14289. }
  14290. } // Diff took too long and hit the deadline or
  14291. // number of diffs equals number of characters, no commonality at all.
  14292. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  14293. }
  14294. /**
  14295. * Given the location of the 'middle snake', split the diff in two parts
  14296. * and recurse.
  14297. * @param {string} text1 Old string to be diffed.
  14298. * @param {string} text2 New string to be diffed.
  14299. * @param {number} x Index of split point in text1.
  14300. * @param {number} y Index of split point in text2.
  14301. * @return {Array} Array of diff tuples.
  14302. */
  14303. function diff_bisectSplit_(text1, text2, x, y) {
  14304. var text1a = text1.substring(0, x);
  14305. var text2a = text2.substring(0, y);
  14306. var text1b = text1.substring(x);
  14307. var text2b = text2.substring(y); // Compute both diffs serially.
  14308. var diffs = diff_main(text1a, text2a);
  14309. var diffsb = diff_main(text1b, text2b);
  14310. return diffs.concat(diffsb);
  14311. }
  14312. /**
  14313. * Determine the common prefix of two strings.
  14314. * @param {string} text1 First string.
  14315. * @param {string} text2 Second string.
  14316. * @return {number} The number of characters common to the start of each
  14317. * string.
  14318. */
  14319. function diff_commonPrefix(text1, text2) {
  14320. // Quick check for common null cases.
  14321. if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
  14322. return 0;
  14323. } // Binary search.
  14324. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  14325. var pointermin = 0;
  14326. var pointermax = Math.min(text1.length, text2.length);
  14327. var pointermid = pointermax;
  14328. var pointerstart = 0;
  14329. while (pointermin < pointermid) {
  14330. if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
  14331. pointermin = pointermid;
  14332. pointerstart = pointermin;
  14333. } else {
  14334. pointermax = pointermid;
  14335. }
  14336. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  14337. }
  14338. if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
  14339. pointermid--;
  14340. }
  14341. return pointermid;
  14342. }
  14343. /**
  14344. * Determine the common suffix of two strings.
  14345. * @param {string} text1 First string.
  14346. * @param {string} text2 Second string.
  14347. * @return {number} The number of characters common to the end of each string.
  14348. */
  14349. function diff_commonSuffix(text1, text2) {
  14350. // Quick check for common null cases.
  14351. if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
  14352. return 0;
  14353. } // Binary search.
  14354. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  14355. var pointermin = 0;
  14356. var pointermax = Math.min(text1.length, text2.length);
  14357. var pointermid = pointermax;
  14358. var pointerend = 0;
  14359. while (pointermin < pointermid) {
  14360. if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
  14361. pointermin = pointermid;
  14362. pointerend = pointermin;
  14363. } else {
  14364. pointermax = pointermid;
  14365. }
  14366. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  14367. }
  14368. if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
  14369. pointermid--;
  14370. }
  14371. return pointermid;
  14372. }
  14373. /**
  14374. * Do the two texts share a substring which is at least half the length of the
  14375. * longer text?
  14376. * This speedup can produce non-minimal diffs.
  14377. * @param {string} text1 First string.
  14378. * @param {string} text2 Second string.
  14379. * @return {Array.<string>} Five element Array, containing the prefix of
  14380. * text1, the suffix of text1, the prefix of text2, the suffix of
  14381. * text2 and the common middle. Or null if there was no match.
  14382. */
  14383. function diff_halfMatch_(text1, text2) {
  14384. var longtext = text1.length > text2.length ? text1 : text2;
  14385. var shorttext = text1.length > text2.length ? text2 : text1;
  14386. if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
  14387. return null; // Pointless.
  14388. }
  14389. /**
  14390. * Does a substring of shorttext exist within longtext such that the substring
  14391. * is at least half the length of longtext?
  14392. * Closure, but does not reference any external variables.
  14393. * @param {string} longtext Longer string.
  14394. * @param {string} shorttext Shorter string.
  14395. * @param {number} i Start index of quarter length substring within longtext.
  14396. * @return {Array.<string>} Five element Array, containing the prefix of
  14397. * longtext, the suffix of longtext, the prefix of shorttext, the suffix
  14398. * of shorttext and the common middle. Or null if there was no match.
  14399. * @private
  14400. */
  14401. function diff_halfMatchI_(longtext, shorttext, i) {
  14402. // Start with a 1/4 length substring at position i as a seed.
  14403. var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
  14404. var j = -1;
  14405. var best_common = '';
  14406. var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
  14407. while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {
  14408. var prefixLength = diff_commonPrefix(longtext.substring(i), shorttext.substring(j));
  14409. var suffixLength = diff_commonSuffix(longtext.substring(0, i), shorttext.substring(0, j));
  14410. if (best_common.length < suffixLength + prefixLength) {
  14411. best_common = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength);
  14412. best_longtext_a = longtext.substring(0, i - suffixLength);
  14413. best_longtext_b = longtext.substring(i + prefixLength);
  14414. best_shorttext_a = shorttext.substring(0, j - suffixLength);
  14415. best_shorttext_b = shorttext.substring(j + prefixLength);
  14416. }
  14417. }
  14418. if (best_common.length * 2 >= longtext.length) {
  14419. return [best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common];
  14420. } else {
  14421. return null;
  14422. }
  14423. } // First check if the second quarter is the seed for a half-match.
  14424. var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter.
  14425. var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
  14426. var hm;
  14427. if (!hm1 && !hm2) {
  14428. return null;
  14429. } else if (!hm2) {
  14430. hm = hm1;
  14431. } else if (!hm1) {
  14432. hm = hm2;
  14433. } else {
  14434. // Both matched. Select the longest.
  14435. hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
  14436. } // A half-match was found, sort out the return data.
  14437. var text1_a, text1_b, text2_a, text2_b;
  14438. if (text1.length > text2.length) {
  14439. text1_a = hm[0];
  14440. text1_b = hm[1];
  14441. text2_a = hm[2];
  14442. text2_b = hm[3];
  14443. } else {
  14444. text2_a = hm[0];
  14445. text2_b = hm[1];
  14446. text1_a = hm[2];
  14447. text1_b = hm[3];
  14448. }
  14449. var mid_common = hm[4];
  14450. return [text1_a, text1_b, text2_a, text2_b, mid_common];
  14451. }
  14452. /**
  14453. * Reorder and merge like edit sections. Merge equalities.
  14454. * Any edit section can move as long as it doesn't cross an equality.
  14455. * @param {Array} diffs Array of diff tuples.
  14456. * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff
  14457. */
  14458. function diff_cleanupMerge(diffs, fix_unicode) {
  14459. diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
  14460. var pointer = 0;
  14461. var count_delete = 0;
  14462. var count_insert = 0;
  14463. var text_delete = '';
  14464. var text_insert = '';
  14465. var commonlength;
  14466. var previous_equality;
  14467. while (pointer < diffs.length) {
  14468. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  14469. diffs.splice(pointer, 1);
  14470. continue;
  14471. }
  14472. switch (diffs[pointer][0]) {
  14473. case DIFF_INSERT:
  14474. count_insert++;
  14475. text_insert += diffs[pointer][1];
  14476. pointer++;
  14477. break;
  14478. case DIFF_DELETE:
  14479. count_delete++;
  14480. text_delete += diffs[pointer][1];
  14481. pointer++;
  14482. break;
  14483. case DIFF_EQUAL:
  14484. previous_equality = pointer - count_insert - count_delete - 1;
  14485. if (fix_unicode) {
  14486. // prevent splitting of unicode surrogate pairs. when fix_unicode is true,
  14487. // we assume that the old and new text in the diff are complete and correct
  14488. // unicode-encoded JS strings, but the tuple boundaries may fall between
  14489. // surrogate pairs. we fix this by shaving off stray surrogates from the end
  14490. // of the previous equality and the beginning of this equality. this may create
  14491. // empty equalities or a common prefix or suffix. for example, if AB and AC are
  14492. // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and
  14493. // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this
  14494. // particular case, both equalities go away, we absorb any previous inequalities,
  14495. // and we keep scanning for the next equality before rewriting the tuples.
  14496. if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
  14497. var stray = diffs[previous_equality][1].slice(-1);
  14498. diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
  14499. text_delete = stray + text_delete;
  14500. text_insert = stray + text_insert;
  14501. if (!diffs[previous_equality][1]) {
  14502. // emptied out previous equality, so delete it and include previous delete/insert
  14503. diffs.splice(previous_equality, 1);
  14504. pointer--;
  14505. var k = previous_equality - 1;
  14506. if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
  14507. count_insert++;
  14508. text_insert = diffs[k][1] + text_insert;
  14509. k--;
  14510. }
  14511. if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
  14512. count_delete++;
  14513. text_delete = diffs[k][1] + text_delete;
  14514. k--;
  14515. }
  14516. previous_equality = k;
  14517. }
  14518. }
  14519. if (starts_with_pair_end(diffs[pointer][1])) {
  14520. var _stray = diffs[pointer][1].charAt(0);
  14521. diffs[pointer][1] = diffs[pointer][1].slice(1);
  14522. text_delete += _stray;
  14523. text_insert += _stray;
  14524. }
  14525. }
  14526. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  14527. // for empty equality not at end, wait for next equality
  14528. diffs.splice(pointer, 1);
  14529. break;
  14530. }
  14531. if (text_delete.length > 0 || text_insert.length > 0) {
  14532. // note that diff_commonPrefix and diff_commonSuffix are unicode-aware
  14533. if (text_delete.length > 0 && text_insert.length > 0) {
  14534. // Factor out any common prefixes.
  14535. commonlength = diff_commonPrefix(text_insert, text_delete);
  14536. if (commonlength !== 0) {
  14537. if (previous_equality >= 0) {
  14538. diffs[previous_equality][1] += text_insert.substring(0, commonlength);
  14539. } else {
  14540. diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
  14541. pointer++;
  14542. }
  14543. text_insert = text_insert.substring(commonlength);
  14544. text_delete = text_delete.substring(commonlength);
  14545. } // Factor out any common suffixes.
  14546. commonlength = diff_commonSuffix(text_insert, text_delete);
  14547. if (commonlength !== 0) {
  14548. diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
  14549. text_insert = text_insert.substring(0, text_insert.length - commonlength);
  14550. text_delete = text_delete.substring(0, text_delete.length - commonlength);
  14551. }
  14552. } // Delete the offending records and add the merged ones.
  14553. var n = count_insert + count_delete;
  14554. if (text_delete.length === 0 && text_insert.length === 0) {
  14555. diffs.splice(pointer - n, n);
  14556. pointer = pointer - n;
  14557. } else if (text_delete.length === 0) {
  14558. diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
  14559. pointer = pointer - n + 1;
  14560. } else if (text_insert.length === 0) {
  14561. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
  14562. pointer = pointer - n + 1;
  14563. } else {
  14564. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
  14565. pointer = pointer - n + 2;
  14566. }
  14567. }
  14568. if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
  14569. // Merge this equality with the previous one.
  14570. diffs[pointer - 1][1] += diffs[pointer][1];
  14571. diffs.splice(pointer, 1);
  14572. } else {
  14573. pointer++;
  14574. }
  14575. count_insert = 0;
  14576. count_delete = 0;
  14577. text_delete = '';
  14578. text_insert = '';
  14579. break;
  14580. }
  14581. }
  14582. if (diffs[diffs.length - 1][1] === '') {
  14583. diffs.pop(); // Remove the dummy entry at the end.
  14584. } // Second pass: look for single edits surrounded on both sides by equalities
  14585. // which can be shifted sideways to eliminate an equality.
  14586. // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
  14587. var changes = false;
  14588. pointer = 1; // Intentionally ignore the first and last element (don't need checking).
  14589. while (pointer < diffs.length - 1) {
  14590. if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
  14591. // This is a single edit surrounded by equalities.
  14592. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
  14593. // Shift the edit over the previous equality.
  14594. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
  14595. diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
  14596. diffs.splice(pointer - 1, 1);
  14597. changes = true;
  14598. } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
  14599. // Shift the edit over the next equality.
  14600. diffs[pointer - 1][1] += diffs[pointer + 1][1];
  14601. diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
  14602. diffs.splice(pointer + 1, 1);
  14603. changes = true;
  14604. }
  14605. }
  14606. pointer++;
  14607. } // If shifts were made, the diff needs reordering and another shift sweep.
  14608. if (changes) {
  14609. diff_cleanupMerge(diffs, fix_unicode);
  14610. }
  14611. }
  14612. function is_surrogate_pair_start(charCode) {
  14613. return charCode >= 0xD800 && charCode <= 0xDBFF;
  14614. }
  14615. function is_surrogate_pair_end(charCode) {
  14616. return charCode >= 0xDC00 && charCode <= 0xDFFF;
  14617. }
  14618. function starts_with_pair_end(str) {
  14619. return is_surrogate_pair_end(str.charCodeAt(0));
  14620. }
  14621. function ends_with_pair_start(str) {
  14622. return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
  14623. }
  14624. function remove_empty_tuples(tuples) {
  14625. var ret = [];
  14626. for (var i = 0; i < tuples.length; i++) {
  14627. if (tuples[i][1].length > 0) {
  14628. ret.push(tuples[i]);
  14629. }
  14630. }
  14631. return ret;
  14632. }
  14633. function make_edit_splice(before, oldMiddle, newMiddle, after) {
  14634. if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
  14635. return null;
  14636. }
  14637. return remove_empty_tuples([[DIFF_EQUAL, before], [DIFF_DELETE, oldMiddle], [DIFF_INSERT, newMiddle], [DIFF_EQUAL, after]]);
  14638. }
  14639. function find_cursor_edit_diff(oldText, newText, cursor_pos) {
  14640. // note: this runs after equality check has ruled out exact equality
  14641. var oldRange = typeof cursor_pos === 'number' ? {
  14642. index: cursor_pos,
  14643. length: 0
  14644. } : cursor_pos.oldRange;
  14645. var newRange = typeof cursor_pos === 'number' ? null : cursor_pos.newRange; // take into account the old and new selection to generate the best diff
  14646. // possible for a text edit. for example, a text change from "xxx" to "xx"
  14647. // could be a delete or forwards-delete of any one of the x's, or the
  14648. // result of selecting two of the x's and typing "x".
  14649. var oldLength = oldText.length;
  14650. var newLength = newText.length;
  14651. if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
  14652. // see if we have an insert or delete before or after cursor
  14653. var oldCursor = oldRange.index;
  14654. var oldBefore = oldText.slice(0, oldCursor);
  14655. var oldAfter = oldText.slice(oldCursor);
  14656. var maybeNewCursor = newRange ? newRange.index : null;
  14657. editBefore: {
  14658. // is this an insert or delete right before oldCursor?
  14659. var newCursor = oldCursor + newLength - oldLength;
  14660. if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
  14661. break editBefore;
  14662. }
  14663. if (newCursor < 0 || newCursor > newLength) {
  14664. break editBefore;
  14665. }
  14666. var newBefore = newText.slice(0, newCursor);
  14667. var newAfter = newText.slice(newCursor);
  14668. if (newAfter !== oldAfter) {
  14669. break editBefore;
  14670. }
  14671. var prefixLength = Math.min(oldCursor, newCursor);
  14672. var oldPrefix = oldBefore.slice(0, prefixLength);
  14673. var newPrefix = newBefore.slice(0, prefixLength);
  14674. if (oldPrefix !== newPrefix) {
  14675. break editBefore;
  14676. }
  14677. var oldMiddle = oldBefore.slice(prefixLength);
  14678. var newMiddle = newBefore.slice(prefixLength);
  14679. return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
  14680. }
  14681. editAfter: {
  14682. // is this an insert or delete right after oldCursor?
  14683. if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
  14684. break editAfter;
  14685. }
  14686. var cursor = oldCursor;
  14687. var _newBefore = newText.slice(0, cursor);
  14688. var _newAfter = newText.slice(cursor);
  14689. if (_newBefore !== oldBefore) {
  14690. break editAfter;
  14691. }
  14692. var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
  14693. var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
  14694. var newSuffix = _newAfter.slice(_newAfter.length - suffixLength);
  14695. if (oldSuffix !== newSuffix) {
  14696. break editAfter;
  14697. }
  14698. var _oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
  14699. var _newMiddle = _newAfter.slice(0, _newAfter.length - suffixLength);
  14700. return make_edit_splice(oldBefore, _oldMiddle, _newMiddle, oldSuffix);
  14701. }
  14702. }
  14703. if (oldRange.length > 0 && newRange && newRange.length === 0) {
  14704. replaceRange: {
  14705. // see if diff could be a splice of the old selection range
  14706. var _oldPrefix = oldText.slice(0, oldRange.index);
  14707. var _oldSuffix = oldText.slice(oldRange.index + oldRange.length);
  14708. var _prefixLength = _oldPrefix.length;
  14709. var _suffixLength = _oldSuffix.length;
  14710. if (newLength < _prefixLength + _suffixLength) {
  14711. break replaceRange;
  14712. }
  14713. var _newPrefix = newText.slice(0, _prefixLength);
  14714. var _newSuffix = newText.slice(newLength - _suffixLength);
  14715. if (_oldPrefix !== _newPrefix || _oldSuffix !== _newSuffix) {
  14716. break replaceRange;
  14717. }
  14718. var _oldMiddle2 = oldText.slice(_prefixLength, oldLength - _suffixLength);
  14719. var _newMiddle2 = newText.slice(_prefixLength, newLength - _suffixLength);
  14720. return make_edit_splice(_oldPrefix, _oldMiddle2, _newMiddle2, _oldSuffix);
  14721. }
  14722. }
  14723. return null;
  14724. }
  14725. function diff(text1, text2, cursor_pos) {
  14726. // only pass fix_unicode=true at the top level, not when diff_main is
  14727. // recursively invoked
  14728. return diff_main(text1, text2, cursor_pos, true);
  14729. }
  14730. diff.INSERT = DIFF_INSERT;
  14731. diff.DELETE = DIFF_DELETE;
  14732. diff.EQUAL = DIFF_EQUAL;
  14733. /* harmony default export */ __webpack_exports__["default"] = (diff);
  14734. /***/ }),
  14735. /***/ "./js/util/testConsole.js":
  14736. /*!********************************!*\
  14737. !*** ./js/util/testConsole.js ***!
  14738. \********************************/
  14739. /*! exports provided: TestConsole */
  14740. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14741. "use strict";
  14742. __webpack_require__.r(__webpack_exports__);
  14743. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestConsole", function() { return TestConsole; });
  14744. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  14745. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  14746. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  14747. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  14748. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../io/domConsole */ "./js/io/domConsole.js");
  14749. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14750. var LocalizedStrings = Object(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["getInstance"])();
  14751. var TestConsole = /*#__PURE__*/function () {
  14752. function TestConsole(inputList) {
  14753. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, TestConsole);
  14754. this.index = 0;
  14755. this.inputList = inputList;
  14756. this.list = [];
  14757. this.currentLine = null;
  14758. }
  14759. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(TestConsole, [{
  14760. key: "writeRawHTML",
  14761. value: function writeRawHTML(text) {
  14762. this._appendTextLn(text);
  14763. }
  14764. }, {
  14765. key: "write",
  14766. value: function write(text) {
  14767. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14768. this._appendText(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER, newLine);
  14769. }
  14770. }, {
  14771. key: "info",
  14772. value: function info(text) {
  14773. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO);
  14774. }
  14775. }, {
  14776. key: "err",
  14777. value: function err(text) {
  14778. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR);
  14779. }
  14780. }, {
  14781. key: "_appendText",
  14782. value: function _appendText(text, _type) {
  14783. var newLine = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14784. if (this.currentLine == null) {
  14785. this.currentLine = this.list.push('') - 1;
  14786. }
  14787. this.list[this.currentLine] += text;
  14788. if (newLine) {
  14789. this.currentLine = null;
  14790. }
  14791. }
  14792. }, {
  14793. key: "_appendTextLn",
  14794. value: function _appendTextLn(text) {
  14795. this.list.push(text);
  14796. this.currentLine = null;
  14797. }
  14798. }, {
  14799. key: "getClassForType",
  14800. value: function getClassForType(type) {
  14801. switch (type) {
  14802. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER:
  14803. return "ivprog-term-userText";
  14804. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO:
  14805. return "ivprog-term-info";
  14806. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR:
  14807. return "ivprog-term-error";
  14808. }
  14809. }
  14810. }, {
  14811. key: "requestInput",
  14812. value: function requestInput() {
  14813. var _this = this;
  14814. var promise = new Promise(function (resolve, reject) {
  14815. if (_this.index < _this.inputList.length) {
  14816. resolve(_this.inputList[_this.index]);
  14817. _this.index++;
  14818. } else {
  14819. reject(new Error(LocalizedStrings.getError("exceeded_input_request")));
  14820. }
  14821. });
  14822. return promise;
  14823. }
  14824. }, {
  14825. key: "sendOutput",
  14826. value: function sendOutput(text) {
  14827. var _this2 = this;
  14828. var output = '' + text;
  14829. if (output.indexOf('\n') !== -1) {
  14830. var outputList = output.split('\n');
  14831. var last = outputList.pop();
  14832. outputList.forEach(function (t) {
  14833. t = t.replace(/\t/g, '&#x0020;&#x0020;');
  14834. t = t.replace(/\s/g, "&#x0020;");
  14835. if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
  14836. });
  14837. last = last.replace(/\t/g, '&#x0020;&#x0020;');
  14838. last = last.replace(/\s/g, "&#x0020;");
  14839. if (last.length != 0) this.write(last);
  14840. } else {
  14841. output = output.replace(/\t/g, '&#x0020;&#x0020;');
  14842. output = output.replace(/\s/g, "&#x0020;");
  14843. this.write(output);
  14844. }
  14845. }
  14846. }]);
  14847. return TestConsole;
  14848. }();
  14849. /***/ }),
  14850. /***/ "./js/util/utils.js":
  14851. /*!**************************!*\
  14852. !*** ./js/util/utils.js ***!
  14853. \**************************/
  14854. /*! exports provided: scrollIt, isElementInViewport, isKeyword, isValidIdentifier, getCodeEditorModeConfig, levenshteinDistance, openAssessmentDetail, range, sleep */
  14855. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14856. "use strict";
  14857. __webpack_require__.r(__webpack_exports__);
  14858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollIt", function() { return scrollIt; });
  14859. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementInViewport", function() { return isElementInViewport; });
  14860. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyword", function() { return isKeyword; });
  14861. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidIdentifier", function() { return isValidIdentifier; });
  14862. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeEditorModeConfig", function() { return getCodeEditorModeConfig; });
  14863. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "levenshteinDistance", function() { return levenshteinDistance; });
  14864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return openAssessmentDetail; });
  14865. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
  14866. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sleep", function() { return sleep; });
  14867. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  14868. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  14869. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  14870. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  14871. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  14872. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);
  14873. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../services/languageService */ "./js/services/languageService.js");
  14874. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14875. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  14876. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_5__);
  14877. /**
  14878. * source: https://pawelgrzybek.com/page-scroll-in-vanilla-javascript/
  14879. *
  14880. */
  14881. function scrollIt(destination) {
  14882. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
  14883. var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'linear';
  14884. var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  14885. var easings = {
  14886. linear: function linear(t) {
  14887. return t;
  14888. },
  14889. easeInQuad: function easeInQuad(t) {
  14890. return t * t;
  14891. },
  14892. easeOutQuad: function easeOutQuad(t) {
  14893. return t * (2 - t);
  14894. },
  14895. easeInOutQuad: function easeInOutQuad(t) {
  14896. return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
  14897. },
  14898. easeInCubic: function easeInCubic(t) {
  14899. return t * t * t;
  14900. },
  14901. easeOutCubic: function easeOutCubic(t) {
  14902. return --t * t * t + 1;
  14903. },
  14904. easeInOutCubic: function easeInOutCubic(t) {
  14905. return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
  14906. },
  14907. easeInQuart: function easeInQuart(t) {
  14908. return t * t * t * t;
  14909. },
  14910. easeOutQuart: function easeOutQuart(t) {
  14911. return 1 - --t * t * t * t;
  14912. },
  14913. easeInOutQuart: function easeInOutQuart(t) {
  14914. return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
  14915. },
  14916. easeInQuint: function easeInQuint(t) {
  14917. return t * t * t * t * t;
  14918. },
  14919. easeOutQuint: function easeOutQuint(t) {
  14920. return 1 + --t * t * t * t * t;
  14921. },
  14922. easeInOutQuint: function easeInOutQuint(t) {
  14923. return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
  14924. }
  14925. };
  14926. var start = window.pageYOffset;
  14927. var startTime = 'now' in window.performance ? performance.now() : new Date().getTime();
  14928. var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
  14929. var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
  14930. var destinationOffset = typeof destination === 'number' ? destination : destination.offsetTop;
  14931. var destinationOffsetToScroll = Math.round(documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset);
  14932. if ('requestAnimationFrame' in window === false) {
  14933. window.scroll(0, destinationOffsetToScroll);
  14934. if (callback) {
  14935. callback();
  14936. }
  14937. return;
  14938. }
  14939. function scroll() {
  14940. var now = 'now' in window.performance ? performance.now() : new Date().getTime();
  14941. var time = Math.min(1, (now - startTime) / duration);
  14942. var timeFunction = easings[easing](time);
  14943. window.scroll(0, Math.ceil(timeFunction * (destinationOffsetToScroll - start) + start));
  14944. if (window.pageYOffset === destinationOffsetToScroll) {
  14945. if (callback) {
  14946. callback();
  14947. }
  14948. return;
  14949. }
  14950. requestAnimationFrame(scroll);
  14951. }
  14952. scroll();
  14953. }
  14954. /**
  14955. *
  14956. * source: https://stackoverflow.com/a/16270434
  14957. */
  14958. function isElementInViewport(el) {
  14959. var rect = el.getBoundingClientRect();
  14960. return rect.bottom > 0 && rect.right > 0 && rect.left < (window.innerWidth || document.documentElement.clientWidth) && rect.top < (window.innerHeight || document.documentElement.clientHeight);
  14961. }
  14962. var cacheMainList = null;
  14963. var cacheOp = null;
  14964. function fillCache() {
  14965. if (cacheMainList == null) {
  14966. cacheMainList = [];
  14967. 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"];
  14968. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  14969. var nullLexer = new lexerClass();
  14970. for (var key = 0; key < mainList.length; ++key) {
  14971. var word = mainList[key];
  14972. var keyword = nullLexer.literalNames[lexerClass[word]];
  14973. cacheMainList.push(keyword.substring(1, keyword.length - 1));
  14974. }
  14975. }
  14976. if (cacheOp == null) {
  14977. cacheOp = [];
  14978. 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];
  14979. for (var op = 0; op < logicOpList.length; ++op) {
  14980. var lOp = "logic_operator_".concat(logicOpList[op]);
  14981. cacheOp.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp));
  14982. }
  14983. }
  14984. }
  14985. function isKeyword(text) {
  14986. fillCache();
  14987. for (var key = 0; key < cacheMainList.length; ++key) {
  14988. var keyword = cacheMainList[key];
  14989. if (keyword == text) {
  14990. return true;
  14991. }
  14992. } // not in main list, check op
  14993. for (var op = 0; op < cacheOp.length; op++) {
  14994. var lOp = cacheOp[op];
  14995. if (lOp == text) {
  14996. return true;
  14997. }
  14998. }
  14999. return false;
  15000. }
  15001. function isValidIdentifier(identifier_str) {
  15002. var validRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  15003. if (!validRegex) {
  15004. return false;
  15005. }
  15006. return !isKeyword(identifier_str);
  15007. }
  15008. function getCodeEditorModeConfig() {
  15009. 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"];
  15010. var keywordsList = ["RK_CONST", "RK_RETURN", "RK_BREAK", "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS", "RK_DO_UNTIL"];
  15011. var typeList = ["RK_REAL", "RK_VOID", "RK_BOOLEAN", "RK_STRING", "RK_INTEGER", "RK_CHARACTER"];
  15012. var atomList = ["RK_FALSE", "RK_TRUE"];
  15013. var case_default = [];
  15014. var blocks = [];
  15015. var keywords = [];
  15016. var types = [];
  15017. var atoms = [];
  15018. var switchString = "";
  15019. cacheMainList = [];
  15020. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  15021. var nullLexer = new lexerClass();
  15022. blockList.forEach(function (v) {
  15023. var keyword = nullLexer.literalNames[lexerClass[v]];
  15024. var value = keyword.substring(1, keyword.length - 1);
  15025. cacheMainList.push(value);
  15026. keywords.push(value);
  15027. blocks.push(value);
  15028. if (v == "RK_SWITCH") {
  15029. switchString = value;
  15030. } else if (v == "RK_CASE" || v == "RK_DEFAULT") {
  15031. case_default.push(value);
  15032. }
  15033. });
  15034. keywordsList.forEach(function (v) {
  15035. var keyword = nullLexer.literalNames[lexerClass[v]];
  15036. var value = keyword.substring(1, keyword.length - 1);
  15037. cacheMainList.push(value);
  15038. keywords.push(value);
  15039. });
  15040. typeList.forEach(function (v) {
  15041. var keyword = nullLexer.literalNames[lexerClass[v]];
  15042. var value = keyword.substring(1, keyword.length - 1);
  15043. cacheMainList.push(value);
  15044. types.push(value);
  15045. });
  15046. atomList.forEach(function (v) {
  15047. var keyword = nullLexer.literalNames[lexerClass[v]];
  15048. var value = keyword.substring(1, keyword.length - 1);
  15049. cacheMainList.push(value);
  15050. atoms.push(value);
  15051. });
  15052. cacheOp = [];
  15053. 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];
  15054. for (var op = 0; op < logicOpList.length; ++op) {
  15055. var lOp = "logic_operator_".concat(logicOpList[op]);
  15056. var value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp);
  15057. cacheOp.push(value);
  15058. keywords.push(value);
  15059. }
  15060. return {
  15061. case_default: case_default,
  15062. atoms: atoms,
  15063. keywords: keywords,
  15064. switchString: switchString,
  15065. types: types,
  15066. blocks: blocks
  15067. };
  15068. }
  15069. /**
  15070. * Source: https://gist.github.com/andrei-m/982927
  15071. * @param {string} a
  15072. * @param {string} b
  15073. */
  15074. function levenshteinDistance(a, b) {
  15075. if (a.length == 0) return b.length;
  15076. if (b.length == 0) return a.length;
  15077. var matrix = []; // increment along the first column of each row
  15078. var i;
  15079. for (i = 0; i <= b.length; i++) {
  15080. matrix[i] = [i];
  15081. } // increment each column in the first row
  15082. var j;
  15083. for (j = 0; j <= a.length; j++) {
  15084. matrix[0][j] = j;
  15085. } // Fill in the rest of the matrix
  15086. for (i = 1; i <= b.length; i++) {
  15087. for (j = 1; j <= a.length; j++) {
  15088. if (b.charCodeAt(i - 1) == a.charCodeAt(j - 1)) {
  15089. matrix[i][j] = matrix[i - 1][j - 1];
  15090. } else {
  15091. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
  15092. Math.min(matrix[i][j - 1] + 1, // insertion
  15093. matrix[i - 1][j] + 1)); // deletion
  15094. }
  15095. }
  15096. }
  15097. return matrix[b.length][a.length];
  15098. }
  15099. var win = null;
  15100. function openAssessmentDetail(event) {
  15101. event.preventDefault();
  15102. var page_code = event.currentTarget.dataset.page;
  15103. if (win != null) {
  15104. win.close();
  15105. }
  15106. win = window.open("", "DetailWindow", "width=550,height=600");
  15107. win.document.open();
  15108. win.document.write(page_code);
  15109. win.document.close();
  15110. }
  15111. function range(size) {
  15112. var startAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  15113. return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(Array(size).keys()).map(function (i) {
  15114. return i + startAt;
  15115. });
  15116. }
  15117. /**
  15118. *
  15119. * @param {number} ms
  15120. */
  15121. function sleep(_x) {
  15122. return _sleep.apply(this, arguments);
  15123. }
  15124. function _sleep() {
  15125. _sleep = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(ms) {
  15126. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  15127. while (1) {
  15128. switch (_context.prev = _context.next) {
  15129. case 0:
  15130. return _context.abrupt("return", new Promise(function (res, _) {
  15131. return setTimeout(res, ms);
  15132. }));
  15133. case 1:
  15134. case "end":
  15135. return _context.stop();
  15136. }
  15137. }
  15138. }, _callee);
  15139. }));
  15140. return _sleep.apply(this, arguments);
  15141. }
  15142. /***/ }),
  15143. /***/ "./js/visualUI/algorithm.js":
  15144. /*!**********************************!*\
  15145. !*** ./js/visualUI/algorithm.js ***!
  15146. \**********************************/
  15147. /*! exports provided: renderAlgorithm */
  15148. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15149. "use strict";
  15150. __webpack_require__.r(__webpack_exports__);
  15151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderAlgorithm", function() { return renderAlgorithm; });
  15152. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  15153. /* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions */ "./js/visualUI/functions.js");
  15154. window.block_render = false;
  15155. function renderAlgorithm() {
  15156. if (window.block_render) {
  15157. return;
  15158. }
  15159. if (window.draging) {
  15160. return;
  15161. }
  15162. window.block_render = true;
  15163. $('.all_functions').children().off();
  15164. $('.all_functions').empty();
  15165. $('.list_globals').children().off();
  15166. $('.list_globals').empty();
  15167. for (var i = 0; i < window.program_obj.functions.length; i++) {
  15168. _functions__WEBPACK_IMPORTED_MODULE_1__["renderFunction"](window.program_obj.functions[i]);
  15169. }
  15170. for (var i = 0; i < window.program_obj.globals.length; i++) {
  15171. _globals__WEBPACK_IMPORTED_MODULE_0__["renderGlobal"](window.program_obj.globals[i]);
  15172. }
  15173. setTimeout(function () {
  15174. window.block_render = false;
  15175. }, 100);
  15176. if (settingsFilter && settingsFilter[0]) {
  15177. blockAllEditingOptions();
  15178. }
  15179. $('.command_drag').popup({
  15180. content: LocalizedStrings.getUI("text_move_command"),
  15181. delay: {
  15182. show: 1000,
  15183. hide: 0
  15184. }
  15185. });
  15186. }
  15187. /***/ }),
  15188. /***/ "./js/visualUI/code_generator.js":
  15189. /*!***************************************!*\
  15190. !*** ./js/visualUI/code_generator.js ***!
  15191. \***************************************/
  15192. /*! exports provided: generate, repeatNtimesHeader, elementExpressionCode, variableValueMenuCode */
  15193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15194. "use strict";
  15195. __webpack_require__.r(__webpack_exports__);
  15196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
  15197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeatNtimesHeader", function() { return repeatNtimesHeader; });
  15198. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementExpressionCode", function() { return elementExpressionCode; });
  15199. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "variableValueMenuCode", function() { return variableValueMenuCode; });
  15200. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  15201. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15202. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15203. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  15204. /* eslint-disable @typescript-eslint/no-use-before-define */
  15205. /* globals $*/
  15206. function generate() {
  15207. $(".ivprog_visual_panel").find(".error_icon").remove();
  15208. var code = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("program") + " { ";
  15209. code += globalsCode();
  15210. code += "\n";
  15211. var has_error = false;
  15212. for (var i = 0; i < window.program_obj.functions.length; i++) {
  15213. var n_code = functionsCode(window.program_obj.functions[i]);
  15214. if (n_code == null) {
  15215. has_error = true;
  15216. }
  15217. code += n_code;
  15218. code += "\n";
  15219. }
  15220. code += "\n}";
  15221. if (has_error) {
  15222. return null;
  15223. } else {
  15224. return code;
  15225. }
  15226. }
  15227. function functionsCode(function_obj) {
  15228. var ret = "\n\t" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + " ";
  15229. var has_error = false;
  15230. switch (function_obj.return_type) {
  15231. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15232. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  15233. break;
  15234. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15235. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  15236. break;
  15237. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15238. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  15239. break;
  15240. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15241. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  15242. break;
  15243. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15244. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  15245. break;
  15246. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID:
  15247. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_void");
  15248. break;
  15249. }
  15250. ret += " ";
  15251. if (function_obj.return_dimensions == 1) {
  15252. ret += "[] ";
  15253. } else if (function_obj.return_dimensions == 2) {
  15254. ret += "[][] ";
  15255. }
  15256. if (function_obj.is_main) {
  15257. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("start");
  15258. } else {
  15259. ret += function_obj.name;
  15260. }
  15261. ret += " ( ";
  15262. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  15263. ret += parametersCode(function_obj.parameters_list[j]);
  15264. if (j + 1 < function_obj.parameters_list.length) {
  15265. ret += ", ";
  15266. }
  15267. }
  15268. ret += " ) {";
  15269. for (var _j = 0; _j < function_obj.variables_list.length; _j++) {
  15270. ret += variablesCode(function_obj.variables_list[_j]);
  15271. }
  15272. for (var _j2 = 0; _j2 < function_obj.commands.length; _j2++) {
  15273. //try {
  15274. ret += commandsCode(function_obj.commands[_j2]);
  15275. /*} catch (err) {
  15276. has_error = true;
  15277. console.error(err.message);
  15278. var todos = $('body').find('.command_container');
  15279. for (var i = 0; i < todos.length; i++) {
  15280. if ($(todos[i]).data('command') == function_obj.commands[j]) {
  15281. $( todos[i] ).prepend( ' <i class="ui icon red exclamation triangle error_icon"></i> ' );
  15282. break;
  15283. }
  15284. }
  15285. }*/
  15286. }
  15287. ret += "\n\t}";
  15288. if (has_error) {
  15289. return null;
  15290. } else {
  15291. return ret;
  15292. }
  15293. }
  15294. function commandsCode(command_obj) {
  15295. var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  15296. switch (command_obj.type) {
  15297. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["break"]:
  15298. return breaksCode(command_obj, indentation);
  15299. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].comment:
  15300. return commentsCode(command_obj, indentation);
  15301. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].reader:
  15302. return readersCode(command_obj, indentation);
  15303. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer:
  15304. return writersCode(command_obj, indentation);
  15305. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].functioncall:
  15306. return functioncallsCode(command_obj, indentation);
  15307. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution:
  15308. return attributionsCode(command_obj, indentation);
  15309. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].whiletrue:
  15310. return whiletruesCode(command_obj, indentation);
  15311. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].dowhiletrue:
  15312. return doWhilesCode(command_obj, indentation);
  15313. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].iftrue:
  15314. return iftruesCode(command_obj, indentation);
  15315. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].repeatNtimes:
  15316. return repeatNtimesCode(command_obj, indentation);
  15317. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["switch"]:
  15318. return switchsCode(command_obj, indentation);
  15319. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["return"]:
  15320. return returnsCode(command_obj, indentation);
  15321. }
  15322. }
  15323. function returnsCode(command_obj, indentation) {
  15324. var ret = "\n";
  15325. for (var i = 0; i < indentation; i++) {
  15326. ret += "\t";
  15327. }
  15328. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_return");
  15329. if (command_obj.variable_value_menu) {
  15330. try {
  15331. ret += " " + elementExpressionCode(command_obj.variable_value_menu); //ret += ' ' + variableValueMenuCode(command_obj.variable_value_menu, true);
  15332. } catch (err) {//Empty block
  15333. }
  15334. }
  15335. return ret;
  15336. }
  15337. function breaksCode(_command_obj, indentation) {
  15338. var ret = "\n";
  15339. for (var i = 0; i < indentation; i++) {
  15340. ret += "\t";
  15341. }
  15342. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_break");
  15343. return ret;
  15344. }
  15345. function switchsCode(command_obj, indentation) {
  15346. var ret = "\n";
  15347. for (var i = 0; i < indentation; i++) {
  15348. ret += "\t";
  15349. }
  15350. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_switch") + " ( ";
  15351. ret += variableValueMenuCode(command_obj.variable);
  15352. ret += " ) { ";
  15353. if (command_obj.cases) {
  15354. for (var _i = 0; _i < command_obj.cases.length; _i++) {
  15355. ret += switchcasesCode(command_obj.cases[_i], indentation + 1);
  15356. }
  15357. }
  15358. ret += "\n";
  15359. for (var _i2 = 0; _i2 < indentation; _i2++) {
  15360. ret += "\t";
  15361. }
  15362. ret += "} ";
  15363. return ret;
  15364. }
  15365. function switchcasesCode(switchcase, indentation) {
  15366. var ret = "\n";
  15367. for (var i = 0; i < indentation; i++) {
  15368. ret += "\t";
  15369. }
  15370. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_case") + " ";
  15371. ret += variableValueMenuCode(switchcase.variable_value_menu);
  15372. ret += " :";
  15373. if (switchcase.commands_block) {
  15374. for (var _i3 = 0; _i3 < switchcase.commands_block.length; _i3++) {
  15375. ret += commandsCode(switchcase.commands_block[_i3], indentation + 1);
  15376. }
  15377. }
  15378. return ret;
  15379. }
  15380. function repeatNtimesHeader(command_obj) {
  15381. var ret = "";
  15382. if (command_obj.var_attribution) {
  15383. ret += '<span class="repeatN_text_par_1">';
  15384. ret += variableValueMenuCode(command_obj.var_attribution);
  15385. ret += '</span>';
  15386. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
  15387. ret += '<span class="repeatN_text_par_2">';
  15388. ret += variableValueMenuCode(command_obj.expression1);
  15389. ret += '</span>';
  15390. }
  15391. if (command_obj.expression2) {
  15392. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
  15393. ret += '<span class="repeatN_text_par_3">';
  15394. ret += variableValueMenuCode(command_obj.expression2);
  15395. ret += '</span>';
  15396. }
  15397. if (command_obj.expression3) {
  15398. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
  15399. ret += '<span class="repeatN_text_par_4">';
  15400. switch (command_obj.expression3.itens[1]) {
  15401. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15402. ret += " +";
  15403. break;
  15404. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15405. ret += " -";
  15406. break;
  15407. }
  15408. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  15409. ret += '</span>';
  15410. }
  15411. return ret;
  15412. }
  15413. function repeatNtimesCode(command_obj, indentation) {
  15414. var ret = "\n";
  15415. for (var i = 0; i < indentation; i++) {
  15416. ret += "\t";
  15417. }
  15418. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_for") + " ";
  15419. if (command_obj.var_attribution) {
  15420. ret += variableValueMenuCode(command_obj.var_attribution);
  15421. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
  15422. ret += variableValueMenuCode(command_obj.expression1);
  15423. }
  15424. if (command_obj.expression2) {
  15425. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
  15426. ret += variableValueMenuCode(command_obj.expression2);
  15427. }
  15428. if (command_obj.expression3) {
  15429. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
  15430. switch (command_obj.expression3.itens[1]) {
  15431. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15432. ret += " +";
  15433. break;
  15434. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15435. ret += " -";
  15436. break;
  15437. }
  15438. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  15439. }
  15440. ret += " { ";
  15441. if (command_obj.commands_block) {
  15442. for (var _i4 = 0; _i4 < command_obj.commands_block.length; _i4++) {
  15443. ret += commandsCode(command_obj.commands_block[_i4], indentation + 1);
  15444. }
  15445. }
  15446. ret += "\n";
  15447. for (var _i5 = 0; _i5 < indentation; _i5++) {
  15448. ret += "\t";
  15449. }
  15450. ret += "}";
  15451. return ret;
  15452. }
  15453. function iftruesCode(command_obj, indentation) {
  15454. var ret = "\n";
  15455. for (var i = 0; i < indentation; i++) {
  15456. ret += "\t";
  15457. }
  15458. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_if");
  15459. if (!command_obj.expression) {
  15460. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  15461. } else {
  15462. ret += " ( ";
  15463. ret += elementExpressionCode(command_obj.expression);
  15464. ret += " ) ";
  15465. }
  15466. /*switch (command_obj.expression.expression.type) {
  15467. case Models.EXPRESSION_TYPES.exp_logic:
  15468. ret += logicExpressionCode(command_obj.expression.expression);
  15469. break;
  15470. case Models.EXPRESSION_TYPES.exp_arithmetic:
  15471. ret += arithmeticExpressionCode(command_obj.expression.expression);
  15472. break;
  15473. }*/
  15474. ret += " { ";
  15475. if (command_obj.commands_block) {
  15476. for (var _i6 = 0; _i6 < command_obj.commands_block.length; _i6++) {
  15477. ret += commandsCode(command_obj.commands_block[_i6], indentation + 1);
  15478. }
  15479. }
  15480. ret += "\n";
  15481. for (var _i7 = 0; _i7 < indentation; _i7++) {
  15482. ret += "\t";
  15483. }
  15484. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_else") + " {";
  15485. if (command_obj.commands_else) {
  15486. for (var _i8 = 0; _i8 < command_obj.commands_else.length; _i8++) {
  15487. ret += commandsCode(command_obj.commands_else[_i8], indentation + 1);
  15488. }
  15489. }
  15490. ret += "\n";
  15491. for (var _i9 = 0; _i9 < indentation; _i9++) {
  15492. ret += "\t";
  15493. }
  15494. ret += "}";
  15495. return ret;
  15496. }
  15497. function doWhilesCode(command_obj, indentation) {
  15498. var ret = "\n";
  15499. for (var i = 0; i < indentation; i++) {
  15500. ret += "\t";
  15501. }
  15502. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do") + " { ";
  15503. if (command_obj.commands_block) {
  15504. for (var _i10 = 0; _i10 < command_obj.commands_block.length; _i10++) {
  15505. ret += commandsCode(command_obj.commands_block[_i10], indentation + 1);
  15506. }
  15507. }
  15508. ret += "\n";
  15509. for (var _i11 = 0; _i11 < indentation; _i11++) {
  15510. ret += "\t";
  15511. }
  15512. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do_until");
  15513. if (!command_obj.expression) {
  15514. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  15515. }
  15516. /*switch (command_obj.expression.expression.type) {
  15517. case Models.EXPRESSION_TYPES.exp_logic:
  15518. ret += logicExpressionCode(command_obj.expression.expression);
  15519. break;
  15520. case Models.EXPRESSION_TYPES.exp_arithmetic:
  15521. ret += arithmeticExpressionCode(command_obj.expression.expression);
  15522. break;
  15523. }*/
  15524. if (command_obj.expression) {
  15525. ret += " ( ";
  15526. ret += elementExpressionCode(command_obj.expression);
  15527. ret += " ) ";
  15528. }
  15529. return ret;
  15530. }
  15531. function whiletruesCode(command_obj, indentation) {
  15532. var ret = "\n";
  15533. for (var i = 0; i < indentation; i++) {
  15534. ret += "\t";
  15535. }
  15536. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_while");
  15537. if (!command_obj.expression) {
  15538. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  15539. }
  15540. /*switch (command_obj.expression.expression.type) {
  15541. case Models.EXPRESSION_TYPES.exp_logic:
  15542. ret += logicExpressionCode(command_obj.expression.expression);
  15543. break;
  15544. case Models.EXPRESSION_TYPES.exp_arithmetic:
  15545. ret += arithmeticExpressionCode(command_obj.expression.expression);
  15546. break;
  15547. }*/
  15548. if (command_obj.expression) {
  15549. ret += " ( ";
  15550. ret += elementExpressionCode(command_obj.expression);
  15551. ret += " ) ";
  15552. }
  15553. ret += " { ";
  15554. if (command_obj.commands_block) {
  15555. for (var _i12 = 0; _i12 < command_obj.commands_block.length; _i12++) {
  15556. ret += commandsCode(command_obj.commands_block[_i12], indentation + 1);
  15557. }
  15558. }
  15559. ret += "\n";
  15560. for (var _i13 = 0; _i13 < indentation; _i13++) {
  15561. ret += "\t";
  15562. }
  15563. ret += "}";
  15564. return ret;
  15565. }
  15566. function logicExpressionCode(expression) {
  15567. var ret = " ( ";
  15568. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15569. ret += logicExpressionCode(expression.first_operand);
  15570. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15571. ret += arithmeticExpressionCode(expression.first_operand);
  15572. } else {
  15573. ret += variableValueMenuCode(expression.first_operand);
  15574. }
  15575. if (expression.operator) {
  15576. switch (expression.operator) {
  15577. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  15578. ret += " == ";
  15579. break;
  15580. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  15581. ret += " != ";
  15582. break;
  15583. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15584. ret += " && ";
  15585. break;
  15586. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15587. ret += " || ";
  15588. break;
  15589. }
  15590. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15591. ret += logicExpressionCode(expression.second_operand);
  15592. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15593. ret += arithmeticExpressionCode(expression.second_operand);
  15594. } else {
  15595. ret += variableValueMenuCode(expression.second_operand);
  15596. }
  15597. }
  15598. ret += " ) ";
  15599. return ret;
  15600. }
  15601. function arithmeticExpressionCode(expression) {
  15602. var ret = " ( ";
  15603. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15604. ret += logicExpressionCode(expression.first_operand);
  15605. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15606. ret += arithmeticExpressionCode(expression.first_operand);
  15607. } else {
  15608. ret += variableValueMenuCode(expression.first_operand);
  15609. }
  15610. switch (expression.operator) {
  15611. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15612. ret += " > ";
  15613. break;
  15614. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15615. ret += " < ";
  15616. break;
  15617. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to:
  15618. ret += " == ";
  15619. break;
  15620. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to:
  15621. ret += " != ";
  15622. break;
  15623. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15624. ret += " >= ";
  15625. break;
  15626. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15627. ret += " <= ";
  15628. break;
  15629. }
  15630. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15631. ret += logicExpressionCode(expression.second_operand);
  15632. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15633. ret += arithmeticExpressionCode(expression.second_operand);
  15634. } else {
  15635. ret += variableValueMenuCode(expression.second_operand);
  15636. }
  15637. ret += " ) ";
  15638. return ret;
  15639. }
  15640. function attributionsCode(command_obj, indentation) {
  15641. var ret = "\n";
  15642. for (var i = 0; i < indentation; i++) {
  15643. ret += "\t";
  15644. }
  15645. ret += variableValueMenuCode(command_obj.variable) + " <- ";
  15646. /*for (var i = 0; i < command_obj.expression.length; i++) {
  15647. ret += elementExpressionCode(command_obj.expression[i]);
  15648. }*/
  15649. ret += elementExpressionCode(command_obj.expression);
  15650. return ret;
  15651. }
  15652. function elementExpressionCode(expression_obj) {
  15653. var ret = "";
  15654. for (var i = 0; i < expression_obj.length; i++) {
  15655. if (expression_obj[i].type) {
  15656. ret += variableValueMenuCode(expression_obj[i]);
  15657. } else if (expression_obj[i].type_op) {
  15658. switch (expression_obj[i].item) {
  15659. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15660. ret += " + ";
  15661. break;
  15662. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15663. ret += " - ";
  15664. break;
  15665. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication:
  15666. ret += " * ";
  15667. break;
  15668. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division:
  15669. ret += " / ";
  15670. break;
  15671. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module:
  15672. ret += " % ";
  15673. break;
  15674. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  15675. ret += " == ";
  15676. break;
  15677. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  15678. ret += " != ";
  15679. break;
  15680. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15681. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + " ";
  15682. break;
  15683. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15684. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_or") + " ";
  15685. break;
  15686. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not:
  15687. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_not") + " ";
  15688. break;
  15689. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15690. ret += " > ";
  15691. break;
  15692. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15693. ret += " < ";
  15694. break;
  15695. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15696. ret += " >= ";
  15697. break;
  15698. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15699. ret += " <= ";
  15700. break;
  15701. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep:
  15702. ret += ", ";
  15703. break;
  15704. }
  15705. } else {
  15706. ret += " " + expression_obj[i] + " ";
  15707. }
  15708. }
  15709. return ret;
  15710. }
  15711. function functioncallsCode(command_obj, indentation) {
  15712. var ret = "\n";
  15713. for (var i = 0; i < indentation; i++) {
  15714. ret += "\t";
  15715. }
  15716. ret += variableValueMenuCode(command_obj.function_called);
  15717. return ret;
  15718. }
  15719. function readersCode(command_obj, indentation) {
  15720. var ret = "\n";
  15721. for (var i = 0; i < indentation; i++) {
  15722. ret += "\t";
  15723. }
  15724. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_read") + " ( ";
  15725. ret += variableValueMenuCode(command_obj.variable_value_menu);
  15726. ret += " ) ";
  15727. return ret;
  15728. }
  15729. function variableValueMenuCode(variable_obj) {
  15730. var is_return = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  15731. var ret = "";
  15732. try {
  15733. if (variable_obj.function_called) {
  15734. if (variable_obj.function_called.name) {
  15735. ret += variable_obj.function_called.name + " ( ";
  15736. } else {
  15737. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + " ( ";
  15738. }
  15739. if (variable_obj.parameters_list) {
  15740. for (var i = 0; i < variable_obj.parameters_list.length; i++) {
  15741. ret += variableValueMenuCode(variable_obj.parameters_list[i]);
  15742. if (i + 1 < variable_obj.parameters_list.length) {
  15743. ret += ", ";
  15744. }
  15745. }
  15746. }
  15747. ret += " )";
  15748. } else if (variable_obj.content.type) {
  15749. ret += variable_obj.content.name;
  15750. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  15751. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15752. }
  15753. if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  15754. ret += " [ " + variableValueMenuCode(variable_obj.row) + " ] ";
  15755. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15756. }
  15757. } else {
  15758. var content = String(variable_obj.content);
  15759. if (isNaN(content)) {
  15760. // console.debug("Content length: ", content.length);
  15761. // console.debug("Char code at 0", content.charCodeAt(0));
  15762. var isBackslash = content.charCodeAt(0) === 92;
  15763. if (content.length === 1 || content.length === 2 && isBackslash) {
  15764. ret += "'".concat(content, "'");
  15765. } else {
  15766. ret += '"' + variable_obj.content + '"';
  15767. }
  15768. } else if (content.length == 0) {
  15769. ret += '""';
  15770. } else if (content.trim().length == 0) {
  15771. ret += '"' + content + '"';
  15772. } else {
  15773. ret += variable_obj.content;
  15774. }
  15775. }
  15776. } catch (err) {
  15777. if (!is_return) {
  15778. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_content"));
  15779. throw err;
  15780. }
  15781. }
  15782. return ret;
  15783. }
  15784. function writersCode(command_obj, indentation) {
  15785. var ret = "\n";
  15786. for (var i = 0; i < indentation; i++) {
  15787. ret += "\t";
  15788. }
  15789. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_write") + " ( ";
  15790. /*for (var i = 0; i < command_obj.content.length; i++) {
  15791. ret += variableValueMenuCode(command_obj.content[i]);
  15792. if ((i + 1) < command_obj.content.length) {
  15793. ret += ' + ';
  15794. }
  15795. }*/
  15796. ret += elementExpressionCode(command_obj.content);
  15797. if (command_obj.newline) {
  15798. ret += ', "\\n"';
  15799. }
  15800. ret += " ) ";
  15801. return ret;
  15802. }
  15803. function commentsCode(command_obj, indentation) {
  15804. var ret = "\n";
  15805. for (var i = 0; i < indentation; i++) {
  15806. ret += "\t";
  15807. }
  15808. ret += "// ";
  15809. ret += command_obj.comment_text.content;
  15810. return ret;
  15811. }
  15812. function parametersCode(parameter_obj) {
  15813. var ret = "";
  15814. switch (parameter_obj.type) {
  15815. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15816. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15817. break;
  15818. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15819. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15820. break;
  15821. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15822. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15823. break;
  15824. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15825. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15826. break;
  15827. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15828. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15829. break;
  15830. }
  15831. ret += parameter_obj.name + "";
  15832. if (parameter_obj.dimensions == 1) {
  15833. ret += " []";
  15834. } else if (parameter_obj.dimensions == 2) {
  15835. ret += " [][]";
  15836. }
  15837. return ret;
  15838. }
  15839. function variablesCode(variable_obj) {
  15840. var ret = "";
  15841. var temp = variable_obj;
  15842. ret += "\n\t\t";
  15843. if (temp.is_constant) {
  15844. ret += "const ";
  15845. }
  15846. switch (temp.type) {
  15847. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15848. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15849. break;
  15850. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15851. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15852. break;
  15853. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15854. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15855. break;
  15856. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15857. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15858. break;
  15859. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15860. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15861. break;
  15862. }
  15863. ret += temp.name + " ";
  15864. if (temp.dimensions == 1) {
  15865. ret += "[" + temp.columns + "] ";
  15866. switch (temp.type) {
  15867. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15868. ret += "<- {";
  15869. for (var j = 0; j < temp.value.length; j++) {
  15870. ret += temp.value[j];
  15871. if (j + 1 < temp.value.length) {
  15872. ret += ", ";
  15873. }
  15874. }
  15875. ret += "}";
  15876. break;
  15877. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15878. ret += "<- {";
  15879. for (var _j3 = 0; _j3 < temp.value.length; _j3++) {
  15880. ret += temp.value[_j3].toFixed(2);
  15881. if (_j3 + 1 < temp.value.length) {
  15882. ret += ", ";
  15883. }
  15884. }
  15885. ret += "}";
  15886. break;
  15887. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15888. ret += "<- {";
  15889. for (var _j4 = 0; _j4 < temp.value.length; _j4++) {
  15890. ret += '"' + temp.value[_j4] + '"';
  15891. if (_j4 + 1 < temp.value.length) {
  15892. ret += ", ";
  15893. }
  15894. }
  15895. ret += "}";
  15896. break;
  15897. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15898. ret += "<- {";
  15899. for (var _j5 = 0; _j5 < temp.value.length; _j5++) {
  15900. if (temp.value[_j5]) {
  15901. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15902. } else {
  15903. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15904. }
  15905. if (_j5 + 1 < temp.value.length) {
  15906. ret += ", ";
  15907. }
  15908. }
  15909. ret += "}";
  15910. break;
  15911. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15912. ret += "<- {";
  15913. for (var _j6 = 0; _j6 < temp.value.length; _j6++) {
  15914. ret += "'" + temp.value[_j6] + "'";
  15915. if (_j6 + 1 < temp.value.length) {
  15916. ret += ", ";
  15917. }
  15918. }
  15919. ret += "}";
  15920. break;
  15921. }
  15922. } else if (temp.dimensions == 2) {
  15923. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  15924. switch (temp.type) {
  15925. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15926. ret += "<- {";
  15927. for (var _j7 = 0; _j7 < temp.rows; _j7++) {
  15928. ret += "{";
  15929. for (var k = 0; k < temp.columns; k++) {
  15930. ret += temp.value[_j7][k];
  15931. if (k + 1 < temp.columns) {
  15932. ret += ", ";
  15933. }
  15934. }
  15935. ret += "}";
  15936. if (_j7 + 1 < temp.rows) {
  15937. ret += ", ";
  15938. }
  15939. }
  15940. ret += "}";
  15941. break;
  15942. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15943. ret += "<- {";
  15944. for (var _j8 = 0; _j8 < temp.rows; _j8++) {
  15945. ret += "{";
  15946. for (var _k = 0; _k < temp.columns; _k++) {
  15947. ret += temp.value[_j8][_k].toFixed(2);
  15948. if (_k + 1 < temp.columns) {
  15949. ret += ", ";
  15950. }
  15951. }
  15952. ret += "}";
  15953. if (_j8 + 1 < temp.rows) {
  15954. ret += ", ";
  15955. }
  15956. }
  15957. ret += "}";
  15958. break;
  15959. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15960. ret += "<- {";
  15961. for (var _j9 = 0; _j9 < temp.rows; _j9++) {
  15962. ret += "{";
  15963. for (var _k2 = 0; _k2 < temp.columns; _k2++) {
  15964. ret += '"' + temp.value[_j9][_k2] + '"';
  15965. if (_k2 + 1 < temp.columns) {
  15966. ret += ", ";
  15967. }
  15968. }
  15969. ret += "}";
  15970. if (_j9 + 1 < temp.rows) {
  15971. ret += ", ";
  15972. }
  15973. }
  15974. ret += "}";
  15975. break;
  15976. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15977. ret += "<- {";
  15978. for (var _j10 = 0; _j10 < temp.rows; _j10++) {
  15979. ret += "{";
  15980. for (var _k3 = 0; _k3 < temp.columns; _k3++) {
  15981. if (temp.value[_j10][_k3]) {
  15982. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15983. } else {
  15984. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15985. }
  15986. if (_k3 + 1 < temp.columns) {
  15987. ret += ", ";
  15988. }
  15989. }
  15990. ret += "}";
  15991. if (_j10 + 1 < temp.rows) {
  15992. ret += ", ";
  15993. }
  15994. }
  15995. ret += "}";
  15996. break;
  15997. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15998. ret += "<- {";
  15999. for (var _j11 = 0; _j11 < temp.rows; _j11++) {
  16000. ret += "{";
  16001. for (var _k4 = 0; _k4 < temp.columns; _k4++) {
  16002. ret += "'" + temp.value[_j11][_k4] + "'";
  16003. if (_k4 + 1 < temp.columns) {
  16004. ret += ", ";
  16005. }
  16006. }
  16007. ret += "}";
  16008. if (_j11 + 1 < temp.rows) {
  16009. ret += ", ";
  16010. }
  16011. }
  16012. ret += "}";
  16013. break;
  16014. }
  16015. } else {
  16016. switch (temp.type) {
  16017. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16018. ret += "<- " + temp.value;
  16019. break;
  16020. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16021. ret += "<- " + temp.value.toFixed(2);
  16022. break;
  16023. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16024. ret += '<- "' + temp.value + '"';
  16025. break;
  16026. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16027. ret += "<- ";
  16028. if (temp.value) {
  16029. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16030. } else {
  16031. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16032. }
  16033. break;
  16034. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16035. ret += "<- '" + temp.value + "'";
  16036. break;
  16037. }
  16038. }
  16039. return ret;
  16040. }
  16041. function globalsCode() {
  16042. var ret = "";
  16043. if (window.program_obj.globals) {
  16044. for (var i = 0; i < window.program_obj.globals.length; i++) {
  16045. var temp = window.program_obj.globals[i];
  16046. ret += "\n\t";
  16047. if (temp.is_constant) {
  16048. ret += "const ";
  16049. }
  16050. switch (temp.type) {
  16051. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16052. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  16053. break;
  16054. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16055. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  16056. break;
  16057. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16058. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  16059. break;
  16060. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16061. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  16062. break;
  16063. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16064. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  16065. break;
  16066. }
  16067. ret += " " + temp.name + " ";
  16068. if (temp.dimensions == 1) {
  16069. ret += "[" + temp.columns + "] ";
  16070. switch (temp.type) {
  16071. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16072. ret += "<- {";
  16073. for (var j = 0; j < temp.value.length; j++) {
  16074. ret += temp.value[j];
  16075. if (j + 1 < temp.value.length) {
  16076. ret += ", ";
  16077. }
  16078. }
  16079. ret += "}";
  16080. break;
  16081. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16082. ret += "<- {";
  16083. for (var _j12 = 0; _j12 < temp.value.length; _j12++) {
  16084. ret += temp.value[_j12].toFixed(2);
  16085. if (_j12 + 1 < temp.value.length) {
  16086. ret += ", ";
  16087. }
  16088. }
  16089. ret += "}";
  16090. break;
  16091. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16092. ret += "<- {";
  16093. for (var _j13 = 0; _j13 < temp.value.length; _j13++) {
  16094. ret += '"' + temp.value[_j13] + '"';
  16095. if (_j13 + 1 < temp.value.length) {
  16096. ret += ", ";
  16097. }
  16098. }
  16099. ret += "}";
  16100. break;
  16101. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16102. ret += "<- {";
  16103. for (var _j14 = 0; _j14 < temp.value.length; _j14++) {
  16104. if (temp.value[_j14]) {
  16105. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16106. } else {
  16107. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16108. }
  16109. if (_j14 + 1 < temp.value.length) {
  16110. ret += ", ";
  16111. }
  16112. }
  16113. ret += "}";
  16114. break;
  16115. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16116. ret += "<- {";
  16117. for (var _j15 = 0; _j15 < temp.value.length; _j15++) {
  16118. ret += "'" + temp.value[_j15] + "'";
  16119. if (_j15 + 1 < temp.value.length) {
  16120. ret += ", ";
  16121. }
  16122. }
  16123. ret += "}";
  16124. break;
  16125. }
  16126. } else if (temp.dimensions == 2) {
  16127. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  16128. switch (temp.type) {
  16129. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16130. ret += "<- {";
  16131. for (var _j16 = 0; _j16 < temp.rows; _j16++) {
  16132. ret += "{";
  16133. for (var k = 0; k < temp.columns; k++) {
  16134. ret += temp.value[_j16][k];
  16135. if (k + 1 < temp.columns) {
  16136. ret += ", ";
  16137. }
  16138. }
  16139. ret += "}";
  16140. if (_j16 + 1 < temp.rows) {
  16141. ret += ", ";
  16142. }
  16143. }
  16144. ret += "}";
  16145. break;
  16146. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16147. ret += "<- {";
  16148. for (var _j17 = 0; _j17 < temp.rows; _j17++) {
  16149. ret += "{";
  16150. for (var _k5 = 0; _k5 < temp.columns; _k5++) {
  16151. ret += temp.value[_j17][_k5].toFixed(2);
  16152. if (_k5 + 1 < temp.columns) {
  16153. ret += ", ";
  16154. }
  16155. }
  16156. ret += "}";
  16157. if (_j17 + 1 < temp.rows) {
  16158. ret += ", ";
  16159. }
  16160. }
  16161. ret += "}";
  16162. break;
  16163. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16164. ret += "<- {";
  16165. for (var _j18 = 0; _j18 < temp.rows; _j18++) {
  16166. ret += "{";
  16167. for (var _k6 = 0; _k6 < temp.columns; _k6++) {
  16168. ret += '"' + temp.value[_j18][_k6] + '"';
  16169. if (_k6 + 1 < temp.columns) {
  16170. ret += ", ";
  16171. }
  16172. }
  16173. ret += "}";
  16174. if (_j18 + 1 < temp.rows) {
  16175. ret += ", ";
  16176. }
  16177. }
  16178. ret += "}";
  16179. break;
  16180. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16181. ret += "<- {";
  16182. for (var _j19 = 0; _j19 < temp.rows; _j19++) {
  16183. ret += "{";
  16184. for (var _k7 = 0; _k7 < temp.columns; _k7++) {
  16185. if (temp.value[_j19][_k7]) {
  16186. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16187. } else {
  16188. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16189. }
  16190. if (_k7 + 1 < temp.columns) {
  16191. ret += ", ";
  16192. }
  16193. }
  16194. ret += "}";
  16195. if (_j19 + 1 < temp.rows) {
  16196. ret += ", ";
  16197. }
  16198. }
  16199. ret += "}";
  16200. break;
  16201. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16202. ret += "<- {";
  16203. for (var _j20 = 0; _j20 < temp.rows; _j20++) {
  16204. ret += "{";
  16205. for (var _k8 = 0; _k8 < temp.columns; _k8++) {
  16206. ret += "'" + temp.value[_j20][_k8] + "'";
  16207. if (_k8 + 1 < temp.columns) {
  16208. ret += ", ";
  16209. }
  16210. }
  16211. ret += "}";
  16212. if (_j20 + 1 < temp.rows) {
  16213. ret += ", ";
  16214. }
  16215. }
  16216. ret += "}";
  16217. break;
  16218. }
  16219. } else {
  16220. switch (temp.type) {
  16221. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16222. ret += "<- " + temp.value;
  16223. break;
  16224. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16225. ret += "<- " + temp.value.toFixed(2);
  16226. break;
  16227. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16228. ret += '<- "' + temp.value + '"';
  16229. break;
  16230. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16231. ret += "<- ";
  16232. if (temp.value) {
  16233. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16234. } else {
  16235. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16236. }
  16237. break;
  16238. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16239. ret += "<- '" + temp.value + "'";
  16240. break;
  16241. }
  16242. }
  16243. }
  16244. }
  16245. return ret;
  16246. }
  16247. /***/ }),
  16248. /***/ "./js/visualUI/commands.js":
  16249. /*!*********************************!*\
  16250. !*** ./js/visualUI/commands.js ***!
  16251. \*********************************/
  16252. /*! exports provided: removeCommand, createFloatingCommand, renderCommand, genericCreateCommand */
  16253. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16254. "use strict";
  16255. __webpack_require__.r(__webpack_exports__);
  16256. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCommand", function() { return removeCommand; });
  16257. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16258. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16259. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericCreateCommand", function() { return genericCreateCommand; });
  16260. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  16261. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16262. /* harmony import */ var _commands_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commands/comment */ "./js/visualUI/commands/comment.js");
  16263. /* harmony import */ var _commands_reader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/reader */ "./js/visualUI/commands/reader.js");
  16264. /* harmony import */ var _commands_writer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/writer */ "./js/visualUI/commands/writer.js");
  16265. /* harmony import */ var _commands_attribution__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/attribution */ "./js/visualUI/commands/attribution.js");
  16266. /* harmony import */ var _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/iftrue */ "./js/visualUI/commands/iftrue.js");
  16267. /* harmony import */ var _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  16268. /* harmony import */ var _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/whiletrue */ "./js/visualUI/commands/whiletrue.js");
  16269. /* harmony import */ var _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/dowhiletrue */ "./js/visualUI/commands/dowhiletrue.js");
  16270. /* harmony import */ var _commands_switch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/switch */ "./js/visualUI/commands/switch.js");
  16271. /* harmony import */ var _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/functioncall */ "./js/visualUI/commands/functioncall.js");
  16272. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16273. /* harmony import */ var _commands_break__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/break */ "./js/visualUI/commands/break.js");
  16274. /* harmony import */ var _commands_return__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/return */ "./js/visualUI/commands/return.js");
  16275. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  16276. // let has_element_created_draged = false;
  16277. // let which_element_is_draged = null;
  16278. function removeCommand(command, function_obj, dom_obj) {
  16279. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_COMMAND, command.type, '/', 0);
  16280. if (function_obj.commands.indexOf(command) > -1) {
  16281. function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  16282. return true;
  16283. } // Utilize dois parantNode, pois o primeiro é o div de comandos
  16284. try {
  16285. if (dom_obj.parent().parent().data('command').commands_block.indexOf(command) > -1) {
  16286. dom_obj.parent().parent().data('command').commands_block.splice(dom_obj.parent().parent().data('command').commands_block.indexOf(command), 1);
  16287. return true;
  16288. }
  16289. } catch (err) {}
  16290. try {
  16291. if (dom_obj.parent().parent().data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16292. if (dom_obj.parent().parent().data('command').commands_else.indexOf(command) > -1) {
  16293. dom_obj.parent().parent().data('command').commands_else.splice(dom_obj.parent().parent().data('command').commands_else.indexOf(command), 1);
  16294. return true;
  16295. }
  16296. }
  16297. } catch (err) {}
  16298. if (dom_obj.parent().data('switchcase')) {
  16299. dom_obj.parent().data('switchcase').commands_block.splice(dom_obj.parent().data('switchcase').commands_block.indexOf(command), 1);
  16300. return true;
  16301. }
  16302. return false;
  16303. }
  16304. window.function_container_active = null;
  16305. function createFloatingCommand(function_obj, function_container, command_type, mouse_event) {
  16306. var floatingObject;
  16307. switch (command_type) {
  16308. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16309. floatingObject = _commands_break__WEBPACK_IMPORTED_MODULE_13__["createFloatingCommand"]();
  16310. break;
  16311. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16312. floatingObject = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"]();
  16313. break;
  16314. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16315. floatingObject = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["createFloatingCommand"]();
  16316. break;
  16317. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16318. floatingObject = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["createFloatingCommand"]();
  16319. break;
  16320. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16321. floatingObject = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"]();
  16322. break;
  16323. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16324. floatingObject = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["createFloatingCommand"]();
  16325. break;
  16326. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16327. floatingObject = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["createFloatingCommand"]();
  16328. break;
  16329. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16330. floatingObject = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["createFloatingCommand"]();
  16331. break;
  16332. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16333. floatingObject = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["createFloatingCommand"]();
  16334. break;
  16335. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16336. floatingObject = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["createFloatingCommand"]();
  16337. break;
  16338. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16339. floatingObject = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["createFloatingCommand"]();
  16340. break;
  16341. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16342. floatingObject = _commands_return__WEBPACK_IMPORTED_MODULE_14__["createFloatingCommand"]();
  16343. break;
  16344. }
  16345. floatingObject.draggable().appendTo("body");
  16346. $('body').mouseup(function (evt) {
  16347. manageCommand(function_obj, function_container, evt, command_type);
  16348. $('body').off('mouseup');
  16349. $('body').off('mouseover');
  16350. });
  16351. if (!function_container.hasClass('function_div') || function_container.length < 1) {
  16352. window.mouse_event = mouse_event;
  16353. function_container = $(mouse_event.originalEvent.srcElement.closest('.function_div'));
  16354. }
  16355. function_container_active = function_container;
  16356. function_container.find('.commands_list_div').on('mousemove', function (evt) {
  16357. addGhostDiv(evt);
  16358. });
  16359. function_container.find('.commands_list_div').find("*").on('mousemove', function (evt) {
  16360. addGhostDiv(evt);
  16361. });
  16362. function_container.on('mouseout', function (event) {
  16363. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16364. if (el.closest('.commands_list_div').length < 1) {
  16365. window.ghostDiv.remove();
  16366. }
  16367. });
  16368. floatingObject.css("position", "absolute");
  16369. mouse_event.type = "mousedown.draggable";
  16370. mouse_event.target = floatingObject[0];
  16371. floatingObject.css("left", mouse_event.pageX - window.divx);
  16372. floatingObject.css("top", mouse_event.pageY);
  16373. floatingObject.trigger(mouse_event);
  16374. }
  16375. window.divx = 100;
  16376. window.ghostDiv = $('<div class="ghost_div">');
  16377. window.active_container = null;
  16378. function addGhostToEmptyBlock(element, evt) {
  16379. $('.ghost_div').remove();
  16380. var container = element.closest('.command_container');
  16381. if (container.hasClass('switch')) {
  16382. container = $(evt.target).closest('.case_div');
  16383. }
  16384. if (!container.hasClass('dowhiletrue') && !container.hasClass('iftrue') && !container.hasClass('repeatNtimes') && !container.hasClass('case_div') && !container.hasClass('whiletrue')) {
  16385. addGhostToNotEmptyBlock(element, evt);
  16386. return;
  16387. }
  16388. if (window.active_container != null) {
  16389. if (window.active_container.is(container)) {//console.log('é o mesmo, não mudou!');
  16390. } else {
  16391. if (container.length < 1) {
  16392. container = element.closest('.commands_list_div');
  16393. if (window.active_container.is(container)) {//console.log('é o mesmo command list');
  16394. } else {
  16395. //console.log('mudou para um command list');
  16396. window.active_container = container;
  16397. }
  16398. } else {//console.log('mudou para um outro container?');
  16399. }
  16400. }
  16401. }
  16402. window.active_container = container;
  16403. if (container.hasClass('iftrue')) {
  16404. var containerIf = container.find('.commands_if').get(0);
  16405. var containerElse = container.find('.commands_else').get(0);
  16406. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  16407. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  16408. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  16409. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  16410. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  16411. $(containerIf).append(window.ghostDiv);
  16412. } else {
  16413. $(containerElse).append(window.ghostDiv);
  16414. }
  16415. } else if (container.hasClass('case_div')) {
  16416. container.find('.case_commands_block').append(window.ghostDiv);
  16417. } else {
  16418. container.find('.block_commands').append(window.ghostDiv);
  16419. }
  16420. }
  16421. function addGhostToNotEmptyBlock(element, evt) {
  16422. $('.ghost_div').remove();
  16423. var container = element.closest('.dowhiletrue, .iftrue, .repeatNtimes, .case_div, .whiletrue'); //console.log("\n\nNOT EMPTY: ", container);
  16424. //if (window.active_container != null) {
  16425. //}
  16426. if (container.length < 1) {
  16427. container = element.closest('.commands_list_div');
  16428. window.active_container = container;
  16429. addGhostToFunctionArea(element, evt);
  16430. } else {//console.log('mudou para um outro container?');
  16431. }
  16432. window.active_container = container; // quem está mais próximo? // Essa regra se aplica somente quando o over está sobre um comando
  16433. var allfilhos;
  16434. if (container.hasClass('iftrue')) {
  16435. if ($(evt.target).closest('.data_block_if').length > 0) {
  16436. allfilhos = container.find('.commands_if').children('.command_container');
  16437. } else if ($(evt.target).closest('.data_block_else').length > 0) {
  16438. allfilhos = container.find('.commands_else').children('.command_container');
  16439. } else {
  16440. var containerIf = container.find('.commands_if').get(0);
  16441. var containerElse = container.find('.commands_else').get(0);
  16442. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  16443. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  16444. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  16445. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  16446. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  16447. allfilhos = $(containerIf).children('.command_container');
  16448. } else {
  16449. allfilhos = $(containerElse).children('.command_container');
  16450. }
  16451. }
  16452. } else if (container.hasClass('case_div')) {
  16453. allfilhos = container.children('.case_commands_block').children('.command_container');
  16454. } else if (container.hasClass('commands_list_div')) {
  16455. allfilhos = container.children('.command_container');
  16456. } else {
  16457. allfilhos = container.children('.block_commands').children('.command_container');
  16458. }
  16459. var topDistances = [];
  16460. var bottomDistances = [];
  16461. for (var i = 0; i < allfilhos.length; i++) {
  16462. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  16463. topDistances.push(topD);
  16464. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  16465. bottomDistances.push(botD);
  16466. }
  16467. var menorTop = Math.min.apply(null, topDistances);
  16468. var indiceTop = topDistances.indexOf(menorTop);
  16469. var menorBot = Math.min.apply(null, bottomDistances);
  16470. var indiceBot = bottomDistances.indexOf(menorBot);
  16471. if (menorTop < menorBot) {
  16472. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  16473. } else {
  16474. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  16475. }
  16476. }
  16477. function addGhostToFunctionArea(undermouse, evt) {
  16478. $('.ghost_div').remove();
  16479. var allfilhos = undermouse.closest('.commands_list_div').children('.command_container');
  16480. var topDistances = [];
  16481. var bottomDistances = [];
  16482. for (var i = 0; i < allfilhos.length; i++) {
  16483. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  16484. topDistances.push(topD);
  16485. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  16486. bottomDistances.push(botD);
  16487. }
  16488. var menorTop = Math.min.apply(null, topDistances);
  16489. var indiceTop = topDistances.indexOf(menorTop);
  16490. var menorBot = Math.min.apply(null, bottomDistances);
  16491. var indiceBot = bottomDistances.indexOf(menorBot);
  16492. if (menorTop < menorBot) {
  16493. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  16494. } else {
  16495. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  16496. }
  16497. }
  16498. function addGhostDiv(evt) {
  16499. var undermouse = $(evt.target);
  16500. if (undermouse.hasClass('ghost_div')) {
  16501. return;
  16502. } else if (undermouse.hasClass('commands_list_div')) {
  16503. addGhostToFunctionArea(undermouse, evt);
  16504. return;
  16505. } else if (undermouse.hasClass('block_commands')) {
  16506. if (undermouse.find('.command_container').length > 0) {
  16507. addGhostToNotEmptyBlock(undermouse, evt);
  16508. } else {
  16509. addGhostToEmptyBlock(undermouse, evt);
  16510. }
  16511. } else if (undermouse.hasClass('case_div')) {
  16512. if (undermouse.find('.case_commands_block').find('.command_container').length > 0) {
  16513. addGhostToNotEmptyBlock(undermouse, evt);
  16514. } else {
  16515. addGhostToEmptyBlock(undermouse, evt);
  16516. }
  16517. } else {
  16518. addGhostToNotEmptyBlock(undermouse, evt);
  16519. }
  16520. }
  16521. function borderMouseDragCommand(function_obj, function_container, evt) {
  16522. function_container.find('.over_command_drag').each(function (index) {
  16523. $(this).removeClass('over_command_drag');
  16524. });
  16525. var prev = null;
  16526. function_container.find('.commands_list_div').each(function (index) {
  16527. prev = $(this);
  16528. if (prev) {
  16529. var objLeft = prev.offset().left;
  16530. var objTop = prev.offset().top;
  16531. var objRight = objLeft + prev.width();
  16532. var objBottom = objTop + prev.height();
  16533. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  16534. prev.addClass("over_command_drag");
  16535. }
  16536. }
  16537. });
  16538. function_container.find('.command_container').each(function (index) {
  16539. var obj = $(this);
  16540. var objLeft = obj.offset().left;
  16541. var objTop = obj.offset().top;
  16542. var objRight = objLeft + obj.width();
  16543. var objBottom = objTop + obj.height();
  16544. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  16545. if (prev) {
  16546. prev.removeClass('over_command_drag');
  16547. }
  16548. obj.addClass("over_command_drag");
  16549. return;
  16550. }
  16551. });
  16552. } // before_after_inside: 1 -> before, 2 -> after, 3 -> inside
  16553. function renderCommand(command, element_reference, before_after_inside, function_obj) {
  16554. var createdElement;
  16555. switch (command.type) {
  16556. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16557. createdElement = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command, function_obj);
  16558. break;
  16559. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16560. createdElement = _commands_break__WEBPACK_IMPORTED_MODULE_13__["renderCommand"](command, function_obj);
  16561. break;
  16562. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16563. createdElement = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["renderCommand"](command, function_obj);
  16564. break;
  16565. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16566. createdElement = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["renderCommand"](command, function_obj);
  16567. break;
  16568. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16569. createdElement = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](command, function_obj);
  16570. break;
  16571. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16572. createdElement = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["renderCommand"](command, function_obj);
  16573. break;
  16574. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16575. createdElement = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["renderCommand"](command, function_obj);
  16576. break;
  16577. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16578. createdElement = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["renderCommand"](command, function_obj);
  16579. break;
  16580. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16581. createdElement = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["renderCommand"](command, function_obj);
  16582. break;
  16583. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16584. createdElement = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["renderCommand"](command, function_obj);
  16585. break;
  16586. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16587. createdElement = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["renderCommand"](command, function_obj);
  16588. break;
  16589. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16590. createdElement = _commands_return__WEBPACK_IMPORTED_MODULE_14__["renderCommand"](command, function_obj);
  16591. break;
  16592. }
  16593. switch (before_after_inside) {
  16594. case 1:
  16595. createdElement.insertBefore(element_reference);
  16596. break;
  16597. case 2:
  16598. createdElement.insertAfter(element_reference);
  16599. break;
  16600. case 3:
  16601. element_reference.append(createdElement);
  16602. break;
  16603. }
  16604. }
  16605. function genericCreateCommand(command_type) {
  16606. switch (command_type) {
  16607. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16608. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Break"]();
  16609. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16610. 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));
  16611. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16612. 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));
  16613. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16614. 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)]);
  16615. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16616. 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), []);
  16617. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16618. 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);
  16619. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16620. 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)]);
  16621. //(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block)
  16622. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16623. 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);
  16624. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16625. 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);
  16626. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16627. 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);
  16628. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16629. 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))];
  16630. 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);
  16631. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16632. 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)]);
  16633. }
  16634. }
  16635. function dragTrash(event) {
  16636. $('.ghost_div').remove();
  16637. var trash = $('<i class="ui icon trash alternate outline"></i>');
  16638. $('body').append(trash);
  16639. trash.css('position', 'absolute');
  16640. trash.css('top', event.clientY);
  16641. trash.css('left', event.clientX - 20);
  16642. trash.css('font-size', '3em');
  16643. trash.css('display', 'none');
  16644. function_container_active.find('.commands_list_div').off('mousemove');
  16645. function_container_active.find('.commands_list_div').find("*").off('mousemove');
  16646. trash.fadeIn(200, function () {
  16647. trash.fadeOut(200, function () {
  16648. trash.remove();
  16649. });
  16650. });
  16651. }
  16652. function findSingleElement(searching, query) {
  16653. if (!searching || !query) {
  16654. return '';
  16655. }
  16656. 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) {
  16657. if (searching.commands_block) {
  16658. return '' + searching.commands_block.indexOf(query);
  16659. } else {
  16660. return '0';
  16661. }
  16662. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16663. if (searching.commands_block == null) {
  16664. searching.commands_block = [];
  16665. }
  16666. if (searching.commands_else == null) {
  16667. searching.commands_else = [];
  16668. }
  16669. if (searching.commands_block.indexOf(query) >= 0) {
  16670. return 'if[' + searching.commands_block.indexOf(query) + ']';
  16671. } else {
  16672. return 'else[' + searching.commands_else.indexOf(query) + ']';
  16673. }
  16674. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16675. for (var i = 0; i < searching.cases.length; i++) {
  16676. if (searching.cases[i].commands_block.indexOf(query) >= 0) {
  16677. return 'case[' + searching.cases[i].commands_block.indexOf(query) + ']';
  16678. }
  16679. }
  16680. }
  16681. }
  16682. function findPathRecursive(starter_index, hierarquia_bottom_up, function_obj) {
  16683. var index_command = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
  16684. var actual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  16685. var full_path = '';
  16686. for (var i = 0; i <= hierarquia_bottom_up.length; i++) {
  16687. full_path += findSingleElement(hierarquia_bottom_up[i], hierarquia_bottom_up[i + 1]) + '-';
  16688. }
  16689. return full_path;
  16690. }
  16691. function manageCommand(function_obj, function_container, event, command_type) {
  16692. $(".created_element").each(function (index) {
  16693. $(this).remove();
  16694. });
  16695. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16696. if (el.hasClass('ghost_div')) {
  16697. if (el.closest('.command_container').length < 1) {
  16698. el.closest('.commands_list_div').css('height', el.closest('.commands_list_div').css('height') + 30); //$('.ghost_div').remove();
  16699. el = el.closest('.commands_list_div');
  16700. }
  16701. } // Primeiro verificar se ele soltou no espaço da função correta:
  16702. var hier = el.parentsUntil(".all_functions");
  16703. var esta_correto = false;
  16704. var esta_na_div_correta = false;
  16705. if (el.hasClass("commands_list_div")) {
  16706. esta_na_div_correta = true;
  16707. }
  16708. for (var i = 0; i < hier.length; i++) {
  16709. var temp = $(hier[i]);
  16710. if (temp.hasClass("commands_list_div")) {
  16711. esta_na_div_correta = true;
  16712. }
  16713. if (temp.data('fun') == function_obj) {
  16714. esta_correto = true;
  16715. break;
  16716. }
  16717. }
  16718. if (!esta_correto) {
  16719. // has_element_created_draged = false;
  16720. // which_element_is_draged = null;
  16721. dragTrash(event);
  16722. return;
  16723. } else {
  16724. if (!esta_na_div_correta) {
  16725. // has_element_created_draged = false;
  16726. // which_element_is_draged = null;
  16727. dragTrash(event);
  16728. return;
  16729. }
  16730. }
  16731. var hierarquia_bottom_up = null; // Agora é descobrir qual o escopo para adicionar o comando:
  16732. // Se o elemento clicado possuir o atributo "fun", então, é direto na div dos comandos:
  16733. if (typeof el.data('fun') !== 'undefined') {
  16734. // Se a lista de comandos estiver vazia, então é o primeiro.
  16735. // Portanto, ele deve soltar o elemento obrigatoriamente no objeto vazio
  16736. if (el.data('fun').commands == null || el.data('fun').commands.length == 0) {
  16737. // pode adicionar
  16738. el.data('fun').commands = [];
  16739. var new_cmd = genericCreateCommand(command_type);
  16740. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', 0);
  16741. el.data('fun').commands.push(new_cmd);
  16742. renderCommand(new_cmd, $(function_container).find('.commands_list_div'), 3, function_obj);
  16743. } else {
  16744. // Entra nesse else, caso já existam outros comandos no bloco:
  16745. findNearbyCommandToAddInFunctionScope(el, event, $(function_container).find('.commands_list_div'), function_obj, command_type);
  16746. }
  16747. } else {
  16748. // descobrir em qual comando ele soltou:
  16749. var hier_find = el.parentsUntil(".commands_list_div");
  16750. hierarquia_bottom_up = [];
  16751. if (typeof el.data('command') !== 'undefined') {
  16752. hierarquia_bottom_up.push(el.data('command'));
  16753. }
  16754. for (var i = 0; i < hier_find.length; i++) {
  16755. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16756. hierarquia_bottom_up.push($(hier_find[i]).data('command'));
  16757. }
  16758. } // Se for do tipo break, verificar se está no contexto correto:
  16759. // Caso não esteja no contexto, apenas retorna sem dar continuidade:
  16760. var is_correct_context = false;
  16761. if (command_type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]) {
  16762. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  16763. 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"]) {
  16764. is_correct_context = true;
  16765. break;
  16766. }
  16767. }
  16768. if (!is_correct_context) {
  16769. console.error("Context not allowed to insert BREAK COMMAND!");
  16770. return;
  16771. }
  16772. } // se a hierarquia possuir apenas um elemento, então está na raiz dos comandos:
  16773. if (hierarquia_bottom_up.length == 1) {
  16774. var sub_elemento = false;
  16775. for (var i = 0; i < hier_find.length; i++) {
  16776. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16777. findBeforeOrAfterCommandToAdd(hier_find[i], event, function_obj, command_type);
  16778. sub_elemento = true;
  16779. break;
  16780. }
  16781. }
  16782. if (!sub_elemento) {
  16783. findBeforeOrAfterCommandToAdd(el[0], event, function_obj, command_type);
  16784. }
  16785. } else {
  16786. // caso exista mais de um elemento na hierarquia:
  16787. if (typeof $(el).data('command') !== 'undefined') {
  16788. insertCommandInBlockHierar(el[0], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16789. } else {
  16790. var sub_elemento = false;
  16791. for (var i = 0; i < hier_find.length; i++) {
  16792. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16793. insertCommandInBlockHierar(hier_find[i], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16794. sub_elemento = true;
  16795. break;
  16796. }
  16797. }
  16798. }
  16799. }
  16800. } // has_element_created_draged = false;
  16801. // which_element_is_draged = null;
  16802. if (hierarquia_bottom_up) {
  16803. var i = hierarquia_bottom_up.length - 1;
  16804. var starter_index = window.program_obj.functions[window.program_obj.functions.indexOf(function_obj)].commands.indexOf(hierarquia_bottom_up[i]);
  16805. var all_str_path = starter_index + '-' + findPathRecursive(starter_index, hierarquia_bottom_up, function_obj);
  16806. 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);
  16807. }
  16808. renderAlgorithm();
  16809. }
  16810. function insertCommandInBlockHierar(el, event, function_obj, command_type, hier_dom, hier_obj) {
  16811. var el_jq = $(el);
  16812. var command_parent = el_jq.data('command');
  16813. 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"]) {
  16814. 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) {
  16815. // Se não tiver outro comando ainda no bloco, só adiciona:
  16816. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16817. command_parent.commands_block = [];
  16818. var recentComand = genericCreateCommand(command_type);
  16819. command_parent.commands_block.push(recentComand);
  16820. 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);
  16821. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  16822. } else {
  16823. // Se já tem algum comando no bloco:
  16824. findNearbyCommandToAddInBlockScope(el, event, el, function_obj, command_type, command_parent);
  16825. }
  16826. } else {
  16827. // QUANDO FOR BLOCO DO TIPO IF OU SWITCH/CASE:
  16828. addCommandToSwitchCase(event, function_obj, command_type);
  16829. }
  16830. } else {
  16831. // entra neste bloco, se soltou o comando sobre outro comando dentro de um subbloco:
  16832. findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type);
  16833. }
  16834. }
  16835. function findNearbyCommandToAddInBlockScope(el, event, node_list_commands, function_obj, command_type, command_parent) {
  16836. var all_sub = $(node_list_commands).find('div.command_container');
  16837. var menor_distancia = 999999999;
  16838. var elemento_menor_distancia = null;
  16839. var antes = true;
  16840. var t_bot;
  16841. var t_top; // Descobrindo o elemento mais próximo:
  16842. for (var i = 0; i < all_sub.length; i++) {
  16843. t_top = all_sub[i].getBoundingClientRect().top;
  16844. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16845. if (t_top - event.clientY < menor_distancia) {
  16846. menor_distancia = event.clientY - t_top;
  16847. elemento_menor_distancia = all_sub[i];
  16848. }
  16849. }
  16850. 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:
  16851. if (borda_inferior - event.clientY < menor_distancia) {
  16852. var recentComand = genericCreateCommand(command_type);
  16853. command_parent.commands_block.push(recentComand); //
  16854. renderCommand(recentComand, node_list_commands, 3, function_obj);
  16855. } else {
  16856. var recentComand = genericCreateCommand(command_type);
  16857. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16858. if (index > -1) {
  16859. command_parent.commands_block.splice(index, 0, recentComand);
  16860. }
  16861. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16862. }
  16863. }
  16864. function findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type) {
  16865. var el_jq = $(el);
  16866. var command_parent = $(el.parentNode.parentNode).data('command');
  16867. var command_target = el_jq.data('command');
  16868. var temp_parent = $(el.parentNode.parentNode);
  16869. var is_in_else = false;
  16870. if (!command_parent) {
  16871. command_parent = el_jq.data('command');
  16872. temp_parent = el_jq;
  16873. var hier = el_jq.parentsUntil(".command_container");
  16874. for (var i = 0; i < hier.length; i++) {
  16875. var temp = $(hier[i]);
  16876. if (typeof temp.data('else') != 'undefined') {
  16877. is_in_else = true;
  16878. }
  16879. if (typeof temp.data('command') != 'undefined') {
  16880. command_parent = temp.data('command');
  16881. temp_parent = temp;
  16882. }
  16883. }
  16884. }
  16885. var hier = el_jq.parentsUntil(".command_container");
  16886. for (var i = 0; i < hier.length; i++) {
  16887. var temp = $(hier[i]);
  16888. if (typeof temp.data('else') != 'undefined') {
  16889. is_in_else = true;
  16890. }
  16891. }
  16892. if (command_parent == command_target) {
  16893. var hier = el_jq.parentsUntil(".command_container");
  16894. for (var i = 0; i < hier.length; i++) {
  16895. var temp = $(hier[i]);
  16896. if (typeof temp.data('else') !== 'undefined') {
  16897. is_in_else = true;
  16898. break;
  16899. }
  16900. }
  16901. }
  16902. 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"]) {
  16903. var hier = temp_parent.parentsUntil(".all_cases_div");
  16904. for (var i = 0; i < hier.length; i++) {
  16905. var temp = $(hier[i]);
  16906. if (typeof temp.data('switchcase') !== 'undefined') {
  16907. command_parent = temp.data('switchcase');
  16908. is_in_else = false;
  16909. break;
  16910. }
  16911. }
  16912. }
  16913. var menor_distancia = 999999999;
  16914. var antes = true;
  16915. var t_bot;
  16916. var t_top;
  16917. t_top = el.getBoundingClientRect().top;
  16918. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  16919. var d_top = event.clientY - t_top; // distancia topo
  16920. var d_bot = t_bot - event.clientY; // distancia baixo
  16921. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16922. if (d_top < d_bot) {
  16923. var recentComand = genericCreateCommand(command_type);
  16924. if (is_in_else) {
  16925. if (command_parent == command_target) {
  16926. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16927. command_parent.commands_else = [];
  16928. var recentComand = genericCreateCommand(command_type);
  16929. command_parent.commands_else.push(recentComand);
  16930. renderCommand(recentComand, el_jq, 3, function_obj);
  16931. } else {
  16932. // Se já tem algum comando no bloco:
  16933. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16934. }
  16935. return;
  16936. }
  16937. var index = command_parent.commands_else.indexOf(command_target);
  16938. if (index > -1) {
  16939. command_parent.commands_else.splice(index, 0, recentComand);
  16940. }
  16941. renderCommand(recentComand, el, 1, function_obj);
  16942. } else {
  16943. if (command_parent == command_target) {
  16944. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16945. command_parent.commands_block = [];
  16946. var recentComand = genericCreateCommand(command_type);
  16947. command_parent.commands_block.push(recentComand);
  16948. renderCommand(recentComand, el_jq, 3, function_obj);
  16949. } else {
  16950. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16951. }
  16952. return;
  16953. }
  16954. var index = command_parent.commands_block.indexOf(command_target);
  16955. if (index > -1) {
  16956. command_parent.commands_block.splice(index, 0, recentComand);
  16957. }
  16958. renderCommand(recentComand, el, 1, function_obj);
  16959. }
  16960. } else {
  16961. var recentComand = genericCreateCommand(command_type);
  16962. if (is_in_else) {
  16963. if (command_parent == command_target) {
  16964. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16965. command_parent.commands_else = [];
  16966. var recentComand = genericCreateCommand(command_type);
  16967. command_parent.commands_else.push(recentComand);
  16968. renderCommand(recentComand, el_jq, 3, function_obj);
  16969. } else {
  16970. // Se já tem algum comando no bloco:
  16971. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16972. }
  16973. return;
  16974. }
  16975. var index = command_parent.commands_else.indexOf(command_target);
  16976. if (index > -1) {
  16977. command_parent.commands_else.splice(index + 1, 0, recentComand);
  16978. }
  16979. renderCommand(recentComand, el, 2, function_obj);
  16980. } else {
  16981. if (command_parent == command_target) {
  16982. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16983. command_parent.commands_block = [];
  16984. var recentComand = genericCreateCommand(command_type);
  16985. command_parent.commands_block.push(recentComand);
  16986. renderCommand(recentComand, el_jq, 3, function_obj);
  16987. } else {
  16988. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16989. }
  16990. return;
  16991. }
  16992. var index = command_parent.commands_block.indexOf(command_target);
  16993. if (index > -1) {
  16994. command_parent.commands_block.splice(index + 1, 0, recentComand);
  16995. }
  16996. renderCommand(recentComand, el, 2, function_obj);
  16997. }
  16998. }
  16999. }
  17000. function insertCommandInBlock(el, event, function_obj, command_type) {
  17001. var el_jq = $(el);
  17002. var command_parent = el_jq.data('command');
  17003. 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) {
  17004. // Se não tiver outro comando ainda no bloco, só adiciona:
  17005. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  17006. command_parent.commands_block = [];
  17007. var recentComand = genericCreateCommand(command_type);
  17008. command_parent.commands_block.push(recentComand);
  17009. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  17010. } else {
  17011. // Se já tem algum comando no bloco:
  17012. findInBlockCorrectPlace(el, event, function_obj, command_type);
  17013. }
  17014. } else if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  17015. // no if ou no else?
  17016. var correct_div = $(document.elementFromPoint(event.pageX, event.pageY));
  17017. var is_in_if = true;
  17018. if (correct_div.data('if')) {
  17019. is_in_if = true;
  17020. } else if (correct_div.data('else')) {
  17021. is_in_if = false;
  17022. } else {
  17023. var hier = correct_div.parentsUntil(".command_container");
  17024. for (var i = 0; i < hier.length; i++) {
  17025. var temp = $(hier[i]);
  17026. if (typeof temp.data('if') !== 'undefined') {
  17027. is_in_if = true;
  17028. break;
  17029. }
  17030. if (typeof temp.data('else') !== 'undefined') {
  17031. is_in_if = false;
  17032. break;
  17033. }
  17034. }
  17035. }
  17036. if (is_in_if) {
  17037. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  17038. command_parent.commands_block = [];
  17039. var recentComand = genericCreateCommand(command_type);
  17040. command_parent.commands_block.push(recentComand);
  17041. renderCommand(recentComand, el_jq.find('.commands_if'), 3, function_obj);
  17042. } else {
  17043. // Se já tem algum comando no bloco:
  17044. findInBlockCorrectPlace(el_jq.find('.commands_if'), event, function_obj, command_type);
  17045. }
  17046. } else {
  17047. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  17048. command_parent.commands_else = [];
  17049. var recentComand = genericCreateCommand(command_type);
  17050. command_parent.commands_else.push(recentComand);
  17051. renderCommand(recentComand, el_jq.find('.commands_else'), 3, function_obj);
  17052. } else {
  17053. // Se já tem algum comando no bloco:
  17054. findInBlockCorrectPlace(el_jq.find('.commands_else'), event, function_obj, command_type, true);
  17055. }
  17056. }
  17057. } else {
  17058. // é do tipo switch
  17059. addCommandToSwitchCase(event, function_obj, command_type);
  17060. }
  17061. }
  17062. function addCommandToSwitchCase(event, function_obj, command_type) {
  17063. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  17064. var which_case = el.data('switchcase');
  17065. var case_div = el;
  17066. if (!which_case) {
  17067. var hier_find = el.parentsUntil(".all_cases_div");
  17068. for (var i = 0; i < hier_find.length; i++) {
  17069. if (typeof $(hier_find[i]).data('switchcase') !== 'undefined') {
  17070. which_case = $(hier_find[i]).data('switchcase');
  17071. case_div = $(hier_find[i]);
  17072. break;
  17073. }
  17074. }
  17075. }
  17076. if (which_case.commands_block == null || which_case.commands_block.length < 1) {
  17077. which_case.commands_block = [];
  17078. var recentComand = genericCreateCommand(command_type);
  17079. which_case.commands_block.push(recentComand);
  17080. renderCommand(recentComand, case_div.find('.case_commands_block'), 3, function_obj);
  17081. } else {
  17082. findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type);
  17083. }
  17084. }
  17085. function findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type) {
  17086. var all_sub = case_div.find('div.command_container');
  17087. var menor_distancia = 999999999;
  17088. var elemento_menor_distancia = null;
  17089. var antes = true;
  17090. var t_bot;
  17091. var t_top; // Descobrindo o elemento mais próximo:
  17092. for (var i = 0; i < all_sub.length; i++) {
  17093. t_top = all_sub[i].getBoundingClientRect().top;
  17094. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  17095. if (t_top - event.clientY < menor_distancia) {
  17096. menor_distancia = event.clientY - t_top;
  17097. elemento_menor_distancia = all_sub[i];
  17098. }
  17099. }
  17100. 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:
  17101. if (borda_inferior - event.clientY < menor_distancia) {
  17102. var recentComand = genericCreateCommand(command_type);
  17103. which_case.commands_block.push(recentComand);
  17104. renderCommand(recentComand, $(case_div.find('.case_commands_block')[0]), 3, function_obj);
  17105. } else {
  17106. var recentComand = genericCreateCommand(command_type);
  17107. var index = which_case.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  17108. if (index > -1) {
  17109. which_case.commands_block.splice(index, 0, recentComand);
  17110. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17111. }
  17112. }
  17113. }
  17114. function findInBlockCorrectPlace(el, event, function_obj, command_type) {
  17115. var is_in_else = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  17116. var el_jq = $(el);
  17117. var all_sub = el_jq.find('div.command_container');
  17118. var menor_distancia = 999999999;
  17119. var elemento_menor_distancia = null;
  17120. var antes = true;
  17121. var t_bot;
  17122. var t_top; // Descobrindo o elemento mais próximo:
  17123. for (var i = 0; i < all_sub.length; i++) {
  17124. t_top = all_sub[i].getBoundingClientRect().top;
  17125. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  17126. if (t_top - event.clientY < menor_distancia) {
  17127. menor_distancia = event.clientY - t_top;
  17128. elemento_menor_distancia = all_sub[i];
  17129. }
  17130. }
  17131. 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:
  17132. if (borda_inferior - event.clientY < menor_distancia) {
  17133. var recentComand = genericCreateCommand(command_type);
  17134. var command_parent = el_jq.data('command');
  17135. if (is_in_else) {
  17136. command_parent.commands_else.push(recentComand);
  17137. renderCommand(recentComand, el_jq, 3, function_obj);
  17138. } else {
  17139. command_parent.commands_block.push(recentComand);
  17140. renderCommand(recentComand, $(el_jq.find('.block_commands')[0]), 3, function_obj);
  17141. }
  17142. } else {
  17143. var recentComand = genericCreateCommand(command_type);
  17144. var command_parent = el_jq.data('command');
  17145. if (is_in_else) {
  17146. var index = command_parent.commands_else.indexOf($(elemento_menor_distancia).data('command'));
  17147. if (index > -1) {
  17148. command_parent.commands_else.splice(index, 0, recentComand);
  17149. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17150. }
  17151. } else {
  17152. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  17153. if (index > -1) {
  17154. command_parent.commands_block.splice(index, 0, recentComand);
  17155. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17156. }
  17157. }
  17158. }
  17159. }
  17160. function findBeforeOrAfterCommandToAdd(el, event, function_obj, command_type) {
  17161. switch ($(el).data('command').type) {
  17162. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  17163. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  17164. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  17165. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  17166. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  17167. insertCommandInBlock(el, event, function_obj, command_type);
  17168. return;
  17169. }
  17170. var menor_distancia = 999999999;
  17171. var antes = true;
  17172. var t_bot;
  17173. var t_top;
  17174. t_top = el.getBoundingClientRect().top;
  17175. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  17176. var d_top = event.clientY - t_top; // distancia topo
  17177. var d_bot = t_bot - event.clientY; // distancia baixo
  17178. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  17179. if (d_top < d_bot) {
  17180. var recentComand = genericCreateCommand(command_type);
  17181. var index = function_obj.commands.indexOf($(el).data('command'));
  17182. if (index > -1) {
  17183. function_obj.commands.splice(index, 0, recentComand);
  17184. }
  17185. renderCommand(recentComand, el, 1, function_obj);
  17186. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  17187. } else {
  17188. var recentComand = genericCreateCommand(command_type);
  17189. var index = function_obj.commands.indexOf($(el).data('command'));
  17190. if (index > -1) {
  17191. function_obj.commands.splice(index + 1, 0, recentComand);
  17192. }
  17193. renderCommand(recentComand, el, 2, function_obj);
  17194. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  17195. }
  17196. }
  17197. function findNearbyCommandToAddInFunctionScope(el, event, node_list_commands, function_obj, command_type) {
  17198. var all_sub = $(node_list_commands).find('div.command_container');
  17199. var menor_distancia = 999999999;
  17200. var elemento_menor_distancia = null;
  17201. var antes = true;
  17202. var t_bot;
  17203. var t_top; // Descobrindo o elemento mais próximo:
  17204. for (var i = 0; i < all_sub.length; i++) {
  17205. t_top = all_sub[i].getBoundingClientRect().top;
  17206. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  17207. if (t_top - event.clientY < menor_distancia) {
  17208. menor_distancia = event.clientY - t_top;
  17209. elemento_menor_distancia = all_sub[i];
  17210. }
  17211. }
  17212. 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:
  17213. if (borda_inferior - event.clientY < menor_distancia) {
  17214. var recentComand = genericCreateCommand(command_type);
  17215. function_obj.commands.push(recentComand); //
  17216. renderCommand(recentComand, node_list_commands, 3, function_obj);
  17217. 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);
  17218. } else {
  17219. var recentComand = genericCreateCommand(command_type);
  17220. var index = function_obj.commands.indexOf($(elemento_menor_distancia).data('command'));
  17221. if (index > -1) {
  17222. function_obj.commands.splice(index, 0, recentComand);
  17223. }
  17224. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17225. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  17226. }
  17227. }
  17228. /***/ }),
  17229. /***/ "./js/visualUI/commands/attribution.js":
  17230. /*!*********************************************!*\
  17231. !*** ./js/visualUI/commands/attribution.js ***!
  17232. \*********************************************/
  17233. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, renderMenuOperations */
  17234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17235. "use strict";
  17236. __webpack_require__.r(__webpack_exports__);
  17237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17238. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17239. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  17240. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenuOperations", function() { return renderMenuOperations; });
  17241. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17242. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17243. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17244. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17245. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  17246. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  17247. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../algorithm */ "./js/visualUI/algorithm.js");
  17248. function createFloatingCommand() {
  17249. return $('<div class="ui attribution created_element"> <i class="ui icon small arrow left"></i> <span> x <&#8212; 1 + 1 </span></div>');
  17250. }
  17251. function renderCommand(command, function_obj) {
  17252. 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>');
  17253. el.data('command', command);
  17254. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.var_attributed'), function_obj);
  17255. if (!command.expression || command.expression.length < 1) {
  17256. 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);
  17257. command.expression.push(exp);
  17258. }
  17259. addHandlers(command, function_obj, el);
  17260. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.expression);
  17261. if (command.lockexpression) {
  17262. if (command.expression) {
  17263. try {
  17264. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  17265. if (text) {
  17266. $(el.find('.expression_elements')[0]).toggle();
  17267. $(el.find('.textual_expression')[0]).text(text);
  17268. $(el.find('.textual_expression')[0]).toggle();
  17269. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  17270. }
  17271. } catch (e) {
  17272. command.lockexpression = false;
  17273. }
  17274. }
  17275. }
  17276. el.find('.unlock').popup({
  17277. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  17278. delay: {
  17279. show: 750,
  17280. hide: 0
  17281. }
  17282. });
  17283. el.find('.lock').popup({
  17284. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  17285. delay: {
  17286. show: 750,
  17287. hide: 0
  17288. }
  17289. });
  17290. el.find('.button_write_expression').popup({
  17291. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression"),
  17292. delay: {
  17293. show: 750,
  17294. hide: 0
  17295. }
  17296. });
  17297. return el;
  17298. }
  17299. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, selectedItem, expression_element) {
  17300. var index_to_move = expression_element.itens.indexOf(ref_object);
  17301. switch (selectedItem.data('exp')) {
  17302. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  17303. 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)]);
  17304. expression_element.itens[index_to_move] = exp;
  17305. break;
  17306. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  17307. 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]]);
  17308. expression_element.itens[index_to_move] = exp;
  17309. break;
  17310. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  17311. 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]]);
  17312. expression_element.itens[index_to_move] = exp;
  17313. break;
  17314. }
  17315. renderExpressionElements(command, function_obj, dom_object);
  17316. }
  17317. function renderExpressionElements(command, function_obj, el) {
  17318. var expression_div = el.find('.expression_elements');
  17319. var command_container;
  17320. if (el.hasClass("command_container") == false) {
  17321. var hier = el.parentsUntil(".command_container");
  17322. for (var i = 0; i < hier.length; i++) {
  17323. if ($(hier[i]).hasClass("command_container")) {
  17324. command_container = $(hier[i]);
  17325. break;
  17326. }
  17327. if ($(hier[i]).hasClass("expression_elements")) {
  17328. expression_div = $(hier[i]);
  17329. break;
  17330. }
  17331. }
  17332. }
  17333. if (command_container) {
  17334. expression_div = command_container.find('.expression_elements');
  17335. }
  17336. expression_div.text('');
  17337. for (var i = 0; i < command.expression.length; i++) {
  17338. var temp = $('<div class="expression_element"></div>');
  17339. temp.data('ref_element', command.expression[i]);
  17340. temp.data('ref_index', i);
  17341. expression_div.append(temp);
  17342. renderElement(command, function_obj, temp, command.expression[i]);
  17343. }
  17344. }
  17345. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  17346. var context_menu = '<div class="ui dropdown"><div class="text">';
  17347. switch (expression_element.itens[index_op]) {
  17348. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  17349. context_menu += '+';
  17350. break;
  17351. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  17352. context_menu += '-';
  17353. break;
  17354. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  17355. context_menu += '*';
  17356. break;
  17357. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  17358. context_menu += '/';
  17359. break;
  17360. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  17361. context_menu += '%';
  17362. break;
  17363. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none:
  17364. context_menu += '...';
  17365. break;
  17366. }
  17367. context_menu += '</div><div class="menu">';
  17368. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus + '">+</div>';
  17369. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus + '">-</div>';
  17370. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  17371. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division + '">/</div>';
  17372. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module + '">%</div>';
  17373. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none + '" data-text="...">Nenhum</div>';
  17374. context_menu += '</div></div>';
  17375. context_menu = $(context_menu);
  17376. temp_op.append(context_menu);
  17377. context_menu.dropdown({
  17378. onChange: function onChange(value, text, $selectedItem) {
  17379. expression_element.itens[index_op] = value;
  17380. }
  17381. });
  17382. }
  17383. function renderMenuAddExpression(command, function_obj, el, dom_append_menu, expression_append_new_expression) {
  17384. if (el.hasClass("command_container") == false) {
  17385. var hier = el.parentsUntil(".commands_list_div");
  17386. for (var i = 0; i < hier.length; i++) {
  17387. if ($(hier[i]).hasClass("command_container")) {
  17388. el = $(hier[i]);
  17389. break;
  17390. }
  17391. }
  17392. }
  17393. if (dom_append_menu.hasClass("expression_elements") == false) {
  17394. var hier = el.parentsUntil(".commands_list_div");
  17395. for (var i = 0; i < hier.length; i++) {
  17396. if ($(hier[i]).hasClass("expression_elements")) {
  17397. dom_append_menu = $(hier[i]);
  17398. break;
  17399. }
  17400. }
  17401. }
  17402. var context_menu = '<div class="ui dropdown"><div class="text"></div><i class="ui icon arrow alternate circle right outline"></i><div class="menu">';
  17403. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp + '">EXP OP EXP</div>';
  17404. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp + '">OP EXP</div>';
  17405. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par + '">( EXP )</div>';
  17406. context_menu += '</div></div>';
  17407. context_menu = $(context_menu);
  17408. dom_append_menu.append(context_menu);
  17409. context_menu.dropdown({
  17410. onChange: function onChange(value, text, $selectedItem) {
  17411. switch (value) {
  17412. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  17413. 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)]);
  17414. expression_append_new_expression.push(exp);
  17415. break;
  17416. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  17417. 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)]);
  17418. expression_append_new_expression.push(exp);
  17419. break;
  17420. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  17421. 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)]);
  17422. expression_append_new_expression.push(exp);
  17423. break;
  17424. }
  17425. renderExpressionElements(command, function_obj, el);
  17426. }
  17427. });
  17428. }
  17429. function renderElement(command, function_obj, el, expression_element) {
  17430. switch (expression_element.type_exp) {
  17431. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  17432. var temp_op = $('<div class="component_element"></div>');
  17433. var temp_exp_1 = $('<div class="component_element"></div>');
  17434. var temp_exp_2 = $('<div class="component_element"></div>');
  17435. el.append(temp_exp_1);
  17436. el.append(temp_op);
  17437. el.append(temp_exp_2);
  17438. if (expression_element.itens[0].type) {
  17439. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[0], temp_exp_1, function_obj, 2, expression_element);
  17440. } else {
  17441. renderElement(command, function_obj, temp_exp_1, expression_element.itens[0]);
  17442. }
  17443. renderOperator(command, function_obj, temp_op, expression_element, 1);
  17444. if (expression_element.itens[2].type) {
  17445. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[2], temp_exp_2, function_obj, 2, expression_element);
  17446. } else {
  17447. renderElement(command, function_obj, temp_exp_2, expression_element.itens[2]);
  17448. }
  17449. break;
  17450. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  17451. var temp_op = $('<div class="component_element"></div>');
  17452. var temp_exp = $('<div class="component_element"></div>');
  17453. el.append(temp_op);
  17454. el.append(temp_exp);
  17455. renderOperator(command, function_obj, temp_op, expression_element, 0);
  17456. if (expression_element.itens[1].type) {
  17457. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[1], temp_exp, function_obj, 2, expression_element);
  17458. } else {
  17459. renderElement(command, function_obj, temp_exp, expression_element.itens[1]);
  17460. }
  17461. break;
  17462. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  17463. var temp_par_1 = $('<div class="component_element"> ( </div>');
  17464. var temp_exp = $('<div class="component_element"></div>');
  17465. var temp_par_2 = $('<div class="component_element"> ) </div>');
  17466. el.append(temp_par_1);
  17467. el.append(temp_exp);
  17468. for (var j = 0; j < expression_element.itens.length; j++) {
  17469. if (expression_element.itens[j].type) {
  17470. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[j], temp_exp, function_obj, 2, expression_element);
  17471. } else {
  17472. renderElement(command, function_obj, temp_exp, expression_element.itens[j]);
  17473. }
  17474. } //renderMenuAddExpression(command, function_obj, el, el, expression_element.itens);
  17475. el.append(temp_par_2);
  17476. break;
  17477. }
  17478. }
  17479. function renderExpression(command, function_obj, el) {
  17480. var expression_div = el.find('.expression_elements');
  17481. expression_div.text('');
  17482. var menu_add_item = $('<div class="menu_add_item"></div>');
  17483. menu_add_item.data('index_add', 0);
  17484. expression_div.append(menu_add_item);
  17485. for (var i = 0; i < command.expression.length; i++) {
  17486. if (command.expression[i].type) {
  17487. var temp = $('<div class="expression_element"></div>');
  17488. temp.data('ref_element', command.expression[i]);
  17489. temp.data('ref_index', i);
  17490. expression_div.append(temp);
  17491. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.expression[i], temp, function_obj);
  17492. } else if (command.expression[i] == "(" || command.expression[i] == ")") {
  17493. var temp = $('<div class="expression_element">' + command.expression[i] + '</div>');
  17494. temp.data('ref_element', command.expression[i]);
  17495. temp.data('ref_index', i);
  17496. expression_div.append(temp);
  17497. } else {
  17498. var temp = '<div class="expression_element">';
  17499. switch (command.expression[i]) {
  17500. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  17501. temp += '+';
  17502. break;
  17503. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  17504. temp += '-';
  17505. break;
  17506. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  17507. temp += '*';
  17508. break;
  17509. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  17510. temp += '/';
  17511. break;
  17512. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  17513. temp += '%';
  17514. break;
  17515. }
  17516. temp += '</div>';
  17517. temp = $(temp);
  17518. temp.data('ref_element', command.expression[i]);
  17519. temp.data('ref_index', i);
  17520. expression_div.append(temp);
  17521. }
  17522. var menu_add_item_seq = $('<div class="menu_add_item"></div>');
  17523. var index_temp = i + 1;
  17524. menu_add_item_seq.data('index_add', index_temp);
  17525. expression_div.append(menu_add_item_seq);
  17526. }
  17527. addMenuItens(command, function_obj, el);
  17528. }
  17529. function addMenuItens(command, function_obj, expression_div) {
  17530. var divs_expression = expression_div.find('.menu_add_item');
  17531. for (var i = 0; i < divs_expression.length; i++) {
  17532. var temp = $(divs_expression[i]).data('index_add');
  17533. var context_menu = '<div class="ui dropdown context_menu_clear"><i class="ui icon plus square outline"></i><div class="menu">';
  17534. context_menu += '<div class="item" data-option="value" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_value') + '</div>';
  17535. context_menu += '<div class="item" data-option="operator" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_operator') + '</div>';
  17536. context_menu += '<div class="item" data-option="parentheses" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_parentheses') + '</div>';
  17537. context_menu += '</div></div>';
  17538. context_menu = $(context_menu);
  17539. $(divs_expression[i]).append(context_menu);
  17540. context_menu.dropdown({
  17541. on: 'hover',
  17542. onChange: function onChange(value, text, $selectedItem) {
  17543. switch ($selectedItem.data('option')) {
  17544. case "value":
  17545. 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));
  17546. renderExpression(command, function_obj, expression_div);
  17547. break;
  17548. case "operator":
  17549. command.expression.splice($selectedItem.data('index'), 0, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus);
  17550. renderExpression(command, function_obj, expression_div);
  17551. break;
  17552. case "parentheses":
  17553. command.expression.splice($selectedItem.data('index'), 0, "(");
  17554. 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));
  17555. command.expression.splice($selectedItem.data('index') + 2, 0, ")");
  17556. renderExpression(command, function_obj, expression_div);
  17557. break;
  17558. }
  17559. }
  17560. });
  17561. }
  17562. }
  17563. function addHandlers(command, function_obj, attribution_dom) {
  17564. attribution_dom.find('.button_write_expression').on('click', function () {
  17565. window.expressionEdition = true;
  17566. window.inputExpression = null;
  17567. var afterWhichElement;
  17568. var lockButton = $(attribution_dom.find('.button_alternate_expression')[0]);
  17569. var editButton = $(this);
  17570. afterWhichElement = attribution_dom.find('.expression_elements');
  17571. if (command.lockexpression) {
  17572. afterWhichElement = attribution_dom.find('.textual_expression');
  17573. }
  17574. var text = "";
  17575. if (command.expression) {
  17576. if (command.expression.length == 1 && command.expression[0].content == null && !command.expression[0].function_called) {
  17577. text = "";
  17578. } else {
  17579. try {
  17580. text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  17581. } catch (ex) {
  17582. text = "";
  17583. }
  17584. }
  17585. }
  17586. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  17587. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  17588. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  17589. input.val(text);
  17590. input.focusout(function (evt) {
  17591. console.log('focosout event!');
  17592. ok_button.click();
  17593. evt.preventDefault();
  17594. return true;
  17595. });
  17596. input.keyup(function (evt) {
  17597. if (evt.keyCode == 27) {
  17598. // esc
  17599. cancel_button.click();
  17600. }
  17601. if (evt.keyCode == 13) {
  17602. // enter
  17603. ok_button.click();
  17604. }
  17605. });
  17606. ok_button.click(function () {
  17607. var parsed = null;
  17608. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](input.val(), function_obj, input);
  17609. if (parsed) {
  17610. window.expressionEdition = false;
  17611. command.expression = parsed;
  17612. Object(_algorithm__WEBPACK_IMPORTED_MODULE_6__["renderAlgorithm"])();
  17613. }
  17614. });
  17615. cancel_button.mousedown(function (evt) {
  17616. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](text, function_obj, input);
  17617. if (parsed) {
  17618. window.expressionEdition = false;
  17619. command.expression = parsed;
  17620. Object(_algorithm__WEBPACK_IMPORTED_MODULE_6__["renderAlgorithm"])();
  17621. }
  17622. });
  17623. input.insertAfter(afterWhichElement);
  17624. input.focus();
  17625. cancel_button.insertAfter(input);
  17626. ok_button.insertAfter(input);
  17627. var len = text.length;
  17628. input[0].setSelectionRange(len, len);
  17629. afterWhichElement.css('display', 'none');
  17630. lockButton.css('display', 'none');
  17631. editButton.css('display', 'none');
  17632. ok_button.popup({
  17633. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  17634. delay: {
  17635. show: 750,
  17636. hide: 0
  17637. }
  17638. });
  17639. cancel_button.popup({
  17640. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  17641. delay: {
  17642. show: 750,
  17643. hide: 0
  17644. }
  17645. });
  17646. });
  17647. $(attribution_dom.find('.textual_expression')[0]).toggle();
  17648. attribution_dom.find('.button_alternate_expression').on('click', function () {
  17649. if (command.expression) {
  17650. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  17651. if (text) {
  17652. $(attribution_dom.find('.expression_elements')[0]).toggle();
  17653. $(attribution_dom.find('.textual_expression')[0]).text(text);
  17654. $(attribution_dom.find('.textual_expression')[0]).toggle();
  17655. $(this).toggleClass('unlock').toggleClass('lock');
  17656. command.lockexpression = !command.lockexpression;
  17657. }
  17658. if (command.lockexpression) {
  17659. attribution_dom.find('.lock').popup({
  17660. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  17661. delay: {
  17662. show: 750,
  17663. hide: 0
  17664. }
  17665. });
  17666. } else {
  17667. attribution_dom.find('.unlock').popup({
  17668. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  17669. delay: {
  17670. show: 750,
  17671. hide: 0
  17672. }
  17673. });
  17674. }
  17675. }
  17676. });
  17677. attribution_dom.find('.button_remove_command').on('click', function () {
  17678. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, attribution_dom)) {
  17679. attribution_dom.fadeOut(400, function () {
  17680. attribution_dom.remove();
  17681. });
  17682. }
  17683. });
  17684. attribution_dom.find('.button_refresh_attribution').on('click', function () {
  17685. renderExpressionElements(command, function_obj, attribution_dom);
  17686. });
  17687. }
  17688. function renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected) {
  17689. /*console.log("recebido o seguinte DOM: ");
  17690. console.log(dom_object);
  17691. if (dom_object.hasClass('var_attributed')) {
  17692. return;
  17693. } else {
  17694. var hier = dom_object.parentsUntil(".command_container");
  17695. for (var i = 0; i < hier.length; i++) {
  17696. if ($(hier[i]).hasClass('var_attributed') || $(hier[i]).hasClass('parameters_function_called')) {
  17697. return;
  17698. }
  17699. }
  17700. }
  17701. dom_object.find('.context_menu_clear').remove();
  17702. var menu_operations = '<div class="ui dropdown menu_operations"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17703. for (var tm in Models.ARITHMETIC_TYPES) {
  17704. menu_operations += '<div class="item" data-option="'+tm+'">'+LocalizedStrings.getUI('btn_arithmetic_' + tm)+'</div>';
  17705. }
  17706. menu_operations += '<div class="item" data-option="clear">'+LocalizedStrings.getUI('btn_clear')+'</div>';
  17707. menu_operations += '</div></div>';
  17708. menu_operations = $(menu_operations);
  17709. dom_object.append(menu_operations);
  17710. menu_operations.dropdown({
  17711. onChange: function(value, text, $selectedItem) {
  17712. switch ($($selectedItem).data('option')) {
  17713. case "clear":
  17714. $(dom_object).text('');
  17715. VariableValueMenu.renderMenu(command, ref_object, dom_object, function_obj);
  17716. break;
  17717. default:
  17718. createExpressionAround(command, ref_object, dom_object, function_obj);
  17719. menu_operations.find('.text').text('');
  17720. }
  17721. }
  17722. });*/
  17723. }
  17724. function createExpressionAround(command, ref_object, dom_object, function_obj) {
  17725. $('<span> ( </span>').insertBefore(dom_object);
  17726. $('<span> ) </span>').insertAfter(dom_object);
  17727. _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);
  17728. }
  17729. /***/ }),
  17730. /***/ "./js/visualUI/commands/break.js":
  17731. /*!***************************************!*\
  17732. !*** ./js/visualUI/commands/break.js ***!
  17733. \***************************************/
  17734. /*! exports provided: createFloatingCommand, renderCommand */
  17735. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17736. "use strict";
  17737. __webpack_require__.r(__webpack_exports__);
  17738. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17740. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17741. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17742. function createFloatingCommand() {
  17743. 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>');
  17744. }
  17745. function renderCommand(command, function_obj) {
  17746. 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>');
  17747. el.data('command', command);
  17748. addHandlers(command, function_obj, el);
  17749. return el;
  17750. }
  17751. function addHandlers(command, function_obj, break_dom) {
  17752. break_dom.find('.button_remove_command').on('click', function () {
  17753. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, break_dom)) {
  17754. break_dom.fadeOut(400, function () {
  17755. break_dom.remove();
  17756. });
  17757. }
  17758. });
  17759. }
  17760. /***/ }),
  17761. /***/ "./js/visualUI/commands/comment.js":
  17762. /*!*****************************************!*\
  17763. !*** ./js/visualUI/commands/comment.js ***!
  17764. \*****************************************/
  17765. /*! exports provided: createFloatingCommand, renderCommand */
  17766. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17767. "use strict";
  17768. __webpack_require__.r(__webpack_exports__);
  17769. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17771. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17772. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17773. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17774. function createFloatingCommand() {
  17775. 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>');
  17776. }
  17777. function renderCommand(command, function_obj) {
  17778. 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>');
  17779. el.data('command', command);
  17780. addHandlers(command, function_obj, el);
  17781. renderTextComment(command, function_obj, el);
  17782. return el;
  17783. }
  17784. function renderTextComment(command, function_obj, el) {
  17785. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.comment_text, el.find('.var_value_menu_div'), function_obj, 20);
  17786. }
  17787. function addHandlers(command, function_obj, comment_dom) {
  17788. comment_dom.find('.button_remove_command').on('click', function () {
  17789. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, comment_dom)) {
  17790. comment_dom.fadeOut(400, function () {
  17791. comment_dom.remove();
  17792. });
  17793. }
  17794. });
  17795. }
  17796. /***/ }),
  17797. /***/ "./js/visualUI/commands/conditional_expression.js":
  17798. /*!********************************************************!*\
  17799. !*** ./js/visualUI/commands/conditional_expression.js ***!
  17800. \********************************************************/
  17801. /*! exports provided: renderExpression */
  17802. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17803. "use strict";
  17804. __webpack_require__.r(__webpack_exports__);
  17805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17806. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17807. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17808. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17809. function renderExpression(command, expression, function_obj, initial_el_to_render) {
  17810. expression.dom_object = initial_el_to_render;
  17811. if (expression.expression == null || expression.expression.length < 1) {
  17812. renderStartMenu(command, expression, function_obj, initial_el_to_render);
  17813. } else {
  17814. var main_div = $('<div class="expression_elements"></div>');
  17815. switch (expression.expression.type) {
  17816. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17817. renderLogicExpression(command, expression, expression.expression, function_obj, main_div, initial_el_to_render);
  17818. break;
  17819. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17820. renderArithmeticExpression(command, expression, expression.expression, function_obj, main_div);
  17821. break;
  17822. }
  17823. initial_el_to_render.append(main_div);
  17824. var restartMenu = $('<div class="ui restart_expression"><i class="ui icon undo"></i></div>');
  17825. initial_el_to_render.append(restartMenu);
  17826. restartMenu.on('click', function (e) {
  17827. expression.expression = null;
  17828. initial_el_to_render.empty();
  17829. renderExpression(command, expression, function_obj, initial_el_to_render);
  17830. });
  17831. }
  17832. }
  17833. function renderArithmeticOperator(command, all_expression, expression_arithmetic, arithmetic_operator, function_obj, element_to_append) {
  17834. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17835. menu_operator.dropdown({
  17836. values: [{
  17837. name: '>',
  17838. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than,
  17839. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than
  17840. }, {
  17841. name: '<',
  17842. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than,
  17843. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than
  17844. }, {
  17845. name: '==',
  17846. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to,
  17847. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to
  17848. }, {
  17849. name: '!=',
  17850. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to,
  17851. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to
  17852. }, {
  17853. name: '>=',
  17854. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to,
  17855. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to
  17856. }, {
  17857. name: '<=',
  17858. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to,
  17859. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to
  17860. }],
  17861. onChange: function onChange(value, text, $selectedItem) {
  17862. expression_arithmetic.operator = value;
  17863. }
  17864. });
  17865. element_to_append.append(menu_operator);
  17866. }
  17867. function renderLogicOperator(command, all_expression, expression_logic, logic_operator, function_obj, element_to_append, initial_el_to_render) {
  17868. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17869. menu_operator.dropdown({
  17870. values: [{
  17871. name: '==',
  17872. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to,
  17873. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to
  17874. }, {
  17875. name: '!=',
  17876. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to,
  17877. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to
  17878. }, {
  17879. name: '&&',
  17880. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and,
  17881. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and
  17882. }, {
  17883. name: '||',
  17884. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or,
  17885. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or
  17886. }],
  17887. onChange: function onChange(value, text, $selectedItem) {
  17888. if ($selectedItem) {
  17889. expression_logic.operator = value;
  17890. if (expression_logic.second_operand == null) {
  17891. 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);
  17892. initial_el_to_render.empty();
  17893. renderExpression(command, all_expression, function_obj, initial_el_to_render);
  17894. }
  17895. }
  17896. }
  17897. });
  17898. element_to_append.append(menu_operator);
  17899. }
  17900. function renderLogicExpression(command, all_expression, expression_logic, function_obj, element_to_append, initial_el_to_render) {
  17901. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17902. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17903. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17904. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17905. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17906. if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17907. renderLogicExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17908. } else if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17909. renderArithmeticExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17910. } else {
  17911. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.first_operand, exp_el_expr_el_1, function_obj);
  17912. }
  17913. element_to_append.append(exp_el_par_1);
  17914. element_to_append.append(exp_el_expr_el_1);
  17915. renderLogicOperator(command, all_expression, expression_logic, expression_logic.operator, function_obj, exp_el_expr_operand, initial_el_to_render);
  17916. element_to_append.append(exp_el_expr_operand);
  17917. if (expression_logic.second_operand) {
  17918. if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17919. renderLogicExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17920. } else if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17921. renderArithmeticExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17922. } else {
  17923. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.second_operand, exp_el_expr_el_2, function_obj);
  17924. }
  17925. element_to_append.append(exp_el_expr_el_2);
  17926. }
  17927. element_to_append.append(exp_el_par_2);
  17928. }
  17929. function renderArithmeticExpression(command, all_expression, expression_arithmetic, function_obj, element_to_append) {
  17930. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17931. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17932. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17933. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17934. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17935. if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17936. renderLogicExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17937. } else if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17938. renderArithmeticExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17939. } else {
  17940. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.first_operand, exp_el_expr_el_1, function_obj);
  17941. }
  17942. if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17943. renderLogicExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17944. } else if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17945. renderArithmeticExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17946. } else {
  17947. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.second_operand, exp_el_expr_el_2, function_obj);
  17948. }
  17949. renderArithmeticOperator(command, all_expression, expression_arithmetic, expression_arithmetic.operator, function_obj, exp_el_expr_operand);
  17950. element_to_append.append(exp_el_par_1);
  17951. element_to_append.append(exp_el_expr_el_1);
  17952. element_to_append.append(exp_el_expr_operand);
  17953. element_to_append.append(exp_el_expr_el_2);
  17954. element_to_append.append(exp_el_par_2);
  17955. }
  17956. function renderStartMenu(command, expression, function_obj, initial_el_to_render) {
  17957. var start_menu = '';
  17958. 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">';
  17959. 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>';
  17960. 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>';
  17961. start_menu += '</div></div>';
  17962. start_menu = $(start_menu);
  17963. start_menu.dropdown({
  17964. onChange: function onChange(value, text, $selectedItem) {
  17965. switch ($selectedItem.data('exp')) {
  17966. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17967. 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));
  17968. break;
  17969. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17970. 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);
  17971. break;
  17972. }
  17973. initial_el_to_render.html('');
  17974. renderExpression(command, expression, function_obj, initial_el_to_render);
  17975. },
  17976. selectOnKeydown: false
  17977. });
  17978. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17979. initial_el_to_render.append(start_menu);
  17980. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17981. }
  17982. /***/ }),
  17983. /***/ "./js/visualUI/commands/contextualized_menu.js":
  17984. /*!*****************************************************!*\
  17985. !*** ./js/visualUI/commands/contextualized_menu.js ***!
  17986. \*****************************************************/
  17987. /*! exports provided: renderMenu */
  17988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17989. "use strict";
  17990. __webpack_require__.r(__webpack_exports__);
  17991. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  17992. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17993. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17994. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17995. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17996. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./switch */ "./js/visualUI/commands/switch.js");
  17997. function renderMenu(command, dom_where_render, function_obj, dom_command) {
  17998. var menu_div = '<div class="ui dropdown menu_commands pause" ><button><i class="icon code"></i></button> <div class="menu"> ';
  17999. 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) {
  18000. 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>';
  18001. } else {
  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. 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>';
  18004. }
  18005. menu_div += '</div></div>';
  18006. menu_div = $(menu_div);
  18007. dom_where_render.append(menu_div);
  18008. addHandlers(command, dom_where_render, function_obj, dom_command);
  18009. if (command.collapsed) {
  18010. dom_command.children('.ui.block_commands').toggle();
  18011. }
  18012. }
  18013. function addHandlers(command, dom_where_render, function_obj, dom_command) {
  18014. dom_where_render.find('.menu_commands').dropdown({
  18015. on: 'hover'
  18016. });
  18017. dom_where_render.find('.menu_commands a').on('click', function (evt) {
  18018. 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) {
  18019. if (command.commands_block == null || command.commands_block.length == 0) {
  18020. command.commands_block = [];
  18021. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_2__["genericCreateCommand"]($(this).data('command'));
  18022. command.commands_block.push(new_cmd);
  18023. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](new_cmd, dom_command.find('.block_commands'), 3, function_obj);
  18024. } else {
  18025. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  18026. }
  18027. } else {
  18028. switch ($(this).data('command')) {
  18029. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  18030. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  18031. break;
  18032. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase:
  18033. addCaseToSwitch(command, dom_where_render, function_obj, dom_command);
  18034. break;
  18035. }
  18036. }
  18037. });
  18038. }
  18039. function addCaseToSwitch(command, dom_where_render, function_obj, dom_command) {
  18040. if (command.cases == null) {
  18041. command.cases = [];
  18042. }
  18043. 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));
  18044. command.cases.push(sc);
  18045. _switch__WEBPACK_IMPORTED_MODULE_4__["renderCase"](sc, command, function_obj, dom_command.find('.all_cases_div'));
  18046. }
  18047. /***/ }),
  18048. /***/ "./js/visualUI/commands/dowhiletrue.js":
  18049. /*!*********************************************!*\
  18050. !*** ./js/visualUI/commands/dowhiletrue.js ***!
  18051. \*********************************************/
  18052. /*! exports provided: createFloatingCommand, renderCommand */
  18053. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18054. "use strict";
  18055. __webpack_require__.r(__webpack_exports__);
  18056. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18057. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18058. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18059. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18060. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  18061. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18062. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18063. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  18064. function createFloatingCommand() {
  18065. 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>');
  18066. }
  18067. function renderCommand(command, function_obj) {
  18068. var ret = '';
  18069. 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>';
  18070. ret += '<div class="ui block_commands" data-subblock="" data-idcommand="">';
  18071. ret += '</div>';
  18072. 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>';
  18073. 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> ';
  18074. ret += '</div>';
  18075. var el = $(ret);
  18076. el.data('command', command);
  18077. el.find('.block_commands').data('command', command);
  18078. addHandlers(command, function_obj, el);
  18079. _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'));
  18080. if (command.expression) {
  18081. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  18082. }
  18083. if (command.commands_block) {
  18084. for (var j = 0; j < command.commands_block.length; j++) {
  18085. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  18086. }
  18087. }
  18088. if (command.lockexpression) {
  18089. if (command.expression) {
  18090. try {
  18091. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  18092. if (text) {
  18093. $(el.find('.conditional_expression')[el.find('.conditional_expression').length - 1]).toggle();
  18094. $(el.find('.textual_expression')[el.find('.textual_expression').length - 1]).text(text);
  18095. $(el.find('.textual_expression')[el.find('.textual_expression').length - 1]).toggle();
  18096. $(el.find('.button_alternate_expression')[el.find('.button_alternate_expression').length - 1]).toggleClass('unlock').toggleClass('lock');
  18097. }
  18098. } catch (e) {
  18099. command.lockexpression = false;
  18100. }
  18101. }
  18102. }
  18103. el.find('.unlock').popup({
  18104. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  18105. delay: {
  18106. show: 750,
  18107. hide: 0
  18108. }
  18109. });
  18110. el.find('.lock').popup({
  18111. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  18112. delay: {
  18113. show: 750,
  18114. hide: 0
  18115. }
  18116. });
  18117. el.find('.button_write_expression').popup({
  18118. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression"),
  18119. delay: {
  18120. show: 750,
  18121. hide: 0
  18122. }
  18123. });
  18124. return el;
  18125. }
  18126. function addHandlers(command, function_obj, dowhiletrue_dom) {
  18127. dowhiletrue_dom.find('.button_write_expression').on('click', function () {
  18128. window.expressionEdition = true;
  18129. window.inputExpression = null;
  18130. var afterWhichElement;
  18131. var lockButton = $(dowhiletrue_dom.find('.button_write_expression')[dowhiletrue_dom.find('.button_write_expression').length - 1]);
  18132. var editButton = $(this);
  18133. afterWhichElement = $(dowhiletrue_dom.find('.conditional_expression')[dowhiletrue_dom.find('.conditional_expression').length - 1]);
  18134. if (command.lockexpression) {
  18135. afterWhichElement = $(dowhiletrue_dom.find('.textual_expression')[dowhiletrue_dom.find('.textual_expression').length - 1]);
  18136. }
  18137. var text = "";
  18138. if (command.expression) {
  18139. if (command.expression.length == 1 && command.expression[0].content == null && !command.expression[0].function_called) {
  18140. text = "";
  18141. } else {
  18142. try {
  18143. text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  18144. } catch (ex) {
  18145. text = "";
  18146. }
  18147. }
  18148. }
  18149. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  18150. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  18151. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  18152. input.val(text);
  18153. input.focusout(function (evt) {
  18154. ok_button.click();
  18155. evt.preventDefault();
  18156. return true;
  18157. });
  18158. input.keyup(function (evt) {
  18159. if (evt.keyCode == 27) {
  18160. // esc
  18161. cancel_button.click();
  18162. }
  18163. if (evt.keyCode == 13) {
  18164. // enter
  18165. ok_button.click();
  18166. }
  18167. });
  18168. ok_button.click(function () {
  18169. var parsed = null;
  18170. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](input.val(), function_obj, input);
  18171. if (parsed) {
  18172. window.expressionEdition = false;
  18173. command.expression = parsed;
  18174. renderAlgorithm();
  18175. }
  18176. });
  18177. cancel_button.mousedown(function (evt) {
  18178. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](text, function_obj, input);
  18179. if (parsed) {
  18180. window.expressionEdition = false;
  18181. command.expression = parsed;
  18182. renderAlgorithm();
  18183. }
  18184. });
  18185. input.insertAfter(afterWhichElement);
  18186. input.focus();
  18187. cancel_button.insertAfter(input);
  18188. ok_button.insertAfter(input);
  18189. var len = text.length;
  18190. input[0].setSelectionRange(len, len);
  18191. afterWhichElement.css('display', 'none');
  18192. lockButton.css('display', 'none');
  18193. editButton.css('display', 'none');
  18194. ok_button.popup({
  18195. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  18196. delay: {
  18197. show: 750,
  18198. hide: 0
  18199. }
  18200. });
  18201. cancel_button.popup({
  18202. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  18203. delay: {
  18204. show: 750,
  18205. hide: 0
  18206. }
  18207. });
  18208. });
  18209. dowhiletrue_dom.find('.minimize_block_button').on('click', function (evt) {
  18210. dowhiletrue_dom.children('.ui.block_commands').toggle();
  18211. command.collapsed = !command.collapsed;
  18212. });
  18213. $(dowhiletrue_dom.find('.textual_expression')[0]).toggle();
  18214. dowhiletrue_dom.find('.button_alternate_expression').on('click', function () {
  18215. if (command.expression) {
  18216. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  18217. if (text) {
  18218. $(dowhiletrue_dom.find('.conditional_expression')[dowhiletrue_dom.find('.conditional_expression').length - 1]).toggle();
  18219. $(dowhiletrue_dom.find('.textual_expression')[dowhiletrue_dom.find('.textual_expression').length - 1]).text(text);
  18220. $(dowhiletrue_dom.find('.textual_expression')[dowhiletrue_dom.find('.textual_expression').length - 1]).toggle();
  18221. $(this).toggleClass('unlock').toggleClass('lock');
  18222. command.lockexpression = !command.lockexpression;
  18223. }
  18224. }
  18225. if (command.lockexpression) {
  18226. dowhiletrue_dom.find('.lock').popup({
  18227. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  18228. delay: {
  18229. show: 750,
  18230. hide: 0
  18231. }
  18232. });
  18233. } else {
  18234. dowhiletrue_dom.find('.unlock').popup({
  18235. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  18236. delay: {
  18237. show: 750,
  18238. hide: 0
  18239. }
  18240. });
  18241. }
  18242. });
  18243. dowhiletrue_dom.find('.button_remove_command').on('click', function () {
  18244. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, dowhiletrue_dom)) {
  18245. dowhiletrue_dom.fadeOut(400, function () {
  18246. dowhiletrue_dom.remove();
  18247. });
  18248. }
  18249. });
  18250. }
  18251. /***/ }),
  18252. /***/ "./js/visualUI/commands/functioncall.js":
  18253. /*!**********************************************!*\
  18254. !*** ./js/visualUI/commands/functioncall.js ***!
  18255. \**********************************************/
  18256. /*! exports provided: createFloatingCommand, renderCommand */
  18257. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18258. "use strict";
  18259. __webpack_require__.r(__webpack_exports__);
  18260. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18261. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18262. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18263. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18264. function createFloatingCommand() {
  18265. return $('<div class="ui functioncall created_element"> <i class="hand point right icon"></i> <span> funcao() </span></div>');
  18266. }
  18267. function renderCommand(command, function_obj) {
  18268. 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>');
  18269. el.data('command', command);
  18270. _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__["renderMenu"](command, command.function_called, el.find('.var_value_menu_div'), function_obj);
  18271. addHandlers(command, function_obj, el);
  18272. return el;
  18273. }
  18274. function addHandlers(command, function_obj, functioncall_dom) {
  18275. functioncall_dom.find('.button_remove_command').on('click', function () {
  18276. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, functioncall_dom)) {
  18277. functioncall_dom.fadeOut(400, function () {
  18278. functioncall_dom.remove();
  18279. });
  18280. }
  18281. });
  18282. }
  18283. /***/ }),
  18284. /***/ "./js/visualUI/commands/generic_expression.js":
  18285. /*!****************************************************!*\
  18286. !*** ./js/visualUI/commands/generic_expression.js ***!
  18287. \****************************************************/
  18288. /*! exports provided: renderExpression, expressionParserToVisual */
  18289. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18290. "use strict";
  18291. __webpack_require__.r(__webpack_exports__);
  18292. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  18293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expressionParserToVisual", function() { return expressionParserToVisual; });
  18294. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  18295. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  18296. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  18297. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18298. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18299. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18300. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../services/userLog */ "./js/services/userLog.js");
  18301. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  18302. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_6__);
  18303. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils */ "./js/visualUI/utils.js");
  18304. window.timer = false;
  18305. function renderExpression(command, function_obj, div_to_render, expression_array) {
  18306. div_to_render.empty();
  18307. melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default.a.unwatch(command, "expression");
  18308. melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default.a.watch(command, "expression", function () {
  18309. if (window.timer) return;
  18310. var m = div_to_render.find(".single_element_expression").not(".mouse_distance").not(".add_parentheses");
  18311. var s = "";
  18312. m.each(function (e) {
  18313. if ($(this).hasClass("parentheses_in_expression")) {
  18314. s += $(this).text() + " ";
  18315. } else {
  18316. s += $(this).find(".text").text();
  18317. s += $(this).find(".var_name").text();
  18318. s += $(this).find(".parameters_function_called").text();
  18319. s += $(this).find(".value_rendered").text();
  18320. s += " ";
  18321. }
  18322. });
  18323. if (s) {
  18324. window.timer = true;
  18325. } else {
  18326. return;
  18327. }
  18328. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_5__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_5__["ActionTypes"].CHANGE_COMMAND_EXP, command.type, "/", s);
  18329. setTimeout(function () {
  18330. window.timer = false;
  18331. }, 200);
  18332. }, 20, true);
  18333. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["COMMAND_TYPES"].attribution) {
  18334. melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default.a.unwatch(command.variable);
  18335. melanke_watchjs__WEBPACK_IMPORTED_MODULE_6___default.a.watch(command.variable, function () {
  18336. renderExpression(command, function_obj, div_to_render, expression_array);
  18337. }, 0);
  18338. if (command.variable.content) {
  18339. var types_included = [];
  18340. if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER || command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL) {
  18341. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic);
  18342. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN) {
  18343. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional);
  18344. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic);
  18345. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic);
  18346. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_1__["Types"].TEXT) {
  18347. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional);
  18348. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic);
  18349. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic);
  18350. } else {//console.log("NÃO RECONHECI! VEJA: ", command.variable.content.type);
  18351. }
  18352. renderElements(command, function_obj, div_to_render, expression_array, types_included);
  18353. } else {
  18354. div_to_render.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("var_menu_select_var").toLowerCase());
  18355. }
  18356. } else {
  18357. var _types_included = [];
  18358. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional);
  18359. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic);
  18360. 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);
  18361. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic);
  18362. renderElements(command, function_obj, div_to_render, expression_array, _types_included);
  18363. }
  18364. div_to_render.children(".mouse_distance").addClass("mouse_distance_hidden");
  18365. div_to_render.children(".higher_element").on("mousemove", function (evt) {
  18366. if (!window.open_or_close) {
  18367. $(this).css("position", "relative", "!important");
  18368. $(this).children(".mouse_distance").css("opacity", "1");
  18369. }
  18370. });
  18371. div_to_render.children(".higher_element").on("mouseout", function (evt) {
  18372. if (!window.open_or_close) {
  18373. $(this).css("position", "absolute", "!important");
  18374. $(this).children(".mouse_distance").css("opacity", "0");
  18375. }
  18376. });
  18377. var lixeira = $('<div class="lixeira" draggable="true"></div>');
  18378. div_to_render.find(".single_element_expression").on("mousedown", function (evt) {
  18379. window.posX = evt.clientX;
  18380. window.posY = evt.clientY;
  18381. });
  18382. Sortable.create(div_to_render[0], {
  18383. animation: 100,
  18384. ghostClass: "ghost",
  18385. group: {
  18386. name: "shared",
  18387. put: false // Do not allow items to be put into this list
  18388. },
  18389. draggable: ".single_element_expression",
  18390. sort: false,
  18391. filter: ".not_allowed",
  18392. onStart: function onStart() {
  18393. $("body").append(lixeira);
  18394. lixeira.css("display", "block");
  18395. lixeira.css("top", window.posY + 70, "!important");
  18396. lixeira.css("left", window.posX - 20, "!important");
  18397. },
  18398. onMove: function onMove() {
  18399. lixeira.addClass("color_test");
  18400. },
  18401. onEnd: function onEnd() {
  18402. lixeira.remove();
  18403. div_to_render.find(".ghost").removeClass("ghost");
  18404. }
  18405. });
  18406. new Sortable(lixeira[0], {
  18407. group: "shared",
  18408. animation: 150,
  18409. onAdd: function onAdd(evt) {
  18410. lixeira.css("display", "none");
  18411. lixeira.find(".single_element_expression").remove();
  18412. lixeira.css("background-color", "");
  18413. lixeira.remove();
  18414. removeElement(evt, expression_array);
  18415. renderExpression(command, function_obj, div_to_render, expression_array);
  18416. }
  18417. });
  18418. }
  18419. function removeElement(event, expression_array) {
  18420. var indice = $(event.item).data("index");
  18421. var first = expression_array[0];
  18422. if (expression_array[indice].type) {
  18423. // if is alone in expression:
  18424. if (expression_array.length == 1) {
  18425. //function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  18426. expression_array.splice(0, 1);
  18427. } else if (expression_array.length > 1) {
  18428. if (indice > 0 && expression_array[indice - 1].type_op) {
  18429. if (indice < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice + 1].type_op) {
  18430. expression_array.splice(indice + 1, 1);
  18431. }
  18432. expression_array.splice(indice, 1);
  18433. expression_array.splice(indice - 1, 1);
  18434. if (indice - 2 < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice - 1] == ")") {
  18435. expression_array.splice(indice - 1, 1);
  18436. expression_array.splice(indice - 2, 1);
  18437. if (indice - 3 >= 0 && indice - 3 < expression_array.length && expression_array[indice - 3].type_op) {
  18438. expression_array.splice(indice - 3, 1);
  18439. }
  18440. }
  18441. } else if (indice < expression_array.length - 1 && expression_array[indice + 1].type_op) {
  18442. expression_array.splice(indice + 1, 1);
  18443. expression_array.splice(indice, 1);
  18444. } else if (indice < expression_array.length - 1 && indice > 0 && expression_array[indice - 1] == "(" && expression_array[indice + 1] == ")") {
  18445. if (indice > 1 && expression_array[indice - 2].type_op) {
  18446. expression_array.splice(indice + 1, 1);
  18447. expression_array.splice(indice, 1);
  18448. expression_array.splice(indice - 1, 1);
  18449. expression_array.splice(indice - 2, 1);
  18450. } else if (indice < expression_array.length - 2 && expression_array[indice + 2].type_op) {
  18451. expression_array.splice(indice + 1, 1);
  18452. expression_array.splice(indice, 1);
  18453. expression_array.splice(indice - 1, 1);
  18454. } else {
  18455. expression_array.splice(indice + 1, 1);
  18456. expression_array.splice(indice, 1);
  18457. expression_array.splice(indice - 1, 1);
  18458. }
  18459. }
  18460. }
  18461. } else if (expression_array[indice].type_op) {// iVProg doesn't support operator remove
  18462. } else {
  18463. var opening = -1;
  18464. var closing = -1;
  18465. if (expression_array[indice] == "(") {
  18466. opening = indice;
  18467. for (var i = indice + 1; i < expression_array.length; i++) {
  18468. if (expression_array[i] == ")") {
  18469. closing = i;
  18470. break;
  18471. }
  18472. }
  18473. } else {
  18474. closing = indice;
  18475. for (var i = indice - 1; i >= 0; i--) {
  18476. if (expression_array[i] == "(") {
  18477. opening = i;
  18478. break;
  18479. }
  18480. }
  18481. }
  18482. if (expression_array[opening + 1].type_op) {
  18483. expression_array.splice(closing, 1);
  18484. expression_array.splice(opening + 1, 1);
  18485. expression_array.splice(opening, 1);
  18486. } else {
  18487. expression_array.splice(closing, 1);
  18488. expression_array.splice(opening, 1);
  18489. }
  18490. } // if expression is empty, add a new var value:
  18491. if (expression_array.length == 0) {
  18492. 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));
  18493. }
  18494. if (first != expression_array[0] && expression_array[0].type_op) {
  18495. expression_array.splice(0, 1);
  18496. }
  18497. }
  18498. function renderElements(command, function_obj, div_to_render, expression_array, types_included) {
  18499. /*if (expression_array.length > 0) {
  18500. if (!expression_array[0].type_op) {
  18501. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  18502. }
  18503. }*/
  18504. var i = 0;
  18505. for (i = 0; i < expression_array.length; i++) {
  18506. if (expression_array[i].type == "var_value") {
  18507. var div_temp = $('<div class="single_element_expression" data-index="' + i + '"></div>');
  18508. if (i == 0) {
  18509. if (expression_array.length > 0 && !expression_array[0].type_op) {//renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  18510. }
  18511. }
  18512. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, expression_array[i], div_temp, function_obj);
  18513. div_to_render.append(div_temp);
  18514. } else if (expression_array[i] == "(" || expression_array[i] == ")") {
  18515. if (expression_array[i] == ")") {
  18516. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i);
  18517. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  18518. } else if (expression_array[i] == "(" && !expression_array[i + 1].type_op) {
  18519. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  18520. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, i + 1);
  18521. } else {
  18522. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  18523. }
  18524. } else {
  18525. if (i == 0) {} else if (expression_array[i - 1] == "(") {}
  18526. renderOperatorMenu(command, function_obj, div_to_render, expression_array[i], types_included, i, expression_array);
  18527. }
  18528. }
  18529. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i, true);
  18530. renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included);
  18531. }
  18532. window.parentheses_activate = false;
  18533. window.open_or_close = null;
  18534. function renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included) {
  18535. 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>');
  18536. div_to_render.append(addParentheses);
  18537. addParentheses.popup({
  18538. content: "Adicionar parênteses",
  18539. delay: {
  18540. show: 750,
  18541. hide: 0
  18542. }
  18543. });
  18544. addParentheses.on("click", function (mouse_event) {
  18545. // verificar se já está ativado
  18546. if (window.parentheses_activate) {
  18547. return;
  18548. }
  18549. div_to_render.find(".usepointer").off("click");
  18550. window.parentheses_activate = true;
  18551. window.open_or_close = "open";
  18552. div_to_render.find(".dropdown").addClass("disabled");
  18553. div_to_render.find(".ghost_element").addClass("temp_class");
  18554. div_to_render.find(".ghost_element").removeClass("ghost_element");
  18555. var floatingObject = $('<div class="floating_parenthesis"> ( </div>');
  18556. floatingObject.draggable().appendTo("body");
  18557. floatingObject.css("position", "absolute");
  18558. mouse_event.type = "mousedown.draggable";
  18559. mouse_event.target = floatingObject[0];
  18560. floatingObject.css("left", mouse_event.pageX + 10);
  18561. floatingObject.css("top", mouse_event.pageY + 10);
  18562. floatingObject.trigger(mouse_event);
  18563. div_to_render.on("mousemove", function (evt) {
  18564. var actual_target = null;
  18565. if ($(evt.target).hasClass("single_element_expression")) {
  18566. actual_target = $(evt.target);
  18567. } else {
  18568. actual_target = $(evt.target).closest(".single_element_expression");
  18569. }
  18570. 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")) {
  18571. return;
  18572. }
  18573. renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array);
  18574. });
  18575. div_to_render.on("mouseleave", function () {
  18576. /*window.open_parentheses.remove();
  18577. window.close_parentheses.remove();*/
  18578. });
  18579. var floating;
  18580. $("body").on("mouseup", function (evt) {
  18581. if (window.open_or_close == "open") {
  18582. window.open_or_close = "close";
  18583. floatingObject.remove();
  18584. var comando_que_esta = $(evt.target).closest(".command_container");
  18585. var comando_certo = div_to_render.closest(".command_container");
  18586. if (!comando_que_esta.is(comando_certo)) {
  18587. window.parentheses_activate = false;
  18588. div_to_render.find(".temp_class").addClass("ghost_element");
  18589. div_to_render.find(".temp_class").removeClass("temp_class");
  18590. div_to_render.off("mousemove");
  18591. div_to_render.off("mouseleave");
  18592. $("body").off("mouseup");
  18593. window.open_parentheses.remove();
  18594. window.close_parentheses.remove();
  18595. window.inserir_open = -1;
  18596. window.inserir_close = -1;
  18597. window.open_or_close = null;
  18598. renderExpression(command, function_obj, div_to_render, expression_array);
  18599. return;
  18600. }
  18601. window.open_parentheses.addClass("parentheses_fixed");
  18602. floating = $('<div class="floating_parenthesis"> ) </div>');
  18603. floating.draggable().appendTo("body");
  18604. floating.css("position", "absolute");
  18605. floating.css("left", evt.pageX + 10);
  18606. floating.css("top", evt.pageY + 10);
  18607. $("body").on("mousemove", function (evts) {
  18608. floating.css("left", evts.pageX + 10);
  18609. floating.css("top", evts.pageY + 10);
  18610. });
  18611. } else {
  18612. floating.remove();
  18613. window.open_parentheses.removeClass("parentheses_fixed");
  18614. div_to_render.off("mousemove");
  18615. div_to_render.off("mouseleave");
  18616. $("body").off("mouseup");
  18617. setTimeout(function () {
  18618. window.parentheses_activate = false;
  18619. }, 50);
  18620. var comando_que_esta = $(evt.target).closest(".command_container");
  18621. var comando_certo = div_to_render.closest(".command_container");
  18622. var is_correct = false;
  18623. if (comando_que_esta.is(comando_certo)) {
  18624. is_correct = true;
  18625. }
  18626. if (is_correct) {
  18627. expression_array.splice(window.inserir_open, 0, "(");
  18628. expression_array.splice(window.inserir_close, 0, ")");
  18629. }
  18630. window.inserir_open = -1;
  18631. window.inserir_close = -1;
  18632. window.open_or_close = null;
  18633. renderExpression(command, function_obj, div_to_render, expression_array);
  18634. }
  18635. });
  18636. });
  18637. }
  18638. window.open_parentheses = $('<div class="parentheses_ghost">(</div>');
  18639. window.close_parentheses = $('<div class="parentheses_ghost">)</div>');
  18640. window.inserir_open = -1;
  18641. window.inserir_close = -1;
  18642. function renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array) {
  18643. /*window.open_parentheses.remove();
  18644. window.close_parentheses.remove();*/
  18645. var index_in_array = actual_target.data("index");
  18646. if (expression_array[index_in_array] == "(" || expression_array[index_in_array] == ")") {
  18647. return;
  18648. }
  18649. if (window.open_or_close == "close") {
  18650. if (index_in_array < window.inserir_open) {
  18651. return;
  18652. }
  18653. } // Tratando a situação quando é na primeira posição:
  18654. if (index_in_array == 0) {
  18655. if (expression_array[index_in_array].type == "var_value") {
  18656. if (window.open_or_close == "open") {
  18657. window.open_parentheses.insertBefore(actual_target);
  18658. window.inserir_open = index_in_array;
  18659. }
  18660. /*if (expression_array.length == 1) {
  18661. if (window.open_or_close == "close") {
  18662. window.close_parentheses.insertAfter(actual_target);
  18663. window.inserir_close = index_in_array + 2;
  18664. }*/
  18665. //} else {
  18666. var count_opened = 0;
  18667. var count_closed = 0;
  18668. for (var i = 0; i < expression_array.length; i++) {
  18669. if (expression_array[i] == "(") {
  18670. count_opened++;
  18671. }
  18672. if (expression_array[i] == ")") {
  18673. count_closed++;
  18674. }
  18675. if (count_opened != count_closed) {} else {
  18676. if (count_opened > 0) {
  18677. if (window.open_or_close == "close") {
  18678. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18679. window.inserir_close = i + 2;
  18680. }
  18681. break;
  18682. } else {
  18683. if (expression_array[i].type == "var_value") {
  18684. if (window.open_or_close == "close") {
  18685. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18686. window.inserir_close = i + 2;
  18687. }
  18688. break;
  18689. }
  18690. }
  18691. }
  18692. } //}
  18693. } else if (expression_array[index_in_array].type_op) {
  18694. if (window.open_or_close == "open") {
  18695. window.open_parentheses.insertBefore(actual_target);
  18696. window.inserir_open = index_in_array;
  18697. }
  18698. var count_opened = 0;
  18699. var count_closed = 0;
  18700. for (var i = 1; i < expression_array.length; i++) {
  18701. // $('.slide-link[data-slide="0"]')
  18702. if (expression_array[i] == "(") {
  18703. count_opened++;
  18704. }
  18705. if (expression_array[i] == ")") {
  18706. count_closed++;
  18707. }
  18708. if (count_opened != count_closed) {} else {
  18709. if (count_opened > 0) {
  18710. if (expression_array[i].type == "var_value") {
  18711. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18712. window.inserir_close = i + 2;
  18713. }
  18714. break;
  18715. } else {
  18716. if (expression_array[i].type == "var_value") {
  18717. if (expression_array[i].type == "var_value") {
  18718. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18719. window.inserir_close = i + 2;
  18720. }
  18721. break;
  18722. }
  18723. }
  18724. }
  18725. }
  18726. }
  18727. return;
  18728. } // Tratando quando não é no índice 0:
  18729. if (expression_array[index_in_array].type == "var_value") {
  18730. if (window.open_or_close == "open") {
  18731. window.open_parentheses.insertBefore(actual_target);
  18732. window.inserir_open = index_in_array;
  18733. }
  18734. if (window.open_or_close == "close") {
  18735. window.close_parentheses.insertAfter(actual_target);
  18736. window.inserir_close = index_in_array + 2;
  18737. }
  18738. return;
  18739. }
  18740. if (expression_array[index_in_array].type_op) {
  18741. // buscar para a esquerda primeiro:
  18742. if (expression_array[index_in_array - 1] == "(") {
  18743. if (window.open_or_close == "open") {
  18744. window.open_parentheses.insertBefore(actual_target);
  18745. window.inserir_open = index_in_array;
  18746. }
  18747. } else if (expression_array[index_in_array - 1] == ")") {
  18748. // buscar a abertura
  18749. var count_opened = 0;
  18750. var count_closed = 0;
  18751. for (var j = index_in_array - 1; j >= 0; j--) {
  18752. if (expression_array[j] == "(") {
  18753. count_opened++;
  18754. }
  18755. if (expression_array[j] == ")") {
  18756. count_closed++;
  18757. }
  18758. if (count_opened != count_closed) {} else {
  18759. if (count_closed > 0) {
  18760. if (window.open_or_close == "open") {
  18761. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  18762. window.inserir_open = j;
  18763. }
  18764. break;
  18765. }
  18766. }
  18767. }
  18768. } else if (expression_array[index_in_array - 1].type == "var_value") {
  18769. if (window.open_or_close == "open") {
  18770. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + (index_in_array - 1) + '"]'));
  18771. window.inserir_open = index_in_array - 1;
  18772. }
  18773. } // buscar para a direita agora:
  18774. if (expression_array[index_in_array + 1] == "(") {
  18775. // buscar o fechamento:
  18776. var count_opened = 0;
  18777. var count_closed = 0;
  18778. for (var j = index_in_array + 1; j < expression_array.length; j++) {
  18779. if (expression_array[j] == "(") {
  18780. count_opened++;
  18781. }
  18782. if (expression_array[j] == ")") {
  18783. count_closed++;
  18784. }
  18785. if (count_opened != count_closed) {} else {
  18786. if (count_opened > 0) {
  18787. if (window.open_or_close == "close") {
  18788. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  18789. window.inserir_close = j + 2;
  18790. }
  18791. break;
  18792. }
  18793. }
  18794. }
  18795. } else if (expression_array[index_in_array + 1].type == "var_value") {
  18796. if (window.open_or_close == "close") {
  18797. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + (index_in_array + 1) + '"]'));
  18798. window.inserir_close = index_in_array + 3;
  18799. }
  18800. }
  18801. }
  18802. }
  18803. function renderParenthesis(div_to_render, expression_content, command, function_obj, position, expression_array) {
  18804. var ghost_parenthesis = $('<div class="single_element_expression parentheses_in_expression" data-index="' + position + '">' + expression_content + "</div>");
  18805. div_to_render.append(ghost_parenthesis);
  18806. }
  18807. function renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, position) {
  18808. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18809. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18810. if (types_included.length > 1) {
  18811. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18812. menu_final += getArithmeticOperators();
  18813. menu_final += "</div></div>";
  18814. } else {
  18815. menu_final += getArithmeticOperators();
  18816. }
  18817. }
  18818. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18819. if (types_included.length > 1) {
  18820. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18821. menu_final += getLogicOperators();
  18822. menu_final += "</div></div>";
  18823. } else {
  18824. menu_final += getLogicOperators();
  18825. }
  18826. }
  18827. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18828. if (types_included.length > 1) {
  18829. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18830. menu_final += getRelationalOperators();
  18831. menu_final += "</div></div>";
  18832. } else {
  18833. menu_final += getRelationalOperators();
  18834. }
  18835. }
  18836. menu_final += "</div></div>";
  18837. menu_final = $(menu_final);
  18838. var div_temp = $('<div class="single_element_expression ghost_element mouse_distance"></div>');
  18839. div_temp.append(menu_final);
  18840. var div_higher = $('<div class="higher_element"></div>');
  18841. div_higher.append(div_temp);
  18842. div_to_render.append(div_higher);
  18843. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].minus);
  18844. div_temp.on("click", function () {
  18845. if (!window.open_or_close) {
  18846. var sera = position;
  18847. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18848. 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));
  18849. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18850. 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));
  18851. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18852. 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));
  18853. }
  18854. renderExpression(command, function_obj, div_to_render, expression_array);
  18855. }
  18856. });
  18857. }
  18858. function renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, position) {
  18859. var is_last = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
  18860. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18861. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18862. if (types_included.length > 1) {
  18863. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18864. menu_final += getArithmeticOperators();
  18865. menu_final += "</div></div>";
  18866. } else {
  18867. menu_final += getArithmeticOperators();
  18868. }
  18869. }
  18870. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18871. if (types_included.length > 1) {
  18872. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18873. menu_final += getLogicOperators();
  18874. menu_final += "</div></div>";
  18875. } else {
  18876. menu_final += getLogicOperators();
  18877. }
  18878. }
  18879. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18880. if (types_included.length > 1) {
  18881. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18882. menu_final += getRelationalOperators();
  18883. menu_final += "</div></div>";
  18884. } else {
  18885. menu_final += getRelationalOperators();
  18886. }
  18887. }
  18888. menu_final += "</div></div>";
  18889. menu_final = $(menu_final);
  18890. var div_temp = $('<div class="simple_add mouse_distance"></div>');
  18891. var div_higher = $('<div class="higher_element"></div>');
  18892. var button = $('<button class="ui button green add_expression"><i class="plus circle inverted icon"></i></button>');
  18893. div_temp.append(button);
  18894. if (!is_last) {
  18895. div_higher.append(div_temp);
  18896. div_to_render.append(div_higher); //div_temp.append(menu_final);
  18897. div_temp.css("opacity", "0", "!important");
  18898. } else {
  18899. div_temp.removeClass("mouse_distance");
  18900. div_temp.css("opacity", "1", "!important"); //div_temp.append(menu_final);
  18901. div_to_render.append(div_temp);
  18902. }
  18903. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["ARITHMETIC_TYPES"].plus);
  18904. div_temp.on("click", function () {
  18905. var sera = position;
  18906. if (expression_array[sera] == ")" && expression_array[sera - 1] == "(") {
  18907. 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));
  18908. renderExpression(command, function_obj, div_to_render, expression_array);
  18909. return;
  18910. }
  18911. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18912. 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));
  18913. 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));
  18914. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18915. 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));
  18916. 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));
  18917. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18918. 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));
  18919. 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));
  18920. }
  18921. renderExpression(command, function_obj, div_to_render, expression_array);
  18922. });
  18923. }
  18924. function renderOperatorMenu(command, function_obj, div_to_render, expression_element, types_included, position, expression_array) {
  18925. var menu_final = '<div class="ui dropdown"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18926. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].write_sep) >= 0) {
  18927. menu_final += getSeparator();
  18928. }
  18929. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18930. if (types_included.length > 1) {
  18931. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18932. menu_final += getArithmeticOperators();
  18933. menu_final += "</div></div>";
  18934. } else {
  18935. menu_final += getArithmeticOperators();
  18936. }
  18937. }
  18938. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18939. if (types_included.length > 1) {
  18940. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18941. menu_final += getLogicOperators();
  18942. menu_final += "</div></div>";
  18943. } else {
  18944. menu_final += getLogicOperators();
  18945. }
  18946. }
  18947. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_2__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18948. if (types_included.length > 1) {
  18949. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18950. menu_final += getRelationalOperators();
  18951. menu_final += "</div></div>";
  18952. } else {
  18953. menu_final += getRelationalOperators();
  18954. }
  18955. }
  18956. menu_final += "</div></div>";
  18957. menu_final = $(menu_final);
  18958. menu_final.find(".ivprog-write-sep").popup({
  18959. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("write_seprator_menu_tooltip"),
  18960. delay: {
  18961. show: 500,
  18962. hide: 0
  18963. }
  18964. });
  18965. var div_temp = $('<div class="single_element_expression not_allowed" data-index="' + position + '"></div>');
  18966. div_temp.append(menu_final);
  18967. div_to_render.append(div_temp);
  18968. menu_final.dropdown({
  18969. onChange: function onChange(_value, _text, $selectedItem) {
  18970. expression_element.item = $selectedItem.data("value");
  18971. expression_element.type_op = $selectedItem.data("type");
  18972. }
  18973. });
  18974. menu_final.dropdown("set selected", expression_element.item);
  18975. }
  18976. function getArithmeticOperators() {
  18977. var arithmetic_operators;
  18978. 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>';
  18979. 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>';
  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"].multiplication + '">*</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"].division + '">/</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"].module + '">%</div>';
  18983. return arithmetic_operators;
  18984. }
  18985. function getLogicOperators() {
  18986. var logic_operators;
  18987. 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>';
  18988. 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>';
  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"].and + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("logic_operator_and") + "</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"].or + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("logic_operator_or") + "</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"].not + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI("logic_operator_not") + "</div>";
  18992. return logic_operators;
  18993. }
  18994. function getRelationalOperators() {
  18995. var relational_operators;
  18996. 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>';
  18997. 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>';
  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"].equals_to + '">==</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"].not_equals_to + '">!=</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"].greater_than_or_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"].less_than_or_equals_to + '"><=</div>';
  19002. return relational_operators;
  19003. }
  19004. function getSeparator() {
  19005. 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>");
  19006. }
  19007. function getVariable(function_obj, search) {
  19008. if (search == ")" || search == "(") {
  19009. return search;
  19010. }
  19011. if (search.instance == "operator") {
  19012. var obj;
  19013. switch (search.value) {
  19014. case '+':
  19015. 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);
  19016. break;
  19017. case '-':
  19018. 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);
  19019. break;
  19020. case '*':
  19021. 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);
  19022. break;
  19023. case '/':
  19024. 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);
  19025. break;
  19026. case '%':
  19027. 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);
  19028. break;
  19029. case '>':
  19030. 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);
  19031. break;
  19032. case '<':
  19033. 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);
  19034. break;
  19035. case '>=':
  19036. 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);
  19037. break;
  19038. case '<=':
  19039. 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);
  19040. break;
  19041. case '==':
  19042. 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);
  19043. break;
  19044. case '!=':
  19045. 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);
  19046. break;
  19047. case 'and':
  19048. 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);
  19049. break;
  19050. case 'or':
  19051. 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);
  19052. break;
  19053. case 'not':
  19054. 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);
  19055. break;
  19056. }
  19057. return obj;
  19058. }
  19059. if (search.instance == "expression" && search.type == "const") {
  19060. if (search.value === true) {
  19061. 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);
  19062. return obj;
  19063. }
  19064. if (search.value === false) {
  19065. 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);
  19066. return obj;
  19067. }
  19068. if (search.value === 0) search.value = "0";
  19069. 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);
  19070. return obj;
  19071. }
  19072. var variavel = null;
  19073. if (search.instance == "expression" && search.type == "var") {
  19074. // 1. Procurar a variável na função:
  19075. for (var j = 0; j < function_obj.variables_list.length; j++) {
  19076. if (function_obj.variables_list[j].name == search.value) {
  19077. variavel = function_obj.variables_list[j];
  19078. break;
  19079. }
  19080. } // 2. Procurar a variável nas gloais:
  19081. if (!variavel) for (var j = 0; j < program_obj.globals.length; j++) {
  19082. if (program_obj.globals[j].name == search.value) {
  19083. variavel = program_obj.globals[j];
  19084. break;
  19085. }
  19086. } // 3. Procurar na lista de parâmetros:
  19087. if (!variavel) for (var j = 0; j < function_obj.parameters_list.length; j++) {
  19088. if (function_obj.parameters_list[j].name == search.value) {
  19089. variavel = function_obj.parameters_list[j];
  19090. break;
  19091. }
  19092. }
  19093. }
  19094. if (search.instance == "expression" && search.type == "var" && !search.line) {
  19095. 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);
  19096. return obj;
  19097. }
  19098. if (search.instance == "expression" && search.type == "var" && search["class"] == "vector") {
  19099. 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);
  19100. return obj;
  19101. }
  19102. if (search.instance == "expression" && search.type == "var" && search["class"] == "matrix") {
  19103. 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);
  19104. return obj;
  19105. }
  19106. if (search.instance == "expression" && search.type == "function") {
  19107. 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:
  19108. for (var i = 0; i < program_obj.functions.length; i++) {
  19109. if (program_obj.functions[i].name == search.value) {
  19110. obj.function_called = program_obj.functions[i];
  19111. }
  19112. } // Se ainda não foi encontrada, procurar na biblioteca do iVProg:
  19113. if (!obj.function_called) {
  19114. for (var i = 0; i < window.system_functions.length; i++) {
  19115. if (search.value.split(".")[1] && search.value.split(".")[1] == window.system_functions[i].identifier) {
  19116. obj.function_called = window.system_functions[i];
  19117. } else if (search.value == window.system_functions[i].identifier) {
  19118. obj.function_called = window.system_functions[i];
  19119. }
  19120. }
  19121. }
  19122. obj.parameters_list = [];
  19123. for (var i = 0; i < search.params.length; i++) {
  19124. obj.parameters_list.push(getVariable(function_obj, search.params[i][0]));
  19125. }
  19126. return obj;
  19127. }
  19128. }
  19129. function expressionParserToVisual(text, function_obj, input_field) {
  19130. if (text.trim().length == 0) {
  19131. 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)];
  19132. }
  19133. var var_not_found = [];
  19134. var fun_not_found = [];
  19135. var parsed;
  19136. try {
  19137. parsed = ivprogCore.parseExpression(text);
  19138. } catch (ex) {
  19139. _utils__WEBPACK_IMPORTED_MODULE_7__["renderErrorMessage"](input_field, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('expression_invalid'));
  19140. }
  19141. if (!parsed) return null;
  19142. for (var i = 0; i < parsed.length; i++) {
  19143. var variavel = null;
  19144. if (parsed[i].instance == "expression" && parsed[i].type == "var") {
  19145. // 1. Procurar a variável na função:
  19146. for (var j = 0; j < function_obj.variables_list.length; j++) {
  19147. if (function_obj.variables_list[j].name == parsed[i].value) {
  19148. variavel = function_obj.variables_list[j];
  19149. break;
  19150. }
  19151. } // 2. Procurar a variável nas globais:
  19152. if (!variavel) for (var j = 0; j < program_obj.globals.length; j++) {
  19153. if (program_obj.globals[j].name == parsed[i].value) {
  19154. variavel = program_obj.globals[j];
  19155. break;
  19156. }
  19157. } // 3. Procurar a variável nos parâmetros:
  19158. if (!variavel) for (var j = 0; j < function_obj.parameters_list.length; j++) {
  19159. if (function_obj.parameters_list[j].name == parsed[i].value) {
  19160. variavel = function_obj.parameters_list[j];
  19161. break;
  19162. }
  19163. }
  19164. if (!variavel) var_not_found.push(parsed[i].value);
  19165. }
  19166. var funcao;
  19167. if (parsed[i].instance == "expression" && parsed[i].type == "function") {
  19168. // Procurar a função para referência:
  19169. for (var j = 0; j < program_obj.functions.length; j++) {
  19170. if (program_obj.functions[j].name == parsed[i].value) {
  19171. funcao = program_obj.functions[j];
  19172. }
  19173. } // Se ainda não encontrou, procurar na biblioteca do iVProg:
  19174. if (!funcao) {
  19175. for (var j = 0; j < window.system_functions.length; j++) {
  19176. if (parsed[i].value.split(".")[1] && parsed[i].value.split(".")[1] == window.system_functions[j].identifier) {
  19177. funcao = window.system_functions[j];
  19178. } else if (parsed[i].value == window.system_functions[j].identifier) {
  19179. funcao = window.system_functions[j];
  19180. }
  19181. }
  19182. }
  19183. if (!funcao) {
  19184. fun_not_found.push(parsed[i].value);
  19185. }
  19186. }
  19187. }
  19188. if (fun_not_found.length > 0) {
  19189. var uniqueWords = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(new Set(fun_not_found));
  19190. _utils__WEBPACK_IMPORTED_MODULE_7__["renderErrorMessage"](input_field, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('expression_undeclared_function') + " " + uniqueWords.join(", "));
  19191. return null;
  19192. }
  19193. if (var_not_found.length > 0) {
  19194. var _uniqueWords = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(new Set(var_not_found));
  19195. _utils__WEBPACK_IMPORTED_MODULE_7__["renderErrorMessage"](input_field, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('expression_undelcared_variable') + " " + _uniqueWords.join(", "));
  19196. return null;
  19197. }
  19198. var exp_obj = [];
  19199. for (var i = 0; i < parsed.length; i++) {
  19200. exp_obj.push(getVariable(function_obj, parsed[i]));
  19201. }
  19202. return exp_obj;
  19203. }
  19204. /***/ }),
  19205. /***/ "./js/visualUI/commands/iftrue.js":
  19206. /*!****************************************!*\
  19207. !*** ./js/visualUI/commands/iftrue.js ***!
  19208. \****************************************/
  19209. /*! exports provided: createFloatingCommand, renderCommand */
  19210. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19211. "use strict";
  19212. __webpack_require__.r(__webpack_exports__);
  19213. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19214. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19215. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19216. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19217. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19218. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  19219. function createFloatingCommand() {
  19220. return $('<div class="ui iftrue created_element"> <i class="ui icon small random"></i> <span> if (x < 1) { } </span></div>');
  19221. }
  19222. function renderCommand(command, function_obj) {
  19223. var ret = '';
  19224. 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>';
  19225. ret += '<span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_if') + '</span>';
  19226. ret += ' <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="textual_expression"></span> <span class="span_command_spec"> ) </span> ';
  19227. ret += ' <i class="ui icon i cursor button_write_expression" style="margin-right: 1rem !important;"></i> ';
  19228. ret += '<i class="ui icon unlock button_alternate_expression"></i>';
  19229. ret += '<span> </span> ';
  19230. ret += '<div class="ui block_commands commands_if conditional_comands_block" data-if="true">';
  19231. ret += '</div></div>';
  19232. 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>';
  19233. ret += '<div class="ui block_commands commands_else conditional_comands_block" data-else="true">';
  19234. ret += '</div>';
  19235. ret += '<span></span></div>';
  19236. ret += '</div>';
  19237. var el = $(ret);
  19238. el.data('command', command);
  19239. el.find('.block_commands').data('command', command);
  19240. el.find('.data_block_if').data('command', command);
  19241. el.find('.data_block_else').data('command', command);
  19242. el.find('.commands_if').data('command', command);
  19243. addHandlers(command, function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
  19244. _generic_expression__WEBPACK_IMPORTED_MODULE_2__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  19245. if (command.commands_block) {
  19246. for (var j = 0; j < command.commands_block.length; j++) {
  19247. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.commands_if')[0]), 3, function_obj);
  19248. }
  19249. }
  19250. if (command.commands_else) {
  19251. for (var j = 0; j < command.commands_else.length; j++) {
  19252. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_else[j], $(el.find('.commands_else')[0]), 3, function_obj);
  19253. }
  19254. }
  19255. if (command.collapsed) {
  19256. el.children('.data_block_else').toggle();
  19257. $(el.find('.block_commands')[0]).toggle();
  19258. }
  19259. if (command.lockexpression) {
  19260. if (command.expression) {
  19261. try {
  19262. var text = _code_generator__WEBPACK_IMPORTED_MODULE_3__["elementExpressionCode"](command.expression);
  19263. if (text) {
  19264. $(el.find('.conditional_expression')[0]).toggle();
  19265. $(el.find('.textual_expression')[0]).text(text);
  19266. $(el.find('.textual_expression')[0]).toggle();
  19267. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19268. }
  19269. } catch (e) {
  19270. command.lockexpression = false;
  19271. }
  19272. }
  19273. }
  19274. el.find('.unlock').popup({
  19275. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  19276. delay: {
  19277. show: 750,
  19278. hide: 0
  19279. }
  19280. });
  19281. el.find('.lock').popup({
  19282. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  19283. delay: {
  19284. show: 750,
  19285. hide: 0
  19286. }
  19287. });
  19288. el.find('.button_write_expression').popup({
  19289. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression"),
  19290. delay: {
  19291. show: 750,
  19292. hide: 0
  19293. }
  19294. });
  19295. return el;
  19296. }
  19297. function addHandlers(command, function_obj, iftrue_dom) {
  19298. iftrue_dom.find('.button_write_expression').on('click', function () {
  19299. window.expressionEdition = true;
  19300. window.inputExpression = null;
  19301. var afterWhichElement;
  19302. var lockButton = $(iftrue_dom.find('.button_alternate_expression')[0]);
  19303. var editButton = $(this);
  19304. afterWhichElement = $(iftrue_dom.find('.conditional_expression')[0]);
  19305. if (command.lockexpression) {
  19306. afterWhichElement = $(iftrue_dom.find('.textual_expression')[0]);
  19307. }
  19308. var text = "";
  19309. if (command.expression) {
  19310. if (command.expression.length == 1 && command.expression[0].content == null && !command.expression[0].function_called) {
  19311. text = "";
  19312. } else {
  19313. try {
  19314. text = _code_generator__WEBPACK_IMPORTED_MODULE_3__["elementExpressionCode"](command.expression);
  19315. } catch (ex) {
  19316. text = "";
  19317. }
  19318. }
  19319. }
  19320. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  19321. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  19322. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  19323. input.val(text);
  19324. input.focusout(function (evt) {
  19325. ok_button.click();
  19326. evt.preventDefault();
  19327. return true;
  19328. });
  19329. input.keyup(function (evt) {
  19330. if (evt.keyCode == 27) {
  19331. // esc
  19332. cancel_button.click();
  19333. }
  19334. if (evt.keyCode == 13) {
  19335. // enter
  19336. ok_button.click();
  19337. }
  19338. });
  19339. ok_button.click(function () {
  19340. var parsed = null;
  19341. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_2__["expressionParserToVisual"](input.val(), function_obj, input);
  19342. if (parsed) {
  19343. window.expressionEdition = false;
  19344. command.expression = parsed;
  19345. renderAlgorithm();
  19346. }
  19347. });
  19348. cancel_button.mousedown(function (evt) {
  19349. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_2__["expressionParserToVisual"](text, function_obj, input);
  19350. if (parsed) {
  19351. window.expressionEdition = false;
  19352. command.expression = parsed;
  19353. renderAlgorithm();
  19354. }
  19355. });
  19356. input.insertAfter(afterWhichElement);
  19357. input.focus();
  19358. cancel_button.insertAfter(input);
  19359. ok_button.insertAfter(input);
  19360. var len = text.length;
  19361. input[0].setSelectionRange(len, len);
  19362. afterWhichElement.css('display', 'none');
  19363. lockButton.css('display', 'none');
  19364. editButton.css('display', 'none');
  19365. ok_button.popup({
  19366. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  19367. delay: {
  19368. show: 750,
  19369. hide: 0
  19370. }
  19371. });
  19372. cancel_button.popup({
  19373. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  19374. delay: {
  19375. show: 750,
  19376. hide: 0
  19377. }
  19378. });
  19379. });
  19380. $(iftrue_dom.find('.textual_expression')[0]).toggle();
  19381. iftrue_dom.find('.button_alternate_expression').on('click', function () {
  19382. if (command.expression) {
  19383. var text = _code_generator__WEBPACK_IMPORTED_MODULE_3__["elementExpressionCode"](command.expression);
  19384. if (text) {
  19385. $(iftrue_dom.find('.conditional_expression')[0]).toggle();
  19386. $(iftrue_dom.find('.textual_expression')[0]).text(text);
  19387. $(iftrue_dom.find('.textual_expression')[0]).toggle();
  19388. $(this).toggleClass('unlock').toggleClass('lock');
  19389. command.lockexpression = !command.lockexpression;
  19390. }
  19391. }
  19392. if (command.lockexpression) {
  19393. iftrue_dom.find('.lock').popup({
  19394. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  19395. delay: {
  19396. show: 750,
  19397. hide: 0
  19398. }
  19399. });
  19400. } else {
  19401. iftrue_dom.find('.unlock').popup({
  19402. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  19403. delay: {
  19404. show: 750,
  19405. hide: 0
  19406. }
  19407. });
  19408. }
  19409. });
  19410. iftrue_dom.find('.button_remove_command').on('click', function () {
  19411. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, iftrue_dom)) {
  19412. iftrue_dom.fadeOut(400, function () {
  19413. iftrue_dom.remove();
  19414. });
  19415. }
  19416. });
  19417. iftrue_dom.find('.minimize_block_button').on('click', function () {
  19418. iftrue_dom.children('.data_block_else').toggle();
  19419. $(iftrue_dom.find('.block_commands')[0]).toggle();
  19420. command.collapsed = !command.collapsed;
  19421. });
  19422. }
  19423. /***/ }),
  19424. /***/ "./js/visualUI/commands/reader.js":
  19425. /*!****************************************!*\
  19426. !*** ./js/visualUI/commands/reader.js ***!
  19427. \****************************************/
  19428. /*! exports provided: createFloatingCommand, renderCommand */
  19429. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19430. "use strict";
  19431. __webpack_require__.r(__webpack_exports__);
  19432. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19434. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19435. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19436. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19437. function createFloatingCommand() {
  19438. 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>');
  19439. }
  19440. function renderCommand(command, function_obj) {
  19441. 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>';
  19442. el = $(el);
  19443. el.data('command', command);
  19444. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
  19445. addHandlers(command, function_obj, el);
  19446. return el;
  19447. }
  19448. function addHandlers(command, function_obj, reader_dom) {
  19449. reader_dom.find('.button_remove_command').on('click', function () {
  19450. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, reader_dom)) {
  19451. reader_dom.fadeOut(400, function () {
  19452. reader_dom.remove();
  19453. });
  19454. }
  19455. });
  19456. }
  19457. /***/ }),
  19458. /***/ "./js/visualUI/commands/repeatNtimes.js":
  19459. /*!**********************************************!*\
  19460. !*** ./js/visualUI/commands/repeatNtimes.js ***!
  19461. \**********************************************/
  19462. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, manageClearExpressionElements */
  19463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19464. "use strict";
  19465. __webpack_require__.r(__webpack_exports__);
  19466. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19467. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19468. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  19469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageClearExpressionElements", function() { return manageClearExpressionElements; });
  19470. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19471. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19472. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19473. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  19474. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19475. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  19476. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19477. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  19478. function createFloatingCommand() {
  19479. 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>');
  19480. }
  19481. function renderCommand(command, function_obj) {
  19482. 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>");
  19483. ret += '<div class="ui block_commands">';
  19484. ret += '</div>';
  19485. ret += '<span> </span>';
  19486. ret += '</div>';
  19487. var el = $(ret);
  19488. el.data('command', command);
  19489. el.find('.block_commands').data('command', command);
  19490. addHandlers(command, function_obj, el);
  19491. _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  19492. _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'));
  19493. _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);
  19494. //VariableValueMenu.renderMenu(command, command.var_incrementation, el.find('.incrementation_variable'), function_obj);
  19495. //angle double right
  19496. if (!command.expression1) {
  19497. 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);
  19498. }
  19499. el.find('.text_receives').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_from"));
  19500. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, el.find('.var_value_expression'), function_obj);
  19501. if (!command.expression3) {
  19502. 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>');
  19503. el.find('.pass_button').find('button').on('click', function () {
  19504. togglePasso(command);
  19505. });
  19506. /*var exp = new Models.ExpressionElement(Models.EXPRESSION_ELEMENTS.exp_op_exp,
  19507. [command.var_attribution,
  19508. Models.ARITHMETIC_TYPES.plus,
  19509. new Models.VariableValueMenu(VariableValueMenu.VAR_OR_VALUE_TYPES.all, "1", null, null, true)]);
  19510. command.expression3 = exp;
  19511. command.var_incrementation = command.var_attribution;*/
  19512. } else {
  19513. 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>');
  19514. el.find('.pass_button').find('button').on('click', function () {
  19515. togglePasso(command);
  19516. });
  19517. renderOperator(command, function_obj, el.find('.operator'), command.expression3, 1);
  19518. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], el.find('.second_operand'), function_obj);
  19519. }
  19520. if (command.commands_block) {
  19521. for (var j = 0; j < command.commands_block.length; j++) {
  19522. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  19523. }
  19524. }
  19525. if (command.lockexpression) {
  19526. try {
  19527. var text = _code_generator__WEBPACK_IMPORTED_MODULE_7__["repeatNtimesHeader"](command);
  19528. if (text) {
  19529. $(el.find('.textual_expression')[0]).html(text);
  19530. $(el.find('.textual_expression')[0]).toggle();
  19531. $(el.find('.attribution_expression')[0]).toggle();
  19532. $(el.find('.span_command_spec.separator_character')[0]).toggle();
  19533. $(el.find('.conditional_expression')[0]).toggle();
  19534. $(el.find('.pass_button')[0]).toggle();
  19535. $(el.find('.incrementation_field')[0]).toggle();
  19536. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19537. }
  19538. } catch (e) {
  19539. command.lockexpression = false;
  19540. }
  19541. }
  19542. el.find('.unlock').popup({
  19543. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  19544. delay: {
  19545. show: 750,
  19546. hide: 0
  19547. }
  19548. });
  19549. el.find('.lock').popup({
  19550. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  19551. delay: {
  19552. show: 750,
  19553. hide: 0
  19554. }
  19555. });
  19556. return el;
  19557. }
  19558. function togglePasso(command) {
  19559. if (!command.expression3) {
  19560. 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)]);
  19561. command.expression3 = exp;
  19562. command.var_incrementation = command.var_attribution;
  19563. } else {
  19564. command.expression3 = null;
  19565. }
  19566. renderAlgorithm();
  19567. }
  19568. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  19569. if (dom_object.hasClass('variable_attribution')) {
  19570. if (!command.expression3) {
  19571. 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)]);
  19572. command.expression3 = exp;
  19573. command.var_incrementation = command.var_attribution;
  19574. 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);
  19575. command.expression2.expression = cond_exp;
  19576. }
  19577. dom_object.parent().find('.text_receives').text('de');
  19578. 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);
  19579. dom_object.parent().find('.var_value_expression').empty();
  19580. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, dom_object.parent().find('.var_value_expression'), function_obj);
  19581. renderAlgorithm();
  19582. }
  19583. if (dom_object.hasClass('incrementation_variable')) {
  19584. dom_object.parent().find('.text_inc_receives').text('de');
  19585. 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)]);
  19586. command.expression3 = exp;
  19587. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[0], dom_object.parent().find('.first_operand'), function_obj);
  19588. renderOperator(command, function_obj, dom_object.parent().find('.operator'), command.expression3, 1);
  19589. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], dom_object.parent().find('.second_operand'), function_obj);
  19590. }
  19591. }
  19592. function manageClearExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  19593. if (dom_object.hasClass('variable_attribution')) {
  19594. $(dom_object).parent().find('.text_receives').text('');
  19595. command.expression1 = null;
  19596. $(dom_object).parent().find('.var_value_expression').empty();
  19597. }
  19598. if (dom_object.hasClass('incrementation_variable')) {
  19599. $(dom_object).parent().find('.text_inc_receives').text('');
  19600. command.expression3 = null;
  19601. $(dom_object).parent().find('.first_operand').empty();
  19602. $(dom_object).parent().find('.operator').empty();
  19603. $(dom_object).parent().find('.second_operand').empty();
  19604. }
  19605. }
  19606. function addHandlers(command, function_obj, repeatNtimes_dom) {
  19607. repeatNtimes_dom.find('.minimize_block_button').on('click', function (evt) {
  19608. repeatNtimes_dom.children('.ui.block_commands').toggle();
  19609. command.collapsed = !command.collapsed;
  19610. });
  19611. $(repeatNtimes_dom.find('.textual_expression')[0]).toggle();
  19612. repeatNtimes_dom.find('.button_alternate_expression').on('click', function () {
  19613. var text = _code_generator__WEBPACK_IMPORTED_MODULE_7__["repeatNtimesHeader"](command);
  19614. if (text) {
  19615. $(repeatNtimes_dom.find('.textual_expression')[0]).html(text);
  19616. $(repeatNtimes_dom.find('.textual_expression')[0]).toggle();
  19617. $(repeatNtimes_dom.find('.attribution_expression')[0]).toggle();
  19618. $(repeatNtimes_dom.find('.span_command_spec.separator_character')[0]).toggle();
  19619. $(repeatNtimes_dom.find('.conditional_expression')[0]).toggle();
  19620. $(repeatNtimes_dom.find('.pass_button')[0]).toggle();
  19621. $(repeatNtimes_dom.find('.incrementation_field')[0]).toggle();
  19622. $(repeatNtimes_dom.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19623. command.lockexpression = !command.lockexpression;
  19624. }
  19625. if (command.lockexpression) {
  19626. repeatNtimes_dom.find('.lock').popup({
  19627. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  19628. delay: {
  19629. show: 750,
  19630. hide: 0
  19631. }
  19632. });
  19633. } else {
  19634. repeatNtimes_dom.find('.unlock').popup({
  19635. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  19636. delay: {
  19637. show: 750,
  19638. hide: 0
  19639. }
  19640. });
  19641. }
  19642. });
  19643. repeatNtimes_dom.find('.button_remove_command').on('click', function () {
  19644. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, repeatNtimes_dom)) {
  19645. repeatNtimes_dom.fadeOut(400, function () {
  19646. repeatNtimes_dom.remove();
  19647. });
  19648. }
  19649. });
  19650. }
  19651. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  19652. var menu_operator = $('<div class="ui dropdown"><div class="text"></div></div>');
  19653. menu_operator.dropdown({
  19654. values: [{
  19655. name: '+',
  19656. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus,
  19657. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus
  19658. }, {
  19659. name: '-',
  19660. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus,
  19661. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus
  19662. }],
  19663. onChange: function onChange(value, text, $selectedItem) {
  19664. expression_element.itens[index_op] = value;
  19665. }
  19666. });
  19667. temp_op.append(menu_operator);
  19668. }
  19669. /***/ }),
  19670. /***/ "./js/visualUI/commands/return.js":
  19671. /*!****************************************!*\
  19672. !*** ./js/visualUI/commands/return.js ***!
  19673. \****************************************/
  19674. /*! exports provided: createFloatingCommand, renderCommand */
  19675. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19676. "use strict";
  19677. __webpack_require__.r(__webpack_exports__);
  19678. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19679. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19680. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  19681. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19682. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19683. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19684. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19685. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19686. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  19687. function createFloatingCommand() {
  19688. 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>');
  19689. }
  19690. function renderCommand(command, function_obj) {
  19691. 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>');
  19692. el.data('command', command);
  19693. if (function_obj.return_type != _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID) {
  19694. if (!command.variable_value_menu) {
  19695. 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)];
  19696. }
  19697. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.variable_value_menu);
  19698. el.append($('<i class="ui icon unlock button_alternate_expression" style="margin-left: 1rem;"></i>'));
  19699. if (command.lockexpression) {
  19700. if (command.variable_value_menu) {
  19701. try {
  19702. var text = _code_generator__WEBPACK_IMPORTED_MODULE_6__["elementExpressionCode"](command.variable_value_menu);
  19703. if (text) {
  19704. $(el.find('.expression_elements')[0]).toggle();
  19705. $(el.find('.textual_expression')[0]).text(text);
  19706. $(el.find('.textual_expression')[0]).toggle();
  19707. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  19708. }
  19709. } catch (e) {
  19710. command.lockexpression = false;
  19711. }
  19712. }
  19713. }
  19714. } else {
  19715. el.find('.expression_elements').remove();
  19716. command.variable_value_menu = null;
  19717. }
  19718. addHandlers(command, function_obj, el);
  19719. return el;
  19720. }
  19721. function addHandlers(command, function_obj, return_dom) {
  19722. return_dom.find('.button_alternate_expression').on('click', function () {
  19723. if (command.variable_value_menu) {
  19724. var text = _code_generator__WEBPACK_IMPORTED_MODULE_6__["elementExpressionCode"](command.variable_value_menu);
  19725. if (text) {
  19726. $(return_dom.find('.expression_elements')[0]).toggle();
  19727. $(return_dom.find('.textual_expression')[0]).text(text);
  19728. $(return_dom.find('.textual_expression')[0]).toggle();
  19729. $(this).toggleClass('unlock').toggleClass('lock');
  19730. command.lockexpression = !command.lockexpression;
  19731. }
  19732. }
  19733. });
  19734. return_dom.find('.button_remove_command').on('click', function () {
  19735. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, return_dom)) {
  19736. return_dom.fadeOut(400, function () {
  19737. return_dom.remove();
  19738. });
  19739. }
  19740. });
  19741. }
  19742. /***/ }),
  19743. /***/ "./js/visualUI/commands/switch.js":
  19744. /*!****************************************!*\
  19745. !*** ./js/visualUI/commands/switch.js ***!
  19746. \****************************************/
  19747. /*! exports provided: createFloatingCommand, renderCommand, renderCase */
  19748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19749. "use strict";
  19750. __webpack_require__.r(__webpack_exports__);
  19751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCase", function() { return renderCase; });
  19754. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19755. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19756. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  19757. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  19758. function createFloatingCommand() {
  19759. 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>');
  19760. }
  19761. function renderCommand(command, function_obj) {
  19762. var ret = '';
  19763. 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>';
  19764. ret += '</div>';
  19765. var el = $(ret);
  19766. el.data('command', command);
  19767. addHandlers(command, function_obj, el);
  19768. _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  19769. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.variable_to_switch'), function_obj);
  19770. if (command.cases) {
  19771. for (var i = 0; i < command.cases.length; i++) {
  19772. renderCase(command.cases[i], command, function_obj, el.find('.all_cases_div'));
  19773. }
  19774. }
  19775. return el;
  19776. }
  19777. function renderCase(switchcase, command, function_obj, el) {
  19778. 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>');
  19779. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, switchcase.variable_value_menu, casediv.find('.variable_case'), function_obj);
  19780. casediv.data('switchcase', switchcase);
  19781. casediv.find('.case_commands_block').data('switchcase', switchcase);
  19782. el.append(casediv);
  19783. if (switchcase.commands_block) {
  19784. for (var j = 0; j < switchcase.commands_block.length; j++) {
  19785. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](switchcase.commands_block[j], $(casediv.find('.case_commands_block')[0]), 3, function_obj);
  19786. }
  19787. }
  19788. casediv.find('.button_remove_command').on('click', function () {
  19789. for (var i = 0; i < command.cases.length; i++) {
  19790. if (switchcase == command.cases[i]) {
  19791. delete command.cases[i];
  19792. command.cases.splice(i, 1);
  19793. casediv.remove();
  19794. break;
  19795. }
  19796. }
  19797. });
  19798. }
  19799. function addHandlers(command, function_obj, switch_dom) {
  19800. switch_dom.find('.button_remove_command').on('click', function () {
  19801. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, switch_dom)) {
  19802. switch_dom.fadeOut(400, function () {
  19803. switch_dom.remove();
  19804. });
  19805. }
  19806. });
  19807. }
  19808. /***/ }),
  19809. /***/ "./js/visualUI/commands/variable_value_menu.js":
  19810. /*!*****************************************************!*\
  19811. !*** ./js/visualUI/commands/variable_value_menu.js ***!
  19812. \*****************************************************/
  19813. /*! exports provided: VAR_OR_VALUE_TYPES, renderMenu */
  19814. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19815. "use strict";
  19816. __webpack_require__.r(__webpack_exports__);
  19817. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VAR_OR_VALUE_TYPES", function() { return VAR_OR_VALUE_TYPES; });
  19818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  19819. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19820. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19821. /* harmony import */ var _attribution__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attribution */ "./js/visualUI/commands/attribution.js");
  19822. /* harmony import */ var _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  19823. var VAR_OR_VALUE_TYPES = Object.freeze({
  19824. only_variable: 1,
  19825. only_value: 2,
  19826. only_function: 3,
  19827. variable_and_function: 4,
  19828. variable_and_value_opt: 5,
  19829. value_and_function: 6,
  19830. all: 7
  19831. });
  19832. function renderMenu(command, ref_object, dom_object, function_obj) {
  19833. var size_field = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
  19834. var expression_element = arguments.length > 5 ? arguments[5] : undefined;
  19835. // Verificar se o objeto atual trata-se de uma chamada de função e conferir se possui a quantidade correta de parâmetros
  19836. // Caso não possua, tem que adicionar as variáveis que servirão de parâmetros:
  19837. if (ref_object.function_called) {
  19838. if (ref_object.function_called.parameters_list) {
  19839. while (ref_object.function_called.parameters_list.length != ref_object.parameters_list.length) {
  19840. if (ref_object.parameters_list.length > ref_object.function_called.parameters_list.length) {
  19841. ref_object.parameters_list.pop();
  19842. } else {
  19843. ref_object.parameters_list.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true));
  19844. }
  19845. }
  19846. }
  19847. }
  19848. 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">';
  19849. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_variable) {
  19850. 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">';
  19851. menu_var_or_value += "</div>";
  19852. }
  19853. 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) {
  19854. 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");
  19855. menu_var_or_value += '<div class="menu menu_only_vars">';
  19856. menu_var_or_value += "</div></div>";
  19857. }
  19858. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_value) {
  19859. menu_var_or_value = '<input type="text" class="width-dynamic" size="' + size_field + '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />';
  19860. }
  19861. 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) {
  19862. 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>";
  19863. }
  19864. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_function) {
  19865. 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">';
  19866. menu_var_or_value += "</div>";
  19867. }
  19868. 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) {
  19869. 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");
  19870. menu_var_or_value += '<div class="menu menu_only_functions">';
  19871. menu_var_or_value += "</div></div>";
  19872. /* if (command.type == Models.COMMAND_TYPES.attribution) {
  19873. menu_var_or_value += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19874. menu_var_or_value += '<div class="menu">';
  19875. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19876. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19877. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19878. menu_var_or_value += '</div></div>';
  19879. }*/
  19880. }
  19881. menu_var_or_value += "</div></div>";
  19882. menu_var_or_value = $(menu_var_or_value);
  19883. menu_var_or_value.find('.width-dynamic').on('input', function () {
  19884. var input_field = $(this);
  19885. var inputWidth = input_field.textWidth() + 10;
  19886. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  19887. input_field.css({
  19888. width: inputWidth
  19889. });
  19890. }).trigger('input');
  19891. dom_object.append(menu_var_or_value);
  19892. ref_object.dom_object = menu_var_or_value;
  19893. addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19894. addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  19895. addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  19896. addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  19897. if (ref_object.content || ref_object.function_called) {
  19898. if (ref_object.content) {
  19899. // Verificar se a variável ainda existe:
  19900. var variable_fun = isVarInProgram(ref_object.content, function_obj);
  19901. if (variable_fun) {
  19902. ref_object.content = variable_fun;
  19903. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  19904. } else {
  19905. if (ref_object.content && ref_object.content.type) {
  19906. ref_object.content = null;
  19907. appendSelectText(ref_object, menu_var_or_value);
  19908. } else {
  19909. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  19910. }
  19911. }
  19912. } else if (ref_object.function_called) {
  19913. // Verificar se a função ainda existe:
  19914. var ret_function = isFunctionInProgram(ref_object.function_called);
  19915. if (ret_function) {
  19916. ref_object.function_called = ret_function;
  19917. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  19918. } else {
  19919. ref_object.content = null;
  19920. ref_object.row = null;
  19921. ref_object.column = null;
  19922. delete ref_object.function_called;
  19923. delete ref_object.parameters_list;
  19924. appendSelectText(ref_object, menu_var_or_value);
  19925. }
  19926. }
  19927. } else {
  19928. appendSelectText(ref_object, menu_var_or_value);
  19929. }
  19930. }
  19931. function appendSelectText(ref_object, menu_var_or_value) {
  19932. switch (ref_object.variable_and_value) {
  19933. case VAR_OR_VALUE_TYPES.only_variable:
  19934. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_var") + "</i>");
  19935. break;
  19936. case VAR_OR_VALUE_TYPES.all:
  19937. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  19938. break;
  19939. case VAR_OR_VALUE_TYPES.variable_and_function:
  19940. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
  19941. break;
  19942. case VAR_OR_VALUE_TYPES.only_function:
  19943. menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_function") + "</i>");
  19944. break;
  19945. }
  19946. }
  19947. function isFunctionInProgram(function_called_obj) {
  19948. if (function_called_obj.name) {
  19949. if (window.program_obj.functions) {
  19950. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19951. if (window.program_obj.functions[i] == function_called_obj) {
  19952. return window.program_obj.functions[i];
  19953. }
  19954. }
  19955. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19956. if (window.program_obj.functions[i].name == function_called_obj.name) {
  19957. return window.program_obj.functions[i];
  19958. }
  19959. }
  19960. }
  19961. } else if (function_called_obj.identifier) {
  19962. for (var i = 0; i < window.system_functions.length; i++) {
  19963. if (window.system_functions[i].identifier == function_called_obj.identifier) {
  19964. return window.system_functions[i];
  19965. }
  19966. }
  19967. }
  19968. return null;
  19969. }
  19970. function isVarInProgram(var_obj, function_obj) {
  19971. // Verify in locals:
  19972. if (function_obj.variables_list) {
  19973. for (var i = 0; i < function_obj.variables_list.length; i++) {
  19974. if (function_obj.variables_list[i] == var_obj) {
  19975. return function_obj.variables_list[i];
  19976. }
  19977. }
  19978. } // Verify in parameters:
  19979. if (function_obj.parameters_list) {
  19980. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  19981. if (function_obj.parameters_list[i] == var_obj) {
  19982. return function_obj.parameters_list[i];
  19983. }
  19984. }
  19985. } // Verify in globals:
  19986. if (window.program_obj.globals) {
  19987. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19988. if (window.program_obj.globals[i] == var_obj) {
  19989. return window.program_obj.globals[i];
  19990. }
  19991. }
  19992. } // If not found, verify if the reference was lost
  19993. if (var_obj) {
  19994. if (function_obj.variables_list) {
  19995. for (var i = 0; i < function_obj.variables_list.length; i++) {
  19996. if (function_obj.variables_list[i].name == var_obj.name) {
  19997. return function_obj.variables_list[i];
  19998. }
  19999. }
  20000. }
  20001. if (function_obj.parameters_list) {
  20002. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  20003. if (function_obj.parameters_list[i].name == var_obj.name) {
  20004. return function_obj.parameters_list[i];
  20005. }
  20006. }
  20007. }
  20008. if (window.program_obj.globals) {
  20009. for (var i = 0; i < window.program_obj.globals.length; i++) {
  20010. if (window.program_obj.globals[i].name == var_obj.name) {
  20011. return window.program_obj.globals[i];
  20012. }
  20013. }
  20014. }
  20015. }
  20016. return null;
  20017. }
  20018. function renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element) {
  20019. if (ref_object.function_called) {
  20020. menu_var_or_value.remove();
  20021. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  20022. } else if (ref_object.content.type) {
  20023. menu_var_or_value.remove();
  20024. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  20025. } else {
  20026. menu_var_or_value.remove();
  20027. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  20028. }
  20029. }
  20030. function variableValueMenuCode(command, variable_obj, dom_object, function_obj, menu_var_or_value, expression_element) {
  20031. if (variable_obj.content || variable_obj.function_called) {
  20032. // Verificar se a variável ainda existe:
  20033. var var_fun = isVarInProgram(variable_obj.content, function_obj);
  20034. if (var_fun) {
  20035. variable_obj.content = var_fun;
  20036. } else {
  20037. if (variable_obj.content && variable_obj.content.type) {
  20038. variable_obj.content = null;
  20039. appendSelectText(variable_obj, menu_var_or_value);
  20040. }
  20041. }
  20042. } else {
  20043. appendSelectText(variable_obj, menu_var_or_value);
  20044. }
  20045. if (variable_obj.content == null && variable_obj.function_called == null) {
  20046. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20047. return;
  20048. }
  20049. var ret = "";
  20050. if (variable_obj.function_called) {
  20051. if (variable_obj.function_called.parameters_list == null || variable_obj.function_called.length == 0) {
  20052. menu_var_or_value.find(".text").text(" ");
  20053. dom_object.find(".menu_var_or_value_dom").remove();
  20054. var parameters_menu;
  20055. if (variable_obj.function_called.name) {
  20056. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  20057. } else {
  20058. 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>";
  20059. }
  20060. parameters_menu += "<span> ) </span></div>";
  20061. parameters_menu = $(parameters_menu);
  20062. dom_object.append(parameters_menu);
  20063. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20064. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20065. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20066. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20067. context_menu += '<div class="menu">';
  20068. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20069. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20070. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20071. context_menu += '</div></div>';
  20072. }*/
  20073. context_menu += "</div></div>";
  20074. context_menu = $(context_menu);
  20075. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  20076. context_menu.dropdown({
  20077. onChange: function onChange(value, text, $selectedItem) {
  20078. if ($selectedItem.data("clear")) {
  20079. dom_object.text("");
  20080. variable_obj.content = null;
  20081. variable_obj.row = null;
  20082. variable_obj.column = null;
  20083. delete variable_obj.function_called;
  20084. delete variable_obj.parameters_list;
  20085. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20086. }
  20087. if ($selectedItem.data("exp")) {
  20088. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20089. }
  20090. },
  20091. selectOnKeydown: false
  20092. });
  20093. } else {
  20094. menu_var_or_value.find(".text").text(" ");
  20095. dom_object.find(".menu_var_or_value_dom").remove();
  20096. var parameters_menu;
  20097. if (variable_obj.function_called.name) {
  20098. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
  20099. } else {
  20100. 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>";
  20101. }
  20102. for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
  20103. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  20104. if (j + 1 != variable_obj.function_called.parameters_list.length) {
  20105. parameters_menu += " , ";
  20106. }
  20107. }
  20108. parameters_menu += "<span> ) </span></div>";
  20109. parameters_menu = $(parameters_menu);
  20110. dom_object.append(parameters_menu);
  20111. for (var _j = 0; _j < variable_obj.function_called.parameters_list.length; _j++) {
  20112. renderMenu(command, variable_obj.parameters_list[_j], parameters_menu.find(".parameter_" + _j), function_obj, 2, expression_element);
  20113. }
  20114. var _context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20115. _context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20116. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20117. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20118. context_menu += '<div class="menu">';
  20119. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20120. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20121. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20122. context_menu += '</div></div>';
  20123. }*/
  20124. _context_menu += "</div></div>";
  20125. _context_menu = $(_context_menu);
  20126. _context_menu.insertAfter(parameters_menu);
  20127. _context_menu.dropdown({
  20128. onChange: function onChange(value, text, $selectedItem) {
  20129. if ($selectedItem.data("clear")) {
  20130. dom_object.text("");
  20131. variable_obj.content = null;
  20132. variable_obj.row = null;
  20133. variable_obj.column = null;
  20134. delete variable_obj.function_called;
  20135. delete variable_obj.parameters_list;
  20136. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20137. }
  20138. if ($selectedItem.data("exp")) {
  20139. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20140. }
  20141. },
  20142. selectOnKeydown: false
  20143. });
  20144. }
  20145. } else if (variable_obj.content.type) {
  20146. var variable_render = "";
  20147. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  20148. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  20149. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  20150. variable_render += "</div>";
  20151. variable_render = $(variable_render);
  20152. dom_object.append(variable_render);
  20153. var _context_menu2 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20154. _context_menu2 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20155. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20156. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20157. context_menu += '<div class="menu">';
  20158. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20159. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20160. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20161. context_menu += '</div></div>';
  20162. }*/
  20163. _context_menu2 += "</div></div>";
  20164. _context_menu2 = $(_context_menu2);
  20165. variable_render.append(_context_menu2);
  20166. _context_menu2.dropdown({
  20167. onChange: function onChange(value, text, $selectedItem) {
  20168. if ($selectedItem.data("clear")) {
  20169. dom_object.text("");
  20170. variable_obj.content = null;
  20171. variable_obj.row = null;
  20172. variable_obj.column = null;
  20173. delete variable_obj.function_called;
  20174. delete variable_obj.parameters_list;
  20175. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20176. }
  20177. if ($selectedItem.data("exp")) {
  20178. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20179. }
  20180. },
  20181. selectOnKeydown: false
  20182. });
  20183. if (!variable_obj.column) {
  20184. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20185. }
  20186. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  20187. } else if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  20188. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  20189. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span>';
  20190. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ] </span>';
  20191. variable_render += "</div>";
  20192. variable_render = $(variable_render);
  20193. dom_object.append(variable_render);
  20194. var _context_menu3 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20195. _context_menu3 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20196. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20197. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20198. context_menu += '<div class="menu">';
  20199. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20200. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20201. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20202. context_menu += '</div></div>';
  20203. }*/
  20204. _context_menu3 += "</div></div>";
  20205. _context_menu3 = $(_context_menu3);
  20206. variable_render.append(_context_menu3);
  20207. _context_menu3.dropdown({
  20208. onChange: function onChange(value, text, $selectedItem) {
  20209. if ($selectedItem.data("clear")) {
  20210. dom_object.text("");
  20211. variable_obj.content = null;
  20212. variable_obj.row = null;
  20213. variable_obj.column = null;
  20214. delete variable_obj.function_called;
  20215. delete variable_obj.parameters_list;
  20216. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20217. }
  20218. if ($selectedItem.data("exp")) {
  20219. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20220. }
  20221. },
  20222. selectOnKeydown: false
  20223. });
  20224. if (!variable_obj.column) {
  20225. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20226. }
  20227. if (!variable_obj.row) {
  20228. variable_obj.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20229. }
  20230. variableValueMenuCode(command, variable_obj.row, $(variable_render.find(".row_container")), function_obj, menu_var_or_value, expression_element);
  20231. variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
  20232. } else {
  20233. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
  20234. variable_render += "</div>";
  20235. variable_render = $(variable_render);
  20236. dom_object.append(variable_render);
  20237. var _context_menu4 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20238. _context_menu4 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20239. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  20240. console.log('dom_object6');
  20241. console.log(dom_object);
  20242. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20243. context_menu += '<div class="menu">';
  20244. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20245. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20246. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20247. context_menu += '</div></div>';
  20248. }*/
  20249. _context_menu4 += "</div></div>";
  20250. _context_menu4 = $(_context_menu4);
  20251. variable_render.append(_context_menu4);
  20252. _context_menu4.dropdown({
  20253. onChange: function onChange(value, text, $selectedItem) {
  20254. if ($selectedItem.data("clear")) {
  20255. dom_object.text("");
  20256. variable_obj.content = null;
  20257. variable_obj.row = null;
  20258. variable_obj.column = null;
  20259. delete variable_obj.function_called;
  20260. delete variable_obj.parameters_list;
  20261. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20262. }
  20263. if ($selectedItem.data("exp")) {
  20264. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20265. }
  20266. },
  20267. selectOnKeydown: false
  20268. });
  20269. }
  20270. } else {
  20271. var _variable_render;
  20272. _variable_render = '<div class="variable_rendered"> <span class="var_name">';
  20273. if (isNaN(variable_obj.content)) {
  20274. _variable_render += variable_obj.content.split(" ").join("&nbsp;");
  20275. } else {
  20276. _variable_render += variable_obj.content;
  20277. }
  20278. _variable_render += "</span>";
  20279. _variable_render += "</div>";
  20280. _variable_render = $(_variable_render);
  20281. dom_object.append(_variable_render);
  20282. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20283. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20284. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20285. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20286. context_menu += '<div class="menu">';
  20287. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20288. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20289. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20290. context_menu += '</div></div>';
  20291. }*/
  20292. context_menu += "</div></div>";
  20293. context_menu = $(context_menu);
  20294. if (variable_obj.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  20295. context_menu.insertAfter(_variable_render);
  20296. }
  20297. context_menu.dropdown({
  20298. onChange: function onChange(value, text, $selectedItem) {
  20299. if ($selectedItem.data("clear")) {
  20300. dom_object.text("");
  20301. variable_obj.content = null;
  20302. variable_obj.row = null;
  20303. variable_obj.column = null;
  20304. delete variable_obj.function_called;
  20305. delete variable_obj.parameters_list;
  20306. dom_object.find(".value_rendered").remove();
  20307. dom_object.find(".context_menu_clear").remove();
  20308. dom_object.find(".width-dynamic-minus").remove();
  20309. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  20310. }
  20311. if ($selectedItem.data("exp")) {
  20312. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20313. }
  20314. },
  20315. selectOnKeydown: false
  20316. });
  20317. _variable_render.on("click", function (e) {
  20318. _variable_render.remove();
  20319. _variable_render.empty();
  20320. _variable_render.remove();
  20321. dom_object.empty();
  20322. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  20323. openInputToValue(command, variable_obj, dom_object, menu_var_or_value, function_obj, expression_element);
  20324. });
  20325. }
  20326. }
  20327. function addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  20328. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  20329. sub_menu.append('<div class="divider"></div><div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_header_ivprog_functions") + "</div>");
  20330. 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>');
  20331. 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>');
  20332. 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>');
  20333. 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:
  20334. for (var i = 0; i < window.system_functions.length; i++) {
  20335. var t = $('<div class="item"></div>');
  20336. t.data("function_reference", window.system_functions[i]);
  20337. t.data("option", VAR_OR_VALUE_TYPES.only_function);
  20338. t.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(window.system_functions[i].identifier));
  20339. switch (window.system_functions[i].category) {
  20340. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].math:
  20341. sub_menu.find(".menu_math_functions").append(t);
  20342. break;
  20343. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].text:
  20344. sub_menu.find(".menu_text_functions").append(t);
  20345. break;
  20346. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement:
  20347. sub_menu.find(".menu_arrangement_functions").append(t);
  20348. break;
  20349. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion:
  20350. sub_menu.find(".menu_conversion_functions").append(t);
  20351. break;
  20352. }
  20353. }
  20354. }
  20355. function addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  20356. var sub_menu = menu_var_or_value.find(".menu_only_functions");
  20357. sub_menu.text("");
  20358. for (var i = 0; i < window.program_obj.functions.length; i++) {
  20359. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_function + '">' + window.program_obj.functions[i].name + " </div>");
  20360. temp.data("function_reference", window.program_obj.functions[i]);
  20361. sub_menu.append(temp);
  20362. }
  20363. }
  20364. function addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  20365. var sub_menu = menu_var_or_value.find(".menu_only_vars");
  20366. sub_menu.text("");
  20367. var is_there = false;
  20368. if (window.program_obj.globals) {
  20369. if (ref_object.include_constant) {
  20370. for (var i = 0; i < window.program_obj.globals.length; i++) {
  20371. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  20372. temp.data("variable_reference", window.program_obj.globals[i]);
  20373. sub_menu.append(temp);
  20374. is_there = true;
  20375. }
  20376. } else {
  20377. for (var i = 0; i < window.program_obj.globals.length; i++) {
  20378. if (!window.program_obj.globals[i].is_constant) {
  20379. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
  20380. temp.data("variable_reference", window.program_obj.globals[i]);
  20381. sub_menu.append(temp);
  20382. is_there = true;
  20383. }
  20384. }
  20385. }
  20386. }
  20387. if (function_obj.parameters_list) {
  20388. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  20389. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.parameters_list[i].name + " </div>");
  20390. temp.data("variable_reference", function_obj.parameters_list[i]);
  20391. sub_menu.append(temp);
  20392. is_there = true;
  20393. }
  20394. }
  20395. if (function_obj.variables_list) {
  20396. for (var i = 0; i < function_obj.variables_list.length; i++) {
  20397. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.variables_list[i].name + " </div>");
  20398. temp.data("variable_reference", function_obj.variables_list[i]);
  20399. sub_menu.append(temp);
  20400. is_there = true;
  20401. }
  20402. }
  20403. if (!is_there) {
  20404. sub_menu.append($('<div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable") + "</div>"));
  20405. sub_menu.append($('<div class="item disabled">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable_instruction") + "</div>"));
  20406. }
  20407. }
  20408. function addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  20409. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  20410. menu_var_or_value.dropdown({
  20411. onChange: function onChange(value, text, $selectedItem) {
  20412. dom_object.find(".var_name").remove();
  20413. switch ($selectedItem.data("option")) {
  20414. case VAR_OR_VALUE_TYPES.only_function:
  20415. openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("function_reference"), expression_element);
  20416. break;
  20417. case VAR_OR_VALUE_TYPES.only_value:
  20418. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  20419. break;
  20420. case VAR_OR_VALUE_TYPES.only_variable:
  20421. openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("variable_reference"), expression_element);
  20422. break;
  20423. }
  20424. if ($selectedItem.data("exp")) {
  20425. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20426. }
  20427. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  20428. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20429. }
  20430. },
  20431. selectOnKeydown: false
  20432. });
  20433. }
  20434. dom_object.find(".width-dynamic").on("input", function () {
  20435. var inputWidth = $(this).textWidth() + 10;
  20436. $(this).focus();
  20437. var tmpStr = $(this).val();
  20438. $(this).val("");
  20439. $(this).val(tmpStr);
  20440. $(this).css({
  20441. width: inputWidth
  20442. });
  20443. }).trigger("input");
  20444. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  20445. dom_object.parent().on("click", function (e) {
  20446. dom_object.find(".value_rendered").remove();
  20447. dom_object.find(".value_rendered").empty();
  20448. dom_object.find(".value_rendered").remove();
  20449. dom_object.empty();
  20450. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  20451. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  20452. });
  20453. }
  20454. }
  20455. function openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, function_selected, expression_element) {
  20456. ref_object.function_called = function_selected;
  20457. ref_object.parameters_list = [];
  20458. if (function_selected.parameters_list != null && function_selected.parameters_list.length > 0) {
  20459. menu_var_or_value.find(".text").text(" ");
  20460. dom_object.find(".menu_var_or_value_dom").remove();
  20461. var parameters_menu;
  20462. if (function_selected.name) {
  20463. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  20464. } else {
  20465. 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>";
  20466. }
  20467. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  20468. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  20469. if (j + 1 != function_selected.parameters_list.length) {
  20470. parameters_menu += " , ";
  20471. }
  20472. }
  20473. parameters_menu += "<span> ) </span></div>";
  20474. parameters_menu = $(parameters_menu);
  20475. dom_object.append(parameters_menu);
  20476. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  20477. var temp;
  20478. if (function_selected.parameters_list[j].dimensions > 0) {
  20479. 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);
  20480. } else {
  20481. temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20482. }
  20483. ref_object.parameters_list.push(temp);
  20484. renderMenu(command, temp, parameters_menu.find(".parameter_" + j), function_obj, 2, expression_element);
  20485. }
  20486. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20487. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20488. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20489. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20490. context_menu += '<div class="menu">';
  20491. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20492. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20493. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20494. context_menu += '</div></div>';
  20495. }*/
  20496. context_menu += "</div></div>";
  20497. context_menu = $(context_menu);
  20498. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  20499. context_menu.dropdown({
  20500. onChange: function onChange(value, text, $selectedItem) {
  20501. if ($selectedItem.data("clear")) {
  20502. dom_object.text("");
  20503. ref_object.content = null;
  20504. ref_object.row = null;
  20505. ref_object.column = null;
  20506. delete ref_object.function_called;
  20507. delete ref_object.parameters_list;
  20508. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  20509. }
  20510. if ($selectedItem.data("exp")) {
  20511. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20512. }
  20513. },
  20514. selectOnKeydown: false
  20515. });
  20516. } else {
  20517. menu_var_or_value.find(".text").text(" ");
  20518. dom_object.find(".menu_var_or_value_dom").remove();
  20519. var parameters_menu;
  20520. if (function_selected.name) {
  20521. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
  20522. } else {
  20523. 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>";
  20524. }
  20525. parameters_menu += "<span> ) </span></div>";
  20526. parameters_menu = $(parameters_menu);
  20527. dom_object.append(parameters_menu);
  20528. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20529. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20530. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20531. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20532. context_menu += '<div class="menu">';
  20533. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20534. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20535. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20536. context_menu += '</div></div>';
  20537. }*/
  20538. context_menu += "</div></div>";
  20539. context_menu = $(context_menu);
  20540. context_menu.insertAfter(dom_object.find(".parameters_function_called"));
  20541. context_menu.dropdown({
  20542. onChange: function onChange(value, text, $selectedItem) {
  20543. if ($selectedItem.data("clear")) {
  20544. dom_object.text("");
  20545. ref_object.content = null;
  20546. ref_object.row = null;
  20547. ref_object.column = null;
  20548. delete ref_object.function_called;
  20549. delete ref_object.parameters_list;
  20550. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  20551. }
  20552. if ($selectedItem.data("exp")) {
  20553. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20554. }
  20555. },
  20556. selectOnKeydown: false
  20557. });
  20558. }
  20559. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20560. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  20561. }*/
  20562. }
  20563. function openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected, expression_element) {
  20564. ref_object.content = variable_selected;
  20565. menu_var_or_value.find(".text").text(" ");
  20566. dom_object.find(".menu_var_or_value_dom").remove();
  20567. var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_selected.name + "</span>";
  20568. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  20569. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  20570. }
  20571. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  20572. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span> ';
  20573. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  20574. }
  20575. variable_render += "</div>";
  20576. variable_render = $(variable_render);
  20577. dom_object.append(variable_render);
  20578. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  20579. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20580. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  20581. }
  20582. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  20583. ref_object.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20584. renderMenu(command, ref_object.row, variable_render.find(".row_container"), function_obj, 2, expression_element);
  20585. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  20586. renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
  20587. }
  20588. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20589. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20590. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  20591. console.log("dom_object 10: ");
  20592. console.log(dom_object);
  20593. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20594. context_menu += '<div class="menu">';
  20595. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20596. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20597. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20598. context_menu += '</div></div>';
  20599. }*/
  20600. context_menu += "</div></div>";
  20601. context_menu = $(context_menu);
  20602. context_menu.insertAfter(dom_object.find(".variable_rendered"));
  20603. context_menu.dropdown({
  20604. onChange: function onChange(value, text, $selectedItem) {
  20605. if ($selectedItem.data("clear")) {
  20606. dom_object.text("");
  20607. ref_object.content = null;
  20608. ref_object.row = null;
  20609. ref_object.column = null;
  20610. delete ref_object.function_called;
  20611. delete ref_object.parameters_list;
  20612. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  20613. }
  20614. if ($selectedItem.data("exp")) {
  20615. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20616. }
  20617. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  20618. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageClearExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20619. }
  20620. },
  20621. selectOnKeydown: false
  20622. });
  20623. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20624. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected);
  20625. }*/
  20626. }
  20627. function openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  20628. if (ref_object.content == null) {
  20629. ref_object.content = "";
  20630. }
  20631. menu_var_or_value.find(".text").text(" ");
  20632. var field = $('<input type="text" size="2" class="width-dynamic-minus" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />');
  20633. field.insertBefore(dom_object.find(".menu_var_or_value_dom"));
  20634. field.on('input', function () {
  20635. var input_field = $(this);
  20636. var inputWidth = input_field.textWidth() + 10;
  20637. inputWidth = inputWidth < 50 ? 50 : inputWidth;
  20638. input_field.css({
  20639. width: inputWidth
  20640. });
  20641. }).trigger('input');
  20642. var rendered = $('<div class="value_rendered"></div>');
  20643. rendered.insertBefore(field);
  20644. field.focus();
  20645. field.val(ref_object.content);
  20646. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  20647. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
  20648. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20649. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  20650. context_menu += '<div class="menu">';
  20651. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  20652. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  20653. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  20654. context_menu += '</div></div>';
  20655. }*/
  20656. context_menu += "</div></div>";
  20657. context_menu = $(context_menu);
  20658. dom_object.find(".menu_var_or_value_dom").remove();
  20659. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  20660. context_menu.insertAfter(field);
  20661. }
  20662. context_menu.dropdown({
  20663. onChange: function onChange(value, text, $selectedItem) {
  20664. if ($selectedItem.data("clear")) {
  20665. dom_object.text("");
  20666. dom_object.find(".value_rendered").remove();
  20667. dom_object.find(".context_menu_clear").remove();
  20668. dom_object.find(".width-dynamic-minus").remove();
  20669. ref_object.content = null;
  20670. ref_object.row = null;
  20671. ref_object.column = null;
  20672. delete ref_object.function_called;
  20673. delete ref_object.parameters_list;
  20674. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  20675. }
  20676. if ($selectedItem.data("exp")) {
  20677. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  20678. }
  20679. },
  20680. selectOnKeydown: false
  20681. });
  20682. dom_object.find(".width-dynamic-minus").focusout(function () {
  20683. /*if (
  20684. $(this)
  20685. .val()
  20686. .trim()
  20687. ) {
  20688. ref_object.content = $(this)
  20689. .val()
  20690. .trim();
  20691. }*/
  20692. ref_object.content = $(this).val();
  20693. if (isNaN(ref_object.content)) {
  20694. rendered.html(ref_object.content.split(" ").join("&nbsp;"));
  20695. } else {
  20696. rendered.text(ref_object.content);
  20697. }
  20698. $(this).remove();
  20699. });
  20700. dom_object.find(".width-dynamic-minus").on("keydown", function (e) {
  20701. var code = e.keyCode || e.which;
  20702. if (code == 13) {
  20703. /*if (
  20704. $(this)
  20705. .val()
  20706. .trim()
  20707. ) {
  20708. ref_object.content = $(this)
  20709. .val()
  20710. .trim();
  20711. }*/
  20712. ref_object.content = $(this).val();
  20713. if (isNaN(ref_object.content)) {
  20714. rendered.html(ref_object.content.split(" ").join("&nbsp;"));
  20715. } else {
  20716. rendered.text(ref_object.content);
  20717. }
  20718. $(this).remove();
  20719. }
  20720. if (code == 27) {
  20721. if (isNaN(ref_object.content)) {
  20722. rendered.html(ref_object.content.split(" ").join("&nbsp;"));
  20723. } else {
  20724. rendered.text(ref_object.content);
  20725. }
  20726. $(this).remove();
  20727. }
  20728. });
  20729. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  20730. /*rendered.parent().on('click', function(e) {
  20731. rendered.parent().off();
  20732. console.log("TTT14");
  20733. rendered.remove();
  20734. rendered.empty();
  20735. rendered.remove();
  20736. dom_object.empty();
  20737. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  20738. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element)
  20739. });*/
  20740. }
  20741. rendered.on("click", function (e) {
  20742. rendered.empty();
  20743. rendered.remove();
  20744. dom_object.empty();
  20745. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  20746. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  20747. });
  20748. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  20749. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  20750. }*/
  20751. }
  20752. $.fn.textWidth = function (text, font) {
  20753. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $("<span>").hide().appendTo(document.body);
  20754. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr("placeholder")).css("font", font || this.css("font"));
  20755. return $.fn.textWidth.fakeEl.width();
  20756. };
  20757. /***/ }),
  20758. /***/ "./js/visualUI/commands/whiletrue.js":
  20759. /*!*******************************************!*\
  20760. !*** ./js/visualUI/commands/whiletrue.js ***!
  20761. \*******************************************/
  20762. /*! exports provided: createFloatingCommand, renderCommand */
  20763. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20764. "use strict";
  20765. __webpack_require__.r(__webpack_exports__);
  20766. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  20767. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  20768. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  20769. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  20770. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  20771. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  20772. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  20773. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  20774. function createFloatingCommand() {
  20775. 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>');
  20776. }
  20777. function renderCommand(command, function_obj) {
  20778. var ret = '';
  20779. 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>';
  20780. ret += '<span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="textual_expression"></span> <span class="span_command_spec"> ) </span>';
  20781. ret += ' </span>';
  20782. 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>';
  20783. ret += '<div class="ui block_commands">';
  20784. ret += '</div>';
  20785. ret += '<span> </span>';
  20786. ret += '</div>';
  20787. var el = $(ret);
  20788. el.data('command', command);
  20789. el.find('.block_commands').data('command', command);
  20790. addHandlers(command, function_obj, el);
  20791. _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'));
  20792. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  20793. if (command.commands_block) {
  20794. for (var j = 0; j < command.commands_block.length; j++) {
  20795. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  20796. }
  20797. }
  20798. if (command.lockexpression) {
  20799. if (command.expression) {
  20800. try {
  20801. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  20802. if (text) {
  20803. $(el.find('.conditional_expression')[0]).toggle();
  20804. $(el.find('.textual_expression')[0]).text(text);
  20805. $(el.find('.textual_expression')[0]).toggle();
  20806. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  20807. }
  20808. } catch (e) {
  20809. command.lockexpression = false;
  20810. }
  20811. }
  20812. }
  20813. el.find('.unlock').popup({
  20814. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  20815. delay: {
  20816. show: 750,
  20817. hide: 0
  20818. }
  20819. });
  20820. el.find('.lock').popup({
  20821. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  20822. delay: {
  20823. show: 750,
  20824. hide: 0
  20825. }
  20826. });
  20827. el.find('.button_write_expression').popup({
  20828. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression"),
  20829. delay: {
  20830. show: 750,
  20831. hide: 0
  20832. }
  20833. });
  20834. return el;
  20835. }
  20836. function addHandlers(command, function_obj, whiletrue_dom) {
  20837. whiletrue_dom.find('.button_write_expression').on('click', function () {
  20838. window.expressionEdition = true;
  20839. window.inputExpression = null;
  20840. var afterWhichElement;
  20841. var lockButton = $(whiletrue_dom.find('.button_alternate_expression')[0]);
  20842. var editButton = $(this);
  20843. afterWhichElement = $(whiletrue_dom.find('.conditional_expression')[0]);
  20844. if (command.lockexpression) {
  20845. afterWhichElement = $(whiletrue_dom.find('.textual_expression')[0]);
  20846. }
  20847. var text = "";
  20848. if (command.expression) {
  20849. if (command.expression.length == 1 && command.expression[0].content == null && !command.expression[0].function_called) {
  20850. text = "";
  20851. } else {
  20852. try {
  20853. text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  20854. } catch (ex) {
  20855. text = "";
  20856. }
  20857. }
  20858. }
  20859. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  20860. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  20861. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  20862. input.val(text);
  20863. input.focusout(function (evt) {
  20864. console.log('focosout event!');
  20865. ok_button.click();
  20866. evt.preventDefault();
  20867. return true;
  20868. });
  20869. input.keyup(function (evt) {
  20870. if (evt.keyCode == 27) {
  20871. // esc
  20872. cancel_button.click();
  20873. }
  20874. if (evt.keyCode == 13) {
  20875. // enter
  20876. ok_button.click();
  20877. }
  20878. });
  20879. ok_button.click(function () {
  20880. var parsed = null;
  20881. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](input.val(), function_obj, input);
  20882. if (parsed) {
  20883. window.expressionEdition = false;
  20884. command.expression = parsed;
  20885. renderAlgorithm();
  20886. }
  20887. });
  20888. cancel_button.mousedown(function (evt) {
  20889. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](text, function_obj, input);
  20890. if (parsed) {
  20891. window.expressionEdition = false;
  20892. command.expression = parsed;
  20893. renderAlgorithm();
  20894. }
  20895. });
  20896. input.insertAfter(afterWhichElement);
  20897. input.focus();
  20898. cancel_button.insertAfter(input);
  20899. ok_button.insertAfter(input);
  20900. var len = text.length;
  20901. input[0].setSelectionRange(len, len);
  20902. afterWhichElement.css('display', 'none');
  20903. lockButton.css('display', 'none');
  20904. editButton.css('display', 'none');
  20905. ok_button.popup({
  20906. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  20907. delay: {
  20908. show: 750,
  20909. hide: 0
  20910. }
  20911. });
  20912. cancel_button.popup({
  20913. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  20914. delay: {
  20915. show: 750,
  20916. hide: 0
  20917. }
  20918. });
  20919. });
  20920. whiletrue_dom.find('.minimize_block_button').on('click', function (evt) {
  20921. whiletrue_dom.children('.ui.block_commands').toggle();
  20922. command.collapsed = !command.collapsed;
  20923. });
  20924. $(whiletrue_dom.find('.textual_expression')[0]).toggle();
  20925. whiletrue_dom.find('.button_alternate_expression').on('click', function () {
  20926. if (command.expression) {
  20927. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.expression);
  20928. if (text) {
  20929. $(whiletrue_dom.find('.conditional_expression')[0]).toggle();
  20930. $(whiletrue_dom.find('.textual_expression')[0]).text(text);
  20931. $(whiletrue_dom.find('.textual_expression')[0]).toggle();
  20932. $(this).toggleClass('unlock').toggleClass('lock');
  20933. command.lockexpression = !command.lockexpression;
  20934. }
  20935. }
  20936. if (command.lockexpression) {
  20937. whiletrue_dom.find('.lock').popup({
  20938. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_unlock_expression"),
  20939. delay: {
  20940. show: 750,
  20941. hide: 0
  20942. }
  20943. });
  20944. } else {
  20945. whiletrue_dom.find('.unlock').popup({
  20946. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("text_lock_expression"),
  20947. delay: {
  20948. show: 750,
  20949. hide: 0
  20950. }
  20951. });
  20952. }
  20953. });
  20954. whiletrue_dom.find('.button_remove_command').on('click', function () {
  20955. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, whiletrue_dom)) {
  20956. whiletrue_dom.fadeOut(400, function () {
  20957. whiletrue_dom.remove();
  20958. });
  20959. }
  20960. });
  20961. }
  20962. /***/ }),
  20963. /***/ "./js/visualUI/commands/writer.js":
  20964. /*!****************************************!*\
  20965. !*** ./js/visualUI/commands/writer.js ***!
  20966. \****************************************/
  20967. /*! exports provided: createFloatingCommand, renderCommand, addContent */
  20968. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20969. "use strict";
  20970. __webpack_require__.r(__webpack_exports__);
  20971. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  20972. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  20973. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContent", function() { return addContent; });
  20974. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  20975. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  20976. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  20977. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  20978. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  20979. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../code_generator */ "./js/visualUI/code_generator.js");
  20980. function createFloatingCommand() {
  20981. 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>");
  20982. }
  20983. function renderCommand(command, function_obj) {
  20984. 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>");
  20985. var el = $(ret);
  20986. el.data("command", command); //renderExpression (command, function_obj, div_to_render, expression_array)
  20987. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find(".all_elements_write"), command.content);
  20988. addHandlers(command, function_obj, el);
  20989. if (command.content && command.lockexpression) {
  20990. try {
  20991. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.content);
  20992. if (text) {
  20993. $(el.find('.all_elements_write')[0]).toggle();
  20994. $(el.find('.textual_expression')[0]).text(text);
  20995. $(el.find('.textual_expression')[0]).toggle();
  20996. $(el.find('.button_alternate_expression')[0]).toggleClass('unlock').toggleClass('lock');
  20997. }
  20998. } catch (e) {
  20999. command.lockexpression = false;
  21000. }
  21001. }
  21002. el.find('.unlock').popup({
  21003. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  21004. delay: {
  21005. show: 750,
  21006. hide: 0
  21007. }
  21008. });
  21009. el.find('.lock').popup({
  21010. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  21011. delay: {
  21012. show: 750,
  21013. hide: 0
  21014. }
  21015. });
  21016. el.find('.button_write_expression').popup({
  21017. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression"),
  21018. delay: {
  21019. show: 750,
  21020. hide: 0
  21021. }
  21022. });
  21023. return el;
  21024. }
  21025. function addHandlersManager(command, _function_obj, _writer_dom, item_div, content_element) {
  21026. item_div.find(".times").on("click", function () {
  21027. for (var i = 0; i < command.content.length; i++) {
  21028. if (command.content[i] == content_element) {
  21029. delete command.content[i];
  21030. command.content.splice(i, 1);
  21031. item_div.children().off();
  21032. item_div.off();
  21033. item_div.fadeOut();
  21034. if (command.content.length > 0) {
  21035. item_div.next(".icon_add_item_to_writer").fadeOut();
  21036. }
  21037. break;
  21038. }
  21039. }
  21040. });
  21041. }
  21042. function addHandlers(command, function_obj, writer_dom) {
  21043. $(writer_dom.find('.textual_expression')[0]).toggle();
  21044. writer_dom.find('.button_write_expression').on('click', function () {
  21045. window.expressionEdition = true;
  21046. window.inputExpression = null;
  21047. var afterWhichElement;
  21048. var lockButton = $(writer_dom.find('.button_alternate_expression')[0]);
  21049. var editButton = $(this);
  21050. afterWhichElement = writer_dom.find('.all_elements_write');
  21051. if (command.lockexpression) {
  21052. afterWhichElement = writer_dom.find('.textual_expression');
  21053. }
  21054. var text = "";
  21055. if (command.content) {
  21056. if (command.content.length == 1 && command.content[0].content == null && !command.content[0].function_called) {
  21057. text = "";
  21058. } else {
  21059. try {
  21060. text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.content);
  21061. } catch (ex) {
  21062. text = "";
  21063. }
  21064. }
  21065. }
  21066. var ok_button = $('<i class="ui icon check circle expression-edit-confirm"></i>');
  21067. var cancel_button = $('<i class="ui icon undo expression-edit-cancel"></i>');
  21068. var input = $('<input type="text" spellcheck="false" autocomplete="off" class="input-expression-field" >');
  21069. input.val(text);
  21070. input.focusout(function (evt) {
  21071. ok_button.click();
  21072. evt.preventDefault();
  21073. return true;
  21074. });
  21075. input.keyup(function (evt) {
  21076. if (evt.keyCode == 27) {
  21077. // esc
  21078. cancel_button.click();
  21079. }
  21080. if (evt.keyCode == 13) {
  21081. // enter
  21082. ok_button.click();
  21083. }
  21084. });
  21085. ok_button.click(function () {
  21086. var parsed = null;
  21087. parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](input.val(), function_obj, input);
  21088. if (parsed) {
  21089. window.expressionEdition = false;
  21090. command.content = parsed;
  21091. renderAlgorithm();
  21092. }
  21093. });
  21094. cancel_button.mousedown(function (evt) {
  21095. var parsed = _generic_expression__WEBPACK_IMPORTED_MODULE_4__["expressionParserToVisual"](text, function_obj, input);
  21096. if (parsed) {
  21097. window.expressionEdition = false;
  21098. command.content = parsed;
  21099. renderAlgorithm();
  21100. }
  21101. });
  21102. input.insertAfter(afterWhichElement);
  21103. input.focus();
  21104. cancel_button.insertAfter(input);
  21105. ok_button.insertAfter(input);
  21106. var len = text.length;
  21107. input[0].setSelectionRange(len, len);
  21108. afterWhichElement.css('display', 'none');
  21109. lockButton.css('display', 'none');
  21110. editButton.css('display', 'none');
  21111. ok_button.popup({
  21112. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression_confirm"),
  21113. delay: {
  21114. show: 750,
  21115. hide: 0
  21116. }
  21117. });
  21118. cancel_button.popup({
  21119. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_edit_expression_cancel"),
  21120. delay: {
  21121. show: 750,
  21122. hide: 0
  21123. }
  21124. });
  21125. });
  21126. writer_dom.find('.button_alternate_expression').on('click', function () {
  21127. if (command.content) {
  21128. var text = _code_generator__WEBPACK_IMPORTED_MODULE_5__["elementExpressionCode"](command.content);
  21129. if (text) {
  21130. $(writer_dom.find('.all_elements_write')[0]).toggle();
  21131. $(writer_dom.find('.textual_expression')[0]).text(text);
  21132. $(writer_dom.find('.textual_expression')[0]).toggle();
  21133. $(this).toggleClass('unlock').toggleClass('lock');
  21134. command.lockexpression = !command.lockexpression;
  21135. }
  21136. if (command.lockexpression) {
  21137. writer_dom.find('.lock').popup({
  21138. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_unlock_expression"),
  21139. delay: {
  21140. show: 750,
  21141. hide: 0
  21142. }
  21143. });
  21144. } else {
  21145. writer_dom.find('.unlock').popup({
  21146. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_lock_expression"),
  21147. delay: {
  21148. show: 750,
  21149. hide: 0
  21150. }
  21151. });
  21152. }
  21153. }
  21154. });
  21155. writer_dom.find(".button_remove_command").on("click", function () {
  21156. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, writer_dom)) {
  21157. writer_dom.fadeOut(400, function () {
  21158. writer_dom.remove();
  21159. });
  21160. }
  21161. });
  21162. Sortable.create(writer_dom.find(".all_elements_write")[0], {
  21163. handle: ".ellipsis",
  21164. animation: 100,
  21165. ghostClass: "ghost",
  21166. group: "writer_" + Math.floor(Math.random() * 10000000),
  21167. draggable: ".div_parent_handler",
  21168. onEnd: function onEnd(evt) {
  21169. command.content.splice(evt.newIndex, 0, command.content.splice(evt.oldIndex, 1)[0]);
  21170. writer_dom.empty();
  21171. writer_dom.replaceWith(renderCommand(command, function_obj));
  21172. }
  21173. }); // Attach event handles for the newline button
  21174. var newlineBtn = writer_dom.find(".ivprog_newline_btn");
  21175. newlineBtn.on("click", function () {
  21176. var state = this.dataset.state;
  21177. if (state === "on") {
  21178. this.dataset.state = "off";
  21179. command.newline = false;
  21180. this.setAttribute("src", "img/no_new_line.svg");
  21181. } else {
  21182. this.dataset.state = "on";
  21183. command.newline = true;
  21184. this.setAttribute("src", "img/new_line.svg");
  21185. }
  21186. writer_dom.data("command", command);
  21187. setPopup(newlineBtn, command.newline);
  21188. }); // Attach jquery popup
  21189. setPopup(newlineBtn, command.newline);
  21190. }
  21191. function setPopup(element, state) {
  21192. if (element.popup("exists")) {
  21193. element.popup("destroy");
  21194. }
  21195. 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");
  21196. element.popup({
  21197. content: content,
  21198. delay: {
  21199. show: 750,
  21200. hide: 0
  21201. }
  21202. });
  21203. }
  21204. function _addHandlerIconAdd(dom_object, command, function_obj) {
  21205. var insert_after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  21206. var after_which = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  21207. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  21208. if (!insert_after) {
  21209. dom_object.append(icon_add_item);
  21210. } else {
  21211. icon_add_item.insertAfter(after_which);
  21212. }
  21213. icon_add_item.on("click", function (_event) {
  21214. var div_parent_with_handler = $('<div class="div_parent_handler" style="display:none;"></div>');
  21215. var new_div_item = $('<div class="var_value_menu_div"></div>');
  21216. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  21217. div_parent_with_handler.append(new_div_item);
  21218. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  21219. div_parent_with_handler.insertAfter(icon_add_item);
  21220. 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);
  21221. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  21222. addHandlerIconAdd(dom_object, command, function_obj, true, div_parent_with_handler);
  21223. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  21224. var pos = 1;
  21225. dom_object.find(".icon_add_item_to_writer").each(function () {
  21226. if ($(this).get(0) === icon_add_item.get(0)) {
  21227. command.content.splice(pos, 0, new_related_menu);
  21228. } else {
  21229. pos++;
  21230. }
  21231. });
  21232. if (command.content.length == 1) {
  21233. icon_add_item.remove();
  21234. }
  21235. div_parent_with_handler.fadeIn();
  21236. });
  21237. }
  21238. function addContent(command, _ref_object, dom_object, _menu_var_or_value, function_obj, _ref_object_content) {
  21239. if (dom_object.hasClass("var_value_menu_div")) {
  21240. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  21241. icon_add_item.insertAfter(dom_object);
  21242. icon_add_item.on("click", function (_event) {
  21243. var div_parent_with_handler = $('<div class="div_parent_handler"></div>');
  21244. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  21245. div_parent_with_handler.append(new_div_item);
  21246. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  21247. div_parent_with_handler.insertAfter(icon_add_item);
  21248. 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);
  21249. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  21250. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  21251. command.content.push(new_related_menu);
  21252. if (command.content.length == 1) {
  21253. icon_add_item.remove();
  21254. }
  21255. });
  21256. }
  21257. }
  21258. /***/ }),
  21259. /***/ "./js/visualUI/functions.js":
  21260. /*!**********************************!*\
  21261. !*** ./js/visualUI/functions.js ***!
  21262. \**********************************/
  21263. /*! exports provided: renderFunction, initVisualUI, setTestCases, getTestCases, addFunctionChangeListener, addGlobalChangeListener, removeGlobalListener, removeFunctionListener */
  21264. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21265. "use strict";
  21266. __webpack_require__.r(__webpack_exports__);
  21267. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderFunction", function() { return renderFunction; });
  21268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return initVisualUI; });
  21269. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestCases", function() { return setTestCases; });
  21270. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return getTestCases; });
  21271. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return addFunctionChangeListener; });
  21272. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return addGlobalChangeListener; });
  21273. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return removeGlobalListener; });
  21274. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return removeFunctionListener; });
  21275. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  21276. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  21277. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  21278. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  21279. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variables */ "./js/visualUI/variables.js");
  21280. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands */ "./js/visualUI/commands.js");
  21281. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./code_generator */ "./js/visualUI/code_generator.js");
  21282. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  21283. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  21284. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  21285. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  21286. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__);
  21287. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  21288. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  21289. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  21290. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  21291. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  21292. /* harmony import */ var _ima_version_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../.ima_version.json */ "./.ima_version.json");
  21293. var _ima_version_json__WEBPACK_IMPORTED_MODULE_16___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./../../.ima_version.json */ "./.ima_version.json", 1);
  21294. /* harmony import */ var _text_editor__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./text_editor */ "./js/visualUI/text_editor.js");
  21295. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  21296. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../processor/modes */ "./js/processor/modes.ts");
  21297. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_processor_modes__WEBPACK_IMPORTED_MODULE_19__);
  21298. var counter_new_functions = 0;
  21299. var counter_new_parameters = 0;
  21300. var ivprog_version = _ima_version_json__WEBPACK_IMPORTED_MODULE_16__.version;
  21301. var globalChangeListeners = [];
  21302. var functionsChangeListeners = [];
  21303. var proc = null;
  21304. var domConsole = null;
  21305. var _testCases = [];
  21306. var isRunning = false;
  21307. window.studentGrade = null;
  21308. window.LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"];
  21309. var program = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Program"]();
  21310. window.system_functions = []; // Adding math functions:
  21311. 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));
  21312. 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));
  21313. 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));
  21314. 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));
  21315. 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));
  21316. 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));
  21317. 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));
  21318. 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));
  21319. 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));
  21320. 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));
  21321. 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));
  21322. 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:
  21323. 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));
  21324. 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));
  21325. 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));
  21326. 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));
  21327. 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:
  21328. 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));
  21329. 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));
  21330. 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:
  21331. 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));
  21332. 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));
  21333. 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));
  21334. 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));
  21335. 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));
  21336. 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));
  21337. 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));
  21338. 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));
  21339. 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');
  21340. 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);
  21341. mainFunction.function_comment = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Comment"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment_main'));
  21342. program.addFunction(mainFunction);
  21343. window.program_obj = program;
  21344. window.generator = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"];
  21345. window.runCodeAssessment = runCodeAssessment;
  21346. window.renderAlgorithm = _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"];
  21347. window.insertContext = false;
  21348. window.watchW = melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a;
  21349. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.globals, function () {
  21350. if (window.insertContext) {
  21351. setTimeout(function () {
  21352. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  21353. globalChangeListeners.forEach(function (x) {
  21354. return x();
  21355. });
  21356. }, 300);
  21357. window.insertContext = false;
  21358. } else {
  21359. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  21360. globalChangeListeners.forEach(function (x) {
  21361. return x();
  21362. });
  21363. }
  21364. }, 1);
  21365. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.functions, function () {
  21366. if (window.insertContext) {
  21367. setTimeout(function () {
  21368. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  21369. functionsChangeListeners.forEach(function (x) {
  21370. return x();
  21371. });
  21372. }, 300);
  21373. window.insertContext = false;
  21374. } else {
  21375. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  21376. functionsChangeListeners.forEach(function (x) {
  21377. return x();
  21378. });
  21379. }
  21380. }, 1);
  21381. function addFunctionHandler() {
  21382. 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')));
  21383. program.addFunction(new_function);
  21384. counter_new_functions++;
  21385. window.insertContext = true;
  21386. 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);
  21387. renderFunction(new_function);
  21388. /*newe.css('display', 'none');
  21389. newe.fadeIn();*/
  21390. }
  21391. function addParameter(function_obj, function_container
  21392. /*, is_from_click = false*/
  21393. ) {
  21394. if (function_obj.parameters_list == null) {
  21395. function_obj.parameters_list = [];
  21396. }
  21397. 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);
  21398. function_obj.parameters_list.push(new_parameter);
  21399. counter_new_parameters++;
  21400. 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);
  21401. renderParameter(function_obj, new_parameter, function_container); // if (is_from_click) {
  21402. // newe.css('display', 'none');
  21403. // newe.fadeIn();
  21404. // }
  21405. }
  21406. function updateReturnType(function_obj, new_type) {
  21407. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  21408. 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);
  21409. function_obj.return_type = new_type;
  21410. function_obj.return_dimensions = new_dimensions;
  21411. }
  21412. function removeFunction(function_obj) {
  21413. var index = program.functions.indexOf(function_obj);
  21414. if (index > -1) {
  21415. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION);
  21416. program.functions.splice(index, 1);
  21417. }
  21418. }
  21419. function minimizeFunction(function_obj) {
  21420. function_obj.is_hidden = !function_obj.is_hidden;
  21421. }
  21422. function addHandlers(function_obj, function_container) {
  21423. function_container.find('.ui.dropdown.function_return').dropdown({
  21424. onChange: function onChange(value, text, $selectedItem) {
  21425. if ($selectedItem.data('dimensions')) {
  21426. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  21427. } else {
  21428. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  21429. }
  21430. },
  21431. selectOnKeydown: false
  21432. });
  21433. function_container.find(".name_function_updated").on('click', function (e) {
  21434. enableNameFunctionUpdate(function_obj, function_container);
  21435. });
  21436. function_container.find(".add_parameter_button").on('click', function (e) {
  21437. window.insertContext = true;
  21438. addParameter(function_obj, function_container, true);
  21439. });
  21440. function_container.find('.menu_commands').dropdown({
  21441. on: 'hover'
  21442. });
  21443. function_container.find('.menu_commands a').on('click', function (evt) {
  21444. if (function_obj.commands == null || function_obj.commands.length == 0) {
  21445. function_obj.commands = [];
  21446. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_5__["genericCreateCommand"]($(this).data('command'));
  21447. function_obj.commands.push(new_cmd);
  21448. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](new_cmd, function_container.find('.commands_list_div'), 3, function_obj);
  21449. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, $(this).data('command'), '/', 0);
  21450. } else {
  21451. _commands__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"](function_obj, function_container, $(this).data('command'), evt);
  21452. }
  21453. });
  21454. function_container.find('.add_var_button_function').on('click', function (e) {
  21455. window.insertContext = true;
  21456. _variables__WEBPACK_IMPORTED_MODULE_4__["addVariable"](function_obj, function_container, true);
  21457. });
  21458. function_container.find('.remove_function_button').on('click', function (e) {
  21459. removeFunction(function_obj);
  21460. function_container.fadeOut();
  21461. });
  21462. function_container.find('.minimize_function_button').on('click', function (e) {
  21463. minimizeFunction(function_obj);
  21464. if (function_obj.is_hidden) {
  21465. function_container.find(".add_var_button_function").toggle();
  21466. function_container.find(".inline_add_command").toggle();
  21467. function_container.find(".function_area").slideToggle();
  21468. } else {
  21469. function_container.find(".function_area").slideToggle(function () {
  21470. function_container.find(".add_var_button_function").toggle();
  21471. function_container.find(".inline_add_command").toggle();
  21472. });
  21473. }
  21474. });
  21475. } // Essa função imprime o tipo de retorno da função e cria o menu do tipo 'select' para alteração
  21476. function renderFunctionReturn(function_obj, function_element) {
  21477. var ret = '<div class="ui dropdown function_return">';
  21478. if (function_obj.return_dimensions == 1) {
  21479. 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()));
  21480. ret += ' [ ] </div>';
  21481. } else if (function_obj.return_dimensions == 2) {
  21482. 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()));
  21483. ret += ' [ ] [ ] </div>';
  21484. } else {
  21485. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase())) + '</div>';
  21486. }
  21487. ret += '<div class="menu">';
  21488. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21489. 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>';
  21490. }
  21491. 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">';
  21492. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21493. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21494. continue;
  21495. }
  21496. 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>';
  21497. }
  21498. ret += '</div></div>';
  21499. 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">';
  21500. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21501. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21502. continue;
  21503. }
  21504. 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>';
  21505. }
  21506. ret += '</div></div>';
  21507. ret += '</div></div>';
  21508. ret = $(ret);
  21509. function_element.find('.function_return').append(ret);
  21510. }
  21511. var cont = 0;
  21512. function renderFunction(function_obj) {
  21513. var appender = '<div class="ui secondary segment function_div list-group-item function_cont_' + cont + '">';
  21514. if (function_obj.function_comment) {//appender += renderComment(function_obj.function_comment, sequence, true, -1);
  21515. }
  21516. appender += '<span class="glyphicon glyphicon-move move_function" aria-hidden="true"><i class="icon sort alternate vertical"></i></span>';
  21517. 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>';
  21518. appender += '<div class="function_signature_div">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + ' ';
  21519. if (function_obj.is_main) {
  21520. 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">';
  21521. } else {
  21522. appender += '<div class="ui function_return"></div>';
  21523. 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">';
  21524. }
  21525. appender += '</div> <span class="parethesis_function"> ) </span> </div>' + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ');
  21526. appender += '<div class="ui add_var_context add_var_button_function" style="float: left;"> <div class="ui icon button purple"> ';
  21527. 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>';
  21528. appender += '</div></div>';
  21529. appender += '<div class="ui top attached segment variables_list_div"></div>';
  21530. 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;">';
  21531. 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"> ';
  21532. 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>';
  21533. appender += '</div></div>' + '</div>';
  21534. appender += '</div></div>';
  21535. appender = $(appender);
  21536. $('.all_functions').append(appender);
  21537. appender.data('fun', function_obj);
  21538. appender.find('.commands_list_div').data('fun', function_obj);
  21539. renderFunctionReturn(function_obj, appender);
  21540. addHandlers(function_obj, appender); // Rendering parameters:
  21541. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  21542. renderParameter(function_obj, function_obj.parameters_list[j], appender);
  21543. } // Rendering variables:
  21544. for (var j = 0; j < function_obj.variables_list.length; j++) {
  21545. _variables__WEBPACK_IMPORTED_MODULE_4__["renderVariable"](appender, function_obj.variables_list[j], function_obj);
  21546. } // Rendering commands:
  21547. for (var j = 0; j < function_obj.commands.length; j++) {
  21548. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](function_obj.commands[j], $(appender.find('.commands_list_div')[0]), 3, function_obj);
  21549. }
  21550. $('.minimize_function_button').popup({
  21551. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_hide_function"),
  21552. delay: {
  21553. show: 750,
  21554. hide: 0
  21555. }
  21556. });
  21557. var function_index = program.functions.indexOf(function_obj);
  21558. Sortable.create(appender.find(".variables_list_div")[0], {
  21559. handle: '.ellipsis',
  21560. animation: 100,
  21561. ghostClass: 'ghost',
  21562. group: 'local_vars_drag_' + function_index,
  21563. onEnd: function onEnd(evt) {
  21564. updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
  21565. }
  21566. });
  21567. addSortableHandler(appender.find(".commands_list_div")[0], function_index);
  21568. if (!function_obj.is_main) {
  21569. Sortable.create(appender.find(".container_parameters_list")[0], {
  21570. handle: '.ellipsis',
  21571. animation: 100,
  21572. ghostClass: 'ghost',
  21573. group: 'parameters_drag_' + program.functions.indexOf(function_obj),
  21574. onEnd: function onEnd(evt) {
  21575. updateSequenceParameters(evt.oldIndex, evt.newIndex, function_obj);
  21576. }
  21577. });
  21578. }
  21579. if (function_obj.commands.length > 0) {
  21580. var teste = '.ui.sticky.sticky_cont_' + cont;
  21581. $(teste).sticky({
  21582. context: '.ui.bottom.attached.segment.commands_list_div.commands_cont_' + cont,
  21583. scrollContext: '.ivprog_visual_panel',
  21584. observeChanges: true,
  21585. offset: 40,
  21586. onStick: function onStick(evt) {
  21587. $(teste).css('top', '20px', 'important');
  21588. },
  21589. onBottom: function onBottom(evt) {
  21590. $(teste).css('top', '20px', 'important');
  21591. },
  21592. onUnstick: function onUnstick(evt) {
  21593. $(teste).css('top', '20px', 'important');
  21594. },
  21595. onReposition: function onReposition(evt) {
  21596. $(teste).css('top', '20px', 'important');
  21597. },
  21598. onScroll: function onScroll(evt) {
  21599. $(teste).css('top', '20px', 'important');
  21600. if (!isVisible($(teste), $(teste).parent())) {
  21601. $(teste).removeClass('fixed');
  21602. }
  21603. },
  21604. onTop: function onTop(evt) {
  21605. $(teste).css('top', '20px', 'important');
  21606. }
  21607. });
  21608. }
  21609. cont++;
  21610. appender.find('.add_parameter_button').popup({
  21611. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_add_parameters"),
  21612. delay: {
  21613. show: 750,
  21614. hide: 0
  21615. }
  21616. });
  21617. return appender;
  21618. }
  21619. function isVisible(element, container) {
  21620. var elementTop = $(element).offset().top,
  21621. elementHeight = $(element).height(),
  21622. containerTop = $(container).offset().top,
  21623. containerHeight = $(container).height() - 30;
  21624. return elementTop - containerTop + elementHeight > 0 && elementTop - containerTop < containerHeight;
  21625. }
  21626. window.evento_drag;
  21627. function updateProgramObjDrag() {
  21628. var nodes = Array.prototype.slice.call($('.all_functions').children());
  21629. var function_index;
  21630. var start_index;
  21631. var function_obj;
  21632. $(evento_drag.item).parentsUntil(".all_functions").each(function (index) {
  21633. var ref = $(this);
  21634. if (ref.hasClass('function_div')) {
  21635. function_index = nodes.indexOf(this);
  21636. start_index = index;
  21637. function_obj = ref;
  21638. }
  21639. });
  21640. var path_target = [];
  21641. $(evento_drag.item).parentsUntil(".all_functions").each(function () {
  21642. if ($(this).hasClass('command_container')) {
  21643. path_target.push(this);
  21644. }
  21645. });
  21646. if (path_target.length == 0) {//console.log('soltou na raiz, na posição: ' + evento_drag.newIndex + ' mas ainda não sei de onde saiu ');
  21647. } else {//console.log('soltou dentro de algum bloco, sequência vem logo abaixo (de baixo pra cima): ');
  21648. //console.log(path_target);
  21649. }
  21650. var index_each = [];
  21651. var path_relative = [];
  21652. for (var i = path_target.length - 1; i >= 0; i--) {
  21653. if (i == path_target.length - 1) {
  21654. // está na raiz
  21655. var indice_na_raiz = function_obj.find('.command_container').index(path_target[i]);
  21656. } else {
  21657. if ($(path_target[i + 1]).hasClass('iftrue')) {
  21658. if ($(path_target[i]).parent().hasClass('commands_if')) {
  21659. path_relative.push('if');
  21660. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  21661. } else {
  21662. path_relative.push('else');
  21663. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  21664. }
  21665. } else if ($(path_target[i + 1]).hasClass('dowhiletrue')) {
  21666. path_relative.push('dowhiletrue');
  21667. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  21668. } else if ($(path_target[i + 1]).hasClass('repeatNtimes')) {
  21669. path_relative.push('repeatNtimes');
  21670. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  21671. } else if ($(path_target[i + 1]).hasClass('whiletrue')) {
  21672. path_relative.push('whiletrue');
  21673. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  21674. } else if ($(path_target[i + 1]).hasClass('switch')) {
  21675. path_relative.push('switch'); //index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  21676. }
  21677. }
  21678. } // var index_in_block = -1;
  21679. 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);
  21680. var is_in_case_switch = $(evento_drag.item).parent().hasClass('case_commands_block'); // encontrar o elemento na árvore:
  21681. var command_start_point = window.program_obj.functions[function_index].commands[indice_na_raiz];
  21682. var block_to_insert = command_start_point;
  21683. for (var i = 0; i < index_each.length; i++) {
  21684. if (path_relative[i] == "else") {
  21685. block_to_insert = block_to_insert.commands_else[index_each[i]];
  21686. } else if (path_relative[i] == "switch") {} else {
  21687. block_to_insert = block_to_insert.commands_block[index_each[i]];
  21688. }
  21689. } //console.log('command_start_point', command_start_point);
  21690. //console.log('block_to_insert', block_to_insert);
  21691. // agora tem que alocar o comando na árvore, mas considerar as quatro situações:
  21692. // (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.
  21693. if (path_target.length == 0) {
  21694. // soltou na raiz:
  21695. window.program_obj.functions[function_index].commands.splice(evento_drag.newIndex - 1, 0, command_in_drag);
  21696. } else if (is_in_else) {
  21697. if (block_to_insert.commands_else) {
  21698. block_to_insert.commands_else.splice(evento_drag.newIndex, 0, command_in_drag);
  21699. } else {
  21700. block_to_insert.commands_else = [];
  21701. block_to_insert.commands_else.push(command_in_drag);
  21702. }
  21703. } else if (is_in_case_switch) {} else {
  21704. // verificar se tem alguma coisa no bloco:
  21705. if (block_to_insert.commands_block) {
  21706. block_to_insert.commands_block.splice(evento_drag.newIndex, 0, command_in_drag);
  21707. } else {
  21708. block_to_insert.commands_block = [];
  21709. block_to_insert.commands_block.push(command_in_drag);
  21710. }
  21711. }
  21712. window.draging = false;
  21713. renderAlgorithm();
  21714. }
  21715. function prepareDragHandler(evt) {
  21716. window.draging = true;
  21717. var nodes = Array.prototype.slice.call($('.all_functions').children());
  21718. var function_index;
  21719. var function_obj;
  21720. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  21721. if ($(this).hasClass('function_div')) {
  21722. function_index = nodes.indexOf(this);
  21723. function_obj = window.program_obj.functions[function_index];
  21724. }
  21725. });
  21726. command_in_drag = $(evt.item).data("command"); //console.log('$(evt.item).parent(): ');
  21727. //console.log($(evt.item).parent());
  21728. // descobrir qual das quatro situações:
  21729. if ($(evt.item).parent().hasClass('commands_list_div')) {
  21730. // está na raiz:
  21731. if (function_obj.commands.indexOf(command_in_drag) > -1) {
  21732. function_obj.commands.splice(function_obj.commands.indexOf(command_in_drag), 1);
  21733. }
  21734. } else if ($(evt.item).parent().hasClass('commands_else')) {
  21735. // está no else:
  21736. if ($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag) > -1) {
  21737. $(evt.item).parent().data('command').commands_else.splice($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag), 1);
  21738. }
  21739. } else if ($(evt.item).parent().hasClass('case_commands_block')) {// está em um switch:
  21740. } else {
  21741. // caso padrão:
  21742. if ($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag) > -1) {
  21743. $(evt.item).parent().data('command').commands_block.splice($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag), 1);
  21744. }
  21745. }
  21746. }
  21747. var command_in_drag;
  21748. function addSortableHandler(element, id_function) {
  21749. var n_group = 'commands_drag_' + id_function;
  21750. Sortable.create(element, {
  21751. handle: '.command_drag',
  21752. ghostClass: 'ghost',
  21753. animation: 300,
  21754. group: {
  21755. name: n_group
  21756. },
  21757. onEnd: function onEnd(evt) {
  21758. var nodes = Array.prototype.slice.call($('.all_functions').children());
  21759. var function_index;
  21760. var function_obj;
  21761. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  21762. if ($(this).hasClass('function_div')) {
  21763. function_index = nodes.indexOf(this);
  21764. function_obj = window.program_obj.functions[function_index];
  21765. }
  21766. });
  21767. 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);
  21768. var itemEl = evt.item; // dragged HTMLElement
  21769. evt.to; // target list
  21770. evt.from; // previous list
  21771. evt.oldIndex; // element's old index within old parent
  21772. evt.newIndex; // element's new index within new parent
  21773. //console.log('::EVT::');
  21774. //console.log(evt);
  21775. window.evento_drag = evt;
  21776. try {
  21777. updateProgramObjDrag();
  21778. } catch (e) {
  21779. console.error(e);
  21780. window.draging = false;
  21781. }
  21782. },
  21783. onStart: function onStart(evt) {
  21784. //console.log("START::EVT::");
  21785. //console.log(evt);
  21786. //console.log("\n\ncommand_in_drag");
  21787. try {
  21788. prepareDragHandler(evt);
  21789. } catch (e) {
  21790. window.draging = false;
  21791. }
  21792. }
  21793. });
  21794. element = $(element);
  21795. element.find(".iftrue").each(function (index) {
  21796. addSortableHandler($(this).find(".block_commands")[0], id_function);
  21797. addSortableHandler($(this).find(".block_commands")[1], id_function);
  21798. });
  21799. element.find(".repeatNtimes").each(function (index) {
  21800. addSortableHandler($(this).find(".block_commands")[0], id_function);
  21801. });
  21802. element.find(".dowhiletrue").each(function (index) {
  21803. addSortableHandler($(this).find(".block_commands")[0], id_function);
  21804. });
  21805. element.find(".whiletrue").each(function (index) {
  21806. addSortableHandler($(this).find(".block_commands")[0], id_function);
  21807. });
  21808. element.find(".switch").each(function (index) {
  21809. $(this).find(".case_div").each(function (index) {
  21810. addSortableHandler($(this).find(".case_commands_block")[0], id_function);
  21811. });
  21812. });
  21813. }
  21814. function initVisualUI() {
  21815. // MUST USE CONST, LET, OR VAR !!!!!!
  21816. // const mainDiv = $('#visual-main-div');
  21817. // fill mainDiv with functions and globals...
  21818. // renderAlgorithm()...
  21819. domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_8__["DOMConsole"]("ivprog-term-div");
  21820. domConsole.hide();
  21821. $(document.getElementById("ivprog-term-div")).draggable();
  21822. $('.add_function_button').on('click', function () {
  21823. addFunctionHandler();
  21824. }).popup({
  21825. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_add_function"),
  21826. delay: {
  21827. show: 750,
  21828. hide: 0
  21829. }
  21830. });
  21831. $('.add_global_button').on('click', function () {
  21832. window.insertContext = true;
  21833. _globals__WEBPACK_IMPORTED_MODULE_3__["addGlobal"](program, true);
  21834. });
  21835. $('#run_button').on('click', function () {
  21836. showStopButton();
  21837. runCode();
  21838. });
  21839. $('#stop_button').on('click', function () {
  21840. showRunButton();
  21841. stopExecution();
  21842. });
  21843. $('.visual_coding_button').on('click', function () {
  21844. toggleVisualCoding();
  21845. });
  21846. $('.textual_coding_button').on('click', function () {
  21847. toggleTextualCoding();
  21848. });
  21849. $('.assessment').on('click', function () {
  21850. is_iassign = true;
  21851. runCodeAssessment();
  21852. });
  21853. $('.div_toggle_console').on('click', function () {
  21854. toggleConsole();
  21855. });
  21856. $('.expand_button').on('click', function () {
  21857. full_screen();
  21858. });
  21859. $('.help_button').on('click', function () {
  21860. window.open('https://www.usp.br/line/ivprog/', '_blank');
  21861. });
  21862. $('.main_title h2').prop('title', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_ivprog_description'));
  21863. var time_show = 750;
  21864. $('.visual_coding_button').popup({
  21865. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_visual"),
  21866. delay: {
  21867. show: time_show,
  21868. hide: 0
  21869. }
  21870. });
  21871. $('.textual_coding_button').popup({
  21872. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_textual"),
  21873. delay: {
  21874. show: time_show,
  21875. hide: 0
  21876. }
  21877. });
  21878. $('.upload_file_button').popup({
  21879. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_upload"),
  21880. delay: {
  21881. show: time_show,
  21882. hide: 0
  21883. }
  21884. });
  21885. $('.download_file_button').popup({
  21886. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_download"),
  21887. delay: {
  21888. show: time_show,
  21889. hide: 0
  21890. }
  21891. });
  21892. $('.undo_button').popup({
  21893. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_undo"),
  21894. delay: {
  21895. show: time_show,
  21896. hide: 0
  21897. }
  21898. });
  21899. $('.redo_button').popup({
  21900. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_redo"),
  21901. delay: {
  21902. show: time_show,
  21903. hide: 0
  21904. }
  21905. });
  21906. $('.run_button').popup({
  21907. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_run"),
  21908. delay: {
  21909. show: time_show,
  21910. hide: 0
  21911. }
  21912. });
  21913. $('.assessment_button').popup({
  21914. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_evaluate"),
  21915. delay: {
  21916. show: time_show,
  21917. hide: 0
  21918. }
  21919. });
  21920. $('.help_button').popup({
  21921. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_help") + ' - ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_ivprog_version") + ' ' + ivprog_version,
  21922. delay: {
  21923. show: time_show,
  21924. hide: 0
  21925. }
  21926. });
  21927. $('.add_global_button').popup({
  21928. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_add_global"),
  21929. delay: {
  21930. show: time_show,
  21931. hide: 0
  21932. }
  21933. });
  21934. $('.div_toggle_console').popup({
  21935. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_console"),
  21936. delay: {
  21937. show: time_show,
  21938. hide: 0
  21939. }
  21940. });
  21941. Sortable.create(listWithHandle, {
  21942. handle: '.glyphicon-move',
  21943. animation: 100,
  21944. ghostClass: 'ghost',
  21945. group: 'functions_divs_drag',
  21946. onEnd: function onEnd(evt) {
  21947. updateSequenceFunction(evt.oldIndex, evt.newIndex);
  21948. }
  21949. });
  21950. var listGlobalsHandle = document.getElementById("listGlobalsHandle");
  21951. Sortable.create(listGlobalsHandle, {
  21952. handle: '.ellipsis',
  21953. animation: 100,
  21954. ghostClass: 'ghost',
  21955. group: 'globals_divs_drag',
  21956. onEnd: function onEnd(evt) {
  21957. updateSequenceGlobals(evt.oldIndex, evt.newIndex);
  21958. }
  21959. });
  21960. }
  21961. function setTestCases(testCases) {
  21962. _testCases = testCases;
  21963. }
  21964. function getTestCases() {
  21965. // Deep clone of test cases to avoid unauthorized modification
  21966. // TODO: It may be not possible to use this once custom test are fully implemented
  21967. return JSON.parse(JSON.stringify(_testCases));
  21968. }
  21969. var is_iassign = false;
  21970. function updateSequenceParameters(oldIndex, newIndex, function_obj) {
  21971. function_obj.parameters_list.splice(newIndex, 0, function_obj.parameters_list.splice(oldIndex, 1)[0]);
  21972. }
  21973. function updateSequenceLocals(oldIndex, newIndex, function_obj) {
  21974. function_obj.variables_list.splice(newIndex, 0, function_obj.variables_list.splice(oldIndex, 1)[0]);
  21975. }
  21976. function updateSequenceGlobals(oldIndex, newIndex) {
  21977. program_obj.globals.splice(newIndex, 0, program_obj.globals.splice(oldIndex, 1)[0]);
  21978. }
  21979. function updateSequenceFunction(oldIndex, newIndex) {
  21980. program_obj.functions.splice(newIndex, 0, program_obj.functions.splice(oldIndex, 1)[0]);
  21981. }
  21982. function runCodeAssessment() {
  21983. if (isRunning) {
  21984. // cannot run assessment or it's already running
  21985. return -1;
  21986. }
  21987. var strCode = null;
  21988. is_iassign = false;
  21989. window.studentGrade = null;
  21990. if (settingsProgrammingTypes == "textual") {
  21991. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  21992. } else {
  21993. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  21994. }
  21995. if (strCode == null) {
  21996. // No code, so no assessment
  21997. return -1;
  21998. }
  21999. toggleConsole(true);
  22000. try {
  22001. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  22002. isRunning = true;
  22003. var runner = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__["IVProgAssessment"](data, _testCases, domConsole);
  22004. runner.runTest().then(function (grade) {
  22005. if (!is_iassign) {
  22006. parent.getEvaluationCallback(grade);
  22007. } else {
  22008. is_iassign = false;
  22009. }
  22010. isRunning = false;
  22011. })["catch"](function (err) {
  22012. console.log(err);
  22013. isRunning = false;
  22014. });
  22015. } catch (error) {
  22016. isRunning = false;
  22017. domConsole.err(error.message);
  22018. console.log(error);
  22019. if (!is_iassign) {
  22020. parent.getEvaluationCallback(0);
  22021. } else {
  22022. is_iassign = false;
  22023. }
  22024. }
  22025. return 0;
  22026. }
  22027. function runCode() {
  22028. if (isRunning) {
  22029. return;
  22030. }
  22031. var strCode = null;
  22032. if (settingsProgrammingTypes == "textual") {
  22033. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  22034. } else {
  22035. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  22036. }
  22037. if (strCode == null) {
  22038. return;
  22039. }
  22040. toggleConsole(true); // if(domConsole == null)
  22041. // domConsole = new DOMConsole("#ivprog-term");
  22042. //$("#ivprog-term").slideDown(500);
  22043. try {
  22044. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  22045. proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__["IVProgProcessor"](data);
  22046. proc.registerInput(domConsole);
  22047. proc.registerOutput(domConsole);
  22048. $("#ivprog-term").addClass('ivprog-term-active');
  22049. isRunning = true;
  22050. proc.interpretAST().then(function (_) {
  22051. scheduleCall(function () {
  22052. if (domConsole.pending_writes.length == 0) {
  22053. if (proc.mode === _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT) {
  22054. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("aborted_execution"));
  22055. } else {
  22056. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("success_execution"));
  22057. }
  22058. $("#ivprog-term").removeClass('ivprog-term-active');
  22059. isRunning = false;
  22060. proc = null;
  22061. showRunButton();
  22062. return true;
  22063. }
  22064. return false;
  22065. }, 100);
  22066. })["catch"](function (err) {
  22067. scheduleCall(function () {
  22068. if (domConsole.pending_writes.length == 0) {
  22069. if (err instanceof Error) {
  22070. domConsole.err(err.message);
  22071. } else {
  22072. domConsole.err(err);
  22073. }
  22074. $("#ivprog-term").removeClass('ivprog-term-active');
  22075. isRunning = false;
  22076. proc = null;
  22077. showRunButton();
  22078. return true;
  22079. }
  22080. return false;
  22081. }, 100);
  22082. });
  22083. } catch (error) {
  22084. scheduleCall(function () {
  22085. if (domConsole.pending_writes.length == 0) {
  22086. isRunning = false;
  22087. proc = null;
  22088. showRunButton();
  22089. domConsole.err(error.message);
  22090. console.log(error);
  22091. return true;
  22092. }
  22093. return false;
  22094. }, 100);
  22095. }
  22096. }
  22097. function toggleConsole(is_running) {
  22098. if (is_running) {
  22099. $('.ivprog-term-div').css('display', 'block');
  22100. $('#ivprog-term').css('min-height', '160px');
  22101. if (domConsole != null) domConsole.focus(); //$('#ivprog-term').css('margin-top', '-170px');
  22102. return;
  22103. } else {
  22104. domConsole.hide();
  22105. return;
  22106. }
  22107. if ($('#ivprog-term').css('min-height') == '160px') {
  22108. // esconder
  22109. $('.ivprog-term-div').css('display', 'none');
  22110. $('#ivprog-term').css('min-height', '0'); //$('#ivprog-term').css('margin-top', '-30px');
  22111. //$('#ivprog-term').css('padding', '5px');
  22112. } else {
  22113. // mostrar
  22114. $('.ivprog-term-div').css('display', 'block');
  22115. $('#ivprog-term').css('min-height', '160px'); //$('#ivprog-term').css('margin-top', '-170px');
  22116. }
  22117. } // function waitToCloseConsole () {
  22118. // domConsole.info("Aperte qualquer tecla para fechar...");
  22119. // const p = new Promise((resolve, _) => {
  22120. // domConsole.requestInput(resolve, true);
  22121. // });
  22122. // p.then( _ => {
  22123. // domConsole.dispose();
  22124. // domConsole = null;
  22125. // $("#ivprog-term").hide();
  22126. // })
  22127. // }
  22128. function toggleTextualCoding() {
  22129. var code = null;
  22130. if (settingsProgrammingTypes != "textual") {
  22131. code = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  22132. if (code == null) {
  22133. return;
  22134. }
  22135. }
  22136. $('.ivprog_visual_panel').css('display', 'none');
  22137. $('.ivprog_textual_panel').css('display', 'block');
  22138. $('.ivprog_textual_panel').removeClass('loading');
  22139. _text_editor__WEBPACK_IMPORTED_MODULE_17__["updateEditor"]();
  22140. if (code != null) _text_editor__WEBPACK_IMPORTED_MODULE_17__["setCode"](code); //$('.ivprog_textual_code').text(code);
  22141. $('.visual_coding_button').removeClass('active');
  22142. $('.textual_coding_button').addClass('active');
  22143. }
  22144. function toggleVisualCoding() {
  22145. $('.ivprog_textual_panel').addClass('loading');
  22146. $('.ivprog_textual_panel').css('display', 'none');
  22147. $('.ivprog_visual_panel').css('display', 'block');
  22148. $('.textual_coding_button').removeClass('active');
  22149. $('.visual_coding_button').addClass('active');
  22150. }
  22151. function removeParameter(function_obj, parameter_obj, parameter_container) {
  22152. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(parameter_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION_PARAM, function_obj.name);
  22153. var index = function_obj.parameters_list.indexOf(parameter_obj);
  22154. if (index > -1) {
  22155. window.insertContext = true;
  22156. function_obj.parameters_list.splice(index, 1);
  22157. }
  22158. $(parameter_container).fadeOut();
  22159. }
  22160. function updateParameterType(parameter_obj, new_type, function_name) {
  22161. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  22162. 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);
  22163. parameter_obj.type = new_type;
  22164. parameter_obj.dimensions = new_dimensions;
  22165. if (new_dimensions > 0) {
  22166. parameter_obj.rows = new_dimensions;
  22167. parameter_obj.columns = 2;
  22168. }
  22169. }
  22170. function renderParameter(function_obj, parameter_obj, function_container) {
  22171. var ret = "";
  22172. ret += '<div class="ui label function_name_parameter pink"><i class="ui icon ellipsis vertical inverted"></i>';
  22173. ret += '<div class="ui dropdown parameter_type">';
  22174. if (parameter_obj.dimensions > 0) {
  22175. 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()));
  22176. if (parameter_obj.dimensions == 1) {
  22177. ret += ' [ ] ';
  22178. } else {
  22179. ret += ' [ ] [ ] ';
  22180. }
  22181. ret += '</div>';
  22182. } else {
  22183. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(parameter_obj.type.toLowerCase())) + '</div>';
  22184. }
  22185. ret += '<div class="menu">';
  22186. for (var _tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22187. if (_tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22188. continue;
  22189. }
  22190. 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>';
  22191. }
  22192. 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">';
  22193. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22194. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22195. continue;
  22196. }
  22197. 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>';
  22198. }
  22199. ret += '</div></div>';
  22200. 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">';
  22201. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22202. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22203. continue;
  22204. }
  22205. 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>';
  22206. }
  22207. ret += '</div></div>';
  22208. ret += '</div></div>';
  22209. ret += '<div class="parameter_div_edit"><span class="span_name_parameter label_enable_name_parameter">' + parameter_obj.name + '</span></div> ';
  22210. ret += ' <i class="yellow inverted icon times remove_parameter"></i></div>';
  22211. ret = $(ret);
  22212. function_container.find('.container_parameters_list').append(ret);
  22213. ret.find('.remove_parameter').on('click', function (e) {
  22214. removeParameter(function_obj, parameter_obj, ret);
  22215. });
  22216. ret.find('.ui.dropdown.parameter_type').dropdown({
  22217. onChange: function onChange(_, __, $selectedItem) {
  22218. if ($selectedItem.data('dimensions')) {
  22219. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  22220. } else {
  22221. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  22222. }
  22223. },
  22224. selectOnKeydown: false
  22225. });
  22226. ret.find('.parameter_div_edit').on('click', function (e) {
  22227. 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);
  22228. enableNameParameterUpdate(parameter_obj, ret, function_obj);
  22229. });
  22230. return ret;
  22231. }
  22232. function updateParameterName(parameter_var, new_name, parameter_obj_dom, function_obj) {
  22233. if (parameter_var.name == new_name) {
  22234. return;
  22235. }
  22236. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  22237. if (variableNameAlreadyExists(new_name, function_obj)) {
  22238. _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]));
  22239. } else {
  22240. 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);
  22241. parameter_var.name = new_name;
  22242. }
  22243. } else {
  22244. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](parameter_obj_dom.find('.parameter_div_edit'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  22245. }
  22246. }
  22247. function variableNameAlreadyExists(name_var, function_obj) {
  22248. if (function_obj.parameters_list) {
  22249. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  22250. if (function_obj.parameters_list[i].name == name_var) {
  22251. return true;
  22252. }
  22253. }
  22254. }
  22255. if (function_obj.variables_list) {
  22256. for (var i = 0; i < function_obj.variables_list.length; i++) {
  22257. if (function_obj.variables_list[i].name == name_var) {
  22258. return true;
  22259. }
  22260. }
  22261. }
  22262. return false;
  22263. }
  22264. function updateFunctionName(function_var, new_name, function_obj_dom) {
  22265. if (function_var.name == new_name) {
  22266. return;
  22267. }
  22268. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  22269. if (functionNameAlreadyExists(new_name)) {
  22270. _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]));
  22271. } else {
  22272. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].RENAME_FUNCTION, new_name);
  22273. function_var.name = new_name;
  22274. }
  22275. } else {
  22276. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](function_obj_dom.find('.function_name_div'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  22277. }
  22278. }
  22279. function functionNameAlreadyExists(function_name) {
  22280. for (var i = 0; i < window.program_obj.functions.length; i++) {
  22281. if (window.program_obj.functions[i].name == function_name) {
  22282. return true;
  22283. }
  22284. }
  22285. return false;
  22286. }
  22287. var opened_name_parameter = false;
  22288. var opened_input_parameter = null;
  22289. function enableNameParameterUpdate(parameter_obj, parent_node, function_obj) {
  22290. if (opened_name_parameter) {
  22291. opened_input_parameter.focus();
  22292. return;
  22293. }
  22294. opened_name_parameter = true;
  22295. parent_node = $(parent_node);
  22296. var input_field;
  22297. parent_node.find('.span_name_parameter').text('');
  22298. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + parameter_obj.name + "' />");
  22299. input_field.insertBefore(parent_node.find('.span_name_parameter'));
  22300. input_field.on('input', function () {
  22301. var inputWidth = input_field.textWidth() + 10;
  22302. opened_input_parameter = input_field;
  22303. input_field.focus();
  22304. var tmpStr = input_field.val();
  22305. input_field.val('');
  22306. input_field.val(tmpStr);
  22307. input_field.css({
  22308. width: inputWidth
  22309. });
  22310. }).trigger('input');
  22311. input_field.focusout(function () {
  22312. /// update array:
  22313. if (input_field.val().trim()) {
  22314. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  22315. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  22316. }
  22317. input_field.off();
  22318. input_field.remove(); /// update elements:
  22319. opened_name_parameter = false;
  22320. opened_input_parameter = false;
  22321. });
  22322. input_field.on('keydown', function (e) {
  22323. var code = e.keyCode || e.which;
  22324. if (code == 13) {
  22325. if (input_field.val().trim()) {
  22326. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  22327. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  22328. }
  22329. input_field.off();
  22330. input_field.remove(); /// update elements:
  22331. opened_name_parameter = false;
  22332. opened_input_parameter = false;
  22333. }
  22334. if (code == 27) {
  22335. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  22336. input_field.off();
  22337. input_field.remove(); /// update elements:
  22338. opened_name_parameter = false;
  22339. opened_input_parameter = false;
  22340. }
  22341. });
  22342. input_field.select();
  22343. }
  22344. var opened_name_function = false;
  22345. var opened_input = null;
  22346. var previousPadding = null;
  22347. function enableNameFunctionUpdate(function_obj, parent_node) {
  22348. if (opened_name_function) {
  22349. opened_input.focus();
  22350. return;
  22351. }
  22352. parent_node = $(parent_node);
  22353. parent_node.find('.span_name_function').text('');
  22354. var input_field;
  22355. if (!previousPadding) {
  22356. previousPadding = parent_node.find('.span_name_function').css('padding-left');
  22357. }
  22358. parent_node.find('.span_name_function').css('padding-left', '0');
  22359. parent_node.find('.span_name_function').css('padding-right', '0');
  22360. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + function_obj.name + "' />");
  22361. input_field.insertBefore(parent_node.find('.span_name_function'));
  22362. input_field.on('input', function () {
  22363. var inputWidth = input_field.textWidth() + 10;
  22364. opened_input = input_field;
  22365. input_field.focus();
  22366. var tmpStr = input_field.val();
  22367. input_field.val('');
  22368. input_field.val(tmpStr);
  22369. input_field.css({
  22370. width: inputWidth
  22371. });
  22372. }).trigger('input');
  22373. input_field.focusout(function () {
  22374. /// update array:
  22375. if (input_field.val().trim()) {
  22376. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  22377. }
  22378. input_field.off();
  22379. input_field.remove();
  22380. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  22381. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  22382. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  22383. opened_name_function = false;
  22384. opened_input = false;
  22385. });
  22386. input_field.on('keydown', function (e) {
  22387. var code = e.keyCode || e.which;
  22388. if (code == 13) {
  22389. if (input_field.val().trim()) {
  22390. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  22391. }
  22392. input_field.off();
  22393. input_field.remove();
  22394. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  22395. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  22396. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  22397. opened_name_function = false;
  22398. opened_input = false;
  22399. }
  22400. if (code == 27) {
  22401. input_field.off();
  22402. input_field.remove();
  22403. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  22404. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  22405. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  22406. opened_name_function = false;
  22407. opened_input = false;
  22408. }
  22409. });
  22410. input_field.select();
  22411. }
  22412. function addFunctionChangeListener(callback) {
  22413. functionsChangeListeners.push(callback);
  22414. return functionsChangeListeners.length - 1;
  22415. }
  22416. function addGlobalChangeListener(callback) {
  22417. globalChangeListeners.push(callback);
  22418. return globalChangeListeners.length - 1;
  22419. }
  22420. function removeGlobalListener(index) {
  22421. globalChangeListeners.splice(index, 1);
  22422. }
  22423. function removeFunctionListener(index) {
  22424. functionsChangeListeners.splice(index);
  22425. }
  22426. function scheduleCall(callback, time) {
  22427. var scheduled_call = function scheduled_call() {
  22428. var id = setInterval(function () {
  22429. if (callback()) {
  22430. clearInterval(id);
  22431. }
  22432. }, time);
  22433. };
  22434. scheduled_call();
  22435. }
  22436. function showRunButton() {
  22437. document.getElementById('run_button').style.display = 'inline';
  22438. document.getElementById('stop_button').style.display = 'none';
  22439. }
  22440. function showStopButton() {
  22441. document.getElementById('run_button').style.display = 'none';
  22442. document.getElementById('stop_button').style.display = 'inline';
  22443. }
  22444. function stopExecution() {
  22445. domConsole.clearPendingWrites();
  22446. domConsole.cancelPendingInputRequests();
  22447. if (!isRunning) {
  22448. return;
  22449. }
  22450. proc.mode = _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT;
  22451. }
  22452. /***/ }),
  22453. /***/ "./js/visualUI/globals.js":
  22454. /*!********************************!*\
  22455. !*** ./js/visualUI/globals.js ***!
  22456. \********************************/
  22457. /*! exports provided: addGlobal, renderGlobal */
  22458. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22459. "use strict";
  22460. __webpack_require__.r(__webpack_exports__);
  22461. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobal", function() { return addGlobal; });
  22462. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderGlobal", function() { return renderGlobal; });
  22463. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  22464. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  22465. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  22466. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  22467. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  22468. var counter_new_globals = 0;
  22469. function addGlobal(program) {
  22470. var is_from_click = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22471. 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);
  22472. counter_new_globals++;
  22473. program.addGlobal(new_global);
  22474. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(new_global.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].INSERT_GLOBAL_VAR);
  22475. var newe = renderGlobal(new_global);
  22476. if (is_from_click) {
  22477. newe.css('display', 'none');
  22478. newe.fadeIn();
  22479. }
  22480. }
  22481. function toggleConstant(global_var) {
  22482. global_var.is_constant = !global_var.is_constant;
  22483. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].SET_GLOBAL_CONST);
  22484. }
  22485. function updateName(global_var, new_name, global_obj_dom) {
  22486. if (global_var.name == new_name) {
  22487. return;
  22488. }
  22489. if (isValidIdentifier(new_name)) {
  22490. if (globalNameAlreadyExists(new_name)) {
  22491. _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'));
  22492. } else {
  22493. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].RENAME_GLOBAL_VAR, new_name);
  22494. global_var.name = new_name;
  22495. }
  22496. } else {
  22497. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_name'));
  22498. }
  22499. }
  22500. function globalNameAlreadyExists(global_name) {
  22501. for (var i = 0; i < window.program_obj.globals.length; i++) {
  22502. if (window.program_obj.globals[i].name == global_name) {
  22503. return true;
  22504. }
  22505. }
  22506. return false;
  22507. }
  22508. function isValidIdentifier(identifier_str) {
  22509. return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  22510. }
  22511. function updateType(global_var, new_type) {
  22512. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  22513. global_var.type = new_type;
  22514. global_var.dimensions = new_dimensions;
  22515. if (new_dimensions > 0) {
  22516. global_var.rows = new_dimensions;
  22517. global_var.columns = 2;
  22518. }
  22519. 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);
  22520. updateInitialValues(global_var);
  22521. }
  22522. function removeGlobal(global_var, global_container) {
  22523. var index = window.program_obj.globals.indexOf(global_var);
  22524. if (index > -1) {
  22525. window.insertContext = true;
  22526. window.program_obj.globals.splice(index, 1);
  22527. }
  22528. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_GLOBAL_VAR);
  22529. global_container.children().off();
  22530. global_container.off();
  22531. global_container.fadeOut();
  22532. }
  22533. function updateInitialValues(global_var) {
  22534. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22535. if (global_var.dimensions == 0) {
  22536. global_var.value = 0;
  22537. }
  22538. if (global_var.dimensions == 1) {
  22539. global_var.value = [0, 0];
  22540. }
  22541. if (global_var.dimensions == 2) {
  22542. global_var.value = [[0, 0], [0, 0]];
  22543. }
  22544. }
  22545. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22546. if (global_var.dimensions == 0) {
  22547. global_var.value = 0.0;
  22548. }
  22549. if (global_var.dimensions == 1) {
  22550. global_var.value = [0.0, 0.0];
  22551. }
  22552. if (global_var.dimensions == 2) {
  22553. global_var.value = [[0.0, 0.0], [0.0, 0.0]];
  22554. }
  22555. }
  22556. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22557. if (global_var.dimensions == 0) {
  22558. global_var.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  22559. }
  22560. if (global_var.dimensions == 1) {
  22561. 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')];
  22562. }
  22563. if (global_var.dimensions == 2) {
  22564. 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')]];
  22565. }
  22566. }
  22567. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22568. if (global_var.dimensions == 0) {
  22569. global_var.value = true;
  22570. }
  22571. if (global_var.dimensions == 1) {
  22572. global_var.value = [true, true];
  22573. }
  22574. if (global_var.dimensions == 2) {
  22575. global_var.value = [[true, true], [true, true]];
  22576. }
  22577. }
  22578. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22579. if (global_var.dimensions == 0) {
  22580. global_var.value = 'A';
  22581. }
  22582. if (global_var.dimensions == 1) {
  22583. global_var.value = ['A', 'A'];
  22584. }
  22585. if (global_var.dimensions == 2) {
  22586. global_var.value = [['A', 'A'], ['A', 'A']];
  22587. }
  22588. }
  22589. 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);
  22590. }
  22591. function alternateBooleanGlobalValue(global_var, value_container) {
  22592. global_var.value = !global_var.value;
  22593. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value)));
  22594. }
  22595. function alternateBooleanGlobalVectorValue(global_var, index, value_container) {
  22596. global_var.value[index] = !global_var.value[index];
  22597. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[index])));
  22598. }
  22599. function removeGlobalColumnVector(global_var) {
  22600. if (global_var.columns == 0) {
  22601. return;
  22602. }
  22603. global_var.columns--;
  22604. global_var.value.splice(global_var.value.length - 1, 1);
  22605. }
  22606. function addGlobalColumnVector(global_var) {
  22607. global_var.columns++;
  22608. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22609. global_var.value.push(0);
  22610. }
  22611. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22612. global_var.value.push(0.0);
  22613. }
  22614. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22615. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22616. }
  22617. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22618. global_var.value.push(true);
  22619. }
  22620. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22621. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22622. }
  22623. }
  22624. function removeColumnGlobalMatrix(global_var) {
  22625. if (global_var.columns == 0) {
  22626. return;
  22627. }
  22628. global_var.columns--;
  22629. for (var i = 0; i < global_var.rows; i++) {
  22630. global_var.value[i].splice(global_var.value[i].length - 1, 1);
  22631. }
  22632. }
  22633. function addColumnGlobalMatrix(global_var) {
  22634. global_var.columns++;
  22635. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22636. for (var i = 0; i < global_var.rows; i++) {
  22637. global_var.value[i].push(0);
  22638. }
  22639. }
  22640. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22641. for (var i = 0; i < global_var.rows; i++) {
  22642. global_var.value[i].push(0.0);
  22643. }
  22644. }
  22645. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22646. for (var i = 0; i < global_var.rows; i++) {
  22647. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22648. }
  22649. }
  22650. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22651. for (var i = 0; i < global_var.rows; i++) {
  22652. global_var.value[i].push(true);
  22653. }
  22654. }
  22655. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22656. for (var i = 0; i < global_var.rows; i++) {
  22657. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22658. }
  22659. }
  22660. }
  22661. function removeLineGlobalMatrix(global_var) {
  22662. if (global_var.rows == 0) {
  22663. return;
  22664. }
  22665. global_var.rows--;
  22666. global_var.value.splice(global_var.value.length - 1, 1);
  22667. }
  22668. function addLineGlobalMatrix(global_var) {
  22669. global_var.rows++;
  22670. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22671. var n_l = [];
  22672. for (var i = 0; i < global_var.columns; i++) {
  22673. n_l.push(0);
  22674. }
  22675. global_var.value.push(n_l);
  22676. }
  22677. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22678. var n_l = [];
  22679. for (i = 0; i < global_var.columns; i++) {
  22680. n_l.push(0.0);
  22681. }
  22682. global_var.value.push(n_l);
  22683. }
  22684. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22685. var n_l = [];
  22686. for (i = 0; i < global_var.columns; i++) {
  22687. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  22688. }
  22689. global_var.value.push(n_l);
  22690. }
  22691. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22692. var n_l = [];
  22693. for (i = 0; i < global_var.columns; i++) {
  22694. n_l.push(true);
  22695. }
  22696. global_var.value.push(n_l);
  22697. }
  22698. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22699. var n_l = [];
  22700. for (i = 0; i < global_var.columns; i++) {
  22701. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  22702. }
  22703. global_var.value.push(n_l);
  22704. }
  22705. }
  22706. function alternateBooleanGlobalMatrixValue(global_var, row, index, value_container) {
  22707. global_var.value[row][index] = !global_var.value[row][index];
  22708. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[row][index])));
  22709. }
  22710. function renderValues(global_var, global_container) {
  22711. var ret = "";
  22712. var j = 0;
  22713. if (global_var.dimensions == 0) {
  22714. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22715. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value.toFixed(1) + '</span> </div> ';
  22716. } else {
  22717. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22718. 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> ';
  22719. } else {
  22720. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value + '</span> </div> ';
  22721. }
  22722. }
  22723. } else {
  22724. ret += '<table class="tabela_var">';
  22725. if (global_var.dimensions == 1) {
  22726. ret += '<tr>';
  22727. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22728. for (var k = 0; k < global_var.columns; k++) {
  22729. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k].toFixed(1) + '</span></td>';
  22730. }
  22731. } else {
  22732. for (var k = 0; k < global_var.columns; k++) {
  22733. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22734. 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>';
  22735. } else {
  22736. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k] + '</span>' + '</td>';
  22737. }
  22738. }
  22739. }
  22740. ret += '</tr>';
  22741. ret += '</table>';
  22742. 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>';
  22743. }
  22744. if (global_var.dimensions == 2) {
  22745. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22746. for (var l = 0; l < global_var.rows; l++) {
  22747. ret += '<tr>';
  22748. for (var k = 0; k < global_var.columns; k++) {
  22749. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  22750. }
  22751. ret += '</tr>';
  22752. }
  22753. } else {
  22754. for (var l = 0; l < global_var.rows; l++) {
  22755. ret += '<tr>';
  22756. for (var k = 0; k < global_var.columns; k++) {
  22757. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22758. 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>';
  22759. } else {
  22760. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k] + '</span></td>';
  22761. }
  22762. }
  22763. ret += '</tr>';
  22764. }
  22765. }
  22766. if (global_var.rows == 0) {
  22767. ret += '<tr><td></td></tr>';
  22768. }
  22769. 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>';
  22770. ret += '</table>';
  22771. 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>';
  22772. }
  22773. }
  22774. global_container.find(".div_valor_var").html('');
  22775. ret = $(ret);
  22776. ret.find('.span_value_variable').data('associatedOject', global_var);
  22777. ret.find(".boolean_simple_type").on('click', function (e) {
  22778. alternateBooleanGlobalValue(global_var, this.parentNode);
  22779. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22780. });
  22781. ret.find(".simple_var").on('click', function (e) {
  22782. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  22783. enableGlobalValueUpdate(global_var, this.parentNode);
  22784. });
  22785. ret.find(".boolean_vector_var").on('click', function (e) {
  22786. alternateBooleanGlobalVectorValue(global_var, $(this).data('index'), this.parentNode);
  22787. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22788. });
  22789. ret.find(".vector_var").on('click', function (e) {
  22790. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  22791. enableGlobalVectorValueUpdate(global_var, $(this).data('index'), this.parentNode);
  22792. });
  22793. ret.find(".remove_global_vector_column").on('click', function (e) {
  22794. removeGlobalColumnVector(global_var);
  22795. global_container.find(".div_valor_var").html('');
  22796. 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);
  22797. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22798. renderValues(global_var, global_container);
  22799. });
  22800. ret.find(".add_global_vector_column").on('click', function (e) {
  22801. addGlobalColumnVector(global_var);
  22802. 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);
  22803. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22804. global_container.find(".div_valor_var").html('');
  22805. renderValues(global_var, global_container);
  22806. });
  22807. ret.find(".remove_global_matrix_column").on('click', function (e) {
  22808. removeColumnGlobalMatrix(global_var);
  22809. 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);
  22810. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22811. global_container.find(".div_valor_var").html('');
  22812. renderValues(global_var, global_container);
  22813. });
  22814. ret.find(".add_global_matrix_column").on('click', function (e) {
  22815. addColumnGlobalMatrix(global_var);
  22816. 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);
  22817. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22818. global_container.find(".div_valor_var").html('');
  22819. renderValues(global_var, global_container);
  22820. });
  22821. ret.find(".remove_global_matrix_line").on('click', function (e) {
  22822. removeLineGlobalMatrix(global_var);
  22823. 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);
  22824. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22825. global_container.find(".div_valor_var").html('');
  22826. renderValues(global_var, global_container);
  22827. });
  22828. ret.find(".add_global_matrix_line").on('click', function (e) {
  22829. addLineGlobalMatrix(global_var);
  22830. 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);
  22831. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22832. global_container.find(".div_valor_var").html('');
  22833. renderValues(global_var, global_container);
  22834. });
  22835. ret.find(".boolean_matrix_var").on('click', function (e) {
  22836. alternateBooleanGlobalMatrixValue(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  22837. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22838. });
  22839. ret.find(".matrix_var").on('click', function (e) {
  22840. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  22841. enableGlobalMatrixValueUpdate(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  22842. });
  22843. global_container.find(".div_valor_var").append(ret);
  22844. updateColumnsAndRowsText(global_container, global_var);
  22845. }
  22846. function addHandlers(global_container) {
  22847. var global_var = global_container.data('associatedOject'); // Manage constant option:
  22848. global_container.find(".alternate_constant").on('click', function (e) {
  22849. toggleConstant(global_var);
  22850. $(this).removeClass("on off");
  22851. if (global_var.is_constant) {
  22852. $(this).addClass("on");
  22853. } else {
  22854. $(this).addClass("off");
  22855. }
  22856. }); // Manage global name:
  22857. global_container.find(".editing_name_var").on('click', function (e) {
  22858. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_NAME);
  22859. enableNameUpdate(global_container);
  22860. }); // Menu to change type:
  22861. global_container.find('.ui.dropdown.global_type').dropdown({
  22862. onChange: function onChange(_, __, $selectedItem) {
  22863. if ($selectedItem.data('dimensions')) {
  22864. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  22865. } else {
  22866. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  22867. }
  22868. renderValues(global_var, global_container);
  22869. },
  22870. selectOnKeydown: false
  22871. }); // Remove global:
  22872. global_container.find(".remove_global").on('click', function (e) {
  22873. removeGlobal(global_var, global_container);
  22874. });
  22875. }
  22876. function updateColumnsAndRowsText(global_container, global_var) {
  22877. var prev = global_container.find('.text').text().split('[');
  22878. if (prev.length == 2) {
  22879. var ff = prev[0] + '[ ' + global_var.columns + ' ] ';
  22880. global_container.find('.text').empty();
  22881. global_container.find('.text').text(ff);
  22882. }
  22883. if (prev.length == 3) {
  22884. var ff = prev[0] + '[ ' + global_var.columns + ' ] [ ' + global_var.rows + ' ] ';
  22885. global_container.find('.text').empty();
  22886. global_container.find('.text').text(ff);
  22887. }
  22888. }
  22889. function renderGlobal(global_var) {
  22890. var element = '<div class="ui label global_container pink"><i class="ui icon ellipsis vertical inverted"></i><div class="global_const">const: ';
  22891. element += '<i class="ui icon toggle ' + (global_var.is_constant ? "on" : "off") + ' alternate_constant"></i></div>';
  22892. element += '<div class="ui dropdown global_type">';
  22893. if (global_var.dimensions == 1) {
  22894. 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));
  22895. element += ' [ <span class="dimensions_0"></span> ] ';
  22896. element += '</div>';
  22897. } else if (global_var.dimensions == 2) {
  22898. 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));
  22899. element += ' [ <span class="dimensions_0"></span> ] [ <span class="dimensions_1"></span> ] ';
  22900. element += '</div>';
  22901. } else {
  22902. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type.toLowerCase())) + '</div>';
  22903. }
  22904. element += '<div class="menu">';
  22905. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22906. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22907. continue;
  22908. }
  22909. 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>';
  22910. }
  22911. 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">';
  22912. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22913. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22914. continue;
  22915. }
  22916. 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>';
  22917. }
  22918. element += '</div></div>';
  22919. 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">';
  22920. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22921. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22922. continue;
  22923. }
  22924. 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>';
  22925. }
  22926. element += '</div></div>';
  22927. 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> ';
  22928. element += '<div class="ui div_valor_var">' + global_var.value + '</div>';
  22929. element += ' <i class="yellow inverted icon times remove_global"></i></div>';
  22930. var complete_element = $(element);
  22931. complete_element.data('associatedOject', global_var);
  22932. $('.list_globals').append(complete_element);
  22933. addHandlers(complete_element);
  22934. renderValues(global_var, complete_element);
  22935. if (global_var.dimensions == 1) {
  22936. complete_element.find('.dimensions_0').text(global_var.columns);
  22937. }
  22938. if (global_var.dimensions == 2) {
  22939. complete_element.find('.dimensions_0').text(global_var.columns);
  22940. complete_element.find('.dimensions_1').text(global_var.rows);
  22941. }
  22942. return complete_element;
  22943. }
  22944. var opened_name_value_matrix_global_v = false;
  22945. var opened_input_value_matrix_global_v = null;
  22946. function enableGlobalMatrixValueUpdate(global_var, row, index, parent_node) {
  22947. if (opened_name_value_matrix_global_v) {
  22948. opened_input_value_matrix_global_v.focus();
  22949. return;
  22950. }
  22951. parent_node = $(parent_node);
  22952. opened_name_value_matrix_global_v = true;
  22953. parent_node.find('.span_value_variable').text('');
  22954. var input_field;
  22955. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22956. 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) + "' />");
  22957. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22958. } else {
  22959. 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] + "' />");
  22960. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22961. }
  22962. input_field.on('input', function () {
  22963. var inputWidth = input_field.textWidth() + 10;
  22964. opened_input_value_matrix_global_v = input_field;
  22965. input_field.focus();
  22966. var tmpStr = input_field.val();
  22967. input_field.val('');
  22968. input_field.val(tmpStr);
  22969. input_field.css({
  22970. width: inputWidth
  22971. });
  22972. }).trigger('input');
  22973. input_field.focusout(function () {
  22974. /// update array:
  22975. if (input_field.val().trim()) {
  22976. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22977. global_var.value[row][index] = parseFloat(input_field.val().trim());
  22978. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  22979. } else {
  22980. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22981. global_var.value[row][index] = parseInt(input_field.val().trim());
  22982. } else {
  22983. global_var.value[row][index] = input_field.val().trim();
  22984. }
  22985. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  22986. }
  22987. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22988. } else {
  22989. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22990. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  22991. } else {
  22992. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  22993. }
  22994. }
  22995. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22996. global_var.value[row][index] = input_field.val();
  22997. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  22998. }
  22999. input_field.off();
  23000. input_field.remove(); /// update elements:
  23001. opened_name_value_matrix_global_v = false;
  23002. opened_input_value_matrix_global_v = false;
  23003. });
  23004. input_field.on('keydown', function (e) {
  23005. var code = e.keyCode || e.which;
  23006. if (code == 13) {
  23007. if (input_field.val().trim()) {
  23008. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23009. global_var.value[row][index] = parseFloat(input_field.val().trim());
  23010. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  23011. } else {
  23012. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23013. global_var.value[row][index] = parseInt(input_field.val().trim());
  23014. } else {
  23015. global_var.value[row][index] = input_field.val().trim();
  23016. }
  23017. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23018. }
  23019. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23020. } else {
  23021. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23022. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  23023. } else {
  23024. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23025. }
  23026. }
  23027. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23028. global_var.value[row][index] = input_field.val();
  23029. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23030. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23031. }
  23032. input_field.off();
  23033. input_field.remove(); /// update elements:
  23034. opened_name_value_matrix_global_v = false;
  23035. opened_input_value_matrix_global_v = false;
  23036. }
  23037. if (code == 27) {
  23038. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23039. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  23040. } else {
  23041. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  23042. }
  23043. input_field.off();
  23044. input_field.remove(); /// update elements:
  23045. opened_name_value_matrix_global_v = false;
  23046. opened_input_value_matrix_global_v = false;
  23047. }
  23048. });
  23049. input_field.select();
  23050. }
  23051. var opened_name_value_global_var = false;
  23052. var opened_input_value_global_ar = null;
  23053. function enableGlobalValueUpdate(global_var, parent_node) {
  23054. if (opened_name_value_global_var) {
  23055. opened_input_value_global_ar.focus();
  23056. return;
  23057. }
  23058. parent_node = $(parent_node);
  23059. opened_name_value_global_var = true;
  23060. parent_node.find('.span_value_variable').text('');
  23061. var input_field;
  23062. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23063. 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) + "' />");
  23064. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23065. } else {
  23066. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value + "' />");
  23067. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23068. }
  23069. input_field.on('input', function () {
  23070. var inputWidth = input_field.textWidth() + 10;
  23071. opened_input_value_global_ar = input_field;
  23072. input_field.focus();
  23073. var tmpStr = input_field.val();
  23074. input_field.val('');
  23075. input_field.val(tmpStr);
  23076. input_field.css({
  23077. width: inputWidth
  23078. });
  23079. }).trigger('input');
  23080. input_field.focusout(function () {
  23081. var changed = false; /// update array:
  23082. if (input_field.val().trim()) {
  23083. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23084. global_var.value = parseFloat(input_field.val().trim());
  23085. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23086. } else {
  23087. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23088. global_var.value = parseInt(input_field.val().trim());
  23089. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23090. global_var.value = input_field.val().charAt(0);
  23091. } else {
  23092. global_var.value = input_field.val().trim();
  23093. }
  23094. parent_node.find('.span_value_variable').text(global_var.value);
  23095. }
  23096. changed = true;
  23097. } else {
  23098. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23099. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23100. } else {
  23101. parent_node.find('.span_value_variable').text(global_var.value);
  23102. }
  23103. }
  23104. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23105. global_var.value = input_field.val();
  23106. changed = true;
  23107. parent_node.find('.span_value_variable').text(global_var.value);
  23108. }
  23109. if (changed) {
  23110. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23111. }
  23112. input_field.off();
  23113. input_field.remove(); /// update elements:
  23114. opened_name_value_global_var = false;
  23115. opened_input_value_global_ar = false;
  23116. });
  23117. input_field.on('keydown', function (e) {
  23118. var code = e.keyCode || e.which;
  23119. var changed = true;
  23120. if (code == 13) {
  23121. if (input_field.val().trim()) {
  23122. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23123. global_var.value = parseFloat(input_field.val().trim());
  23124. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23125. } else {
  23126. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23127. global_var.value = parseInt(input_field.val().trim());
  23128. } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23129. global_var.value = input_field.val().charAt(0);
  23130. } else {
  23131. global_var.value = input_field.val().trim();
  23132. }
  23133. parent_node.find('.span_value_variable').text(global_var.value);
  23134. }
  23135. changed = true;
  23136. } else {
  23137. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23138. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23139. } else {
  23140. parent_node.find('.span_value_variable').text(global_var.value);
  23141. }
  23142. }
  23143. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23144. global_var.value = input_field.val();
  23145. changed = true;
  23146. parent_node.find('.span_value_variable').text(global_var.value);
  23147. }
  23148. if (changed) {
  23149. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23150. }
  23151. input_field.off();
  23152. input_field.remove(); /// update elements:
  23153. opened_name_value_global_var = false;
  23154. opened_input_value_global_ar = false;
  23155. }
  23156. if (code == 27) {
  23157. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23158. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  23159. } else {
  23160. parent_node.find('.span_value_variable').text(global_var.value);
  23161. }
  23162. input_field.off();
  23163. input_field.remove(); /// update elements:
  23164. opened_name_value_global_var = false;
  23165. opened_input_value_global_ar = false;
  23166. }
  23167. });
  23168. input_field.select();
  23169. }
  23170. var opened_name_global = false;
  23171. var opened_input_global = null;
  23172. function enableNameUpdate(global_container) {
  23173. var global_var = global_container.data('associatedOject');
  23174. if (opened_name_global) {
  23175. opened_input_global.focus();
  23176. return;
  23177. }
  23178. opened_name_global = true;
  23179. global_container.find('.span_name_variable').text('');
  23180. var input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.name + "' />");
  23181. input_name.insertBefore(global_container.find('.span_name_variable'));
  23182. input_name.on('input', function () {
  23183. var inputWidth = input_name.textWidth() + 10;
  23184. opened_input_global = input_name;
  23185. opened_input_global.focus();
  23186. opened_input_global.css({
  23187. width: inputWidth
  23188. });
  23189. }).trigger('input');
  23190. input_name.focusout(function () {
  23191. /// update array:
  23192. if (input_name.val().trim().length > 0) {
  23193. updateName(global_var, input_name.val().trim(), global_container);
  23194. global_container.find('.span_name_variable').text(global_var.name);
  23195. } else {
  23196. global_container.find('.span_name_variable').text(global_var.name);
  23197. }
  23198. input_name.off();
  23199. input_name.remove(); /// update elements:
  23200. opened_name_global = false;
  23201. opened_input_global = false;
  23202. });
  23203. input_name.on('keydown', function (e) {
  23204. var code = e.keyCode || e.which;
  23205. if (code == 13) {
  23206. if (input_name.val().trim()) {
  23207. updateName(global_var, input_name.val().trim(), global_container);
  23208. global_container.find('.span_name_variable').text(global_var.name);
  23209. } else {
  23210. global_container.find('.span_name_variable').text(global_var.name);
  23211. }
  23212. input_name.off();
  23213. input_name.remove(); /// update elements:
  23214. opened_name_global = false;
  23215. opened_input_global = false;
  23216. }
  23217. if (code == 27) {
  23218. global_container.find('.span_name_variable').text(global_var.name);
  23219. input_name.off();
  23220. input_name.remove(); /// update elements:
  23221. opened_name_global = false;
  23222. opened_input_global = false;
  23223. }
  23224. });
  23225. input_name.select();
  23226. }
  23227. var opened_name_value_vector_global_ = false;
  23228. var opened_input_value_vector_global_ = null;
  23229. function enableGlobalVectorValueUpdate(global_var, index, parent_node) {
  23230. if (opened_name_value_vector_global_) {
  23231. opened_input_value_vector_global_.focus();
  23232. return;
  23233. }
  23234. parent_node = $(parent_node);
  23235. opened_name_value_vector_global_ = true;
  23236. parent_node.find('.span_value_variable').text('');
  23237. var input_field;
  23238. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23239. 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) + "' />");
  23240. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23241. } else {
  23242. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[index] + "' />");
  23243. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23244. }
  23245. input_field.on('input', function () {
  23246. var inputWidth = input_field.textWidth() + 10;
  23247. opened_input_value_vector_global_ = input_field;
  23248. input_field.focus();
  23249. var tmpStr = input_field.val();
  23250. input_field.val('');
  23251. input_field.val(tmpStr);
  23252. input_field.css({
  23253. width: inputWidth
  23254. });
  23255. }).trigger('input');
  23256. input_field.focusout(function () {
  23257. var changed = false; /// update array:
  23258. if (input_field.val().trim()) {
  23259. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23260. global_var.value[index] = parseFloat(input_field.val().trim());
  23261. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23262. } else {
  23263. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23264. global_var.value[index] = parseInt(input_field.val().trim());
  23265. } else {
  23266. global_var.value[index] = input_field.val().trim();
  23267. }
  23268. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23269. }
  23270. changed = true;
  23271. } else {
  23272. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23273. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23274. } else {
  23275. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23276. }
  23277. }
  23278. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23279. global_var.value[index] = input_field.val();
  23280. changed = true;
  23281. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23282. }
  23283. if (changed) {
  23284. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23285. }
  23286. input_field.off();
  23287. input_field.remove(); /// update elements:
  23288. opened_name_value_vector_global_ = false;
  23289. opened_input_value_vector_global_ = false;
  23290. });
  23291. input_field.on('keydown', function (e) {
  23292. var code = e.keyCode || e.which;
  23293. var changed = false;
  23294. if (code == 13) {
  23295. if (input_field.val().trim()) {
  23296. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23297. global_var.value[index] = parseFloat(input_field.val().trim());
  23298. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23299. } else {
  23300. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23301. global_var.value[index] = parseInt(input_field.val().trim());
  23302. } else {
  23303. global_var.value[index] = input_field.val().trim();
  23304. }
  23305. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23306. }
  23307. changed = true;
  23308. } else {
  23309. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23310. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23311. } else {
  23312. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23313. }
  23314. }
  23315. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23316. global_var.value[index] = input_field.val();
  23317. changed = true;
  23318. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23319. }
  23320. if (changed) {
  23321. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  23322. }
  23323. input_field.off();
  23324. input_field.remove(); /// update elements:
  23325. opened_name_value_vector_global_ = false;
  23326. opened_input_value_vector_global_ = false;
  23327. }
  23328. if (code == 27) {
  23329. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23330. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  23331. } else {
  23332. parent_node.find('.span_value_variable').text(global_var.value[index]);
  23333. }
  23334. input_field.off();
  23335. input_field.remove(); /// update elements:
  23336. opened_name_value_vector_global_ = false;
  23337. opened_input_value_vector_global_ = false;
  23338. }
  23339. });
  23340. input_field.select();
  23341. }
  23342. $.fn.textWidth = function (text, font) {
  23343. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  23344. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  23345. return $.fn.textWidth.fakeEl.width();
  23346. };
  23347. /***/ }),
  23348. /***/ "./js/visualUI/ivprog_elements.js":
  23349. /*!****************************************!*\
  23350. !*** ./js/visualUI/ivprog_elements.js ***!
  23351. \****************************************/
  23352. /*! 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 */
  23353. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23354. "use strict";
  23355. __webpack_require__.r(__webpack_exports__);
  23356. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_TYPES", function() { return COMMAND_TYPES; });
  23357. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_TYPES", function() { return ARITHMETIC_TYPES; });
  23358. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_ELEMENTS", function() { return EXPRESSION_ELEMENTS; });
  23359. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_TYPES", function() { return EXPRESSION_TYPES; });
  23360. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_COMPARISON", function() { return ARITHMETIC_COMPARISON; });
  23361. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOGIC_COMPARISON", function() { return LOGIC_COMPARISON; });
  23362. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYSTEM_FUNCTIONS_CATEGORIES", function() { return SYSTEM_FUNCTIONS_CATEGORIES; });
  23363. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; });
  23364. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  23365. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemFunction", function() { return SystemFunction; });
  23366. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });
  23367. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  23368. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reader", function() { return Reader; });
  23369. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Writer", function() { return Writer; });
  23370. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribution", function() { return Attribution; });
  23371. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionOperator", function() { return ExpressionOperator; });
  23372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionElement", function() { return ExpressionElement; });
  23373. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionalExpression", function() { return ConditionalExpression; });
  23374. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicExpression", function() { return LogicExpression; });
  23375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArithmeticExpression", function() { return ArithmeticExpression; });
  23376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfTrue", function() { return IfTrue; });
  23377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatNTimes", function() { return RepeatNTimes; });
  23378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WhileTrue", function() { return WhileTrue; });
  23379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DoWhileTrue", function() { return DoWhileTrue; });
  23380. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  23381. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  23382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwitchCase", function() { return SwitchCase; });
  23383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  23384. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableValueMenu", function() { return VariableValueMenu; });
  23385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCallMenu", function() { return FunctionCallMenu; });
  23386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Program", function() { return Program; });
  23387. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  23388. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__);
  23389. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  23390. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  23391. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  23392. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  23393. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__);
  23394. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  23395. var COMMAND_TYPES = Object.freeze({
  23396. "function": "function",
  23397. comment: "comment",
  23398. reader: "reader",
  23399. writer: "writer",
  23400. attribution: "attribution",
  23401. iftrue: "iftrue",
  23402. repeatNtimes: "repeatNtimes",
  23403. whiletrue: "whiletrue",
  23404. dowhiletrue: "dowhiletrue",
  23405. "switch": "switch",
  23406. switchcase: "switchcase",
  23407. functioncall: "functioncall",
  23408. "break": "break",
  23409. "return": "return"
  23410. });
  23411. var ARITHMETIC_TYPES = Object.freeze({
  23412. plus: "plus",
  23413. minus: "minus",
  23414. multiplication: "multiplication",
  23415. division: "division",
  23416. module: "module",
  23417. none: "none"
  23418. });
  23419. var EXPRESSION_ELEMENTS = Object.freeze({
  23420. exp_op_exp: "exp_op_exp",
  23421. op_exp: "op_exp",
  23422. par_exp_par: "par_exp_par",
  23423. start_point: "start_point"
  23424. });
  23425. var EXPRESSION_TYPES = Object.freeze({
  23426. exp_conditional: "exp_conditional",
  23427. exp_logic: "exp_logic",
  23428. exp_arithmetic: "exp_arithmetic",
  23429. write_sep: "write_separator"
  23430. });
  23431. var ARITHMETIC_COMPARISON = Object.freeze({
  23432. greater_than: "greater_than",
  23433. less_than: "less_than",
  23434. equals_to: "equals_to",
  23435. not_equals_to: "not_equals_to",
  23436. greater_than_or_equals_to: "greater_than_or_equals_to",
  23437. less_than_or_equals_to: "less_than_or_equals_to"
  23438. });
  23439. var LOGIC_COMPARISON = Object.freeze({
  23440. equals_to: "equals_to",
  23441. not_equals_to: "not_equals_to",
  23442. and: "and",
  23443. or: "or",
  23444. not: "not"
  23445. });
  23446. var SYSTEM_FUNCTIONS_CATEGORIES = Object.freeze({
  23447. math: "$mathLib",
  23448. text: "$strLib",
  23449. arrangement: "$arrayLib",
  23450. conversion: "$langLib"
  23451. });
  23452. var Variable = function Variable(type, name, value) {
  23453. var dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  23454. var is_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  23455. var rows = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  23456. var columns = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
  23457. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Variable);
  23458. this.type = type;
  23459. this.name = name;
  23460. this.value = value;
  23461. this.dimensions = dimensions;
  23462. this.is_constant = is_constant;
  23463. this.rows = rows;
  23464. this.columns = columns;
  23465. };
  23466. var Function = function Function(name) {
  23467. var return_type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID;
  23468. var return_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  23469. var parameters_list = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  23470. var is_main = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  23471. var is_hidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
  23472. var variables_list = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
  23473. var function_comment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
  23474. var commands = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];
  23475. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Function);
  23476. this.type = COMMAND_TYPES["function"];
  23477. this.name = name;
  23478. this.return_type = return_type;
  23479. this.return_dimensions = return_dimensions;
  23480. this.parameters_list = parameters_list;
  23481. this.is_main = is_main;
  23482. this.is_hidden = is_hidden;
  23483. this.variables_list = variables_list;
  23484. this.function_comment = function_comment;
  23485. this.commands = commands;
  23486. };
  23487. var SystemFunction = function SystemFunction(identifier, return_type, return_dimensions, parameters_list) {
  23488. var function_comment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  23489. var category = arguments.length > 5 ? arguments[5] : undefined;
  23490. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SystemFunction);
  23491. this.type = COMMAND_TYPES["function"];
  23492. this.identifier = identifier;
  23493. this.return_type = return_type;
  23494. this.return_dimensions = return_dimensions;
  23495. this.parameters_list = parameters_list;
  23496. this.function_comment = function_comment;
  23497. this.category = category;
  23498. };
  23499. var Comment = function Comment(comment_text) {
  23500. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Comment);
  23501. this.type = COMMAND_TYPES.comment;
  23502. this.comment_text = comment_text;
  23503. };
  23504. var Break = function Break() {
  23505. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Break);
  23506. this.type = COMMAND_TYPES["break"];
  23507. };
  23508. var Reader = function Reader() {
  23509. var variable_value_menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new VariableValueMenu();
  23510. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Reader);
  23511. this.type = COMMAND_TYPES.reader;
  23512. this.variable_value_menu = variable_value_menu;
  23513. };
  23514. var Writer = function Writer(content) {
  23515. var newline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  23516. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Writer);
  23517. this.type = COMMAND_TYPES.writer;
  23518. this.content = content;
  23519. this.newline = newline;
  23520. };
  23521. var Attribution = function Attribution(variable) {
  23522. var expression = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23523. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Attribution);
  23524. this.type = COMMAND_TYPES.attribution;
  23525. this.variable = variable;
  23526. this.expression = expression;
  23527. };
  23528. var ExpressionOperator = function ExpressionOperator(type_op, item) {
  23529. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionOperator);
  23530. this.type_op = type_op; // Logic, Arithmetic OR Relational
  23531. this.item = item;
  23532. };
  23533. var ExpressionElement = function ExpressionElement(type_exp) {
  23534. var itens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23535. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionElement);
  23536. this.type_exp = type_exp;
  23537. this.itens = itens;
  23538. };
  23539. var ConditionalExpression = function ConditionalExpression(expression) {
  23540. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ConditionalExpression);
  23541. this.type = EXPRESSION_TYPES.exp_conditional;
  23542. this.expression = expression;
  23543. };
  23544. var LogicExpression = function LogicExpression(has_neg, first_operand, second_operand, operator) {
  23545. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, LogicExpression);
  23546. this.type = EXPRESSION_TYPES.exp_logic;
  23547. this.has_neg = has_neg;
  23548. this.first_operand = first_operand;
  23549. this.second_operand = second_operand;
  23550. this.operator = operator;
  23551. };
  23552. var ArithmeticExpression = function ArithmeticExpression(first_operand, second_operand, operator) {
  23553. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ArithmeticExpression);
  23554. this.type = EXPRESSION_TYPES.exp_arithmetic;
  23555. this.first_operand = first_operand;
  23556. this.second_operand = second_operand;
  23557. this.operator = operator;
  23558. };
  23559. var IfTrue = function IfTrue(expression, commands_block, commands_else) {
  23560. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, IfTrue);
  23561. this.type = COMMAND_TYPES.iftrue;
  23562. this.expression = expression;
  23563. this.commands_block = commands_block;
  23564. this.commands_else = commands_else;
  23565. };
  23566. var RepeatNTimes = function RepeatNTimes(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block) {
  23567. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, RepeatNTimes);
  23568. this.type = COMMAND_TYPES.repeatNtimes;
  23569. this.var_attribution = var_attribution;
  23570. this.var_incrementation = var_incrementation;
  23571. this.expression1 = expression1;
  23572. this.expression2 = expression2;
  23573. this.expression3 = expression3;
  23574. this.commands_block = commands_block;
  23575. };
  23576. var WhileTrue = function WhileTrue(expression, commands_block) {
  23577. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, WhileTrue);
  23578. this.type = COMMAND_TYPES.whiletrue;
  23579. this.expression = expression;
  23580. this.commands_block = commands_block;
  23581. };
  23582. var DoWhileTrue = function DoWhileTrue(expression, commands_block) {
  23583. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, DoWhileTrue);
  23584. this.type = COMMAND_TYPES.dowhiletrue;
  23585. this.expression = expression;
  23586. this.commands_block = commands_block;
  23587. };
  23588. var Switch = function Switch(variable) {
  23589. var cases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23590. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Switch);
  23591. this.type = COMMAND_TYPES["switch"];
  23592. this.variable = variable;
  23593. this.cases = cases;
  23594. };
  23595. var Return = function Return(variable_value_menu) {
  23596. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Return);
  23597. this.type = COMMAND_TYPES["return"];
  23598. this.variable_value_menu = variable_value_menu;
  23599. };
  23600. var SwitchCase = function SwitchCase(variable_value_menu) {
  23601. var commands_block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23602. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SwitchCase);
  23603. this.type = COMMAND_TYPES.switchcase;
  23604. this.variable_value_menu = variable_value_menu;
  23605. this.commands_block = commands_block;
  23606. };
  23607. var FunctionCall = function FunctionCall(function_called, parameters_list) {
  23608. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCall);
  23609. this.type = COMMAND_TYPES.functioncall;
  23610. this.function_called = function_called;
  23611. this.parameters_list = parameters_list;
  23612. };
  23613. var VariableValueMenu = function VariableValueMenu() {
  23614. var variable_and_value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
  23615. var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  23616. var row = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  23617. var column = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  23618. var include_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  23619. var dimensions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  23620. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, VariableValueMenu);
  23621. this.type = "var_value";
  23622. this.variable_and_value = variable_and_value;
  23623. this.content = content;
  23624. this.row = row;
  23625. this.column = column;
  23626. this.include_constant = include_constant;
  23627. this.dimensions = dimensions;
  23628. };
  23629. var FunctionCallMenu = function FunctionCallMenu() {
  23630. var function_called = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  23631. var parameters_list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23632. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCallMenu);
  23633. this.type = "function_call";
  23634. this.function_called = function_called;
  23635. this.parameters_list = parameters_list;
  23636. };
  23637. var Program = /*#__PURE__*/function () {
  23638. function Program() {
  23639. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Program);
  23640. this.functions = [];
  23641. this.globals = [];
  23642. }
  23643. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default()(Program, [{
  23644. key: "addFunction",
  23645. value: function addFunction(function_to_add) {
  23646. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.parameters_list, function () {
  23647. if (window.insertContext) {
  23648. setTimeout(function () {
  23649. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  23650. }, 300);
  23651. window.insertContext = false;
  23652. } else {
  23653. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  23654. }
  23655. }, 1);
  23656. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.variables_list, function () {
  23657. if (window.insertContext) {
  23658. setTimeout(function () {
  23659. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  23660. }, 300);
  23661. window.insertContext = false;
  23662. } else {
  23663. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  23664. }
  23665. }, 1);
  23666. this.functions.push(function_to_add);
  23667. }
  23668. }, {
  23669. key: "addVariable",
  23670. value: function addVariable(function_to_receive, variable) {
  23671. if (this.functions[function_to_receive].variable === null) {
  23672. this.functions[function_to_receive].variables_list = [];
  23673. }
  23674. this.functions[function_to_receive].variables_list.push(variable);
  23675. }
  23676. }, {
  23677. key: "addGlobal",
  23678. value: function addGlobal(variable) {
  23679. this.globals.push(variable);
  23680. }
  23681. }]);
  23682. return Program;
  23683. }();
  23684. /***/ }),
  23685. /***/ "./js/visualUI/text_editor.js":
  23686. /*!************************************!*\
  23687. !*** ./js/visualUI/text_editor.js ***!
  23688. \************************************/
  23689. /*! exports provided: initTextEditor, disable, updateEditor, setCode, getCode */
  23690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23691. "use strict";
  23692. __webpack_require__.r(__webpack_exports__);
  23693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initTextEditor", function() { return initTextEditor; });
  23694. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disable", function() { return disable; });
  23695. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateEditor", function() { return updateEditor; });
  23696. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCode", function() { return setCode; });
  23697. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  23698. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! codemirror */ "./node_modules/codemirror/lib/codemirror.js");
  23699. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  23700. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! codemirror/addon/edit/closebrackets */ "./node_modules/codemirror/addon/edit/closebrackets.js");
  23701. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__);
  23702. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! codemirror/addon/edit/matchbrackets */ "./node_modules/codemirror/addon/edit/matchbrackets.js");
  23703. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__);
  23704. /* 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");
  23705. /* 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__);
  23706. /* harmony import */ var _util_editorMode2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../util/editorMode2 */ "./js/util/editorMode2.js");
  23707. // import "codemirror/addon/hint/show-hint";
  23708. // import "codemirror/addon/hint/anyword-hint";
  23709. Object(_util_editorMode2__WEBPACK_IMPORTED_MODULE_4__["CodeEditorMode"])(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  23710. var codeEditor = null;
  23711. function initTextEditor(element) {
  23712. var id = element;
  23713. if (element[0] == '#') {
  23714. id = element.substring(1);
  23715. }
  23716. codeEditor = codemirror__WEBPACK_IMPORTED_MODULE_0__["fromTextArea"](document.getElementById(id), {
  23717. theme: "ttcn",
  23718. value: "",
  23719. mode: "text/x-ivprog",
  23720. indentUnit: 4,
  23721. lineNumbers: true,
  23722. matchBrackets: true,
  23723. autoCloseBrackets: true,
  23724. fixedGutter: true,
  23725. styleActiveLine: true,
  23726. readOnly: true
  23727. });
  23728. }
  23729. function disable(flag) {
  23730. codeEditor.setOption("readOnly", flag);
  23731. updateEditor();
  23732. }
  23733. function updateEditor() {
  23734. codeEditor.refresh();
  23735. }
  23736. function setCode(code) {
  23737. codeEditor.setValue(code);
  23738. }
  23739. function getCode() {
  23740. return codeEditor.getValue();
  23741. }
  23742. /***/ }),
  23743. /***/ "./js/visualUI/types.js":
  23744. /*!******************************!*\
  23745. !*** ./js/visualUI/types.js ***!
  23746. \******************************/
  23747. /*! exports provided: Types */
  23748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23749. "use strict";
  23750. __webpack_require__.r(__webpack_exports__);
  23751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Types", function() { return Types; });
  23752. var Types = Object.freeze({
  23753. INTEGER: "integer",
  23754. REAL: "real",
  23755. TEXT: "text",
  23756. CHAR: 'char',
  23757. BOOLEAN: "boolean",
  23758. VOID: "void"
  23759. });
  23760. /***/ }),
  23761. /***/ "./js/visualUI/utils.js":
  23762. /*!******************************!*\
  23763. !*** ./js/visualUI/utils.js ***!
  23764. \******************************/
  23765. /*! exports provided: renderErrorMessage */
  23766. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23767. "use strict";
  23768. __webpack_require__.r(__webpack_exports__);
  23769. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderErrorMessage", function() { return renderErrorMessage; });
  23770. function renderErrorMessage(dom_obj_target, message_text) {
  23771. dom_obj_target.popup({
  23772. html: '<i class="ui icon inverted exclamation triangle yellow"></i>' + message_text,
  23773. transition: "fade up",
  23774. on: 'click',
  23775. closable: true,
  23776. movePopup: true,
  23777. boundary: window,
  23778. preserve: false,
  23779. target: false,
  23780. className: {
  23781. popup: 'ui popup invalid-identifier'
  23782. },
  23783. onHidden: function onHidden($module) {
  23784. dom_obj_target.popup('destroy');
  23785. }
  23786. }).popup('toggle');
  23787. }
  23788. /***/ }),
  23789. /***/ "./js/visualUI/variables.js":
  23790. /*!**********************************!*\
  23791. !*** ./js/visualUI/variables.js ***!
  23792. \**********************************/
  23793. /*! exports provided: addVariable, renderVariable */
  23794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23795. "use strict";
  23796. __webpack_require__.r(__webpack_exports__);
  23797. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVariable", function() { return addVariable; });
  23798. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderVariable", function() { return renderVariable; });
  23799. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  23800. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  23801. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  23802. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  23803. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  23804. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  23805. var counter_new_variables = 0;
  23806. function addVariable(function_obj, function_container) {
  23807. var is_in_click = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  23808. 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);
  23809. if (function_obj.variables_list == null) {
  23810. function_obj.variables_list = [];
  23811. }
  23812. function_obj.variables_list.push(new_var);
  23813. counter_new_variables++;
  23814. 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);
  23815. var newe = renderVariable(function_container, new_var, function_obj);
  23816. if (is_in_click) {
  23817. newe.css('display', 'none');
  23818. newe.fadeIn();
  23819. }
  23820. }
  23821. function updateName(variable_obj, new_name, variable_obj_dom, function_obj) {
  23822. if (variable_obj.name == new_name) {
  23823. return;
  23824. }
  23825. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_5__["isValidIdentifier"])(new_name)) {
  23826. if (variableNameAlreadyExists(new_name, function_obj)) {
  23827. _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]));
  23828. } else {
  23829. 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);
  23830. variable_obj.name = new_name;
  23831. }
  23832. } else {
  23833. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  23834. }
  23835. }
  23836. function variableNameAlreadyExists(name_var, function_obj) {
  23837. if (function_obj.parameters_list) {
  23838. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  23839. if (function_obj.parameters_list[i].name == name_var) {
  23840. return true;
  23841. }
  23842. }
  23843. }
  23844. if (function_obj.variables_list) {
  23845. for (var i = 0; i < function_obj.variables_list.length; i++) {
  23846. if (function_obj.variables_list[i].name == name_var) {
  23847. return true;
  23848. }
  23849. }
  23850. }
  23851. return false;
  23852. }
  23853. function removeVariable(variable_obj, variable_container, function_name) {
  23854. var function_associated = variable_container.data('associatedFunction');
  23855. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_FUNCTION_VAR, variable_obj.name);
  23856. var index = function_associated.variables_list.indexOf(variable_obj);
  23857. if (index > -1) {
  23858. window.insertContext = true;
  23859. delete function_associated.variables_list[index];
  23860. function_associated.variables_list.splice(index, 1);
  23861. }
  23862. variable_container.children().off();
  23863. variable_container.off();
  23864. variable_container.fadeOut();
  23865. }
  23866. function updateType(variable_obj, new_type, function_name) {
  23867. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  23868. variable_obj.type = new_type;
  23869. variable_obj.dimensions = new_dimensions;
  23870. if (new_dimensions > 0) {
  23871. variable_obj.rows = new_dimensions;
  23872. variable_obj.columns = 2;
  23873. }
  23874. 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);
  23875. updateInitialValues(variable_obj, function_name);
  23876. }
  23877. function addHandlers(variable_obj, variable_container, function_obj) {
  23878. // Manage variable name:
  23879. variable_container.find(".editing_name_var").on('click', function (e) {
  23880. 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);
  23881. enableNameUpdate(variable_obj, variable_container, function_obj);
  23882. }); // Menu to change type:
  23883. variable_container.find('.ui.dropdown.variable_type').dropdown({
  23884. onChange: function onChange(_, __, $selectedItem) {
  23885. if ($selectedItem.data('dimensions')) {
  23886. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  23887. } else {
  23888. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  23889. }
  23890. renderValues(variable_obj, variable_container, function_obj.name);
  23891. },
  23892. selectOnKeydown: false
  23893. }); // Remove variable:
  23894. variable_container.find(".remove_variable").on('click', function (e) {
  23895. removeVariable(variable_obj, variable_container, function_obj.name);
  23896. });
  23897. }
  23898. function renderVariable(function_container, new_var, function_obj) {
  23899. var element = '<div class="ui label variable_container pink"><i class="ui icon ellipsis vertical inverted"></i>';
  23900. element += '<div class="ui dropdown variable_type">';
  23901. if (new_var.dimensions == 1) {
  23902. 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()));
  23903. element += ' [ ] </div>';
  23904. } else if (new_var.dimensions == 2) {
  23905. 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()));
  23906. element += ' [ ] [ ] </div>';
  23907. } else {
  23908. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase())) + '</div>';
  23909. }
  23910. element += '<div class="menu">';
  23911. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  23912. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  23913. continue;
  23914. }
  23915. 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>';
  23916. }
  23917. 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">';
  23918. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  23919. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  23920. continue;
  23921. }
  23922. 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>';
  23923. }
  23924. element += '</div></div>';
  23925. 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">';
  23926. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  23927. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  23928. continue;
  23929. }
  23930. 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>';
  23931. }
  23932. element += '</div></div>';
  23933. element += '</div></div> ';
  23934. element += '<div class="editing_name_var"><span class="span_name_variable enable_edit_name_variable">' + new_var.name + '</span> </div>';
  23935. element += ' <span class="character_equals"> <&#8212; </span> <div class="ui div_valor_var">' + new_var.value + '</div>';
  23936. element += ' <i class="yellow inverted icon times remove_variable"></i></div>';
  23937. element = $(element);
  23938. element.data('associatedFunction', function_obj);
  23939. function_container.find('.variables_list_div').append(element);
  23940. addHandlers(new_var, element, function_obj);
  23941. renderValues(new_var, element, function_obj.name);
  23942. return element;
  23943. }
  23944. function updateColumnsAndRowsText(variable_container, variable_var) {
  23945. var prev = variable_container.find('.text').text().split('[');
  23946. if (prev.length == 2) {
  23947. var ff = prev[0] + '[ ' + variable_var.columns + ' ] ';
  23948. variable_container.find('.text').empty();
  23949. variable_container.find('.text').text(ff);
  23950. }
  23951. if (prev.length == 3) {
  23952. var ff = prev[0] + '[ ' + variable_var.columns + ' ] [ ' + variable_var.rows + ' ] ';
  23953. variable_container.find('.text').empty();
  23954. variable_container.find('.text').text(ff);
  23955. }
  23956. }
  23957. function renderValues(new_var, variable_container, function_name) {
  23958. var ret = "";
  23959. var j = 0;
  23960. if (new_var.dimensions == 0) {
  23961. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23962. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value.toFixed(1) + '</span> </div> ';
  23963. } else {
  23964. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  23965. 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> ';
  23966. } else {
  23967. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value + '</span> </div> ';
  23968. }
  23969. }
  23970. } else {
  23971. ret += '<table class="tabela_var">';
  23972. if (new_var.dimensions == 1) {
  23973. ret += '<tr>';
  23974. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23975. for (var k = 0; k < new_var.columns; k++) {
  23976. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k].toFixed(1) + '</span></td>';
  23977. }
  23978. } else {
  23979. for (var k = 0; k < new_var.columns; k++) {
  23980. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  23981. 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>';
  23982. } else {
  23983. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k] + '</span>' + '</td>';
  23984. }
  23985. }
  23986. }
  23987. ret += '</tr>';
  23988. ret += '</table>';
  23989. 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>';
  23990. }
  23991. if (new_var.dimensions == 2) {
  23992. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23993. for (var l = 0; l < new_var.rows; l++) {
  23994. ret += '<tr>';
  23995. for (var k = 0; k < new_var.columns; k++) {
  23996. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  23997. }
  23998. ret += '</tr>';
  23999. }
  24000. } else {
  24001. for (var l = 0; l < new_var.rows; l++) {
  24002. ret += '<tr>';
  24003. for (var k = 0; k < new_var.columns; k++) {
  24004. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24005. 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>';
  24006. } else {
  24007. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k] + '</span></td>';
  24008. }
  24009. }
  24010. ret += '</tr>';
  24011. }
  24012. }
  24013. if (new_var.rows == 0) {
  24014. ret += '<tr><td></td></tr>';
  24015. }
  24016. 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>';
  24017. ret += '</table>';
  24018. 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>';
  24019. }
  24020. }
  24021. $(variable_container).find(".div_valor_var").html('');
  24022. ret = $(ret);
  24023. $(ret).find('.span_value_variable').data('associatedOject', new_var);
  24024. $(ret).find(".boolean_simple_type").on('click', function (e) {
  24025. 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);
  24026. alternateBooleanValue(new_var, this.parentNode);
  24027. });
  24028. $(ret).find(".simple_var").on('click', function (e) {
  24029. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  24030. enableValueUpdate(new_var, this.parentNode, function_name);
  24031. });
  24032. $(ret).find(".boolean_vector_var").on('click', function (e) {
  24033. alternateBooleanVectorValue(new_var, $(this).data('index'), this.parentNode);
  24034. 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);
  24035. });
  24036. $(ret).find(".vector_var").on('click', function (e) {
  24037. enableVectorValueUpdate(new_var, $(this).data('index'), this.parentNode, function_name);
  24038. });
  24039. $(ret).find(".remove_global_vector_column").on('click', function (e) {
  24040. removeColumnVector(new_var);
  24041. 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);
  24042. 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);
  24043. $(variable_container).find(".div_valor_var").html('');
  24044. renderValues(new_var, variable_container, function_name);
  24045. });
  24046. $(ret).find(".add_global_vector_column").on('click', function (e) {
  24047. addColumnVector(new_var);
  24048. 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);
  24049. 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);
  24050. $(variable_container).find(".div_valor_var").html('');
  24051. renderValues(new_var, variable_container, function_name);
  24052. });
  24053. $(ret).find(".remove_global_matrix_column").on('click', function (e) {
  24054. removeColumnMatrix(new_var);
  24055. 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);
  24056. 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);
  24057. $(variable_container).find(".div_valor_var").html('');
  24058. renderValues(new_var, variable_container, function_name);
  24059. });
  24060. $(ret).find(".add_global_matrix_column").on('click', function (e) {
  24061. addColumnMatrix(new_var);
  24062. 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);
  24063. 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);
  24064. $(variable_container).find(".div_valor_var").html('');
  24065. renderValues(new_var, variable_container, function_name);
  24066. });
  24067. $(ret).find(".remove_global_matrix_line").on('click', function (e) {
  24068. removeLineMatrix(new_var);
  24069. 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);
  24070. 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);
  24071. $(variable_container).find(".div_valor_var").html('');
  24072. renderValues(new_var, variable_container, function_name);
  24073. });
  24074. $(ret).find(".add_global_matrix_line").on('click', function (e) {
  24075. addLineMatrix(new_var);
  24076. 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);
  24077. 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);
  24078. $(variable_container).find(".div_valor_var").html('');
  24079. renderValues(new_var, variable_container, function_name);
  24080. });
  24081. $(ret).find(".boolean_matrix_var").on('click', function (e) {
  24082. alternateBooleanMatrixValue(new_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  24083. 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);
  24084. });
  24085. $(ret).find(".matrix_var").on('click', function (e) {
  24086. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  24087. enableMatrixValueUpdate(new_var, $(this).data('row'), $(this).data('index'), this.parentNode, function_name);
  24088. });
  24089. $(variable_container).find(".div_valor_var").append(ret);
  24090. updateColumnsAndRowsText(variable_container, new_var);
  24091. }
  24092. function alternateBooleanMatrixValue(var_obj, row, index, value_container) {
  24093. var_obj.value[row][index] = !var_obj.value[row][index];
  24094. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[row][index])));
  24095. }
  24096. function addLineMatrix(var_obj) {
  24097. var_obj.rows++;
  24098. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24099. var n_l = [];
  24100. for (var i = 0; i < var_obj.columns; i++) {
  24101. n_l.push(0);
  24102. }
  24103. var_obj.value.push(n_l);
  24104. }
  24105. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24106. var n_l = [];
  24107. for (i = 0; i < var_obj.columns; i++) {
  24108. n_l.push(0.0);
  24109. }
  24110. var_obj.value.push(n_l);
  24111. }
  24112. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24113. var n_l = [];
  24114. for (i = 0; i < var_obj.columns; i++) {
  24115. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  24116. }
  24117. var_obj.value.push(n_l);
  24118. }
  24119. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24120. var n_l = [];
  24121. for (i = 0; i < var_obj.columns; i++) {
  24122. n_l.push(true);
  24123. }
  24124. var_obj.value.push(n_l);
  24125. }
  24126. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24127. var n_l = [];
  24128. for (i = 0; i < var_obj.columns; i++) {
  24129. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  24130. }
  24131. var_obj.value.push(n_l);
  24132. }
  24133. }
  24134. function removeLineMatrix(var_obj) {
  24135. if (var_obj.rows == 0) {
  24136. return;
  24137. }
  24138. var_obj.rows--;
  24139. var_obj.value.splice(var_obj.value.length - 1, 1);
  24140. }
  24141. function addColumnMatrix(var_obj) {
  24142. var_obj.columns++;
  24143. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24144. for (var i = 0; i < var_obj.rows; i++) {
  24145. var_obj.value[i].push(0);
  24146. }
  24147. }
  24148. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24149. for (var i = 0; i < var_obj.rows; i++) {
  24150. var_obj.value[i].push(0.0);
  24151. }
  24152. }
  24153. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24154. for (var i = 0; i < var_obj.rows; i++) {
  24155. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  24156. }
  24157. }
  24158. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24159. for (var i = 0; i < var_obj.rows; i++) {
  24160. var_obj.value[i].push(true);
  24161. }
  24162. }
  24163. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24164. for (var i = 0; i < var_obj.rows; i++) {
  24165. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  24166. }
  24167. }
  24168. }
  24169. function removeColumnMatrix(var_obj) {
  24170. if (var_obj.columns == 0) {
  24171. return;
  24172. }
  24173. var_obj.columns--;
  24174. for (var i = 0; i < var_obj.rows; i++) {
  24175. var_obj.value[i].splice(var_obj.value[i].length - 1, 1);
  24176. }
  24177. }
  24178. function addColumnVector(var_obj) {
  24179. var_obj.columns++;
  24180. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24181. var_obj.value.push(0);
  24182. }
  24183. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24184. var_obj.value.push(0.0);
  24185. }
  24186. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24187. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  24188. }
  24189. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24190. var_obj.value.push(true);
  24191. }
  24192. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24193. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  24194. }
  24195. }
  24196. function removeColumnVector(var_obj) {
  24197. if (var_obj.columns == 0) {
  24198. return;
  24199. }
  24200. var_obj.columns--;
  24201. var_obj.value.splice(var_obj.value.length - 1, 1);
  24202. }
  24203. function alternateBooleanValue(var_obj, value_container) {
  24204. var_obj.value = !var_obj.value;
  24205. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value)));
  24206. }
  24207. function alternateBooleanVectorValue(var_obj, index, value_container) {
  24208. var_obj.value[index] = !var_obj.value[index];
  24209. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[index])));
  24210. }
  24211. function updateInitialValues(variable_obj, function_name) {
  24212. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24213. if (variable_obj.dimensions == 0) {
  24214. variable_obj.value = 0;
  24215. }
  24216. if (variable_obj.dimensions == 1) {
  24217. variable_obj.value = [0, 0];
  24218. }
  24219. if (variable_obj.dimensions == 2) {
  24220. variable_obj.value = [[0, 0], [0, 0]];
  24221. }
  24222. }
  24223. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24224. if (variable_obj.dimensions == 0) {
  24225. variable_obj.value = 0.0;
  24226. }
  24227. if (variable_obj.dimensions == 1) {
  24228. variable_obj.value = [0.0, 0.0];
  24229. }
  24230. if (variable_obj.dimensions == 2) {
  24231. variable_obj.value = [[0.0, 0.0], [0.0, 0.0]];
  24232. }
  24233. }
  24234. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24235. if (variable_obj.dimensions == 0) {
  24236. variable_obj.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  24237. }
  24238. if (variable_obj.dimensions == 1) {
  24239. 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')];
  24240. }
  24241. if (variable_obj.dimensions == 2) {
  24242. 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')]];
  24243. }
  24244. }
  24245. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  24246. if (variable_obj.dimensions == 0) {
  24247. variable_obj.value = true;
  24248. }
  24249. if (variable_obj.dimensions == 1) {
  24250. variable_obj.value = [true, true];
  24251. }
  24252. if (variable_obj.dimensions == 2) {
  24253. variable_obj.value = [[true, true], [true, true]];
  24254. }
  24255. }
  24256. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24257. if (variable_obj.dimensions == 0) {
  24258. variable_obj.value = 'A';
  24259. }
  24260. if (variable_obj.dimensions == 1) {
  24261. variable_obj.value = ['A', 'A'];
  24262. }
  24263. if (variable_obj.dimensions == 2) {
  24264. variable_obj.value = [['A', 'A'], ['A', 'A']];
  24265. }
  24266. }
  24267. 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);
  24268. }
  24269. var opened_name_value_vector_global_ = false;
  24270. var opened_input_value_vector_global_ = null;
  24271. function enableVectorValueUpdate(var_obj, index, parent_node, function_name) {
  24272. if (opened_name_value_vector_global_) {
  24273. opened_input_value_vector_global_.focus();
  24274. return;
  24275. }
  24276. parent_node = $(parent_node);
  24277. opened_name_value_vector_global_ = true;
  24278. parent_node.find('.span_value_variable').text('');
  24279. var input_field;
  24280. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24281. 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) + "' />");
  24282. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24283. } else {
  24284. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[index] + "' />");
  24285. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24286. }
  24287. input_field.on('input', function () {
  24288. var inputWidth = input_field.textWidth() + 10;
  24289. opened_input_value_vector_global_ = input_field;
  24290. input_field.focus();
  24291. var tmpStr = input_field.val();
  24292. input_field.val('');
  24293. input_field.val(tmpStr);
  24294. input_field.css({
  24295. width: inputWidth
  24296. });
  24297. }).trigger('input');
  24298. input_field.focusout(function () {
  24299. var changed = false; /// update array:
  24300. if (input_field.val().trim()) {
  24301. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24302. var_obj.value[index] = parseFloat(input_field.val().trim());
  24303. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24304. } else {
  24305. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24306. var_obj.value[index] = parseInt(input_field.val().trim());
  24307. } else {
  24308. var_obj.value[index] = input_field.val().trim();
  24309. }
  24310. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24311. }
  24312. changed = true;
  24313. } else {
  24314. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24315. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24316. } else {
  24317. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24318. }
  24319. }
  24320. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24321. var_obj.value[index] = input_field.val();
  24322. changed = true;
  24323. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24324. }
  24325. if (changed) {
  24326. 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);
  24327. }
  24328. input_field.off();
  24329. input_field.remove(); /// update elements:
  24330. opened_name_value_vector_global_ = false;
  24331. opened_input_value_vector_global_ = false;
  24332. });
  24333. input_field.on('keydown', function (e) {
  24334. var code = e.keyCode || e.which;
  24335. var changed = false;
  24336. if (code == 13) {
  24337. if (input_field.val().trim()) {
  24338. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24339. var_obj.value[index] = parseFloat(input_field.val().trim());
  24340. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24341. } else {
  24342. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24343. var_obj.value[index] = parseInt(input_field.val().trim());
  24344. } else {
  24345. var_obj.value[index] = input_field.val().trim();
  24346. }
  24347. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24348. }
  24349. changed = true;
  24350. } else {
  24351. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24352. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24353. } else {
  24354. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24355. }
  24356. }
  24357. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24358. var_obj.value[index] = input_field.val();
  24359. changed = true;
  24360. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24361. }
  24362. if (changed) {
  24363. 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);
  24364. }
  24365. input_field.off();
  24366. input_field.remove(); /// update elements:
  24367. opened_name_value_vector_global_ = false;
  24368. opened_input_value_vector_global_ = false;
  24369. }
  24370. if (code == 27) {
  24371. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24372. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  24373. } else {
  24374. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  24375. }
  24376. input_field.off();
  24377. input_field.remove(); /// update elements:
  24378. opened_name_value_vector_global_ = false;
  24379. opened_input_value_vector_global_ = false;
  24380. }
  24381. });
  24382. input_field.select();
  24383. }
  24384. var opened_name_value_global_var = false;
  24385. var opened_input_value_global_ar = null;
  24386. function enableValueUpdate(var_obj, parent_node, function_name) {
  24387. if (opened_name_value_global_var) {
  24388. opened_input_value_global_ar.focus();
  24389. return;
  24390. }
  24391. parent_node = $(parent_node);
  24392. opened_name_value_global_var = true;
  24393. var input_field;
  24394. parent_node.find('.span_value_variable').text('');
  24395. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24396. 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) + "' />");
  24397. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24398. } else {
  24399. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value + "' />");
  24400. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24401. }
  24402. input_field.on('input', function () {
  24403. var inputWidth = input_field.textWidth() + 10;
  24404. opened_input_value_global_ar = input_field;
  24405. input_field.focus();
  24406. var tmpStr = input_field.val();
  24407. input_field.val('');
  24408. input_field.val(tmpStr);
  24409. input_field.css({
  24410. width: inputWidth
  24411. });
  24412. }).trigger('input');
  24413. input_field.focusout(function () {
  24414. /// update array:
  24415. var changed = false;
  24416. if (input_field.val().trim()) {
  24417. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24418. var_obj.value = parseFloat(input_field.val().trim());
  24419. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24420. } else {
  24421. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24422. var_obj.value = parseInt(input_field.val().trim());
  24423. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24424. var_obj.value = input_field.val().charAt(0);
  24425. } else {
  24426. var_obj.value = input_field.val().trim();
  24427. }
  24428. parent_node.find('.span_value_variable').text(var_obj.value);
  24429. }
  24430. changed = true;
  24431. } else {
  24432. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24433. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24434. } else {
  24435. parent_node.find('.span_value_variable').text(var_obj.value);
  24436. }
  24437. }
  24438. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24439. var_obj.value = input_field.val();
  24440. changed = true;
  24441. parent_node.find('.span_value_variable').text(var_obj.value);
  24442. }
  24443. if (changed) {
  24444. 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);
  24445. }
  24446. input_field.off();
  24447. input_field.remove(); /// update elements:
  24448. opened_name_value_global_var = false;
  24449. opened_input_value_global_ar = false;
  24450. });
  24451. input_field.on('keydown', function (e) {
  24452. var code = e.keyCode || e.which;
  24453. var changed = false;
  24454. if (code == 13) {
  24455. if (input_field.val().trim()) {
  24456. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24457. var_obj.value = parseFloat(input_field.val().trim());
  24458. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24459. } else {
  24460. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24461. var_obj.value = parseInt(input_field.val().trim());
  24462. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  24463. var_obj.value = input_field.val().charAt(0);
  24464. } else {
  24465. var_obj.value = input_field.val().trim();
  24466. }
  24467. parent_node.find('.span_value_variable').text(var_obj.value);
  24468. }
  24469. changed = true;
  24470. } else {
  24471. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24472. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24473. } else {
  24474. parent_node.find('.span_value_variable').text(var_obj.value);
  24475. }
  24476. }
  24477. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24478. var_obj.value = input_field.val();
  24479. changed = true;
  24480. parent_node.find('.span_value_variable').text(var_obj.value);
  24481. }
  24482. if (changed) {
  24483. 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);
  24484. }
  24485. input_field.off();
  24486. input_field.remove(); /// update elements:
  24487. opened_name_value_global_var = false;
  24488. opened_input_value_global_ar = false;
  24489. }
  24490. if (code == 27) {
  24491. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24492. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  24493. } else {
  24494. parent_node.find('.span_value_variable').text(var_obj.value);
  24495. }
  24496. input_field.off();
  24497. input_field.remove(); /// update elements:
  24498. opened_name_value_global_var = false;
  24499. opened_input_value_global_ar = false;
  24500. }
  24501. });
  24502. input_field.select();
  24503. }
  24504. var opened_name_global = false;
  24505. var opened_input_global = null;
  24506. function enableNameUpdate(variable_obj, variable_container, function_obj) {
  24507. if (opened_name_global) {
  24508. opened_input_global.focus();
  24509. return;
  24510. }
  24511. opened_name_global = true;
  24512. variable_container.find('.span_name_variable').text('');
  24513. var input_name;
  24514. input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + variable_obj.name + "' />");
  24515. input_name.insertBefore(variable_container.find('.span_name_variable'));
  24516. input_name.on('input', function () {
  24517. var inputWidth = input_name.textWidth() + 10;
  24518. opened_input_global = input_name;
  24519. input_name.focus();
  24520. var tmpStr = input_name.val();
  24521. input_name.val('');
  24522. input_name.val(tmpStr);
  24523. input_name.css({
  24524. width: inputWidth
  24525. });
  24526. }).trigger('input');
  24527. input_name.focusout(function () {
  24528. /// update array:
  24529. if (input_name.val().trim().length > 0) {
  24530. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  24531. variable_container.find('.span_name_variable').text(variable_obj.name);
  24532. } else {
  24533. variable_container.find('.span_name_variable').text(variable_obj.name);
  24534. }
  24535. input_name.off();
  24536. input_name.remove(); /// update elements:
  24537. opened_name_global = false;
  24538. opened_input_global = false;
  24539. });
  24540. input_name.on('keydown', function (e) {
  24541. var code = e.keyCode || e.which;
  24542. if (code == 13) {
  24543. if (input_name.val().trim().length > 0) {
  24544. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  24545. variable_container.find('.span_name_variable').text(variable_obj.name);
  24546. } else {
  24547. variable_container.find('.span_name_variable').text(variable_obj.name);
  24548. }
  24549. input_name.off();
  24550. input_name.remove(); /// update elements:
  24551. opened_name_global = false;
  24552. opened_input_global = false;
  24553. }
  24554. if (code == 27) {
  24555. variable_container.find('.span_name_variable').text(variable_obj.name);
  24556. input_name.off();
  24557. input_name.remove(); /// update elements:
  24558. opened_name_global = false;
  24559. opened_input_global = false;
  24560. }
  24561. });
  24562. input_name.select();
  24563. }
  24564. var opened_name_value_matrix_global_v = false;
  24565. var opened_input_value_matrix_global_v = null;
  24566. function enableMatrixValueUpdate(var_obj, row, index, parent_node, function_name) {
  24567. if (opened_name_value_matrix_global_v) {
  24568. opened_input_value_matrix_global_v.focus();
  24569. return;
  24570. }
  24571. parent_node = $(parent_node);
  24572. opened_name_value_matrix_global_v = true;
  24573. parent_node.find('.span_value_variable').text('');
  24574. var input_field;
  24575. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24576. 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) + "' />");
  24577. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24578. } else {
  24579. 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] + "' />");
  24580. input_field.insertBefore(parent_node.find('.span_value_variable'));
  24581. }
  24582. input_field.on('input', function () {
  24583. var inputWidth = input_field.textWidth() + 10;
  24584. opened_input_value_matrix_global_v = input_field;
  24585. input_field.focus();
  24586. var tmpStr = input_field.val();
  24587. input_field.val('');
  24588. input_field.val(tmpStr);
  24589. input_field.css({
  24590. width: inputWidth
  24591. });
  24592. }).trigger('input');
  24593. input_field.focusout(function () {
  24594. var changed = false; /// update array:
  24595. if (input_field.val().trim()) {
  24596. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24597. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  24598. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24599. } else {
  24600. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24601. var_obj.value[row][index] = parseInt(input_field.val().trim());
  24602. } else {
  24603. var_obj.value[row][index] = input_field.val().trim();
  24604. }
  24605. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24606. }
  24607. changed = true;
  24608. } else {
  24609. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24610. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24611. } else {
  24612. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24613. }
  24614. }
  24615. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24616. var_obj.value[row][index] = input_field.val();
  24617. changed = true;
  24618. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24619. }
  24620. if (changed) {
  24621. 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);
  24622. }
  24623. input_field.off();
  24624. input_field.remove(); /// update elements:
  24625. opened_name_value_matrix_global_v = false;
  24626. opened_input_value_matrix_global_v = false;
  24627. });
  24628. input_field.on('keydown', function (e) {
  24629. var code = e.keyCode || e.which;
  24630. var changed = false;
  24631. if (code == 13) {
  24632. if (input_field.val().trim()) {
  24633. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24634. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  24635. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24636. } else {
  24637. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  24638. var_obj.value[row][index] = parseInt(input_field.val().trim());
  24639. } else {
  24640. var_obj.value[row][index] = input_field.val().trim();
  24641. }
  24642. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24643. }
  24644. changed = true;
  24645. } else {
  24646. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24647. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24648. } else {
  24649. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24650. }
  24651. }
  24652. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  24653. var_obj.value[row][index] = input_field.val();
  24654. changed = true;
  24655. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24656. }
  24657. if (changed) {
  24658. 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);
  24659. }
  24660. input_field.off();
  24661. input_field.remove(); /// update elements:
  24662. opened_name_value_matrix_global_v = false;
  24663. opened_input_value_matrix_global_v = false;
  24664. }
  24665. if (code == 27) {
  24666. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  24667. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  24668. } else {
  24669. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  24670. }
  24671. input_field.off();
  24672. input_field.remove(); /// update elements:
  24673. opened_name_value_matrix_global_v = false;
  24674. opened_input_value_matrix_global_v = false;
  24675. }
  24676. });
  24677. input_field.select();
  24678. }
  24679. /***/ })
  24680. /******/ });
  24681. });
  24682. //# sourceMappingURL=main.7121176c0750a24caa1f.js.map